00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef skSTRINGBUFFER_H
00024 #define skSTRINGBUFFER_H
00025
00026 #include "skString.h"
00027
00031 class skStringBuffer
00032 #ifdef __SYMBIAN32__
00033 : public CBase
00034 #endif
00035 {
00036 public:
00041 inline skStringBuffer(USize capacity,USize growth_increment=16);
00042 #ifndef __SYMBIAN32__
00043
00048 IMPORT_C skStringBuffer(const skString& s,USize growth_increment=16);
00053 IMPORT_C skStringBuffer(const skStringBuffer& s);
00054 #endif
00055
00058 IMPORT_C virtual ~skStringBuffer();
00063 IMPORT_C skStringBuffer& operator=(const skStringBuffer& s);
00069 IMPORT_C void append(Char ch);
00075 IMPORT_C void append(const skString& s);
00081 IMPORT_C void append(const Char * s);
00082 #ifdef __SYMBIAN32__
00083
00089 IMPORT_C void append(const TDesC& s);
00090 #endif
00091
00096 IMPORT_C skString toString() ;
00102 IMPORT_C skString toStringCopy() const;
00103 #ifndef __SYMBIAN32
00104
00109 IMPORT_C operator const Char * () const;
00110 #endif
00111
00115 inline USize length() const;
00120 inline USize capacity() const;
00121 private:
00127 void ensureCapacity(USize capacity);
00129 Char * m_Buffer;
00131 USize m_Length;
00133 USize m_Capacity;
00135 USize m_GrowthIncrement;
00136 };
00137
00138
00139 inline skStringBuffer::skStringBuffer(USize length,USize growth_increment)
00140
00141 : m_Buffer(0),m_Length(0),m_Capacity(length+1),m_GrowthIncrement(growth_increment)
00142 {
00143 }
00144
00145 inline USize skStringBuffer::length() const
00146
00147 {
00148 return m_Length;
00149 }
00150
00151 inline USize skStringBuffer::capacity() const
00152
00153 {
00154 return m_Capacity;
00155 }
00156 #endif