SoSFString Class Reference
[Fields]

Field containing a string. More...

#include <Inventor/fields/SoSFString.h>

Inheritance diagram for SoSFString:
SoSField SoField SoTypedObject SoSFFilePathString

List of all members.

Public Member Functions

virtual SoType getTypeId () const
const SoSFStringoperator= (const SoSFString &f)
 SoSFString ()
virtual ~SoSFString ()
const SbStringgetValue () const
void setValue (const SbString &newValue)
const SbStringoperator= (const SbString &newValue)
int operator== (const SoSFString &f) const
int operator!= (const SoSFString &f) const
virtual size_t getValueSize () const
SoNONUNICODE void setValue (const char *string)
void setValue (const SO_WCHAR_T *string)

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

Field containing a string.

A field containing an string (sequence of characters).

SoSFStrings are written to file as a sequence of ASCII characters in double quotes (optional if the string doesn't contain any whitespace). Any characters (including newlines) may appear within the quotes. To include a double quote character within the string, precede it with a backslash. For example:

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

are all valid strings.

Unicode Support

Unicode is an industry standard for encoding text of all forms and languages for use by computers. Open Inventor supports Unicode encoding, which allows internationalization of text in a standard cross-platform fashion.

String as well as classes like SoSFString support the wchar_t type which is used for Unicode strings, and all of the text nodes are able to render Unicode strings.

SbString includes methods for construction of Unicode strings, string operators (=, += ,== ,!=, <, >, <=, >=), as well as a query method (SbString::isUnicode()).

To be able to display a particular Unicode character, the selected font must have a character for that Unicode value. Many fonts do not contain a complete set of Unicode characters. However, the shareware Unicode font file "Code2000" seems to work well.

Note that Unicode characters are not directly supported in Open Inventor files. Unicode strings are written as if the bytes in the string were a string of 8-bit characters. The string will be prefixed by "MCS_U_".

SEE ALSO

SoField, SoSField, SoMFString


Constructor & Destructor Documentation

SoSFString::SoSFString (  ) 

Default constructor.

virtual SoSFString::~SoSFString (  )  [virtual]

Destructor.


Member Function Documentation

static SoType SoSFString::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoSField.

Reimplemented in SoSFFilePathString.

virtual SoType SoSFString::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Implements SoTypedObject.

Reimplemented in SoSFFilePathString.

const SbString& SoSFString::getValue (  )  const [inline]

Returns this field's value.

virtual size_t SoSFString::getValueSize (  )  const [inline, virtual]

Get size of the value.

Reimplemented from SoField.

int SoSFString::operator!= ( const SoSFString f  )  const [inline]

Returns FALSE if otherField is of the same type and has the same value as this field.

Reimplemented from SoField.

const SbString& SoSFString::operator= ( const SbString newValue  )  [inline]

Sets this field to newValue.

Reimplemented in SoSFFilePathString.

const SoSFString& SoSFString::operator= ( const SoSFString f  ) 

Copy from another field of same type.

Reimplemented in SoSFFilePathString.

int SoSFString::operator== ( const SoSFString f  )  const

Returns TRUE if otherField is of the same type and has the same value as this field.

Reimplemented from SoField.

void SoSFString::setValue ( const SO_WCHAR_T *  string  ) 

Convenience method to set the field's value given a character array.

SoNONUNICODE void SoSFString::setValue ( const char *  string  ) 

Convenience method to set the field's value given a character array.

Non Unicode List:
This function should not be used in a Unicode application.
void SoSFString::setValue ( const SbString newValue  ) 

Sets this field to newValue.


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

Open Inventor Toolkit reference manual, generated on 28 Oct 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/