SbString(3)
okay bestie, sit DOWN because today we're doing SbString(3) from the Library Functions Manual, and it's honestly a whole vibe. It's giving "string class that actually has your back" π
β¨ NAME β¨
SbString β the SbString class is a string class with convenience functions for string operations. π
πΈ SYNOPSIS πΈ
#include <Inventor/SbString.h>
π Public Member Functions π
SbString (void)
SbString (const char *s)
SbString (const char *s, int start, int end)
SbString (const SbString &s)
SbString (const int digits)
~SbString ()
uint32_t hash (void) const
int getLength (void) const
void makeEmpty (SbBool freeold=1)
const char * getString (void) const
SbString getSubString (int startidx, int endidx=-1) const
void deleteSubString (int startidx, int endidx=-1)
void addIntString (const int value)
char operator[] (int index) const
SbString & operator= (const char *s)
SbString & operator= (const SbString &s)
SbString & operator+= (const char *s)
SbString & operator+= (const SbString &s)
SbString & operator+= (const char c)
int operator! (void) const
int compareSubString (const char *text, int offset=0) const
SbString & sprintf (const char *formatstr,...)
SbString & vsprintf (const char *formatstr, va_list args)
void apply (char(*func)(char input))
int find (const SbString &s) const
SbBool findAll (const SbString &s, SbIntList &found) const
β Static Public Member Functions β
static uint32_t hash (const char *s)
π¦ Friends π¦
int operator== (const SbString &sbstr, const char *s)
int operator== (const char *s, const SbString &sbstr)
int operator== (const SbString &str1, const SbString &str2)
int operator!= (const SbString &sbstr, const char *s)
int operator!= (const char *s, const SbString &sbstr)
int operator!= (const SbString &str1, const SbString &str2)
π Detailed Description π
The SbString class is a string class with convenience functions for string operations. Periodt. π
So like, this is the class for storing and working with character strings. It automatically handles all the "bookkeeping" tasks you'd normally have to do yourself when you're messing with character strings β memory allocation and deallocation, etc. No cap, it just does it. π«Ά
This class should also be well suited for use by the application programmer throughout the application using the Coin library. So yeah, use it everywhere, she's built for it. β¨
See also
SbNameπ
π Constructor & Destructor Documentation π
π SbString::SbString (void ) [inline]
This is the default constructor, bestie. It initializes the string to be empty. Starting from zero, main character energy. π
Referenced by find(), findAll(), getSubString(), operator!=, operator!=, operator!=, operator+=(), operator+=(), operator+=(), operator=(), operator=(), operator==, operator==, operator==, SbString(), sprintf(), and vsprintf().
not me listing every single one of those references β but yeah, she gets around, everyone wants a piece of that default constructor π«Ά
π¦ SbString::SbString (const char * str) [inline]
This constructor assigns from the given string. Copy-paste but make it official. β¨
πΈ SbString::SbString (const char * str, int start, int end) [inline]
This constructor constructs a string from the given substring from start to end indices inclusive. And if end is -1? Then the substring goes from start all the way to the end of the string. Lowkey the most useful thing ever. π
π SbString::SbString (const SbString & str) [inline]
This is the copy constructor. Iconic behaviour, honestly. π
References SbString().
β SbString::SbString (const int digits) [inline]
Construct an SbString instance containing the digits of the integer argument. Int goes in, string comes out, you literally cannot explain that. π₯
π§ SbString::~SbString () [inline]
The destructor. She deallocates any internal resources used during the lifetime of the SbString instance. Clean up after yourself, queen. π
and that's part one bestie β there's more coming, don't go anywhere π
β¨ Member Function Documentation β¨
okay bestie, this is the part where we meet the actual methods of SbString β the string class that's lowkey carrying Coin on its back. let's get into it π
uint32_t SbString::hash β the vibe check for your string
uint32_t SbString::hash (void ) const [inline]
okay so this method gives you a reasonable hash value for the current string. it's like a numeric vibe check, no cap.
See also: uint32_t SbString::hash(const char * s)
uint32_t SbString::hash β static edition, no object needed
uint32_t SbString::hash (const char * s) [inline], [static]
this static method returns a hash value for the given string. no object needed, she's independent.
int SbString::getLength β how many characters are we working with?
int SbString::getLength (void ) const [inline]
this method returns the length of the string. how many characters? she'll tell you.
Referenced by: SoInput::closeFile(), find(), findAll(), SoInput::findFile(), SoWWWInline::getFullURLName(), SoDB::getHeaderData(), SoText2::GLRender(), SoVRMLAnchor::handleEvent(), SoOutput::padHeader(), SoInput::popFile(), SoInput::read(), SoInteractionKit::readDefaultParts(), SbImage::readFile(), SoTextureCubeMap::readInstance(), SoDB::registerHeader(), SoInput::searchForFile(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), and SoBase::writeHeader().
not me counting eight SoOutput::write() entries... she's booked and busy fr fr π
void SbString::makeEmpty β clear it out, reset the vibe
void SbString::makeEmpty (SbBool freeold = 1) [inline]
this method clears the string, making it an empty string (""). if freeold is TRUE (which is the default), the memory used by the old string is freed. otherwise, memory will be kept and reused when the string is manipulated later.
Referenced by: SoInput::read().
const char * SbString::getString β the raw pointer reveal
const char * SbString::getString (void ) const [inline]
this method returns the pointer to the string (character array). raw pointer reveal, handle with care.
Referenced by: SoInput::checkISReference(), SoInput::closeFile(), SoSwitch::doAction(), SoHandleBoxDragger::dragStart(), SoTabPlaneDragger::dragStart(), SoTransformerDragger::dragStart(), SoInput::findFile(), SoType::fromName(), SoInput::getBasename(), SoFontStyle::getFontName(), SoGlyph::getGlyph(), SoInput::getPathname(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoAudioDevice::init(), SoInput::openFile(), SoInput::popFile(), SoReadError::post(), SbTime::print(), SoInput::pushFile(), SoField::read(), SoInput::read(), SoInteractionKit::readDefaultParts(), SoFieldData::readFieldDescriptions(), SbImage::readFile(), SoTextureCubeMap::readInstance(), SoFile::readNamedFile(), SoBase::readRoute(), SoDB::registerHeader(), SbName::SbName(), SoInput::searchForFile(), SoBaseKit::set(), SoBaseKit::set(), SoHandleBoxDragger::setAllPartsActive(), SoField::setDefault(), SoBase::setName(), SoCenterballDragger::setUpConnections(), SoTabBoxDragger::setUpConnections(), SoTransformBoxDragger::setUpConnections(), SoField::shouldWrite(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoBase::writeHeader(), and SoOffscreenRenderer::writeToFile().
SbString SbString::getSubString β grab a slice, bestie
SbString SbString::getSubString (int startidx, int endidx = -1) const [inline]
this method returns a new string which contains a substring defined by the given indices startidx and endidx (inclusive).
if endidx is -1, the substring from startidx to the end of the string is used.
this will return a string which is (endidx - startidx + 1) characters long, i.e. if this string is "foo/bar" and we call by SbString::getSubString(0, 3), the returned string will be "foo/".
References: SbString().
Referenced by: SoType::fromName(), SoInput::getBasename(), SoDB::getHeaderData(), SoInput::getPathname(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoInput::searchForFile(), and SoBase::writeHeader().
void SbString::deleteSubString β yeet that slice out
void SbString::deleteSubString (int startidx, int endidx = -1) [inline]
this method deletes the substring defined by startidx and endidx (inclusive). if endidx is -1, the substring from startidx to the end of the string is deleted.
void SbString::addIntString β number to string, no cap
void SbString::addIntString (const int value) [inline]
constructs a string from the given integer (e.g. intToString(42) creates the string "42"), and adds this to the contents of the string.
Referenced by: SbTime::format(), and SoBaseKit::getPartString().
char SbString::operator[] β index into the character, periodt
char SbString::operator[] (int index) const [inline]
returns character at position index in the string.
See also: getSubString()
SbString & SbString::operator= β assignment, but make it const char*
SbString & SbString::operator= (const char * str) [inline]
this is the assignment operator.
References: SbString().
SbString & SbString::operator= β assignment, SbString edition
SbString & SbString::operator= (const SbString & str) [inline]
assign from the given string.
References: SbString().
SbString & SbString::operator+= β append the const char*
SbString & SbString::operator+= (const char * str) [inline]
concatenate the given string to the end of the current one.
References: SbString().
SbString & SbString::operator+= β append the SbString
SbString & SbString::operator+= (const SbString & str) [inline]
concatenate the given string to the end of the current one.
References: SbString().
SbString & SbString::operator+= β append a single char
SbString & SbString::operator+= (const char c) [inline]
concatenate the given character to the end of the current string.
Note: This member function is not compatible with OpenInventor.
References: SbString().
int SbString::operator! β the "is it empty?" check
int SbString::operator! (void ) const [inline]
this unary operator results in TRUE if the current string is empty ("") or FALSE otherwise.
int SbString::compareSubString β compare a slice, get the diff
int SbString::compareSubString (const char * text, int offset = 0) const [inline]
uses text as a substring to be compared to the string, starting at offset offset. return value is 0 upon success, and the failing character comparison difference upon failure.
Referenced by: SoType::fromName().
SbString & SbString::sprintf β printf but for SbString, she's versatile
SbString & SbString::sprintf (const char * formatstr, ...) [inline]
set SbString instance to the formatted string formatstr, replacing the current contents. the control characters within formatstr and the remaining arguments should follow the conventions of the printf() call.
note that this function is not part of the original Open Inventor API.
References: SbString().
Referenced by: SoHandleBoxDragger::dragStart(), SoTabPlaneDragger::dragStart(), SoTransformerDragger::dragStart(), SoInput::findFile(), SoType::fromName(), SoInput::getLocationString(), SoWWWAnchor::handleEvent(), SoField::read(), SoFieldData::readFieldDescriptions(), SoInput::searchForFile(), SoHandleBoxDragger::setAllPartsActive(), SoCenterballDragger::setUpConnections(), SoTabBoxDragger::setUpConnections(), SoTransformBoxDragger::setUpConnections(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), SoOutput::write(), and SoBase::writeHeader().
SbString & SbString::vsprintf β va_list version, very fancy
SbString & SbString::vsprintf (const char * formatstr, va_list args) [inline]
set SbString instance to the formatted string formatstr, replacing the current contents. the control characters within formatstr and the arguments of the args argument list should follow the conventions of the printf() call.
note that this function is not part of the original Open Inventor API.
References: SbString().
Referenced by: SoReadError::post().
int SbString::find β where's that substring at?
int SbString::find (const SbString & strarg) const
if s is found, the method returns the first index where s starts. otherwise it returns -1.
Note: SbString::find() is a Coin specific extension to the original Open Inventor API.
See also: SbString::findAll()
Since: Coin 2.0
References: getLength(), and SbString().
SbBool SbString::findAll β find every single one, she's thorough
SbBool SbString::findAll (const SbString & strarg, SbIntList & found) const
all occurences of str is represented in found as indices to the characters where str starts. if 1 or more is found, TRUE is returned, else FALSE is returned.
Note: SbString::findAll() is an extension to the original Open Inventor API.
See also: SbString::find()
Since: Coin 2.0
References: SbIntList::append(), SbPList::getLength(), getLength(), SbString(), and SbPList::truncate().
π€ Friends And Related Symbol Documentation π€
okay so these are the friend operators β they're not members, but they're part of the squad π
int operator== β SbString vs const char*
int operator== (const SbString & str, const char * s) [friend]
equality operator. check if the strings have the same contents.
References: operator==, and SbString().
Referenced by: operator==, operator==, and operator==.
int operator== β const char* vs SbString
int operator== (const char * s, const SbString & str) [friend]
equality operator. check if the strings have the same contents.
References: operator==, and SbString().
int operator== β SbString vs SbString
int operator== (const SbString & str1, const SbString & str2) [friend]
equality operator. check if the strings have the same contents.
References: operator==, and SbString().
int operator!= β SbString vs const char*
int operator!= (const SbString & str, const char * s) [friend]
inequality operator.
References: operator!=, and SbString().
Referenced by: operator!=, operator!=, and operator!=.
int operator!= β const char* vs SbString
int operator!= (const char * s, const SbString & str) [friend]
inequality operator.
References: operator!=, and SbString().
int operator!= β SbString vs SbString
int operator!= (const SbString & str1, const SbString & str2) [friend]
inequality operator.
References: operator!=, and SbString().
π Author π
Generated automatically by Doxygen for Coin from the source code.
that's the whole page, bestie. this was generated by Doxygen for Coin, version 2.5.0, and the manpage is SbString(3). no date on this one, just vibes and version numbers. stay slaying π
β¨π¦
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms