osgEarth 2.1.1
|
Lightweight wrapper to tag static string. More...
Public Member Functions | |
StaticString (const char *czstring) | |
operator const char * () const | |
const char * | c_str () const |
Private Attributes | |
const char * | str_ |
Lightweight wrapper to tag static string.
Value constructor and objectValue member assignement takes advantage of the StaticString and avoid the cost of string duplication when storing the string or the member name.
Example of usage:
Json::Value aValue( StaticString("some text") ); Json::Value object; static const StaticString code("code"); object[code] = 1234;
osgEarth::Json::StaticString::StaticString | ( | const char * | czstring | ) | [inline, explicit] |
const char* osgEarth::Json::StaticString::c_str | ( | ) | const [inline] |
osgEarth::Json::StaticString::operator const char * | ( | ) | const [inline] |
const char* osgEarth::Json::StaticString::str_ [private] |