Medical Imaging Interaction Toolkit  2018.4.99-1bab67a2
Medical Imaging Interaction Toolkit
Json::StaticString Class Reference

Lightweight wrapper to tag static string. More...

#include <jsoncpp.h>

Public Member Functions

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

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 384 of file jsoncpp.h.

Constructor & Destructor Documentation

◆ StaticString()

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

Definition at line 387 of file jsoncpp.h.

Member Function Documentation

◆ c_str()

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

Definition at line 397 of file jsoncpp.h.

Referenced by Json::Value::Value().

◆ operator const char *()

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

Definition at line 392 of file jsoncpp.h.

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