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. | |
~SbString () | |
Destructor. | |
uint32_t | hash () |
Returns a reasonable hash key for string. | |
int | getLength () const |
Returns length of string. | |
void | makeEmpty (SbBool freeOld=TRUE) |
Sets string to be the empty string (""). | |
const char * | getString () const |
Returns pointer to the character string. | |
SbString | getSubString (int startChar, int endChar=-1) const |
Returns new string representing sub-string from startChar to endChar , inclusive. | |
void | deleteSubString (int startChar, int endChar=-1) |
Deletes the characters from startChar to endChar , inclusive, from the string. | |
SbString & | operator= (const char *str) |
Assignment operators for character string, SbString. | |
SbString & | operator= (const SbString &str) |
Assignment operators for character string, SbString. | |
SbString & | operator+= (const char *str) |
Concatenation operators "+=" for string, SbString. | |
SbString & | operator+= (const SbString &str) |
Concatenation operators "+=" for string, SbString. | |
int | operator! () const |
Unary "not" operator; returns TRUE if string is empty (""). | |
Static Public Member Functions | |
static uint32_t | hash (const char *s) |
Returns a reasonable hash key for string. | |
Friends | |
INVENTOR_API int | operator== (const SbString &str, const char *s) |
Equality operator for SbString/char* and SbString/SbString comparison. | |
INVENTOR_API int | operator== (const char *s, const SbString &str) |
INVENTOR_API int | operator== (const SbString &str1, const SbString &str2) |
INVENTOR_API int | operator!= (const SbString &str, const char *s) |
Inequality operator for SbString/char* and SbString/SbString comparison. | |
INVENTOR_API int | operator!= (const char *s, const SbString &str) |
INVENTOR_API int | operator!= (const SbString &str1, const SbString &str2) |
INVENTOR_API int | operator< (const SbString &str, const char *s) |
Lexically less than operator for SbString/char* and SbString/SbString comparison. | |
INVENTOR_API int | operator< (const char *s, const SbString &str) |
INVENTOR_API int | operator< (const SbString &str1, const SbString &str2) |
Strings which have many convenience methods to make string manipulation easier.
Definition at line 80 of file SbString.h.
SbString::SbString | ( | ) | [inline] |
Definition at line 84 of file SbString.h.
SbString::SbString | ( | const char * | str | ) | [inline] |
Definition at line 88 of file SbString.h.
SbString::SbString | ( | const char * | str, |
int | start, | ||
int | end | ||
) |
SbString::SbString | ( | const SbString & | str | ) | [inline] |
Definition at line 95 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.
int SbString::getLength | ( | ) | const [inline] |
Definition at line 115 of file SbString.h.
const char* SbString::getString | ( | ) | const [inline] |
Definition at line 122 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.
uint32_t SbString::hash | ( | ) | [inline] |
Definition at line 112 of file SbString.h.
static uint32_t SbString::hash | ( | const char * | s | ) | [static] |
void SbString::makeEmpty | ( | SbBool | freeOld = TRUE | ) |
If freeOld is TRUE (default), any old storage is freed up.
int SbString::operator! | ( | ) | const [inline] |
Definition at line 147 of file SbString.h.
SbString& SbString::operator+= | ( | const char * | str | ) |
SbString& SbString::operator= | ( | const char * | str | ) |
Definition at line 137 of file SbString.h.
INVENTOR_API int operator!= | ( | const SbString & | str, |
const char * | s | ||
) | [friend] |
INVENTOR_API int operator!= | ( | const char * | s, |
const SbString & | str | ||
) | [friend] |
Definition at line 162 of file SbString.h.
Definition at line 165 of file SbString.h.
Definition at line 175 of file SbString.h.
INVENTOR_API int operator< | ( | const char * | s, |
const SbString & | str | ||
) | [friend] |
Definition at line 172 of file SbString.h.
INVENTOR_API int operator< | ( | const SbString & | str, |
const char * | s | ||
) | [friend] |
INVENTOR_API int operator== | ( | const char * | s, |
const SbString & | str | ||
) | [friend] |
Definition at line 152 of file SbString.h.
INVENTOR_API int operator== | ( | const SbString & | str, |
const char * | s | ||
) | [friend] |
Definition at line 156 of file SbString.h.