| 1 |
NAME SbString SbStr "" { class for smart character strings } |
| 2 |
INCLUDE SbString.h |
| 3 |
DESC { |
| 4 |
Strings which have many convenience methods to make |
| 5 |
string manipulation easier. |
| 6 |
} |
| 7 |
METHOD "" SbString() {} |
| 8 |
METHOD CreateStr SbString(const char *str) {} |
| 9 |
METHOD CreateSubStr SbString(const char *str, int start, int end) {} |
| 10 |
METHOD CreateCopy SbString(const SbString &str) {} |
| 11 |
METHOD CreateInt SbString(int digitString) {} |
| 12 |
METHOD "" ~SbString() { |
| 13 |
Constructors and destructor. Constructors take a character string, the |
| 14 |
subset of a character string from start to end (inclusive), or an |
| 15 |
integer to be turned into a string. |
| 16 |
\+ |
| 17 |
For example, |
| 18 |
\kSbString(1234)\. |
| 19 |
creates the string "1234". |
| 20 |
\kSbString("Testing",1,3)\. |
| 21 |
creates the string "est". |
| 22 |
\. |
| 23 |
} |
| 24 |
METHOD "" uint32_t hash() { |
| 25 |
Returns a reasonable hash key for string. |
| 26 |
} |
| 27 |
METHOD getLen int getLength() const { |
| 28 |
Returns length of string. |
| 29 |
} |
| 30 |
METHOD empty void makeEmpty(SbBool freeOld = TRUE) { |
| 31 |
Sets string to be the empty string (""). If freeOld is TRUE |
| 32 |
(default), any old storage is freed up. |
| 33 |
} |
| 34 |
METHOD getStr const char * getString() const { |
| 35 |
Returns pointer to the character string. |
| 36 |
} |
| 37 |
METHOD getSubStr SbString getSubString(int startChar, int endChar = -1) const { |
| 38 |
Returns new string representing sub-string from \astartChar\. to |
| 39 |
\aendChar\., inclusive. If \aendChar\. is -1 (the default), the |
| 40 |
sub-string from \astartChar\. until the end is returned. |
| 41 |
} |
| 42 |
METHOD deleteSubStr void deleteSubString(int startChar, int endChar = -1) { |
| 43 |
Deletes the characters from \astartChar\. to \aendChar\., inclusive, |
| 44 |
from the string. If \aendChar\. is -1 (the default), all characters |
| 45 |
from \astartChar\. until the end are deleted. |
| 46 |
} |
| 47 |
METHOD CopyStr SbString & operator =(const char *str) {} |
| 48 |
METHOD "" SbString & operator =(const SbString &str) { |
| 49 |
Assignment operators for character string, \cSbString\.. |
| 50 |
} |
| 51 |
METHOD concatStr SbString & operator +=(const char *str) {} |
| 52 |
METHOD concat SbString & operator +=(const SbString &str) { |
| 53 |
Concatenation operators "+=" for string, \cSbString\.. |
| 54 |
} |
| 55 |
METHOD "" int operator !() const { |
| 56 |
Unary "not" operator; returns TRUE if string is empty (""). |
| 57 |
} |
| 58 |
BEGIN C++ |
| 59 |
METHOD "" int operator ==(const char *s, const SbString &str) {} |
| 60 |
END |
| 61 |
METHOD IsEqStr int operator ==(const SbString &str, const char *s) {} |
| 62 |
METHOD "" int operator ==(const SbString &str1, const SbString &str2) { |
| 63 |
Equality operator for \cSbString\./\kchar*\. and \cSbString\./\cSbString\. |
| 64 |
comparison. |
| 65 |
} |
| 66 |
BEGIN C++ |
| 67 |
METHOD "" int operator !=(const char *s, const SbString &str) {} |
| 68 |
END |
| 69 |
METHOD IsNEqStr int operator !=(const SbString &str, const char *s) {} |
| 70 |
METHOD "" int operator !=(const SbString &str1, const SbString &str2) { |
| 71 |
Inequality operator for \cSbString\./\kchar*\. and |
| 72 |
\cSbString\./\cSbString\. comparison. |
| 73 |
} |
| 74 |
ALSO { SbName } |
| 75 |
|