SbString(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– SbString(3) πŸ’– β€” from the Library Functions Manual, and yes she's iconic

okay so bestie, buckle up, because today we're talking about SbString. It's a man page, it's a string class, it's giving main character energy. Let's get into it. πŸŽ€


✨ NAME ✨

SbString β€” the SbString class is a string class with convenience functions for string operations. no cap, that's literally it. πŸ¦‹


🌸 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=TRUE)
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
SbString lower () const
SbString upper () const

⭐ Static Public Member Functions

static uint32_t hash (const char *s)

πŸ’œ Detailed Description πŸ’œ

So, the SbString class is a string class with convenience functions for string operations. That's the official vibe. πŸ’…

This is the class used for storing and working with character strings. The way it just... automatically takes care of all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.?? Obsessed. She handles the admin so you don't have to. 🫢

This class should also be well suited for use by the application programmer throughout the application using the Coin library. Go off, application programmer. 🌈

See also: SbName


🧚 Constructor & Destructor Documentation 🧚

πŸŽ€ SbString::SbString (void ) [inline]

This is the default constructor. It initializes the string to be empty. A blank slate, a fresh start, an empty string. ✨

πŸŽ€ SbString::SbString (const char * str) [inline]

This constructor assigns from the given string. You give her a string, she becomes that string. slay. πŸ’–

πŸŽ€ 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, the substring from start until the end of the string is used. inclusive, bestie, we do NOT forget the last character. 😭

πŸŽ€ SbString::SbString (const SbString & str) [inline]

This is the copy constructor. Twin energy. πŸ‘―

πŸŽ€ SbString::SbString (const int digits) [inline]

Construct an SbString instance containing the digits of the integer argument. numbers β†’ text, a glow-up. πŸ”₯

πŸŽ€ SbString::~SbString () [inline]

The destructor. Deallocates any internal resources used during the lifetime of the SbString instance. she's leaving, and she's cleaning up after herself. queen behavior. πŸ‘‘


πŸ’… Member Function Documentation πŸ’…

πŸ’« uint32_t SbString::hash (void ) const [inline]

This method returns a reasonable hash value for the current string.

See also: uint32_t SbString::hash(const char * s)

πŸ’« uint32_t SbString::hash (const char * s) [inline], [static]

This static method returns a hash value for the given string. static, so you don't even need an instance β€” she's just out here hashing for the community. 🌸

πŸ’« int SbString::getLength (void ) const [inline]

This method returns the length of the string. how many characters, fr fr. πŸ“

πŸ’« void SbString::makeEmpty (SbBool freeold = TRUE) [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. So like β€” do you want her to throw out the old stuff, or hang onto it for later? your call, bestie. πŸ—‘οΈβ™»οΈ

πŸ’« const char * SbString::getString (void ) const [inline]

This method returns the pointer to the string (character array). raw pointer, right there, no filter. 🫣

πŸ’« 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/".

math is mathing. do the count yourself, it checks 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. bye bye little substring, we hardly knew ye. πŸ‘‹

πŸ’« 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. yes, 42, the answer, adding itself to your string. iconic. πŸ”’

πŸ’« char SbString::operator[] (int index) const [inline]

Returns character at position index in the string.

See also: getSubString()

πŸ’« SbString & SbString::operator= (const char * str) [inline]

This is the assignment operator. old string out, new string in. πŸ’«

πŸ’« SbString & SbString::operator= (const SbString & str) [inline]

Assign from the given string. same deal, but she's an SbString this time. πŸŽ€

πŸ’« SbString & SbString::operator+= (const char * str) [inline]

Concatenate the given string to the end of the current one. gluing strings together, that's the whole vibe. 🧴

πŸ’« SbString & SbString::operator+= (const SbString & str) [inline]

Concatenate the given string to the end of the current one. yeah, same thing, SbString flavor. πŸ’œ

πŸ’« SbString & SbString::operator+= (const char c) [inline]

Concatenate the given character to the end of the current string. one single character, tacked on the end. baby steps. 🐣

Note: This member function is not compatible with OpenInventor. ⚠️ so if you're living in OpenInventor-land, this one's not for you, bestie, tread carefully.

πŸ’« int SbString::operator! (void ) const [inline]

This unary operator results in TRUE if the current string is empty ("") or FALSE otherwise. yes, it's the "am I empty" check. she's honest. πŸ’€

πŸ’« 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. so 0 = we ate, anything else = tell me exactly how much it didn't match. πŸ‘€

πŸ’« 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. πŸ†•

πŸ’« 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. πŸ†• β€” yes, the va_list version, for when you've already got your arguments all packed up and ready to go. πŸ“¦

πŸ’« 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

πŸ’« 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. so she's not just finding one β€” she's finding ALL OF THEM and dropping the indices into your SbIntList. πŸ’–

Note: SbString::findAll() is an extension to the original Open Inventor API. πŸͺ™

See also: SbString::find()

Since: Coin 2.0

πŸ’« SbString SbString::lower () const

Converts all of the characters to lowercase using tolower(). soft, gentle, lowercase energy. πŸ“

Since: Coin 3.1

πŸ’« SbString SbString::upper () const

Converts all of the characters to uppercase using toupper(). AND NOW SHE'S YELLING. πŸ“£

Since: Coin 3.1


πŸ–‹οΈ Author πŸ–‹οΈ

Generated automatically by Doxygen for Coin from the source code. so technically no human wrote this, it's just Doxygen doing its little thing. πŸ€–βœ¨


and that's the page, bestie!! this one came from Coin, Version 3.1.3 β€” so if you see Version 3.1.3 floating around, that's where this whole thing lives. tysm for reading, go forth and manipulate some strings responsibly. πŸ’–πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from