#include <string-buffer.h>
Classes | |
struct | iterator_t |
Public Member Functions | |
virtual | ~StringBuffer (void) throw () |
virtual int | appendString (IN 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 (IN int offset) const =0 throw () |
given an offset, returns the string | |
virtual void | getIterator (OUT iterator_t &i) const =0 throw () |
initialize an iterator to the beginning of the list of strings | |
virtual const char * | getNextString (IO iterator_t &i) const =0 throw () |
retrieve the current string, and advance the iterator. | |
virtual void | dumpStrings (IO std::ostream &stream) const =0 |
for diagnostics: runs through and writes all strings to stream | |
Static Public Member Functions | |
static smart_ptr< StringBuffer > | create (IN int initialBytes=4096) |
Definition at line 57 of file string-buffer.h.
StringBuffer::~StringBuffer | ( | void | ) | throw () [virtual] |
Definition at line 41 of file string-buffer.cpp.
virtual int StringBuffer::appendString | ( | IN 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 | ( | IN int | offset | ) | const throw () [pure virtual] |
given an offset, returns the string
virtual void StringBuffer::getIterator | ( | OUT iterator_t & | i | ) | const throw () [pure virtual] |
initialize an iterator to the beginning of the list of strings
virtual const char* StringBuffer::getNextString | ( | IO 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 | ( | IO std::ostream & | stream | ) | const [pure virtual] |
for diagnostics: runs through and writes all strings to stream
smart_ptr< StringBuffer > StringBuffer::create | ( | IN int | initialBytes = 4096 |
) | [static] |
Definition at line 238 of file string-buffer.cpp.