![]() |
Public API Reference |
00001 /* 00002 Crystal Space Shared String Vector class 00003 Copyright (C) 1998,1999 by Andrew Zabolotny <bit@eltech.ru> 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_SCFSTR_H__ 00021 #define __CS_SCFSTR_H__ 00022 00023 #include "iutil/string.h" 00024 #include "csutil/csstring.h" 00025 00027 class scfString : public iString 00028 { 00029 csString s; 00030 00031 public: 00032 SCF_DECLARE_IBASE; 00033 00035 scfString () 00036 { SCF_CONSTRUCT_IBASE (NULL); } 00037 00039 scfString (size_t iLength) : s(iLength) 00040 { SCF_CONSTRUCT_IBASE (NULL); } 00041 00043 scfString (const iString ©) : s(copy.GetData()) 00044 { SCF_CONSTRUCT_IBASE (NULL); } 00045 00047 scfString (const char *copy) : s(copy) 00048 { SCF_CONSTRUCT_IBASE (NULL); } 00049 00051 virtual ~scfString () {} 00052 00054 const csString& GetCsString () const { return s; } 00055 00057 csString& GetCsString () { return s; } 00058 00060 virtual void SetCapacity (size_t NewSize); 00062 virtual size_t GetCapacity() const; 00064 virtual void SetGrowsBy(size_t); 00066 virtual size_t GetGrowsBy() const; 00068 virtual void SetGrowsExponentially(bool); 00070 virtual bool GetGrowsExponentially() const; 00071 00073 virtual void Truncate (size_t iPos); 00074 00076 virtual void Reclaim (); 00077 00079 virtual iString *Clone () const; 00080 00082 virtual char *GetData () const; 00083 00085 virtual size_t Length () const; 00086 00088 virtual char& operator [] (size_t iPos); 00089 00091 virtual void SetAt (size_t iPos, char iChar); 00092 00094 virtual char GetAt (size_t iPos) const; 00095 00097 virtual void Insert (size_t iPos, iString *iStr); 00098 00100 virtual void Overwrite (size_t iPos, iString *iStr); 00101 00103 virtual iString &Append (const char *iStr, size_t iCount = (size_t)-1); 00104 00106 virtual iString &Append (const iString *iStr, size_t iCount = (size_t)-1); 00107 00109 virtual void Format (const char *format, ...) CS_GNUC_PRINTF (2, 3); 00111 virtual void FormatV (const char *format, va_list args); 00112 00114 virtual void Replace (const iString *iStr, size_t iCount = (size_t)-1); 00115 00117 virtual bool Compare (const iString *iStr) const; 00118 00120 virtual bool CompareNoCase (const iString *iStr) const; 00121 }; 00122 00123 #endif // __CS_SCFSTR_H__