xstring Class Reference
BASE CLASS FOR STRINGS.
More...
#include <Zclassut.h>
List of all members.
Public Member Functions |
| int | Locate (LPCTSTR lpsz_to_locate, unsigned long start_at_byte=0, bool ignore_case=__nocasesensitive) |
| int | LocateLast (LPCTSTR lpsz_to_locate, unsigned long start_at_byte=0, bool casecheck=__nocasesensitive) |
| xstring & | Erase (int at_char, unsigned long how_many_bytes) |
| xstring & | Insert (int at_char, LPCTSTR source_string, bool append=true) |
| xstring & | Replace (LPCTSTR lpsz_to_find, LPCTSTR lpsz_to_replace, bool replace_all=true, bool casecheck=__nocasesensitive) |
| bool | isNotNull (void) |
| bool | isNull (void) |
| bool | isNotZero (void) |
| bool | isZero (void) |
| xstring | Middle (int at_char, int how_many_chars=-1) |
| xstring | Left (int how_many_chars) |
| xstring | Right (int how_many_chars) |
| xstring | LeftZeroPad (int how_many_zeroes) |
| xstring | LeftSpacePad (int how_many_spaces) |
| xstring | RightSpacePad (int how_many_spaces) |
| xstring | SpaceTrim (void) |
| xstring | LeftSpaceTrim (void) |
| xstring | RightSpaceTrim (void) |
| xstring | LeftZeroTrim (void) |
| int | Length (void) |
| xstring & | Mask (unsigned char mask_char) |
| void | Spaces (int how_many_spaces) |
| void | startTokenize (void) |
| xstring | nextToken (void) |
| xstring | currentToken (void) |
| int | indexToken (void) |
| xstring & | AppendNulls (short how_many_nulls=1) |
| xstring & | toLowerCase (void) |
| xstring & | toUpperCase (void) |
| xstring | asLowerCase (void) |
| xstring | asUpperCase (void) |
| | operator double (void) |
| | operator int (void) |
| | operator long (void) |
| | operator unsigned int (void) |
| | operator short (void) |
| | operator __int64 (void) |
| | operator unsigned short (void) |
| | operator char (void) |
| | operator unsigned char (void) |
Detailed Description
BASE CLASS FOR STRINGS.
Provides methods for manipulating strings. xstring object consists of a variable-length sequence of characters and provides functions and operators using a syntax similar to that of Basic. Concatenation and comparison operators,together with simplified memory management,make xstring objects easier to use than ordinary character arrays.
xstring str="this is a string";
str+=" now it is longer";
str+=" without realloc and strcat!";
Member Function Documentation
| xstring& xstring::AppendNulls |
( |
short |
how_many_nulls = 1 |
) |
|
| xstring xstring::asLowerCase |
( |
void |
|
) |
[inline] |
- Returns:
- the string value converted to lowercase.
| xstring xstring::asUpperCase |
( |
void |
|
) |
[inline] |
- Returns:
- the string value converted to uppercase.
| xstring xstring::currentToken |
( |
void |
|
) |
[inline] |
- Returns:
- the current token(refer to startTokenize)
| xstring& xstring::Erase |
( |
int |
at_char, |
|
|
unsigned long |
how_many_bytes | |
|
) |
| | |
Erases characters beginning at the specified position; overflow/underflow checking is performed. The position is 0 based.
| int xstring::indexToken |
( |
void |
|
) |
[inline] |
- Returns:
- the current token character index(refer to startTokenize)
| xstring& xstring::Insert |
( |
int |
at_char, |
|
|
LPCTSTR |
source_string, |
|
|
bool |
append = true | |
|
) |
| | |
Inserts a string before the specified position; overflow/underflow checking is performed. The position is 0 based.
| bool xstring::isNotNull |
( |
void |
|
) |
[inline] |
- Returns:
- true if the object is not null.
| bool xstring::isNotZero |
( |
void |
|
) |
[inline] |
- Returns:
- true if the object is not zero.
| bool xstring::isNull |
( |
void |
|
) |
|
- Returns:
- true if the object is null.
| bool xstring::isZero |
( |
void |
|
) |
[inline] |
- Returns:
- true if the object is zero.
| xstring xstring::Left |
( |
int |
how_many_chars |
) |
[inline] |
- Returns:
- a specified number of characters from the left side
| xstring xstring::LeftSpacePad |
( |
int |
how_many_spaces |
) |
[inline] |
- Returns:
- the string value padded with a specified number of spaces on left.
| xstring xstring::LeftSpaceTrim |
( |
void |
|
) |
[inline] |
| xstring xstring::LeftZeroPad |
( |
int |
how_many_zeroes |
) |
[inline] |
- Returns:
- the string value padded with a specified number of zeroes on left.
| xstring xstring::LeftZeroTrim |
( |
void |
|
) |
[inline] |
| int xstring::Length |
( |
void |
|
) |
[inline] |
- Returns:
- the number of characters.
| int xstring::Locate |
( |
LPCTSTR |
lpsz_to_locate, |
|
|
unsigned long |
start_at_byte = 0, |
|
|
bool |
ignore_case = __nocasesensitive | |
|
) |
| | |
Finds the first occurrence of a substring beginning at the specified position; the comparison is no case sensitive unless the parameter ignore_case is __casesensitive.
- Returns:
- the position of the substring found or __notfound if no occurrence is found. The position is 0 based.
| int xstring::LocateLast |
( |
LPCTSTR |
lpsz_to_locate, |
|
|
unsigned long |
start_at_byte = 0, |
|
|
bool |
casecheck = __nocasesensitive | |
|
) |
| | |
Finds the last occurrence of a substring beginning at the specified position; the comparison is no case sensitive unless the parameter ignore_case is __casesensitive.
- Returns:
- the position of the position of the substring found or __notfound if no occurrence is found. The position is 0 based.
| xstring& xstring::Mask |
( |
unsigned char |
mask_char |
) |
[inline] |
Masks each character with a value.
| xstring xstring::Middle |
( |
int |
at_char, |
|
|
int |
how_many_chars = -1 | |
|
) |
| | |
- Returns:
- a specified number of characters beginning at the specified position. The position is 0 based.
| xstring xstring::nextToken |
( |
void |
|
) |
|
- Returns:
- the next token(refer to startTokenize)
| xstring::operator __int64 |
( |
void |
|
) |
[inline] |
- Returns:
- the short value produced by interpreting this object as a number.
| xstring::operator char |
( |
void |
|
) |
[inline] |
- Returns:
- the char value produced by interpreting this object at the specified position.
| xstring::operator double |
( |
void |
|
) |
|
- Returns:
- the double value produced by interpreting this object as a number.
| xstring::operator int |
( |
void |
|
) |
[inline] |
- Returns:
- the integer value produced by interpreting this object as a number.
| xstring::operator long |
( |
void |
|
) |
[inline] |
- Returns:
- the long value produced by interpreting this object as a number.
| xstring::operator short |
( |
void |
|
) |
[inline] |
- Returns:
- the short value produced by interpreting this object as a number.
| xstring::operator unsigned char |
( |
void |
|
) |
[inline] |
- Returns:
- the char value produced by interpreting this object at the specified position.
| xstring::operator unsigned int |
( |
void |
|
) |
[inline] |
- Returns:
- the long value produced by interpreting this object as a number.
| xstring::operator unsigned short |
( |
void |
|
) |
[inline] |
- Returns:
- the unsigned short value produced by interpreting this object as a number.
| xstring& xstring::Replace |
( |
LPCTSTR |
lpsz_to_find, |
|
|
LPCTSTR |
lpsz_to_replace, |
|
|
bool |
replace_all = true, |
|
|
bool |
casecheck = __nocasesensitive | |
|
) |
| | |
Finds and replace the first occurrence of a substring with another string; the comparison is no case sensitive unless ignore_case is __casesensitive. The position is 0 based.
| xstring xstring::Right |
( |
int |
how_many_chars |
) |
[inline] |
- Returns:
- a specified number of characters from the right side
| xstring xstring::RightSpacePad |
( |
int |
how_many_spaces |
) |
[inline] |
- Returns:
- the string value padded with a specified number of zeroes on right.
| xstring xstring::RightSpaceTrim |
( |
void |
|
) |
[inline] |
| void xstring::Spaces |
( |
int |
how_many_spaces |
) |
|
Fills with specified number of spaces; underflow checking is performed.
| xstring xstring::SpaceTrim |
( |
void |
|
) |
[inline] |
Removes leading and trailing spaces.
| void xstring::startTokenize |
( |
void |
|
) |
|
Initialize this object for further search of tokens. A typical sequence of operations to get tokens from a string look like this:
| xstring& xstring::toLowerCase |
( |
void |
|
) |
[inline] |
All characters will be converted to lowercase.
| xstring& xstring::toUpperCase |
( |
void |
|
) |
[inline] |
All characters will be converted to uppercase.
The documentation for this class was generated from the following file: