Open Inventor Reference
|
Class for smart character strings. More...
#include <Inventor/SbString.h>
Public Member Functions | |
SbString () | |
SbString (const char *str) | |
SbString (const char *str, int start, int end) | |
SbString (const SbString &str) | |
SbString (int digitString) | |
Constructors and destructor. More... | |
~SbString () | |
Destructor. More... | |
uint32_t | hash () |
Returns a reasonable hash key for string. More... | |
int | getLength () const |
Returns length of string. More... | |
void | makeEmpty (bool freeOld=TRUE) |
Sets string to be the empty string (""). More... | |
const char * | getString () const |
Returns pointer to the character string. More... | |
SbString | getSubString (int startChar, int endChar=-1) const |
Returns new string representing sub-string from startChar to endChar , inclusive. More... | |
void | deleteSubString (int startChar, int endChar=-1) |
Deletes the characters from startChar to endChar , inclusive, from the string. More... | |
SbString & | operator= (const char *str) |
Assignment operators for character string, SbString. More... | |
SbString & | operator= (const SbString &str) |
Assignment operators for character string, SbString. More... | |
SbString & | operator+= (const char *str) |
Concatenation operators "+=" for string, SbString. More... | |
SbString & | operator+= (const SbString &str) |
Concatenation operators "+=" for string, SbString. More... | |
bool | operator! () const |
Unary "not" operator; returns TRUE if string is empty (""). More... | |
Static Public Member Functions | |
static uint32_t | hash (const char *s) |
Returns a reasonable hash key for string. More... | |
Friends | |
INVENTOR_API bool | operator== (const SbString &str, const char *s) |
Equality operator for SbString/char* and SbString/SbString comparison. More... | |
INVENTOR_API bool | operator== (const char *s, const SbString &str) |
INVENTOR_API bool | operator== (const SbString &str1, const SbString &str2) |
INVENTOR_API bool | operator!= (const SbString &str, const char *s) |
Inequality operator for SbString/char* and SbString/SbString comparison. More... | |
INVENTOR_API bool | operator!= (const char *s, const SbString &str) |
INVENTOR_API bool | operator!= (const SbString &str1, const SbString &str2) |
INVENTOR_API bool | operator< (const SbString &str, const char *s) |
Lexically less than operator for SbString/char* and SbString/SbString comparison. More... | |
INVENTOR_API bool | operator< (const char *s, const SbString &str) |
INVENTOR_API bool | operator< (const SbString &str1, const SbString &str2) |
Strings which have many convenience methods to make string manipulation easier.
Definition at line 85 of file SbString.h.
|
inline |
Definition at line 89 of file SbString.h.
|
inline |
Definition at line 93 of file SbString.h.
SbString::SbString | ( | const char * | str, |
int | start, | ||
int | end | ||
) |
|
inline |
Definition at line 100 of file SbString.h.
SbString::SbString | ( | int | digitString | ) |
Constructors take a character string, the subset of a character string from start to end (inclusive), or an integer to be turned into a string. For example, SbString(1234)
creates the string "1234". SbString("Testing",1,3)
creates the string "est".
SbString::~SbString | ( | ) |
void SbString::deleteSubString | ( | int | startChar, |
int | endChar = -1 |
||
) |
If endChar
is -1 (the default), all characters from startChar
until the end are deleted.
|
inline |
Definition at line 120 of file SbString.h.
|
inline |
Definition at line 127 of file SbString.h.
Referenced by SbName::SbName().
SbString SbString::getSubString | ( | int | startChar, |
int | endChar = -1 |
||
) | const |
If endChar
is -1 (the default), the sub-string from startChar
until the end is returned.
|
inline |
Definition at line 117 of file SbString.h.
|
static |
void SbString::makeEmpty | ( | bool | freeOld = TRUE | ) |
If freeOld is TRUE (default), any old storage is freed up.
|
inline |
Definition at line 152 of file SbString.h.
SbString& SbString::operator+= | ( | const char * | str | ) |
SbString& SbString::operator= | ( | const char * | str | ) |
Definition at line 142 of file SbString.h.
|
friend |
|
friend |
Definition at line 167 of file SbString.h.
|
friend |
Definition at line 170 of file SbString.h.
|
friend |
|
friend |
Definition at line 177 of file SbString.h.
|
friend |
Definition at line 180 of file SbString.h.
|
friend |
|
friend |
Definition at line 157 of file SbString.h.
|
friend |
Definition at line 161 of file SbString.h.