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   virtual size_t Length () const
00060   {
00061     return GetSize ();
00062   }
00063 
00065   virtual void Push (char const *value)
00066   {
00067     v.Push ((char*)value);
00068   }
00069 
00075   virtual char *Pop ()
00076   {
00077     return v.Pop ();
00078   }
00079 
00081   virtual char const *Get (size_t n) const
00082   {
00083     return v.Get (n);
00084   }
00085 
00092   virtual size_t Find (const char *value) const
00093   {
00094     return v.Find (value);
00095   }
00096 
00103   virtual size_t FindCaseInsensitive (const char *value) const
00104   {
00105     return v.FindCaseInsensitive (value);
00106   }
00107 
00113   virtual size_t FindSortedKey (const char *value) const
00114   {
00115     return v.FindSortedKey ((char*)value);
00116   }
00117 
00129   virtual size_t Contains(const char* str, bool case_sensitive = true) const
00130   {
00131     return v.Contains (str, case_sensitive);
00132   }
00133 
00139   virtual void Sort (bool case_sensitive = true)
00140   {
00141     v.Sort (case_sensitive);
00142   }
00143 
00145   virtual bool DeleteIndex (size_t n)
00146   {
00147     return v.DeleteIndex (n);
00148   }
00149 
00151   virtual bool Insert (size_t n, char const *value)
00152   {
00153     return v.Insert (n, (char*)value);
00154   }
00155 
00157   virtual void Empty ()
00158   {
00159     v.Empty();
00160   }
00161 
00166   virtual void DeleteAll ()
00167   {
00168     Empty();
00169   }
00170 
00176   virtual bool IsEmpty() const
00177   {
00178     return v.IsEmpty();
00179   }
00180 };
00181 
00182 #endif // __CS_SCFSTRINGARRAY_H__

Generated for Crystal Space by doxygen 1.4.6