Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Attributes | List of all members
UniqueString Class Reference

Public Member Functions

 UniqueString (void)
 Empty constructor. The internal characters is initialized to an empty string.
 
 UniqueString (const UniqueString &string)
 Copy constructor.
 
 UniqueString (const char *string)
 Instantiate a OIIO::ustring from the given string and store its value.
 
 UniqueString (const CoreString &string)
 Instantiate a OIIO::ustring from the given string and store its value.
 
const char * c_str (void) const
 Get the string.
 
bool is_empty (void) const
 Returns true if the string is empty.
 
 operator CoreString (void) const
 Convert to a CoreString.
 
bool operator!= (const UniqueString &other) const
 Inequality operator.
 
bool operator== (const UniqueString &other) const
 Equality operator.
 

Static Public Attributes

static const UniqueString empty
 Empty string.
 

Detailed Description

This is a temporary class used to work with OIIO::ustring. The reason for this is that some of our 3rd parties use those ustring's, but they are designed in a way that makes them extremely costly to create in a multithreaded context. To fix this, we need to bake those string to avoid creating them at runtime. This class allows us to do just that, and is reinterpretable into a OIIO::ustring

So wherever we have to deal with OpenImageIO's ustrings, use this instead, and cast it when needed. For instance:

``` UniqueString string(CoreString("some_string")); some_function_using_oiio_ustrings(reinterpret_cast<const OIIO::ustring&>(string)); ```