vdk 2.4.0
|
Implements famous cont referenced string objects. More...
#include <vdkstring.h>
Public Member Functions | |
VDKString () | |
VDKString (const char *s) | |
VDKString (const char &c) | |
VDKString (const VDKString &s) | |
VDKString & | operator= (const VDKString &s) |
VDKString & | operator= (const char *s) |
~VDKString () | |
operator char * () | |
int | operator== (const VDKString &s) const |
int | operator< (const VDKString &s) const |
int | operator> (const VDKString &s) const |
int | operator<= (const VDKString &s) const |
int | operator>= (const VDKString &s) const |
int | operator!= (const VDKString &s) const |
VDKString & | operator+= (const char *s) |
VDKString & | operator+= (const VDKString &s) |
VDKString | operator+ (const char *s) const |
VDKString | operator+ (const VDKString &s) const |
bool | isNull () const |
int | size () const |
char | operator[] (unsigned int ix) const |
const char * | c_str () const |
VDKString & | DelSelection (unsigned int begin, unsigned int len) |
VDKString & | RTrim () |
VDKString & | LTrim () |
VDKString & | Trim () |
unsigned int | CharCount (const char car) const |
VDKString & | UpperCase () |
VDKString & | LowerCase () |
bool | isEmpty () const |
VDKString & | Concatf (const char *format,...) |
VDKString & | Sprintf (const char *format,...) |
VDKString & | GetPart (unsigned int i, const char sep= '|') |
int | GetFCharPos (const char car) const |
int | GetLCharPos (const char car) const |
double | StrtoDouble () const |
int | StrtoInt () const |
VDKString & | SubStr (unsigned int start, unsigned int len) |
VDKString & | Cut (unsigned int len) |
VDKString & | LPad (unsigned int len, const char car) |
VDKString & | RPad (unsigned int len, const char car) |
VDKString & | DoubleChar (const char car= '\'') |
VDKString & | FormatDate (const char sep, int orig, int ret) |
Implements famous cont referenced string objects.
VDKString::VDKString | ( | ) |
Constructor, makes an empty string
VDKString::VDKString | ( | const char * | s | ) |
Constructor
s | a null terminated C string VDKString s = "uncle bill";
|
VDKString::VDKString | ( | const char & | c | ) |
Constructor
c | a single character VDKString s(c);
|
VDKString::VDKString | ( | const VDKString & | s | ) |
VDKString::~VDKString | ( | ) |
Destructor
const char * VDKString::c_str | ( | ) | const |
string pointer access for const instances
unsigned int VDKString::CharCount | ( | const char | car | ) | const |
VDKString & VDKString::Concatf | ( | const char * | format, |
... | |||
) |
Strcat() to the existing string (printf style). Modifies and returns the resulting VDKString.
format | a NULL terminated string |
... | a list of parameters |
VDKString & VDKString::Cut | ( | unsigned int | len | ) |
Cut the string at 'len' length. Modifies and returns the resulting VDKString.
len | length of the resulting string |
VDKString & VDKString::DelSelection | ( | unsigned int | begin, |
unsigned int | len | ||
) |
Removes a part of the string, beginning at 'begin' on 'len' length. Modifies and returns the resulting VDKString.
begin | char number where begins the selection (0 based) |
len | selection length |
VDKString & VDKString::DoubleChar | ( | const char | car = '\'' | ) |
VDKString & VDKString::FormatDate | ( | const char | sep, |
int | orig, | ||
int | ret | ||
) |
int VDKString::GetFCharPos | ( | const char | car | ) | const |
Returns the first occurrence position of the specified char 'car' (0 based) or -1 if 'car ' not found.
car | char to be searched for |
int VDKString::GetLCharPos | ( | const char | car | ) | const |
Returns the last occurrence position of the specified char 'car' (0 based) or -1 if 'car ' not found.
car | char to be searched for |
VDKString & VDKString::GetPart | ( | unsigned int | i, |
const char | sep = '|' |
||
) |
bool VDKString::isEmpty | ( | ) | const |
Returns true if this is an empty string meaning NULL buffer or strlen() == 0.
bool VDKString::isNull | ( | ) | const |
Returns true if this is an empty string
VDKString & VDKString::LowerCase | ( | ) |
Returns the lower case VDKString after having modify it.
VDKString & VDKString::LPad | ( | unsigned int | len, |
const char | car | ||
) |
Pad left of string with a specified char 'car' upon 'len' length. Modifies and returns the resulting VDKString.
len | length of the resulting string |
car | char to be padded |
VDKString & VDKString::LTrim | ( | ) |
Removes all leading spaces. Modifies and returns the resulting VDKString.
|
inline |
VDKString to char* casting warning ** can violate data hiding OO concept
int VDKString::operator!= | ( | const VDKString & | s | ) | const |
disequality operator
VDKString VDKString::operator+ | ( | const char * | s | ) | const |
VDKString & VDKString::operator+= | ( | const char * | s | ) |
cat to this
s | a null terminated string VDKString s = "uncle bill";
s += " is a smart boy";
|
int VDKString::operator< | ( | const VDKString & | s | ) | const |
less than operator
int VDKString::operator<= | ( | const VDKString & | s | ) | const |
less-equal operator
VDKString & VDKString::operator= | ( | const char * | s | ) |
Assignement operator
s | a null terminated C string VDKString s = "uncle bill";
s = "uncle sam";
|
int VDKString::operator== | ( | const VDKString & | s | ) | const |
Equality operator
int VDKString::operator> | ( | const VDKString & | s | ) | const |
greater than operator
int VDKString::operator>= | ( | const VDKString & | s | ) | const |
greater-equal operator
char VDKString::operator[] | ( | unsigned int | ix | ) | const |
index operator for const instances returns NULL if ix >= size
VDKString & VDKString::RPad | ( | unsigned int | len, |
const char | car | ||
) |
Pad right of string with a specified char 'car' upon 'len' length. Modifies and returns the resulting VDKString.
len | length of the resulting string |
car | char to be padded |
VDKString & VDKString::RTrim | ( | ) |
Removes all trailing spaces. Modifies and returns the resulting VDKString.
int VDKString::size | ( | ) | const |
as strlen()
VDKString & VDKString::Sprintf | ( | const char * | format, |
... | |||
) |
Assignment to string (printf style). Modifies and returns the resulting VDKString.
format | a NULL terminated string |
... | a list of parameters |
double VDKString::StrtoDouble | ( | ) | const |
Returns the converted string to double. See atof() for details.
int VDKString::StrtoInt | ( | ) | const |
Returns the converted string to int. See atoi() for details.
VDKString & VDKString::SubStr | ( | unsigned int | start, |
unsigned int | len | ||
) |
Extract a part of the string beginning at 'start' upon 'len' length. Modifies and returns the resulting VDKString.
start | first char position (0 based) |
len | maximum length of the resulting string |
VDKString & VDKString::Trim | ( | ) |
Removes all leading and trailing spaces. Modifies and returns the resulting VDKString.
VDKString & VDKString::UpperCase | ( | ) |
Returns the upper case VDKString after having modify it.