CMS 3D CMS Logo

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") );
static const StaticString code("code");
object[code] = 1234;

Definition at line 60 of file value.h.

Constructor & Destructor Documentation

◆ StaticString()

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

Definition at line 62 of file value.h.

62 : str_(czstring) {}

Member Function Documentation

◆ c_str()

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

Definition at line 66 of file value.h.

66 { return str_; }

◆ operator const char *()

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

Definition at line 64 of file value.h.

64 { return str_; }

Member Data Documentation

◆ str_

const char* Json::StaticString::str_
private

Definition at line 69 of file value.h.

resolutioncreator_cfi.object
object
Definition: resolutioncreator_cfi.py:4
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: value.h:62
Json::StaticString::str_
const char * str_
Definition: value.h:69
Json::Value
Represents a JSON value.
Definition: value.h:99