Open Inventor Reference
SbString Class 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 (bool 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.
 
SbStringoperator= (const char *str)
 Assignment operators for character string, SbString.
 
SbStringoperator= (const SbString &str)
 Assignment operators for character string, SbString.
 
SbStringoperator+= (const char *str)
 Concatenation operators "+=" for string, SbString.
 
SbStringoperator+= (const SbString &str)
 Concatenation operators "+=" for string, SbString.
 
bool 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 bool operator== (const SbString &str, const char *s)
 Equality operator for SbString/char* and SbString/SbString comparison.
 
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.
 
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.
 
INVENTOR_API bool operator< (const char *s, const SbString &str)
 
INVENTOR_API bool operator< (const SbString &str1, const SbString &str2)
 

Detailed Description

Strings which have many convenience methods to make string manipulation easier.

See Also
SbName

Definition at line 85 of file SbString.h.

Constructor & Destructor Documentation

◆ SbString() [1/5]

SbString::SbString ( )
inline
See also
SbString(int digitString)

Definition at line 89 of file SbString.h.

◆ SbString() [2/5]

SbString::SbString ( const char *  str)
inline
See also
SbString(int digitString)

Definition at line 93 of file SbString.h.

◆ SbString() [3/5]

SbString::SbString ( const char *  str,
int  start,
int  end 
)

◆ SbString() [4/5]

SbString::SbString ( const SbString str)
inline
See also
SbString(int digitString)

Definition at line 100 of file SbString.h.

◆ SbString() [5/5]

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::~SbString ( )

Member Function Documentation

◆ deleteSubString()

void SbString::deleteSubString ( int  startChar,
int  endChar = -1 
)

If endChar is -1 (the default), all characters from startChar until the end are deleted.

◆ getLength()

int SbString::getLength ( ) const
inline

Definition at line 120 of file SbString.h.

◆ getString()

const char * SbString::getString ( ) const
inline

Definition at line 127 of file SbString.h.

Referenced by SbName::SbName().

◆ getSubString()

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.

◆ hash() [1/2]

uint32_t SbString::hash ( )
inline

Definition at line 117 of file SbString.h.

References hash().

Referenced by hash().

◆ hash() [2/2]

static uint32_t SbString::hash ( const char *  s)
static

◆ makeEmpty()

void SbString::makeEmpty ( bool  freeOld = TRUE)

If freeOld is TRUE (default), any old storage is freed up.

◆ operator!()

bool SbString::operator! ( ) const
inline

Definition at line 152 of file SbString.h.

◆ operator+=() [1/2]

SbString & SbString::operator+= ( const char *  str)

◆ operator+=() [2/2]

SbString & SbString::operator+= ( const SbString str)

◆ operator=() [1/2]

SbString & SbString::operator= ( const char *  str)

◆ operator=() [2/2]

SbString & SbString::operator= ( const SbString str)
inline

Definition at line 142 of file SbString.h.

Friends And Related Symbol Documentation

◆ operator!= [1/3]

INVENTOR_API bool operator!= ( const char *  s,
const SbString str 
)
friend

Definition at line 167 of file SbString.h.

◆ operator!= [2/3]

INVENTOR_API bool operator!= ( const SbString str,
const char *  s 
)
friend

◆ operator!= [3/3]

INVENTOR_API bool operator!= ( const SbString str1,
const SbString str2 
)
friend

Definition at line 170 of file SbString.h.

◆ operator< [1/3]

INVENTOR_API bool operator< ( const char *  s,
const SbString str 
)
friend

Definition at line 177 of file SbString.h.

◆ operator< [2/3]

INVENTOR_API bool operator< ( const SbString str,
const char *  s 
)
friend

◆ operator< [3/3]

INVENTOR_API bool operator< ( const SbString str1,
const SbString str2 
)
friend

Definition at line 180 of file SbString.h.

◆ operator== [1/3]

INVENTOR_API bool operator== ( const char *  s,
const SbString str 
)
friend

Definition at line 157 of file SbString.h.

◆ operator== [2/3]

INVENTOR_API bool operator== ( const SbString str,
const char *  s 
)
friend

◆ operator== [3/3]

INVENTOR_API bool operator== ( const SbString str1,
const SbString str2 
)
friend

Definition at line 161 of file SbString.h.


The documentation for this class was generated from the following file: