test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Json::StaticString Class Reference

Lightweight wrapper to tag static string. More...

#include <value.h>

Public Member Functions

const char * c_str () const
 
 operator const char * () const
 
 StaticString (const char *czstring)
 

Private Attributes

const char * str_
 

Detailed Description

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;
*

Definition at line 62 of file value.h.

Constructor & Destructor Documentation

Json::StaticString::StaticString ( const char *  czstring)
inlineexplicit

Definition at line 65 of file value.h.

66  : str_( czstring )
67  {
68  }
const char * str_
Definition: value.h:81

Member Function Documentation

const char* Json::StaticString::c_str ( ) const
inline

Definition at line 75 of file value.h.

76  {
77  return str_;
78  }
const char * str_
Definition: value.h:81
Json::StaticString::operator const char * ( ) const
inline

Definition at line 70 of file value.h.

71  {
72  return str_;
73  }
const char * str_
Definition: value.h:81

Member Data Documentation

const char* Json::StaticString::str_
private

Definition at line 81 of file value.h.