Public Member Functions | Private Attributes | List of all members
Json::StaticString Class Reference

Lightweight wrapper to tag static string. More...

#include <json.h>

Public Member Functions

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

Private Attributes

const char * c_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 501 of file json.h.

Constructor & Destructor Documentation

◆ StaticString()

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

Definition at line 503 of file json.h.

Member Function Documentation

◆ c_str()

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

Definition at line 507 of file json.h.

◆ operator const char *()

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

Definition at line 505 of file json.h.

Member Data Documentation

◆ c_str_

const char* Json::StaticString::c_str_
private

Definition at line 510 of file json.h.


The documentation for this class was generated from the following file:
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: json.h:503
Json::Value
Represents a JSON value.
Definition: json.h:547


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:10