iutil/string.h
Go to the documentation of this file.00001 /* 00002 Crystal Space String interface 00003 Copyright (C) 1999 by Brandon Ehle (Azverkan) 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_IUTIL_STRING_H__ 00021 #define __CS_IUTIL_STRING_H__ 00022 00028 #include "csutil/scf_interface.h" 00029 00030 00032 struct iString : public virtual iBase 00033 { 00034 SCF_INTERFACE(iString, 2,1,0); 00043 virtual void SetCapacity (size_t NewSize) = 0; 00045 virtual size_t GetCapacity () const = 0; 00046 00059 virtual void SetGrowsBy(size_t) = 0; 00065 virtual size_t GetGrowsBy() const = 0; 00066 00076 virtual void Truncate (size_t Len) = 0; 00077 00086 virtual void ShrinkBestFit () = 0; 00087 00093 virtual void Empty () = 0; 00094 00101 CS_DEPRECATED_METHOD_MSG("Use Empty() instead") 00102 virtual void Clear () = 0; 00103 00105 virtual csRef<iString> Clone () const = 0; 00106 00112 virtual char const* GetData () const = 0; 00113 00121 /*CS_DEPRECATED_METHOD*/ 00122 // @@@ GCC and VC always seem to prefer this GetData() and barf "deprecated". 00123 virtual char* GetData () = 0; 00124 00130 virtual size_t Length () const = 0; 00131 00137 virtual bool IsEmpty () const = 0; 00138 00140 virtual char& operator [] (size_t n) = 0; 00141 00143 virtual char operator [] (size_t n) const = 0; 00144 00151 virtual void SetAt (size_t n, char iChar) = 0; 00152 00154 virtual char GetAt (size_t n) const = 0; 00155 00161 virtual void DeleteAt (size_t Pos, size_t Count = 1) = 0; 00162 00168 virtual void Insert (size_t Pos, iString const* Str) = 0; 00169 00177 virtual void Overwrite (size_t Pos, iString const* Str) = 0; 00178 00185 virtual void Append (const char* Str, size_t Count = (size_t)-1) = 0; 00186 00193 virtual void Append (const iString* Str, size_t Count = (size_t)-1) = 0; 00194 00201 virtual csRef<iString> Slice (size_t start, size_t len) const = 0; 00202 00213 virtual void SubString (iString* sub, size_t start, size_t len) const = 0; 00214 00221 virtual size_t FindFirst (const char c, size_t p = (size_t)-1) const = 0; 00222 00230 virtual size_t FindLast (const char c, size_t p = (size_t)-1) const = 0; 00231 00238 virtual size_t Find (const char* search, size_t pos = 0) const = 0; 00239 00244 virtual void ReplaceAll (const char* search, const char* replacement) = 0; 00245 00252 virtual void Format (const char* format, ...) CS_GNUC_PRINTF (2, 3) = 0; 00253 00261 virtual void FormatV (const char* format, va_list args) = 0; 00262 00269 virtual void Replace (const iString* str, size_t count = (size_t)-1) = 0; 00270 00277 virtual void Replace (const char* str, size_t count = (size_t)-1) = 0; 00278 00285 virtual bool Compare (const iString* Str) const = 0; 00286 00293 virtual bool CompareNoCase (const iString* Str) const = 0; 00294 00301 virtual bool StartsWith (const iString* Str, bool ignore_case = false) const = 0; 00302 00309 virtual bool StartsWith (const char* Str, bool ignore_case = false) const = 0; 00310 00312 virtual void operator += (const iString& iStr) = 0; 00313 00315 virtual void operator += (const char* iStr) = 0; 00316 00318 virtual csRef<iString> operator + (const iString& iStr) const = 0; 00319 00325 virtual operator char const* () const = 0; 00326 00333 virtual bool operator == (const iString& Str) const = 0; 00334 00341 virtual bool operator != (const iString& Str) const = 0; 00342 00344 virtual void Downcase() = 0; 00345 00347 virtual void Upcase() = 0; 00348 }; 00349 00352 #endif // __CS_IUTIL_STRING_H__
Generated for Crystal Space 1.2 by doxygen 1.4.7