Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skStringBuffer.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser 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     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 * $Id: skStringBuffer_8h-source.html,v 1.1 2003/04/14 15:56:13 simkin_cvs Exp $
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

Generated on Mon Apr 14 16:49:00 2003 for Simkin C++ for Symbian by doxygen1.3