CrystalSpace

Public API Reference

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

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 <stdarg.h>
00029 #include "csutil/scf.h"
00030 #include "csutil/ref.h"
00031 
00032 SCF_VERSION (iString, 0, 2, 0);
00033 
00035 struct iString : public iBase
00036 {
00045   virtual void SetCapacity (size_t NewSize) = 0;
00047   virtual size_t GetCapacity () const = 0;
00048 
00056   virtual void SetGrowsBy(size_t) = 0;
00058   virtual size_t GetGrowsBy() const = 0;
00059 
00064   virtual void SetGrowsExponentially(bool) = 0;
00065 
00067   virtual bool GetGrowsExponentially() const = 0;
00068 
00078   virtual void Truncate (size_t Len) = 0;
00079 
00088   virtual void Reclaim () = 0;
00089 
00095   virtual void Clear () = 0;
00096 
00098   virtual csRef<iString> Clone () const = 0;
00099 
00105   virtual char const* GetData () const = 0;
00106 
00114   /*CS_DEPRECATED_METHOD*/ 
00115     // @@@ GCC and VC always seem to prefer this GetData() and barf "deprecated".
00116   virtual char* GetData () = 0;
00117 
00123   virtual size_t Length () const = 0;
00124 
00130   virtual bool IsEmpty () const = 0;
00131 
00133   virtual char& operator [] (size_t n) = 0;
00134 
00136   virtual char operator [] (size_t n) const = 0;
00137 
00144   virtual void SetAt (size_t n, char iChar) = 0;
00145 
00147   virtual char GetAt (size_t n) const = 0;
00148 
00154   virtual void Insert (size_t Pos, iString const* Str) = 0;
00155 
00163   virtual void Overwrite (size_t Pos, iString const* Str) = 0;
00164 
00171   virtual void Append (const char* Str, size_t Count = (size_t)-1) = 0;
00172 
00179   virtual void Append (const iString* Str, size_t Count = (size_t)-1) = 0;
00180 
00187   virtual csRef<iString> Slice (size_t start, size_t len) const = 0;
00188 
00199   virtual void SubString (iString* sub, size_t start, size_t len) const = 0;
00200 
00207   virtual size_t FindFirst (const char c, size_t p = (size_t)-1) const = 0;
00208 
00216   virtual size_t FindLast (const char c, size_t p = (size_t)-1) const = 0;
00217   
00223   virtual void Format (const char* format, ...) CS_GNUC_PRINTF (2, 3) = 0;
00224 
00231   virtual void FormatV (const char* format, va_list args) = 0;
00232 
00239   virtual void Replace (const iString* str, size_t count = (size_t)-1) = 0;
00240 
00247   virtual bool Compare (const iString* Str) const = 0;
00248 
00255   virtual bool CompareNoCase (const iString* Str) const = 0;
00256 
00258   virtual void operator += (const iString& iStr) = 0;
00259 
00261   virtual void operator += (const char* iStr) = 0;
00262 
00264   virtual csRef<iString> operator + (const iString& iStr) const = 0;
00265 
00271   virtual operator char const* () const = 0;
00272 
00279   virtual bool operator == (const iString& Str) const = 0;
00280 
00287   virtual bool operator != (const iString& Str) const = 0;
00288 
00290   virtual void Downcase() = 0;
00291 
00293   virtual void Upcase() = 0;
00294 };
00295 
00298 #endif // __CS_IUTIL_STRING_H__

Generated for Crystal Space by doxygen 1.3.9.1