class CWBuffer

copy on write buffer, used in conjunction with CopyOnWriteData

Public Methods

void clear()
clear the string
int compare(const char* str, int rightSize)
compare this buffer with a character array
int compareNoCase(const char* str, int rightSize)
compare this buffer with a character array case-insensitvely
CWBuffer(int len = 0)
default constructor (constructs an empty buffer of length len)
CWBuffer(const CWBuffer& src)
copy constructor
CWBuffer(const char* src, int length, int hint = 0)
construct a buffer of size hint, copying length bytes from p
void makeCString()
convert this string into a C string (a NUL terminated one)
void makeWritable(int length)
verify that the current string can be written to, up to length-1 characters
const CWBuffer& operator=(const CWBuffer& src)
assignment operator
void split(int p, CWBuffer* ptr)
split the string into two
void substr(int first, int last)
truncate the current buffer
void truncate(int front, int back)
truncate the current buffer
~CWBuffer()
destructor

Documentation

copy on write buffer, used in conjunction with CopyOnWriteData. Do not derive from this class
CWBuffer(int len = 0)
default constructor (constructs an empty buffer of length len)

CWBuffer(const char* src, int length, int hint = 0)
construct a buffer of size hint, copying length bytes from p

CWBuffer(const CWBuffer& src)
copy constructor

~CWBuffer()
destructor

const CWBuffer& operator=(const CWBuffer& src)
assignment operator

void clear()
clear the string

int compare(const char* str, int rightSize)
compare this buffer with a character array
Parameters:
str - character array to compare against
rightSize - size of array to compare against

int compareNoCase(const char* str, int rightSize)
compare this buffer with a character array case-insensitvely
Parameters:
str - character array to compare against
rightSize - size of array to compare against

void split(int p, CWBuffer* ptr)
split the string into two. This object becomes the front, which has all the characters w/ positions < p, while ptr has the positions >= p. Note that this is special in that it does NOT write to any of the string, so the underlying buffer is never written.
Parameters:
p - number of bytes to split at.
ptr - returned buffer, containing the positions >= p

void truncate(int front, int back)
truncate the current buffer
Parameters:
front - number of characters to remove from the beginning of the string
back - number of characters to remove from the end of the string

void substr(int first, int last)
truncate the current buffer
Parameters:
first - the first character of the string to keep
last - the last character of the string to keep

void makeWritable(int length)
verify that the current string can be written to, up to length-1 characters
Parameters:
length - number of characters in bitsPtr which are writable.

void makeCString()
convert this string into a C string (a NUL terminated one)


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++