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
 

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
eString 
eNumber 
eBool 
eNull 

Constructor & Destructor Documentation

◆ JsonValue() [1/5]

JsonValue ( const std::string & value)

◆ JsonValue() [2/5]

JsonValue ( int value)

◆ JsonValue() [3/5]

JsonValue ( long value)

◆ JsonValue() [4/5]

JsonValue ( float value)

◆ JsonValue() [5/5]

JsonValue ( double value)

Member Function Documentation

◆ asBool()

bool asBool ( ) const

◆ asFloat()

float asFloat ( ) const

◆ asInt()

int asInt ( ) const

◆ asString()

std::string asString ( ) const

◆ CheckBool()

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

◆ CheckInt()

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

◆ CheckNull()

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

◆ CheckNumber()

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

◆ CheckValue()

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

◆ clone()

JsonDataPtr clone ( )
overridevirtual

Implements JsonData.

◆ Create() [1/5]

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

◆ Create() [2/5]

JsonValuePtr Create ( double value)
static

◆ Create() [3/5]

JsonValuePtr Create ( float value)
static

◆ Create() [4/5]

JsonValuePtr Create ( int value)
static

◆ Create() [5/5]

JsonValuePtr Create ( long value)
static

◆ CreateRaw()

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

◆ False()

JsonValuePtr False ( )
static

◆ getType()

JsonValue::Type getType ( )

◆ Null()

JsonValuePtr Null ( )
static

◆ rawValue()

std::string rawValue ( )

◆ toSharedPtr()

JsonValuePtr toSharedPtr ( ) const

◆ ToString() [1/4]

std::string ToString ( double value)
static

◆ ToString() [2/4]

std::string ToString ( float value)
static

◆ ToString() [3/4]

std::string ToString ( int value)
static

◆ ToString() [4/4]

std::string ToString ( long value)
static

◆ True()

JsonValuePtr True ( )
static

◆ writeJson()

void writeJson ( const JsonWriterPtr & writer)
overridevirtual

Implements JsonData.

Friends And Related Symbol Documentation

◆ StructuralJsonParser

friend class StructuralJsonParser
friend

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