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 scfStringArray (const csStringArray& other) 00047 : scfImplementationType (this), v (other) 00048 { } 00049 00051 virtual ~scfStringArray () 00052 { } 00053 00055 virtual size_t GetSize () const 00056 { 00057 return v.GetSize (); 00058 } 00059 00061 virtual void Push (char const *value) 00062 { 00063 v.Push ((char*)value); 00064 } 00065 00071 virtual char *Pop () 00072 { 00073 return v.Pop (); 00074 } 00075 00077 virtual char const *Get (size_t n) const 00078 { 00079 return v.Get (n); 00080 } 00081 00088 virtual size_t Find (const char *value) const 00089 { 00090 return v.Find (value); 00091 } 00092 00099 virtual size_t FindCaseInsensitive (const char *value) const 00100 { 00101 return v.FindCaseInsensitive (value); 00102 } 00103 00109 virtual size_t FindSortedKey (const char *value) const 00110 { 00111 return v.FindSortedKey ((char*)value); 00112 } 00113 00125 virtual size_t Contains (const char* str, bool case_sensitive = true) const 00126 { 00127 return v.Contains (str, case_sensitive); 00128 } 00129 00135 virtual void Sort (bool case_sensitive = true) 00136 { 00137 v.Sort (case_sensitive); 00138 } 00139 00141 virtual bool DeleteIndex (size_t n) 00142 { 00143 return v.DeleteIndex (n); 00144 } 00145 00147 virtual bool Insert (size_t n, char const *value) 00148 { 00149 return v.Insert (n, (char*)value); 00150 } 00151 00152 00154 virtual void Empty () 00155 { 00156 v.Empty (); 00157 } 00158 00164 virtual bool IsEmpty () const 00165 { 00166 return v.IsEmpty (); 00167 } 00168 00173 virtual void Put (size_t n, const char* value) 00174 { 00175 v.Put (n, value); 00176 } 00177 }; 00178 00179 #endif // __CS_SCFSTRINGARRAY_H__
Generated for Crystal Space 2.0 by doxygen 1.6.1