Open Inventor Reference
SbName Class Reference

Character string stored in a hash table. More...

#include <Inventor/SbString.h>

Public Member Functions

 SbName ()
 Constructors and destructor. More...
 
 SbName (const char *s)
 Constructor that initializes to given character string. More...
 
 SbName (const SbString &s)
 Constructor that initializes to given SbString. More...
 
 SbName (const SbName &n)
 Constructors and destructor. More...
 
 ~SbName ()
 Constructors and destructor. More...
 
const char * getString () const
 Returns pointer to the character string. More...
 
int getLength () const
 Returns length of string. More...
 
bool operator! () const
 Unary "not" operator; returns TRUE if string is empty (""). More...
 

Static Public Member Functions

static bool isIdentStartChar (char c)
 Returns TRUE if given character is a legal starting character for an identifier. More...
 
static bool isIdentChar (char c)
 Returns TRUE if given character is a legal nonstarting character for an identifier. More...
 
static bool isBaseNameStartChar (char c)
 Returns TRUE if given character is a legal starting character for an SoBase's name. More...
 
static bool isBaseNameChar (char c)
 Returns TRUE if given character is a legal nonstarting character for an SoBase's name. More...
 

Friends

INVENTOR_API bool operator== (const SbName &n, const char *s)
 Equality operator for SbName/char* and SbName/SbName comparison. More...
 
INVENTOR_API bool operator== (const char *s, const SbName &n)
 
INVENTOR_API bool operator== (const SbName &n1, const SbName &n2)
 
INVENTOR_API bool operator!= (const SbName &n, const char *s)
 Inequality operator for SbName/char* and SbName/SbName comparison. More...
 
INVENTOR_API bool operator!= (const char *s, const SbName &n)
 
INVENTOR_API bool operator!= (const SbName &n1, const SbName &n2)
 

Detailed Description

This class of strings stores the string in a hash table. It is used by the Inventor toolkit for keywords and other unique names. It is not recommended for general use (only in the context of Inventor objects). When a string is stored in this table, a pointer to the storage is returned. Two identical strings will return the same pointer. This means that comparison of two SbNames for equality can be accomplished by comparing their identifiers. SbNames are used for strings which are expected to show up frequently, such as node names.

See Also
SbString

Definition at line 264 of file SbString.h.

Constructor & Destructor Documentation

◆ SbName() [1/4]

SbName::SbName ( )

◆ SbName() [2/4]

SbName::SbName ( const char *  s)
inline

Definition at line 271 of file SbString.h.

◆ SbName() [3/4]

SbName::SbName ( const SbString s)
inline

Definition at line 274 of file SbString.h.

References SbString::getString().

◆ SbName() [4/4]

SbName::SbName ( const SbName n)
inline

Definition at line 277 of file SbString.h.

◆ ~SbName()

SbName::~SbName ( )
inline

Definition at line 280 of file SbString.h.

Member Function Documentation

◆ getLength()

int SbName::getLength ( ) const
inline

Definition at line 286 of file SbString.h.

◆ getString()

const char* SbName::getString ( ) const
inline

Definition at line 283 of file SbString.h.

◆ isBaseNameChar()

static bool SbName::isBaseNameChar ( char  c)
static

◆ isBaseNameStartChar()

static bool SbName::isBaseNameStartChar ( char  c)
static

◆ isIdentChar()

static bool SbName::isIdentChar ( char  c)
static

◆ isIdentStartChar()

static bool SbName::isIdentStartChar ( char  c)
static

◆ operator!()

bool SbName::operator! ( ) const
inline

Definition at line 305 of file SbString.h.

Friends And Related Function Documentation

◆ operator!= [1/3]

INVENTOR_API bool operator!= ( const char *  s,
const SbName n 
)
friend

Definition at line 321 of file SbString.h.

◆ operator!= [2/3]

INVENTOR_API bool operator!= ( const SbName n,
const char *  s 
)
friend

Definition at line 318 of file SbString.h.

◆ operator!= [3/3]

INVENTOR_API bool operator!= ( const SbName n1,
const SbName n2 
)
friend

Definition at line 324 of file SbString.h.

◆ operator== [1/3]

INVENTOR_API bool operator== ( const char *  s,
const SbName n 
)
friend

Definition at line 311 of file SbString.h.

◆ operator== [2/3]

INVENTOR_API bool operator== ( const SbName n,
const char *  s 
)
friend

Definition at line 308 of file SbString.h.

◆ operator== [3/3]

INVENTOR_API bool operator== ( const SbName n1,
const SbName n2 
)
friend

Definition at line 314 of file SbString.h.


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