JsonValue Class Reference

#include <ArmarXGui/libraries/StructuralJson/JsonValue.h>

+ Inheritance diagram for JsonValue:

Public Types

enum  Type { eString, eNumber, eBool, eNull }
 

Public Member Functions

bool asBool () const
 
float asFloat () const
 
int asInt () const
 
std::string asString () const
 
JsonDataPtr clone () override
 
Type getType ()
 
 JsonValue (const std::string &value)
 
 JsonValue (double value)
 
 JsonValue (float value)
 
 JsonValue (int value)
 
 JsonValue (long value)
 
std::string rawValue ()
 
JsonValuePtr toSharedPtr () const
 
void writeJson (const JsonWriterPtr &writer) override
 
- Public Member Functions inherited from JsonData
LexerInfo getLexerEndOffset ()
 
LexerInfo getLexerStartOffset ()
 
 JsonData ()
 
void setLexerEndOffset (LexerInfo lexerEndOffset)
 
void setLexerStartOffset (LexerInfo lexerStartOffset)
 
std::string toJsonString (int indenting=0, const std::string indentChars=" ", bool jsStyleKeys=false)
 
virtual ~JsonData ()=default
 

Static Public Member Functions

static bool CheckBool (const std::string &value)
 
static bool CheckInt (const std::string &value)
 
static bool CheckNull (const std::string &value)
 
static bool CheckNumber (const std::string &value)
 
static bool CheckValue (Type type, const std::string &value)
 
static JsonValuePtr Create (const std::string &value)
 
static JsonValuePtr Create (double value)
 
static JsonValuePtr Create (float value)
 
static JsonValuePtr Create (int value)
 
static JsonValuePtr Create (long value)
 
static JsonValuePtr CreateRaw (Type type, const std::string &value)
 
static JsonValuePtr False ()
 
static JsonValuePtr Null ()
 
static std::string ToString (double value)
 
static std::string ToString (float value)
 
static std::string ToString (int value)
 
static std::string ToString (long value)
 
static JsonValuePtr True ()
 

Friends

class StructuralJsonParser
 

Detailed Description

Definition at line 34 of file JsonValue.h.

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
eString 
eNumber 
eBool 
eNull 

Definition at line 38 of file JsonValue.h.

Constructor & Destructor Documentation

◆ JsonValue() [1/5]

JsonValue ( const std::string &  value)

Definition at line 29 of file JsonValue.cpp.

+ Here is the caller graph for this function:

◆ JsonValue() [2/5]

JsonValue ( int  value)

Definition at line 33 of file JsonValue.cpp.

◆ JsonValue() [3/5]

JsonValue ( long  value)

Definition at line 37 of file JsonValue.cpp.

◆ JsonValue() [4/5]

JsonValue ( float  value)

Definition at line 41 of file JsonValue.cpp.

◆ JsonValue() [5/5]

JsonValue ( double  value)

Definition at line 45 of file JsonValue.cpp.

Member Function Documentation

◆ asBool()

bool asBool ( ) const

Definition at line 229 of file JsonValue.cpp.

◆ asFloat()

float asFloat ( ) const

Definition at line 211 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ asInt()

int asInt ( ) const

Definition at line 220 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ asString()

std::string asString ( ) const

Definition at line 202 of file JsonValue.cpp.

◆ CheckBool()

bool CheckBool ( const std::string &  value)
static

Definition at line 138 of file JsonValue.cpp.

+ Here is the caller graph for this function:

◆ CheckInt()

bool CheckInt ( const std::string &  value)
static

Definition at line 131 of file JsonValue.cpp.

+ Here is the caller graph for this function:

◆ CheckNull()

bool CheckNull ( const std::string &  value)
static

Definition at line 143 of file JsonValue.cpp.

+ Here is the caller graph for this function:

◆ CheckNumber()

bool CheckNumber ( const std::string &  value)
static

Definition at line 124 of file JsonValue.cpp.

+ Here is the caller graph for this function:

◆ CheckValue()

bool CheckValue ( JsonValue::Type  type,
const std::string &  value 
)
static

Definition at line 105 of file JsonValue.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clone()

JsonDataPtr clone ( )
overridevirtual

Implements JsonData.

Definition at line 243 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ Create() [1/5]

JsonValuePtr Create ( const std::string &  value)
static

Definition at line 65 of file JsonValue.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Create() [2/5]

JsonValuePtr Create ( double  value)
static

Definition at line 89 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ Create() [3/5]

JsonValuePtr Create ( float  value)
static

Definition at line 83 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ Create() [4/5]

JsonValuePtr Create ( int  value)
static

Definition at line 71 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ Create() [5/5]

JsonValuePtr Create ( long  value)
static

Definition at line 77 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ CreateRaw()

JsonValuePtr CreateRaw ( JsonValue::Type  type,
const std::string &  value 
)
static

Definition at line 95 of file JsonValue.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ False()

JsonValuePtr False ( )
static

Definition at line 59 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ getType()

JsonValue::Type getType ( )

Definition at line 249 of file JsonValue.cpp.

◆ Null()

JsonValuePtr Null ( )
static

Definition at line 49 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ rawValue()

std::string rawValue ( )

Definition at line 238 of file JsonValue.cpp.

◆ toSharedPtr()

JsonValuePtr toSharedPtr ( ) const

Definition at line 164 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ ToString() [1/4]

std::string ToString ( double  value)
static

Definition at line 194 of file JsonValue.cpp.

◆ ToString() [2/4]

std::string ToString ( float  value)
static

Definition at line 186 of file JsonValue.cpp.

◆ ToString() [3/4]

std::string ToString ( int  value)
static

Definition at line 170 of file JsonValue.cpp.

◆ ToString() [4/4]

std::string ToString ( long  value)
static

Definition at line 178 of file JsonValue.cpp.

◆ True()

JsonValuePtr True ( )
static

Definition at line 54 of file JsonValue.cpp.

+ Here is the call graph for this function:

◆ writeJson()

void writeJson ( const JsonWriterPtr writer)
overridevirtual

Implements JsonData.

Definition at line 148 of file JsonValue.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ StructuralJsonParser

friend class StructuralJsonParser
friend

Definition at line 36 of file JsonValue.h.


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