class Data

Class for representing binary data and strings, in a thread-safe manner

Public Methods

Data( const string& str)
constructor for C++ strings
Data( const int value)
constructor that converts an int to a Data
Data( const char* str )
constructor for C style strings
Data( const char* buffer, int len )
constructor for character arrays with length
Data( const Data& data )
copy constructor
Data( )
Default constructor
Data( const mstring& mstr)
constructor for mstring (a specialization of C++ strings)
int Data::match(const char* match, Data* data, bool replace = false, Data replaceWith = "")
match
void Data::removeLWS()
remove leading white space
void erase()
erase this object
void expand(Data startFrom, Data findstr, Data replstr, Data delimiter)
expand expands headers (depreciated)
char getChar( int i )
return one character from the string
const char* getData()
returns a NUL terminated (a C string) buffer
const char* getDataBuf()
returns a pointer to the buffer
friend bool isEqualNoCase( const char* left, const Data& right )
do a case-insensitive match
friend bool isEqualNoCase( const Data& left, const Data& right )
do a case-insensitive match
int length()
length of the Data object
operator const char*()
convert to a C style character array
operator int()
convert to an int (depreciated)
operator mstring()
convert to an mstring
operator string()
convert to a string
bool operator!=( const Data& data )
inequality operator
bool operator!=( const char* str )
inequality operator
Data operator+( const Data& data)
concatenate two Data objects together
Data operator+( const char* str)
concatenate a Data object and a C-style string together
void operator+=(const Data& d)
append a Data object d to this Data
void operator+=(const char* s)
append a string s to this Data
bool operator<(const Data& )
compares two Data objects, returning the value of a dictionary comparison of the two strings
Data& operator=(const char* str)
assignment operator
Data& operator=(const Data& data)
assignment operator
bool operator==( const Data& data )
equality operator
bool operator==( const char* str )
equality operator
bool operator>(const Data& )
compares two Data objects, returning the value of a dictionary comparison of the two strings
char operator[]( int i )
return one character from the string
void removeSpaces()
removes spaces before and after a string.
void setchar( int i, char c )
return one character from the string
~Data()
destructor

Documentation

Class for representing binary data and strings, in a thread-safe manner
Data( )
Default constructor

Data( const char* str )
constructor for C style strings
Parameters:
str - null-terminated (C style) character array

Data( const char* buffer, int len )
constructor for character arrays with length
Parameters:
buffer - character array
len - size of buffer

Data( const Data& data )
copy constructor

Data( const string& str)
constructor for C++ strings

Data( const mstring& mstr)
constructor for mstring (a specialization of C++ strings)

Data( const int value)
constructor that converts an int to a Data

~Data()
destructor

bool operator>(const Data& )
compares two Data objects, returning the value of a dictionary comparison of the two strings

bool operator<(const Data& )
compares two Data objects, returning the value of a dictionary comparison of the two strings

Data& operator=(const char* str)
assignment operator
Parameters:
str - C string character array

Data& operator=(const Data& data)
assignment operator
Parameters:
data - Data object

const char* getData()
returns a NUL terminated (a C string) buffer

const char* getDataBuf()
returns a pointer to the buffer. Note that this buffer is NOT NUL terminated (not a C string).

char getChar( int i )
return one character from the string
Parameters:
i - index into the Data object

void setchar( int i, char c )
return one character from the string
Parameters:
i - index into the Data object
c - character to set

char operator[]( int i )
return one character from the string
Parameters:
i - index into the Data object

int length()
length of the Data object

bool operator==( const char* str )
equality operator
Parameters:
str - C string to compare to

bool operator==( const Data& data )
equality operator
Parameters:
data - Data to compare to

bool operator!=( const char* str )
inequality operator

bool operator!=( const Data& data )
inequality operator

Data operator+( const Data& data)
concatenate two Data objects together. Warning -- this creates an extra copy of the Data object, so it is not terribly efficient. If possible, it is better to use += instead.

Data operator+( const char* str)
concatenate a Data object and a C-style string together. Warning -- this creates an extra copy of the Data object, so it is not terribly efficient. If possible, it is better to use += instead.

void operator+=(const Data& d)
append a Data object d to this Data. this is potentially much more efficient than operator+().

void operator+=(const char* s)
append a string s to this Data. this is potentially much more efficient than operator+().

void erase()
erase this object

operator string()
convert to a string

operator const char*()
convert to a C style character array

operator mstring()
convert to an mstring

operator int()
convert to an int (depreciated)

int Data::match(const char* match, Data* data, bool replace = false, Data replaceWith = "")
match

void removeSpaces()
removes spaces before and after a string.

void Data::removeLWS()
remove leading white space

void expand(Data startFrom, Data findstr, Data replstr, Data delimiter)
expand expands headers (depreciated)

friend bool isEqualNoCase( const Data& left, const Data& right )
do a case-insensitive match

friend bool isEqualNoCase( const char* left, const Data& right )
do a case-insensitive match


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++