Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SbName Class Reference

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

#include <Inventor/SbName.h>

Public Member Functions

 SbName ()
 Constructor.
 
 SbName (const char *s)
 Constructor.
 
 SbName (const SbString &s)
 Constructor.
 
 SbName (const SbName &n)
 Constructor.
 
 ~SbName ()
 Destructor.
 
const char * getString () const
 Returns pointer to the character string.
 
int getLength () const
 Returns length of string.
 
int operator! () const
 Unary "not" operator; returns TRUE if string is empty ("").
 

Static Public Member Functions

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

Friends

int operator== (const SbName &n, const char *s)
 Equality operator for SbName/char* and SbName/SbName comparison.
 
int operator== (const char *s, const SbName &n)
 Equality operator for SbName/char* and SbName/SbName comparison.
 
int operator== (const SbName &n1, const SbName &n2)
 Equality operator for SbName/char* and SbName/SbName comparison.
 
int operator!= (const SbName &n, const char *s)
 Inequality operator for SbName/char* and SbName/SbName comparison.
 
int operator!= (const char *s, const SbName &n)
 Inequality operator for SbName/char* and SbName/SbName comparison.
 
int operator!= (const SbName &n1, const SbName &n2)
 Inequality operator for SbName/char* and SbName/SbName comparison.
 
bool operator< (const SbName &n1, const SbName &n2)
 "less than" relational operator for SbName / SbName that returns TRUE if the first operand is less than the second, FALSE otherwise.
 
std::ostream & operator<< (std::ostream &os, const SbName &n)
 Writes the SbName to the specified output stream.
 

Detailed Description

Character string stored in a hash table.

This class of strings stores the string in a hash table. It is used by the Open Inventor toolkit for keywords and other unique names. It is not recommended for general use (only in the context of Open 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.

Note: SbName does not support Unicode strings.

SEE ALSO

SbString, SoBase::setName()

Definition at line 161 of file SbName.h.

Constructor & Destructor Documentation

◆ SbName() [1/4]

SbName::SbName ( )
inline

Constructor.

Definition at line 167 of file SbName.h.

◆ SbName() [2/4]

SbName::SbName ( const char *  s)
inline

Constructor.

Definition at line 172 of file SbName.h.

◆ SbName() [3/4]

SbName::SbName ( const SbString s)
inline

Constructor.

Definition at line 177 of file SbName.h.

◆ SbName() [4/4]

SbName::SbName ( const SbName n)
inline

Constructor.

Definition at line 182 of file SbName.h.

◆ ~SbName()

SbName::~SbName ( )
inline

Destructor.

Definition at line 187 of file SbName.h.

Member Function Documentation

◆ getLength()

int SbName::getLength ( ) const
inline

Returns length of string.

Definition at line 200 of file SbName.h.

◆ getString()

const char * SbName::getString ( ) const
inline

Returns pointer to the character string.

Definition at line 192 of file SbName.h.

◆ isBaseNameChar()

static SbBool SbName::isBaseNameChar ( char  c)
static

Returns TRUE if given character is a legal nonstarting character for an SoBase's name.

◆ isBaseNameStartChar()

static SbBool SbName::isBaseNameStartChar ( char  c)
static

Returns TRUE if given character is a legal starting character for an SoBase's name.

◆ isIdentChar()

static SbBool SbName::isIdentChar ( char  c)
static

Returns TRUE if given character is a legal nonstarting character for an identifier.

◆ isIdentStartChar()

static SbBool SbName::isIdentStartChar ( char  c)
static

Returns TRUE if given character is a legal starting character for an identifier.

◆ operator!()

int SbName::operator! ( ) const
inline

Unary "not" operator; returns TRUE if string is empty ("").

Definition at line 231 of file SbName.h.

Friends And Related Symbol Documentation

◆ operator!= [1/3]

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

Inequality operator for SbName/char* and SbName/SbName comparison.

Definition at line 271 of file SbName.h.

◆ operator!= [2/3]

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

Inequality operator for SbName/char* and SbName/SbName comparison.

Definition at line 263 of file SbName.h.

◆ operator!= [3/3]

int operator!= ( const SbName n1,
const SbName n2 
)
friend

Inequality operator for SbName/char* and SbName/SbName comparison.

Definition at line 277 of file SbName.h.

◆ operator<

bool operator< ( const SbName n1,
const SbName n2 
)
friend

"less than" relational operator for SbName / SbName that returns TRUE if the first operand is less than the second, FALSE otherwise.

Definition at line 285 of file SbName.h.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SbName n 
)
friend

Writes the SbName to the specified output stream.

Definition at line 293 of file SbName.h.

◆ operator== [1/3]

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

Equality operator for SbName/char* and SbName/SbName comparison.

Definition at line 247 of file SbName.h.

◆ operator== [2/3]

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

Equality operator for SbName/char* and SbName/SbName comparison.

Definition at line 239 of file SbName.h.

◆ operator== [3/3]

int operator== ( const SbName n1,
const SbName n2 
)
friend

Equality operator for SbName/char* and SbName/SbName comparison.

Definition at line 255 of file SbName.h.


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