SOSFSTRING(3iv)

✨ SoSFString ✨

okay bestie, buckle up, we're talking about SoSFString from the Inventor fam (manual page SoSFString(3IV), iykyk) β€” it's literally just a field holding a string πŸ’…


πŸ’– INHERITS FROM πŸ’–

SoField > SoSField > SoSFString

so yeah, it's a single-value field (that's the S in there, no cap), sitting pretty at the bottom of that whole inheritance chain 🫢


✨ SYNOPSIS ✨

#include <Inventor/fields/SoSFString.h>

Methods from class SoSFString:

                     setValue(const char *string)
 static SoType       getClassTypeId()
 virtual void        getTypeId() const
 const SbString &    getValue() const
 const SbString &    operator =(const SbString & newValue)
 void                setValue(const SbString & newValue)
 int                 operator ==(const SoSFString &f) const
 int                 operator !=(const SoSFString &f) const

Methods from class SoField:

 void                setIgnored(SbBool ignore)
 SbBool              isIgnored() const
 SbBool              isDefault() const
 virtual SbBool      isOfType(SoType type) const
 SbBool              set(const char *valueString)
 void                get(SbString &valueString)
 void                touch()
 SbBool              connectFrom(SoField *fromField)
 SbBool              connectFrom(SoEngineOutput *fromEngine)
 void                disconnect()
 SbBool              isConnected() const
 SbBool              isConnectedFromField() const
 SbBool              getConnectedField(SoField *&writingField) const
 SbBool              isConnectedFromEngine() const
 SbBool              getConnectedEngine(SoEngineOutput *&engineOutput)
                          const
 void                enableConnection(SbBool flag)
 SbBool              isConnectionEnabled() const
 int                 getForwardConnections(SoFieldList &list) const
 SoFieldContainer *  getContainer() const

🌸 DESCRIPTION 🌸

so basically, this is a field that holds an ASCII string β€” a lil sequence of characters, that's it, that's the whole vibe πŸŽ€

⚠️ important!! Inventor does not support non-ASCII strings. like, at all. keep it ASCII bestie, don't try it πŸ’€

when SoSFStrings get written out to a file, they show up as a sequence of ASCII characters wrapped in double quotes β€” and the quotes are optional if the string has no whitespace in it. any characters (yes, even newlines, we love a chaotic queen) can appear inside those quotes. and if you wanna sneak an actual double quote character into the string? just put a backslash in front of it. easy peasy πŸ“

for example:

Testing
"One, Two, Three"
"He said, \"Immel did it!\""

all of those? valid strings. iconic. no notes ✨


πŸ’… METHODS πŸ’…

  • setValue(const char *string) β€” convenience method to set the field's value when all you've got is a character array. short n sweet 🫢
  • static SoType getClassTypeId()
  • virtual void getTypeId() const

returns the type for this class, or for a particular object of this class πŸ‘‘

  • const SbString & getValue() const β€” hands you back this field's value. that's it, that's the method 🌈
  • const SbString & operator =(const SbString & newValue)
  • void setValue(const SbString & newValue)

sets this field to newValue πŸ’–

  • int operator ==(const SoSFString &f) const
  • int operator !=(const SoSFString &f) const

returns TRUE if f is of the same type and has the same value as this field πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

SbString, SoField, SoSField, SoMFString


and that's the whole page bestie!! this one came straight out of the SoSFString(3IV) manual page, SoSFString(3IV)() energy and all 🧚 go forth and string responsibly, mwah πŸ’œβœ¨