zmm::StringBuffer Class Reference

#include <stringbuffer.h>

Inheritance diagram for zmm::StringBuffer:
zmm::Object

Public Member Functions

 StringBuffer ()
 StringBuffer (int capacity)
virtual ~StringBuffer ()
StringBufferoperator<< (String other)
StringBufferoperator<< (Ref< StringBuffer > other)
StringBufferoperator<< (const char *str)
StringBufferoperator<< (signed char *str)
StringBufferoperator<< (signed char chr)
StringBufferoperator<< (char chr)
StringBufferoperator<< (int x)
StringBufferoperator<< (unsigned int x)
void concat (Ref< StringBuffer > other, int offset=0)
void concat (char *str, int length)
int length ()
int getCapacity ()
void setLength (int newLength)
char * c_str (int offset=0)
String toString ()
String toString (int offset)
void clear ()
void ensureCapacity (int neededCapacity)
void setCharAt (int index, char c)
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

void addCapacity (int increment)

Protected Attributes

char * data
int capacity
int len
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

Definition at line 43 of file stringbuffer.h.


Constructor & Destructor Documentation

StringBuffer::StringBuffer (  ) 

Definition at line 45 of file stringbuffer.cc.

References capacity, data, DEFAULT_STRINGBUFFER_CAPACITY, len, and MALLOC.

StringBuffer::StringBuffer ( int  capacity  ) 

Definition at line 53 of file stringbuffer.cc.

References data, len, and MALLOC.

StringBuffer::~StringBuffer (  )  [virtual]

Definition at line 61 of file stringbuffer.cc.

References data, and FREE.


Member Function Documentation

void zmm::StringBuffer::addCapacity ( int  increment  )  [inline, protected]

Definition at line 76 of file stringbuffer.h.

References ensureCapacity(), and len.

Referenced by concat(), and operator<<().

char * StringBuffer::c_str ( int  offset = 0  ) 

Definition at line 175 of file stringbuffer.cc.

References _, _Exception, data, and len.

void StringBuffer::clear (  ) 

Definition at line 201 of file stringbuffer.cc.

References data, and len.

void StringBuffer::concat ( char *  str,
int  length 
)

Definition at line 150 of file stringbuffer.cc.

References addCapacity(), data, and len.

void StringBuffer::concat ( Ref< StringBuffer other,
int  offset = 0 
)

Definition at line 136 of file stringbuffer.cc.

References _, _Exception, addCapacity(), data, and len.

void StringBuffer::ensureCapacity ( int  neededCapacity  ) 

Definition at line 207 of file stringbuffer.cc.

References capacity, data, REALLOC, and STRINGBUFFER_CAPACITY_INCREMENT.

Referenced by addCapacity(), and setLength().

int zmm::StringBuffer::getCapacity (  )  [inline]

Definition at line 66 of file stringbuffer.h.

References capacity.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

int StringBuffer::length (  ) 

Definition at line 161 of file stringbuffer.cc.

References len.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

StringBuffer & StringBuffer::operator<< ( unsigned int  x  ) 

Definition at line 127 of file stringbuffer.cc.

References addCapacity(), data, len, and MAX_INT_STRING_LENGTH.

StringBuffer & StringBuffer::operator<< ( int  x  ) 

Definition at line 118 of file stringbuffer.cc.

References addCapacity(), data, len, and MAX_INT_STRING_LENGTH.

StringBuffer & StringBuffer::operator<< ( char  chr  ) 

Definition at line 104 of file stringbuffer.cc.

References addCapacity(), data, and len.

StringBuffer & StringBuffer::operator<< ( signed char  chr  ) 

Definition at line 113 of file stringbuffer.cc.

References operator<<().

StringBuffer & StringBuffer::operator<< ( signed char *  str  ) 

Definition at line 99 of file stringbuffer.cc.

References operator<<().

StringBuffer & StringBuffer::operator<< ( const char *  str  ) 

Definition at line 85 of file stringbuffer.cc.

References addCapacity(), data, and len.

StringBuffer & StringBuffer::operator<< ( Ref< StringBuffer other  ) 

Definition at line 78 of file stringbuffer.cc.

StringBuffer & StringBuffer::operator<< ( String  other  ) 

Definition at line 66 of file stringbuffer.cc.

References addCapacity(), zmm::String::base, zmm::StringBase::data, data, len, and zmm::String::length().

Referenced by operator<<().

void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
void StringBuffer::setCharAt ( int  index,
char  c 
)

Definition at line 194 of file stringbuffer.cc.

References _, _Exception, data, and len.

void StringBuffer::setLength ( int  newLength  ) 

Definition at line 166 of file stringbuffer.cc.

References data, ensureCapacity(), and len.

String StringBuffer::toString ( int  offset  ) 

Definition at line 187 of file stringbuffer.cc.

References _, _Exception, data, and len.

String StringBuffer::toString (  ) 

Definition at line 182 of file stringbuffer.cc.

References data, and len.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int zmm::StringBuffer::capacity [protected]

Definition at line 47 of file stringbuffer.h.

Referenced by ensureCapacity(), getCapacity(), and StringBuffer().

char* zmm::StringBuffer::data [protected]
int zmm::StringBuffer::len [protected]
pthread_mutex_t zmm::Object::mutex [protected, inherited]

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

Generated on Fri Mar 26 20:16:59 2010 for MediaTomb by  doxygen 1.6.1