CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csutil/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 "iutil/stringarray.h"
00025 #include "stringarray.h"
00026 
00028 class CS_CSUTIL_EXPORT scfStringArray : public iStringArray
00029 {
00030   csStringArray v;
00031 
00032 public:
00033   SCF_DECLARE_IBASE;
00034 
00036   scfStringArray (int iLimit = 16, int iDelta = 16) : v (iLimit, iDelta)
00037   { SCF_CONSTRUCT_IBASE (0); }
00038 
00040   virtual ~scfStringArray ()
00041   { SCF_DESTRUCT_IBASE(); }
00042 
00044   virtual int Length () const
00045   {
00046     return v.Length ();
00047   }
00048 
00050   virtual void Push (char const *value)
00051   {
00052     v.Push ((char*)value);
00053   }
00054 
00056   virtual char *Pop ()
00057   {
00058     return v.Pop ();
00059   }
00060 
00062   virtual char const *Get (int n) const
00063   {
00064     return v.Get (n);
00065   }
00066 
00068   virtual int Find (const char *value) const
00069   {
00070     return v.Find (value);
00071   }
00072 
00074   virtual int FindCaseInsensitive (const char *value) const
00075   {
00076     return v.FindCaseInsensitive (value);
00077   }
00078 
00080   virtual int FindSortedKey (const char *value) const
00081   {
00082     return v.FindSortedKey ((char*)value);
00083   }
00084 
00086   virtual void Sort ()
00087   {
00088     v.Sort ();
00089   }
00090 
00092   virtual bool DeleteIndex (int n)
00093   {
00094     return v.DeleteIndex (n);
00095   }
00096 
00098   virtual bool Insert (int n, char const *value)
00099   {
00100     return v.Insert (n, (char*)value);
00101   }
00102 
00104   virtual void DeleteAll ()
00105   {
00106     v.DeleteAll ();
00107   }
00108 };
00109 
00110 #endif // __CS_SCFSTRINGARRAY_H__
00111 

Generated for Crystal Space by doxygen 1.2.18