jcpp::StringBuffer Class Reference

#include <StringBuffer.h>

Inheritance diagram for jcpp::StringBuffer:

Inheritance graph
[legend]
Collaboration diagram for jcpp::StringBuffer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

CDELETE StringBuffer (char *str)
CDELETE StringBuffer (int length)
StringBufferappend (Object *obj)
StringBufferappend (char *str)
StringBufferappend (std::string str)
StringBufferappend (char *str, int len)
StringBufferappend (int i)
StringBufferappend (char c)
StringBufferappend (char *str, int offset, int len)
StringBufferappend (double d)
StringBufferappend (float f)
StringBufferappend (long l)
int capacity ()
char charAt (int index, int &error)
void ensureCapacity (int minimumCapacity)
STRING_OVERFLOW void getChars (int srcBegin, int srcEnd, char *dst, int dstBegin, int &rangeError)
StringBufferinsert (int offset, Object *obj, int &offsetError)
 see java.
StringBufferinsert (int offset, char c, int &offsetError)
 see java.
StringBufferinsert (int offset, char *str, int &offsetError)
 see java.
StringBufferinsert (int offset, double d, int &offsetError)
 see java.
StringBufferinsert (int offset, float f, int &offsetError)
 see java.
StringBufferinsert (int offset, int i, int &offsetError)
 see java.
StringBufferinsert (int offset, long l, int &offsetError)
 see java.
int length ()
 see java.
StringBufferreverse ()
void setCharAt (int index, char ch, int &err)
void setLength (int newLength, int &StringIndexOutOfBoundsErrJC)
CFREE char * toString ()

Private Member Functions

int checkIndex (int index)
void newdata (int l)

Private Attributes

char * buffer
int tmp
int used
int buffer_length

Static Private Attributes

static const int SPARECAPACITY


Detailed Description

See java's string buffer, tcls DString, etc

Member Function Documentation

StringBuffer* jcpp::StringBuffer::append ( Object obj  ) 

Note on all append/insert functions: the StringBuffer returned is the same as the one called. Note, because there are no methods on c++ objects (void *)s we can't call toString on Object. so printed form is a pointer.

StringBuffer* jcpp::StringBuffer::append ( char *  str,
int  len 
)

len is the number of characters appended, not counting the null character at the end of str. Note that str does NOT have to be null terminated at len+1.

StringBuffer* jcpp::StringBuffer::append ( int  i  ) 

append the stringified int value.

StringBuffer* jcpp::StringBuffer::append ( char  c  ) 

append a raw character.

StringBuffer* jcpp::StringBuffer::append ( char *  str,
int  offset,
int  len 
)

the real workhorse of this class.

StringBuffer* jcpp::StringBuffer::append ( double  d  ) 

append double as 21.18g

StringBuffer* jcpp::StringBuffer::append ( float  f  ) 

append cast to double as 21.18g

StringBuffer* jcpp::StringBuffer::append ( long  l  ) 

append as ld

int jcpp::StringBuffer::capacity (  ) 

return the total size allocated for the string so far.

char jcpp::StringBuffer::charAt ( int  index,
int &  error 
)

return s[index]th character. if bad index, err -> -1, else 0.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
Object obj,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
char  c,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
char *  str,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
double  d,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
float  f,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
int  i,
int &  offsetError 
)

see java.

StringBuffer* jcpp::StringBuffer::insert ( int  offset,
long  l,
int &  offsetError 
)

see java.

int jcpp::StringBuffer::length (  ) 

see java.

returns the current length (via strlen)

CFREE char* jcpp::StringBuffer::toString (  ) 

Caller should free the pointer returned. Copies value into null terminated string.


Member Data Documentation

int jcpp::StringBuffer::tmp [private]

scratch for macros

int jcpp::StringBuffer::used [private]

does not include terminator


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

Generated on Thu Mar 17 13:10:46 2011 for CCAFFEINE by  doxygen 1.5.9