Classes | Public Member Functions | Static Public Member Functions

StringBuffer Class Reference
[Utility Library]

#include <string-buffer.h>

Inheritance diagram for StringBuffer:
Inheritance graph
[legend]

List of all members.

Classes

struct  iterator_t

Public Member Functions

virtual ~StringBuffer (void) throw ()
virtual int appendString (const char *string)=0
 appends the given string to the end of the buffer, and returns the offset into the buffer.
virtual const char * getString (int offset) const =0 throw ()
 given an offset, returns the string
virtual void getIterator (iterator_t &i) const =0 throw ()
 initialize an iterator to the beginning of the list of strings
virtual const char * getNextString (iterator_t &i) const =0 throw ()
 retrieve the current string, and advance the iterator.
virtual void dumpStrings (std::ostream &stream) const =0
 for diagnostics: runs through and writes all strings to stream

Static Public Member Functions

static smart_ptr< StringBuffercreate (int initialBytes=4096)

Detailed Description

Definition at line 57 of file string-buffer.h.


Constructor & Destructor Documentation

StringBuffer::~StringBuffer ( void   )  throw () [virtual]

Definition at line 41 of file string-buffer.cpp.


Member Function Documentation

virtual int StringBuffer::appendString ( const char *  string  )  [pure virtual]

appends the given string to the end of the buffer, and returns the offset into the buffer.

virtual const char* StringBuffer::getString ( int  offset  )  const throw () [pure virtual]

given an offset, returns the string

virtual void StringBuffer::getIterator ( iterator_t i  )  const throw () [pure virtual]

initialize an iterator to the beginning of the list of strings

virtual const char* StringBuffer::getNextString ( iterator_t i  )  const throw () [pure virtual]

retrieve the current string, and advance the iterator.

Returns NULL at the end. Note that iterators remain valid even if appendString() is repeatedly called and increases the buffer. However, iteration is NOT threadsafe.

virtual void StringBuffer::dumpStrings ( std::ostream &  stream  )  const [pure virtual]

for diagnostics: runs through and writes all strings to stream

smart_ptr< StringBuffer > StringBuffer::create ( int  initialBytes = 4096  )  [static]

Definition at line 238 of file string-buffer.cpp.


The documentation for this class was generated from the following files: