TrueReality  v0.1.1912
trUtil::JSON::Base Class Referenceabstract

The Base class for all the JSON classes. More...

#include <Base.h>

Inheritance diagram for trUtil::JSON::Base:
Collaboration diagram for trUtil::JSON::Base:

Public Member Functions

virtual void Clear ()=0
 Clears the internal JSON Root node. More...
 
virtual ValueGetJSONRoot ()=0
 Returns a reference to the internal JSON Root node. More...
 
virtual void PrintJSONRoot ()=0
 Prints out to the screen the whole JSON Root content. More...
 
virtual bool KeyPresent (const std::string &key) const =0
 Checks if the JSON Root Node has an entry with a given key present. More...
 
virtual bool IsNull (const std::string &key) const =0
 Checks if the value stored at the specific key is a NULL. More...
 
virtual void SetNull (const std::string &key)=0
 Sets the value stored at the specific key to NULL. More...
 
virtual bool IsBool (const std::string &key) const =0
 Checks if the value stored at the specific key is a Boolean. More...
 
virtual bool GetBool (const std::string &key) const =0
 Returns the Boolean value stored at the given key. More...
 
virtual void SetBool (const std::string &key, const bool &value)=0
 Sets the Boolean value to be stored at the given key. More...
 
virtual bool IsTrue (const std::string &key) const =0
 Checks if the value stored at the specific key is True. More...
 
virtual bool IsFalse (const std::string &key) const =0
 Checks if the value stored at the specific key is False. More...
 
virtual bool IsNumber (const std::string &key) const =0
 Checks if the value stored at the specific key is a Number. More...
 
virtual bool IsInt (const std::string &key) const =0
 Checks if the value stored at the specific key is an Integer. More...
 
virtual int GetInt (const std::string &key) const =0
 Returns the Integer value stored at the given key. More...
 
virtual void SetInt (const std::string &key, const int &value)=0
 Sets the Integer value to be stored at the given key. More...
 
virtual bool IsDouble (const std::string &key) const =0
 Checks if the value stored at the specific key is a Double. More...
 
virtual double GetDouble (const std::string &key) const =0
 Returns the Double value stored at the given key. More...
 
virtual void SetDouble (const std::string &key, const double &value)=0
 Sets the Double value to be stored at the given key. More...
 
virtual bool IsUInt (const std::string &key) const =0
 Checks if the value stored at the specific key is an Unsigned Integer. More...
 
virtual unsigned int GetUInt (const std::string &key) const =0
 Returns the Unsigned Integer value stored at the given key. More...
 
virtual void SetUInt (const std::string &key, const unsigned int &value)=0
 Sets the Unsigned Integer value to be stored at the given key. More...
 
virtual bool IsInt64 (const std::string &key) const =0
 Checks if the value stored at the specific key is a 64bit Integer. More...
 
virtual Int64 GetInt64 (const std::string &key) const =0
 Returns the 64bit Integer value stored at the given key. More...
 
virtual void SetInt64 (const std::string &key, const Int64 &value)=0
 Sets the 64bit Integer value to be stored at the given key. More...
 
virtual bool IsUInt64 (const std::string &key) const =0
 Checks if the value stored at the specific key is a 64bit Integer. More...
 
virtual UInt64 GetUInt64 (const std::string &key) const =0
 Returns the 64bit Integer value stored at the given key. More...
 
virtual void SetUInt64 (const std::string &key, const UInt64 &value)=0
 Sets the 64bit Integer value to be stored at the given key. More...
 
virtual bool IsFloat (const std::string &key) const =0
 Checks if the value stored at the specific key is a float. More...
 
virtual float GetFloat (const std::string &key) const =0
 Returns the float value stored at the given key. More...
 
virtual void SetFloat (const std::string &key, const float &value)=0
 Sets the float value to be stored at the given key. More...
 
virtual bool IsString (const std::string &key) const =0
 Checks if the value stored at the specific key is a String. More...
 
virtual const std::string GetString (const std::string &key) const =0
 Returns the String value stored at the given key. More...
 
virtual void SetString (const std::string &key, const std::string &value)=0
 Sets the String to be stored at the given key. More...
 
virtual bool IsArray (const std::string &key) const =0
 Checks if the value stored at the specific key is an Array. More...
 
virtual Array GetArray (const std::string &key) const =0
 Returns the Array value stored at the given key. More...
 
virtual void SetArray (const std::string &key, Array &Array)=0
 Sets the Array to be stored at the given key. More...
 
virtual bool IsObject (const std::string &key) const =0
 Checks if the value stored at the specific key is an Object. More...
 
virtual Object GetObject (const std::string &key) const =0
 Returns the Object value stored at the given key. More...
 
virtual void SetObject (const std::string &key, Object &Object)=0
 Sets the Array to be stored at the given key. More...
 

Detailed Description

The Base class for all the JSON classes.

Author
Maxim Serebrennik

Definition at line 61 of file trUtil/JSON/Base.h.

Member Function Documentation

◆ Clear()

void trUtil::JSON::Base::Clear ( )
pure virtual

Clears the internal JSON Root node.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetArray()

Array trUtil::JSON::Base::GetArray ( const std::string &  key) const
pure virtual

Returns the Array value stored at the given key.

Parameters
keyThe key.
Returns
The array.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetBool()

bool trUtil::JSON::Base::GetBool ( const std::string &  key) const
pure virtual

Returns the Boolean value stored at the given key.

Parameters
keyThe key.
Returns
True if it succeeds, false if it fails.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetDouble()

double trUtil::JSON::Base::GetDouble ( const std::string &  key) const
pure virtual

Returns the Double value stored at the given key.

Parameters
keyThe key.
Returns
The double.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetFloat()

float trUtil::JSON::Base::GetFloat ( const std::string &  key) const
pure virtual

Returns the float value stored at the given key.

Parameters
keyThe key.
Returns
The float.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetInt()

int trUtil::JSON::Base::GetInt ( const std::string &  key) const
pure virtual

Returns the Integer value stored at the given key.

Parameters
keyThe key.
Returns
The int.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetInt64()

Int64 trUtil::JSON::Base::GetInt64 ( const std::string &  key) const
pure virtual

Returns the 64bit Integer value stored at the given key.

Parameters
keyThe key.
Returns
The int 64.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetJSONRoot()

Value & trUtil::JSON::Base::GetJSONRoot ( )
pure virtual

Returns a reference to the internal JSON Root node.

Returns
The JSON root.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetObject()

Object trUtil::JSON::Base::GetObject ( const std::string &  key) const
pure virtual

Returns the Object value stored at the given key.

Parameters
keyThe key.
Returns
The object.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetString()

const std::string trUtil::JSON::Base::GetString ( const std::string &  key) const
pure virtual

Returns the String value stored at the given key.

Parameters
keyThe key.
Returns
The string.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetUInt()

unsigned int trUtil::JSON::Base::GetUInt ( const std::string &  key) const
pure virtual

Returns the Unsigned Integer value stored at the given key.

Parameters
keyThe key.
Returns
The u int.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ GetUInt64()

UInt64 trUtil::JSON::Base::GetUInt64 ( const std::string &  key) const
pure virtual

Returns the 64bit Integer value stored at the given key.

Parameters
keyThe key.
Returns
The u int 64.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsArray()

bool trUtil::JSON::Base::IsArray ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is an Array.

Parameters
keyThe key.
Returns
True if array, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsBool()

bool trUtil::JSON::Base::IsBool ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a Boolean.

Parameters
keyThe key.
Returns
True if bool, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsDouble()

bool trUtil::JSON::Base::IsDouble ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a Double.

Parameters
keyThe key.
Returns
True if double, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsFalse()

bool trUtil::JSON::Base::IsFalse ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is False.

Parameters
keyThe key.
Returns
True if false, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsFloat()

bool trUtil::JSON::Base::IsFloat ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a float.

Parameters
keyThe key.
Returns
True if float, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsInt()

bool trUtil::JSON::Base::IsInt ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is an Integer.

Parameters
keyThe key.
Returns
True if int, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsInt64()

bool trUtil::JSON::Base::IsInt64 ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a 64bit Integer.

Parameters
keyThe key.
Returns
True if int 64, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsNull()

bool trUtil::JSON::Base::IsNull ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a NULL.

Parameters
keyThe key.
Returns
True if null, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsNumber()

bool trUtil::JSON::Base::IsNumber ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a Number.

Parameters
keyThe key.
Returns
True if number, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsObject()

bool trUtil::JSON::Base::IsObject ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is an Object.

Parameters
keyThe key.
Returns
True if object, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsString()

bool trUtil::JSON::Base::IsString ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a String.

Parameters
keyThe key.
Returns
True if string, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsTrue()

bool trUtil::JSON::Base::IsTrue ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is True.

Parameters
keyThe key.
Returns
True if true, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsUInt()

bool trUtil::JSON::Base::IsUInt ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is an Unsigned Integer.

Parameters
keyThe key.
Returns
True if u int, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ IsUInt64()

bool trUtil::JSON::Base::IsUInt64 ( const std::string &  key) const
pure virtual

Checks if the value stored at the specific key is a 64bit Integer.

Parameters
keyThe key.
Returns
True if u int 64, false if not.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ KeyPresent()

bool trUtil::JSON::Base::KeyPresent ( const std::string &  key) const
pure virtual

Checks if the JSON Root Node has an entry with a given key present.

Parameters
keyThe key.
Returns
True if it succeeds, false if it fails.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ PrintJSONRoot()

void trUtil::JSON::Base::PrintJSONRoot ( )
pure virtual

Prints out to the screen the whole JSON Root content.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetArray()

void trUtil::JSON::Base::SetArray ( const std::string &  key,
Array Array 
)
pure virtual

Sets the Array to be stored at the given key.

Parameters
keyThe key.
[in,out]ArrayThe array.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetBool()

void trUtil::JSON::Base::SetBool ( const std::string &  key,
const bool &  value 
)
pure virtual

Sets the Boolean value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetDouble()

void trUtil::JSON::Base::SetDouble ( const std::string &  key,
const double &  value 
)
pure virtual

Sets the Double value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetFloat()

void trUtil::JSON::Base::SetFloat ( const std::string &  key,
const float &  value 
)
pure virtual

Sets the float value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetInt()

void trUtil::JSON::Base::SetInt ( const std::string &  key,
const int &  value 
)
pure virtual

Sets the Integer value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetInt64()

void trUtil::JSON::Base::SetInt64 ( const std::string &  key,
const Int64 value 
)
pure virtual

Sets the 64bit Integer value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetNull()

void trUtil::JSON::Base::SetNull ( const std::string &  key)
pure virtual

Sets the value stored at the specific key to NULL.

Parameters
keyThe key.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetObject()

void trUtil::JSON::Base::SetObject ( const std::string &  key,
Object Object 
)
pure virtual

Sets the Array to be stored at the given key.

Parameters
keyThe key.
[in,out]ObjectThe object.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetString()

void trUtil::JSON::Base::SetString ( const std::string &  key,
const std::string &  value 
)
pure virtual

Sets the String to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetUInt()

void trUtil::JSON::Base::SetUInt ( const std::string &  key,
const unsigned int &  value 
)
pure virtual

Sets the Unsigned Integer value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.

◆ SetUInt64()

void trUtil::JSON::Base::SetUInt64 ( const std::string &  key,
const UInt64 value 
)
pure virtual

Sets the 64bit Integer value to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implemented in trUtil::JSON::File, and trUtil::JSON::Object.


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