SBNAME(3iv)

πŸ’– SbName β€” the character string that lives in a hash table πŸ’–

okay so bestie, welcome to SbName(3IV) β€” yes that's the manual page name, yes I'm folding it in right here at the top, you're welcome. It's giving ✨string but make it interned✨. Let's get into it.


🌸 NAME 🌸

SbName β€” character string stored in a hash table πŸ—‚οΈβœ¨


πŸ¦‹ INHERITS FROM πŸ¦‹

SbName

(yeah she inherits from herself, main character energy only, no cap πŸ‘‘)


✨ SYNOPSIS ✨

#include <Inventor/SbString.h>

Methods from class SbName:

                     SbName()
                     SbName(const char *s)
                     SbName(const SbString &s)
                     SbName(const SbName &n)
                     ~SbName()
 const char *        getString() const
 int                 getLength() const
 static SbBool       isIdentStartChar(char c)
 static SbBool       isIdentChar(char c)
 int                 operator !() const
 int                 operator ==(const char *s, const SbName &n)
 int                 operator ==(const SbName &n1, const SbName &n2)
 int                 operator ==(const SbName &n, const char *s)
 int                 operator !=(const char *s, const SbName &n)
 int                 operator !=(const SbName &n1, const SbName &n2)
 int                 operator !=(const SbName &n, const char *s)

πŸ’… DESCRIPTION πŸ’…

so like, this class of strings stores the string in a hash table. It's 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, bestie, stay in your lane 🫢.

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. literally the interned-string trick before it was cool πŸ’€βœ¨


πŸŽ€ METHODS πŸŽ€

                     SbName()
                     SbName(const char *s)
                     SbName(const SbString &s)
                     SbName(const SbName &n)
                     ~SbName()

Constructors and destructor. birth, birth, birth, birth, and the lil goodbye πŸ₯Ή

  • const char * getString() const β€” Returns pointer to the character string. just handin' you the pointer, no drama ✨
  • int getLength() const β€” Returns length of string. how many characters, fr fr πŸ“
  • static SbBool isIdentStartChar(char c) β€” Returns TRUE if given character is a legal starting character for an identifier. (starters only, this char has to be first πŸ₯‡)
  • static SbBool isIdentChar(char c) β€” Returns TRUE if given character is a legal nonstarting character for an identifier. (so like, allowed, but NOT allowed to go first β€” know your role πŸ’…)
  • int operator !() const β€” Unary "not" operator; returns TRUE if string is empty (""). not me checking if you're empty πŸ™ˆ
  • int operator ==(const char *s, const SbName &n) int operator ==(const SbName &n1, const SbName &n2) int operator ==(const SbName &n, const char *s) β€” Equality operator for SbName/char* and SbName/SbName comparison. are y'all the same?? πŸ‘―β€β™€οΈ
  • int operator !=(const char *s, const SbName &n) int operator !=(const SbName &n1, const SbName &n2) int operator !=(const SbName &n, const char *s) β€” Inequality operator for SbName/char* and SbName/SbName comparison. and are y'all NOT the same?? πŸ’€

🌈 SEE ALSO 🌈

SbString


bestie reminder: SbNames are for strings that show up frequently β€” node names, keywords, the usual suspects. Don't be out here using it for random general-purpose strings, it's not built for that 🫢

k bye, this has been SbName(3IV) from the Inventor toolkit docs, 3IV edition, no date on the page so we're just gonna say "timeless" πŸ’…βœ¨ stay interned, stay iconic, periodt πŸŽ€πŸ¦‹