CrystalSpace

Public API Reference

csutil/scfstringarray.h

Go to the documentation of this file.
00001 /*
00002     Crystal Space String Array SCF interface
00003     Copyright (C) 2003 by Jorrit Tyberghein
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_SCFSTRINGARRAY_H__
00021 #define __CS_SCFSTRINGARRAY_H__
00022 
00027 #include "csextern.h"
00028 #include "csutil/scf_implementation.h"
00029 #include "csutil/stringarray.h"
00030 #include "iutil/stringarray.h"
00031 
00033 class scfStringArray : public scfImplementation1<scfStringArray, 
00034                                                    iStringArray>
00035 {
00036   csStringArray v;
00037 
00038 public:
00039 
00041   scfStringArray (int limit = 16, int delta = 16) 
00042     : scfImplementationType (this), v (limit, delta)
00043   { }
00044 
00046   virtual ~scfStringArray ()
00047   { }
00048 
00050   virtual size_t GetSize () const
00051   {
00052     return v.Length ();
00053   }
00054 
00059   /*CS_DEPRECATED_METHOD_MSG("Use GetSize() instead.")*/
00060   virtual size_t Length () const
00061   {
00062     return GetSize ();
00063   }
00064 
00066   virtual void Push (char const *value)
00067   {
00068     v.Push ((char*)value);
00069   }
00070 
00076   virtual char *Pop ()
00077   {
00078     return v.Pop ();
00079   }
00080 
00082   virtual char const *Get (size_t n) const
00083   {
00084     return v.Get (n);
00085   }
00086 
00093   virtual size_t Find (const char *value) const
00094   {
00095     return v.Find (value);
00096   }
00097 
00104   virtual size_t FindCaseInsensitive (const char *value) const
00105   {
00106     return v.FindCaseInsensitive (value);
00107   }
00108 
00114   virtual size_t FindSortedKey (const char *value) const
00115   {
00116     return v.FindSortedKey ((char*)value);
00117   }
00118 
00130   virtual size_t Contains(const char* str, bool case_sensitive = true) const
00131   {
00132     return v.Contains (str, case_sensitive);
00133   }
00134 
00140   virtual void Sort (bool case_sensitive = true)
00141   {
00142     v.Sort (case_sensitive);
00143   }
00144 
00146   virtual bool DeleteIndex (size_t n)
00147   {
00148     return v.DeleteIndex (n);
00149   }
00150 
00152   virtual bool Insert (size_t n, char const *value)
00153   {
00154     return v.Insert (n, (char*)value);
00155   }
00156 
00158   virtual void Empty ()
00159   {
00160     v.Empty();
00161   }
00162 
00167   CS_DEPRECATED_METHOD_MSG("Use Empty() instead.")
00168   virtual void DeleteAll ()
00169   {
00170     Empty();
00171   }
00172 
00178   virtual bool IsEmpty() const
00179   {
00180     return v.IsEmpty();
00181   }
00182 };
00183 
00184 #endif // __CS_SCFSTRINGARRAY_H__

Generated for Crystal Space 1.0.2 by doxygen 1.4.7