CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

scfstringarray.h

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 
00023 #include "csextern.h"
00024 #include "csutil/stringarray.h"
00025 #include "iutil/stringarray.h"
00026 
00028 class CS_CRYSTALSPACE_EXPORT scfStringArray : public iStringArray
00029 {
00030   csStringArray v;
00031 
00032 public:
00033   SCF_DECLARE_IBASE;
00034 
00036   scfStringArray (int limit = 16, int delta = 16) : v (limit, delta)
00037   { SCF_CONSTRUCT_IBASE (0); }
00038 
00040   virtual ~scfStringArray ()
00041   { SCF_DESTRUCT_IBASE(); }
00042 
00044   virtual size_t GetSize () const
00045   {
00046     return v.Length ();
00047   }
00048 
00053   virtual size_t Length () const
00054   {
00055     return GetSize ();
00056   }
00057 
00059   virtual void Push (char const *value)
00060   {
00061     v.Push ((char*)value);
00062   }
00063 
00069   virtual char *Pop ()
00070   {
00071     return v.Pop ();
00072   }
00073 
00075   virtual char const *Get (size_t n) const
00076   {
00077     return v.Get (n);
00078   }
00079 
00086   virtual size_t Find (const char *value) const
00087   {
00088     return v.Find (value);
00089   }
00090 
00097   virtual size_t FindCaseInsensitive (const char *value) const
00098   {
00099     return v.FindCaseInsensitive (value);
00100   }
00101 
00107   virtual size_t FindSortedKey (const char *value) const
00108   {
00109     return v.FindSortedKey ((char*)value);
00110   }
00111 
00123   virtual size_t Contains(const char* str, bool case_sensitive = true) const
00124   {
00125     return v.Contains (str, case_sensitive);
00126   }
00127 
00133   virtual void Sort (bool case_sensitive = true)
00134   {
00135     v.Sort (case_sensitive);
00136   }
00137 
00139   virtual bool DeleteIndex (size_t n)
00140   {
00141     return v.DeleteIndex (n);
00142   }
00143 
00145   virtual bool Insert (size_t n, char const *value)
00146   {
00147     return v.Insert (n, (char*)value);
00148   }
00149 
00151   virtual void Empty ()
00152   {
00153     v.Empty();
00154   }
00155 
00160   virtual void DeleteAll ()
00161   {
00162     Empty();
00163   }
00164 
00170   virtual bool IsEmpty() const
00171   {
00172     return v.IsEmpty();
00173   }
00174 };
00175 
00176 #endif // __CS_SCFSTRINGARRAY_H__

Generated for Crystal Space by doxygen 1.4.4