Although this code has been completely rewritten, it was originally inspired byte the CWizCharString published by Poul Costinsky at www.codeproject.com.
|
Public Member Functions |
|
| HStr (HStr const &T) |
|
| HStr (StringPtr pstr) |
| HStr & | Align (HString::Alignment align, uint32 uWidth, Text chPad= ' ') throw () |
| | Align the string to a given width.
|
| ErrCode | Append (StringPtr pstr) |
| | Appends one string onto the end of this string.
|
| int32 | Compare (const HStr &rhs, bool bCase=true) const |
| | Compares this string to another string.
|
| int32 | Compare (StringPtr pstr, bool bCase=true) const |
| | Compares this string to another string.
|
| int32 | Find (Text ch, uint32 uStart=0) const |
| | Searches for the first ocurrence of a character.
|
| int32 | Find (StringPtr pstr, uint32 uStart=0) const |
| | Searches for the first ocurrence of a string.
|
| int32 | FindLast (Text ch) const |
| | Searches for the last occurrence of a character.
|
| int32 | Format (StringPtr pstr,...) |
| | Formats the string using a sprintf()-style syntax.
|
| HStr< MAX_LEN > | Left (uint32 uCount) const |
| | Returns a portion of the string.
|
| HStr & | MakeLower (void) |
| | Converts the string to all lower case.
|
| HStr & | MakeUpper (void) |
| | Converts the string to all upper case (capitals).
|
| HStr< MAX_LEN > | Mid (uint32 uStart, int32 nCount=-1) const |
| | Returns a portion of the string.
|
| int32 | Replace (Text chOld, Text chNew) |
| | Replaces all ocurrences of one character with another.
|
| HStr< MAX_LEN > | Right (uint32 uCount) const |
| | Returns a portion of the string.
|
| HStr & | Trim (void) |
| | Trims all whitespace--front and back--from the string.
|
| HStr & | TrimLeft (void) |
| | Trims all whitespace at the front of the string.
|
| HStr & | TrimRight (void) |
| | Trims all whitespace at the end of the string.
|
| Text | GetAt (int32 index) const |
| | Returns the character at a given offset, or zero if offset is out of bounds.
|
| void | SetAt (int32 index, Text ch) |
| | Sets the character at a given offset.
|
| int32 | GetLength (void) const |
| | Returns length of the string in characters.
|
| StringPtr | GetString (void) const |
| | Returns a ptr to the underlying buffer.
|
| int32 | GetValue (void) const |
| | Returns an integer value for the string.
|
|
void | SetEmpty (void) |
| | Sets the string to an empty (zero-length) string.
|
| int32 | FormatV (StringPtr pstr, va_list &vaList) |
| | Formats the string using a sprintf()-style syntax.
|
| uint32 | Hash (void) const |
| | Returns a 32-bit hash value for the string.
|
| bool | IsEmpty (void) const |
| | Evaluates to true if the string is empty, i.e., zero-length.
|
| bool | IsNotEmpty (void) const |
| | Evaluates to true if the string is not empty.
|
|
bool | operator== (StringPtr pstr) const |
|
bool | operator!= (StringPtr pstr) const |
|
bool | operator<= (StringPtr pstr) const |
|
bool | operator< (StringPtr pstr) const |
|
bool | operator>= (StringPtr pstr) const |
|
bool | operator> (StringPtr pstr) const |
|
| operator StringPtr () const |
|
Text | operator[] (int index) const |
|
HStr & | operator= (HStr const &rhs) |
|
HStr & | operator= (StringPtr pstr) |
|
HStr & | operator+= (HStr const &rhs) |
|
HStr & | operator+= (StringPtr pstr) |
|
HStr | operator+ (HStr const &rhs) const |
|
HStr | operator+ (StringPtr pstr) const |
Static Public Member Functions |
| static int32 | GetMaxLength (void) |
| | Returns the maximum length of the string buffer (not including '\0').
|
Protected Member Functions |
| void | assign (StringPtr pstr) |
| | Sets the managed string to the given string.
|
| bool | isValidIndex (uint32 udx) const |
| | Evaluates if an offset is within the buffer.
|
| bool | validPtr (StringPtr pstr) const |
| | Evaluate a string ptr for validity.
|
Protected Attributes |
|
Text | m_buffer [MAX_LEN+1] |
| | buffer to store the text
|