
#include <gzBase.h>
Inheritance diagram for gzString:

Public Member Functions | |
| gzString () | |
| Default constructor of a gzString. | |
| gzString (const char *str) | |
| Create a gzString from a C string. | |
| gzString (const char *str, gzUShort len) | |
| gzString (const gzString &str) | |
| virtual | ~gzString () |
| gzString (const gzWideChar *widestr) | |
| gzString (const gzWideChar *widestr, gzUShort len, gzBool isPlain=FALSE) | |
| gzString (gzLongLong number, gzUByte radix, gzULong minLen=0) | |
| gzString (gzDouble number, const gzString &format="") | |
| gzUShort | length () const |
| gzVoid | clear () |
| const char * | getString () const |
| gzLongLong | num () const |
| gzDouble | real (gzUShort decimalToken='.') const |
| gzDouble | sortval () const |
| gzBool | contains (const gzString &substr, gzUShort startindex=0, gzBool caseSensitive=TRUE, gzUShort *index=NULL) const |
| Search for substring. | |
| gzString | rightOf (const gzString &substr, gzBool searchFromEnd=TRUE, gzBool caseSensitive=TRUE) const |
| Extract substring. | |
| gzString | leftOf (const gzString &substr, gzBool searchFromStart=TRUE, gzBool caseSensitive=TRUE) const |
| Extract substring. | |
| gzString | toLower () const |
| Convert to lower ascii representation. Does not work with WIDE strings. | |
| gzString | toUpper () const |
| Convert to upper ascii representation. Does not work with WIDE strings. | |
| gzString | left (gzULong count, gzBool inverse=FALSE) const |
| gzString | right (gzULong count, gzBool inverse=FALSE) const |
| gzString | strip (char c, gzBool left=TRUE, gzBool right=TRUE) const |
| gzString | stripWhiteSpace (gzBool left=TRUE, gzBool right=TRUE) const |
| gzVoid | reverse () |
| Reverse the string contents. Does not work with WIDE strings. | |
| gzULong | hash () const |
| Return a rather unique number that represents the string. | |
| gzBool | isEmpty () const |
| Check for empty string. | |
| gzBool | isFirst (const gzString &str, gzBool caseSensitive=TRUE) const |
| Check prefix character. | |
| gzBool | isFirst (const char ch, gzBool caseSensitive=TRUE) const |
| Check prefix character. | |
| gzBool | isLast (const gzString &str, gzBool caseSensitive=TRUE) const |
| Check postfix character. | |
| gzBool | isLast (const char ch, gzBool caseSensitive=TRUE) const |
| Check postfix character. | |
| gzString & | format (const gzString &format, ARG_DECL_LIST) |
| Recreate the string based on a formatting sequence. | |
| gzString & | identifier (gzLongLong number) |
| gzUShort | getWideStringLength () const |
| Get The length of the wide string representation. | |
| gzUShort | getWideString (gzWideChar *buffer, gzBool appendZero=TRUE) const |
| Get the wide string data into a buffer. | |
| gzBool | hasEscapedUTF8Chars () const |
| Tell you if the string has possible escaped UTF8 chars. | |
| gzBool | isAsciiString () const |
| Tell you if you have a ascii sequence that is no UTF8 valid sequence. | |
| gzString | convertAsciiToUTF8 () const |
| Convert from Ascii to UTF8. | |
| gzString | convertUTF8ToAscii () const |
| Convert from UTF8 to Ascii. | |
| gzString | convertUTF8ToNumList (const gzString &format="0x%02x", const gzString &separator=",") const |
| gzString | convertNumListToUTF8 () const |
| gzString | convertTextToCtrl () const |
| gzString | convertCtrlToText () const |
| const gzWideChar * | getWideString (gzUShort knownLength=0) const |
| Get a pointer to a null terminated gzWideChar buffer. | |
| gzArray< gzUByte > | getBSTR () const |
| Get a BSTR that contains the length in the first byte. No appended zero in the end. | |
| gzArray< gzWideChar > | getWideBSTR () const |
| Get a Wide BSTR that contains the length in the first gzWideChar. No appended zero in the end. | |
| gzString & | scramble (gzULong code) |
| Scrambles the string with the code value. | |
| gzLongLong | dotValue (gzULong base=256, gzULong *groups=NULL) const |
| Get the dot value e.g. "255.234.245.23". | |
| gzUShort | substitute (char from, char to) |
| Changes character from into a to character. | |
| gzBool | yesNo () |
| returns True if string contains "yes" | |
| gzBool | isUnique () const |
| gzUShort | getUniqueID () const |
| gzBool | makeUnique (gzUShort uniqueID=0) |
| gzBool | checkUnique () const |
| operator gzLongLong () const | |
| operator gzDouble () const | |
| gzString & | operator= (const char *str) |
| operator const char * () const | |
| gzString & | operator= (const gzString &str) |
| gzString & | operator+= (const char *str) |
| gzString | operator+ (const char *str) const |
| gzString | operator+ (const gzString &str) const |
| gzString & | operator+= (const gzString &str) |
| gzString & | operator+= (const char c) |
| gzString & | operator+= (const gzWideChar wc) |
| gzString | operator+ (const char c) const |
| gzString | operator+ (const gzWideChar wc) const |
| gzBool | operator! () const |
| char & | operator() (const gzUShort index) |
| gzString | operator() (const gzUShort index, const gzUShort len) const |
Static Public Member Functions | |
| static gzULong | hash (const char *s, gzULong size=0) |
| Calcualtes the hash value of the buffer s with size. | |
| static gzString | spaces (gzUShort count, const char fillChar=' ') |
Public Attributes | |
| GZ_DECLARE_TYPE_INTERFACE | |
Friends | |
| gzBool | operator== (const gzString &str, const char *s) |
| gzBool | operator== (const char *s, const gzString &str) |
| gzBool | operator== (const gzString &str1, const gzString &str2) |
| gzBool | operator!= (const gzString &str, const char *s) |
| gzBool | operator!= (const char *s, const gzString &str) |
| gzBool | operator!= (const gzString &str1, const gzString &str2) |
| gzBool | operator< (const gzString &str, const char *s) |
| gzBool | operator< (const char *s, const gzString &str) |
| gzBool | operator< (const gzString &str1, const gzString &str2) |
| gzBool | operator> (const gzString &str, const char *s) |
| gzBool | operator> (const char *s, const gzString &str) |
| gzBool | operator> (const gzString &str1, const gzString &str2) |
| gzBool | operator<= (const gzString &str, const char *s) |
| gzBool | operator<= (const char *s, const gzString &str) |
| gzBool | operator<= (const gzString &str1, const gzString &str2) |
| gzBool | operator>= (const gzString &str, const char *s) |
| gzBool | operator>= (const char *s, const gzString &str) |
| gzBool | operator>= (const gzString &str1, const gzString &str2) |
The gzString class is Gizmo3D generic class for string management. It encapsulates C strings (null terminated) and provides methods for comparing, sub string search etc.
dbviewer.cpp, lod.cpp, materialDemo.cpp, mirror.cpp, node.cpp, shaders.cpp, skybox.cpp, and tree.cpp.
Definition at line 91 of file gzBase.h.
|
|
Default constructor of a gzString. Creates an empty string. No allocation of "string" memory is done. However a (cast) to a const char * returns a pointer to a zero terminated empty C string. |
|
|
Create a gzString from a C string. Creates a gzString from a C string pointer. Remember to have a zero terminated string as input !!
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
Creates a gzString from a WIDE string pointer. The gzString will be encoded into UTF8 if the character values are greater than 0x7f
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
Creates a string representation of the number. Use radix=10 to create normal decimal number, Use radix=16 to create Hex.
|
|
||||||||||||
|
creates a string representation of the gzDouble number. You can provide formatting (printf) sequence to customize output
|
|
|
|
|
|
Clears the contents of the string |
|
||||||||||||||||||||
|
Search for substring. Returns TRUE if substr is found withing the string. FALSE if not.
|
|
|
Convert from Ascii to UTF8. Sometimes you have ascii data with e.g. едц characters that are not valid UTF8 characters and therefor you can not convert between UTF8 and gzWideChar. This method casts Ascii to UTF8 |
|
|
|
|
|
|
|
|
|
|
|
Convert from UTF8 to Ascii. Sometimes you want tp have have ascii data with e.g. едц characters that are not valid UTF8 characters and therefor you can not convert between UTF8 and Ascii. This method casts UTF8 to Ascii |
|
||||||||||||
|
|
|
||||||||||||
|
Get the dot value e.g. "255.234.245.23". Use this to convert Ip adresses etc into a large number |
|
||||||||||||
|
Recreate the string based on a formatting sequence. The method works like a sprintf method to create a string out of a format sequence. The ARG_DECL_LIST is a type specified ecliptic argument that can hold 10 values e.g. Creates a string "10.27"
formats: %<pos><flags><width><precision><size><type>
<pos>
number$ uses number to get argument at position 1 to 16. Number is ended by $
*$ takes argument and uses that value as argument position 1-16
<flags>
- left align within width field. Default is to right align
+ prefix width sign if output is number type
0 insert 0 if number value and no + prefix
' ' (blank) prefix with a space, ignore if + prefix
<precision>
.number for type 's' or 'S' number specifies the number of characters in string.
for type 'f' number specifies the number of decimals
<type>
c takes a number n and insert wide char token with value n in string
s takes pointer to null terminated ansi string or ansii gzString and inserts ansii string
S takes pointer to null terminated unicode string or utf8 gzString and inserts unicode string
f takes number and inserts plain number [-]ddd.ddd in string
e takes number and insert exponential number [-]d.dddd e [sign]dd in string
E takes number and insert exponential number [-]d.dddd E [sign]dd in string
g takes number and insers most compact format of f or e
G takes number and insers most compact format of f or E
d takes signed integer and inserts integer value in string
u takes unsigned integer and inserts unsigned integer value in string
x takes unsigned integer and inserts hex lower case value in string
X takes unsigned integer and inserts hex upper case value in string
b takes unsigned integer and inserts binary lower case value in string
B takes unsigned integer and inserts binary upper case value in string
o takes unsigned integer and inserts octal lower case value in string
O takes unsigned integer and inserts octal upper case value in string
|
|
|
Get a BSTR that contains the length in the first byte. No appended zero in the end.
|
|
|
Returns a C string representation of the gzString. The buffer is terminated by a ZERO |
|
|
|
|
|
Get a Wide BSTR that contains the length in the first gzWideChar. No appended zero in the end.
|
|
|
Get a pointer to a null terminated gzWideChar buffer.
|
|
||||||||||||
|
Get the wide string data into a buffer. The buffer need to have the appropriate size so the buffer doesn't get overflowed. Use the getWideStringLength() to create a buffer and remember to append a zero slot at the end of you want a NULL terminated wide string |
|
|
Get The length of the wide string representation.
|
|
|
Tell you if the string has possible escaped UTF8 chars.
|
|
||||||||||||
|
Calcualtes the hash value of the buffer s with size.
|
|
|
Return a rather unique number that represents the string.
|
|
|
|
|
|
Tell you if you have a ascii sequence that is no UTF8 valid sequence.
|
|
|
Check for empty string.
|
|
||||||||||||
|
Check prefix character.
|
|
||||||||||||
|
Check prefix character.
|
|
||||||||||||
|
Check postfix character.
|
|
||||||||||||
|
Check postfix character.
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Extract substring. Extracts the contents of the gzString on the left side of the substr.
|
|
|
Returns the number of UTF8 characters in the string. Remember to use getWideStringLength for WIDE strings. |
|
|
|
|
|
Return a gzLongLong representation of the string |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return a gzDouble representation of the string |
|
|
Reverse the string contents. Does not work with WIDE strings.
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Extract substring. Extracts the contents of the gzString on the right side of the substr.
|
|
|
Scrambles the string with the code value.
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Remove characters from start and end of string.
|
|
||||||||||||
|
|
|