VDKString Class Reference
Implements famous cont referenced string objects.
More...
#include <vdkstring.h>
List of all members.
Public Member Functions
Detailed Description
Implements famous cont referenced string objects.
Constructor & Destructor Documentation
Constructor, makes an empty string
VDKString::VDKString |
( |
const char * |
s |
) |
|
Constructor
- Parameters:
-
| s | a null terminated C string |
VDKString::VDKString |
( |
const char & |
c |
) |
|
Copy-initializer
- Parameters:
-
VDKString::~VDKString |
( |
|
) |
|
Member Function Documentation
Assignement operator
- Parameters:
-
VDKString & VDKString::operator= |
( |
const char * |
s |
) |
|
Assignement operator
- Parameters:
-
| s | a null terminated C string |
VDKString::operator char * |
( |
|
) |
[inline] |
VDKString to char* casting warning ** can violate data hiding OO concept
int VDKString::operator== |
( |
const VDKString & |
s |
) |
const |
int VDKString::operator< |
( |
const VDKString & |
s |
) |
const |
int VDKString::operator> |
( |
const VDKString & |
s |
) |
const |
int VDKString::operator<= |
( |
const VDKString & |
s |
) |
const |
int VDKString::operator>= |
( |
const VDKString & |
s |
) |
const |
int VDKString::operator!= |
( |
const VDKString & |
s |
) |
const |
VDKString & VDKString::operator+= |
( |
const char * |
s |
) |
|
cat to this
- Parameters:
-
| s | a null terminated string VDKString s = "uncle bill";
s += " is a smart boy";
|
VDKString VDKString::operator+ |
( |
const char * |
s |
) |
const |
Returns a VDKString concatenated
- Parameters:
-
| s | a null terminated string |
bool VDKString::isNull |
( |
|
) |
const |
Returns true if this is an empty string
int VDKString::size |
( |
|
) |
const |
char VDKString::operator[] |
( |
unsigned int |
ix |
) |
const |
index operator for const instances returns NULL if ix >= size
const char * VDKString::c_str |
( |
|
) |
const |
string pointer access for const instances
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.
- Parameters:
-
| begin | char number where begins the selection (0 based) |
| len | selection length |
Removes all trailing spaces. Modifies and returns the resulting VDKString.
Removes all leading spaces. Modifies and returns the resulting VDKString.
Removes all leading and trailing spaces. Modifies and returns the resulting VDKString.
unsigned int VDKString::CharCount |
( |
const char |
car |
) |
const |
Returns the number of the specified char 'car' contained in the string.
- Parameters:
-
Returns the upper case VDKString after having modify it.
- Warning:
- Does not modify unknown characters.
Upper case characters are assumed without accents.
Returns the lower case VDKString after having modify it.
- Warning:
- Upper case characters are assumed without accents.
bool VDKString::isEmpty |
( |
|
) |
const |
Returns true if this is an empty string meaning NULL buffer or strlen() == 0.
VDKString & VDKString::Concatf |
( |
const char * |
format, |
|
|
|
... | |
|
) |
| | |
Strcat() to the existing string (printf style). Modifies and returns the resulting VDKString.
- Warning:
- Final string is 65534 chars max.
Returns the previous string in case of memory overflow or buffer overflow.
- Parameters:
-
| format | a NULL terminated string |
| ... | a list of parameters |
VDKString & VDKString::Sprintf |
( |
const char * |
format, |
|
|
|
... | |
|
) |
| | |
Assignment to string (printf style). Modifies and returns the resulting VDKString.
- Warning:
- Final string is 65534 chars max.
Returns the previous string in case of memory overflow or buffer overflow.
- Parameters:
-
| format | a NULL terminated string |
| ... | a list of parameters |
VDKString & VDKString::GetPart |
( |
unsigned int |
i, |
|
|
const char |
sep = '|' | |
|
) |
| | |
Extract the specified part of a formatted string. Modifies and returns the resulting VDKString.
- Warning:
- Returns an isNull() string if the specified part not found.
- Parameters:
-
| i | the desired part position (starting at 1) |
| sep | the parts separator, '|' by default |
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.
- Parameters:
-
| 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.
- Parameters:
-
| car | char to be searched for |
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.
- Parameters:
-
| start | first char position (0 based) |
| len | maximum length of the resulting string |
VDKString & VDKString::Cut |
( |
unsigned int |
len |
) |
|
Cut the string at 'len' length. Modifies and returns the resulting VDKString.
- Parameters:
-
| len | length of the resulting string |
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.
- Parameters:
-
| len | length of the resulting string |
| car | char to be padded |
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.
- Parameters:
-
| len | length of the resulting string |
| car | char to be padded |
VDKString & VDKString::DoubleChar |
( |
const char |
car = '\'' |
) |
|
Double all 'car' chars in the string (for SQL purpose). Modifies and returns the resulting VDKString.
- Parameters:
-
| car | char to be doubled, '\'' (cote) by default |
VDKString & VDKString::FormatDate |
( |
const char |
sep, |
|
|
int |
orig, |
|
|
int |
ret | |
|
) |
| | |
Returns a VDKString containing a formatted date according to parameters settings. Modifies and returns the resulting VDKString.
- Warning:
- Only complete dates are supported. That's to say days and months on two digits and years on 4 digits. For ex. : 02/03/2000.
- Parameters:
-
| sep | desired separator. If 0, no separator left |
| orig | date style staying in VDKString buffer |
| ret | date style to return |
The documentation for this class was generated from the following files: