TrueReality  v0.1.1912
trUtil::JSON::Object Class Reference

Forward declaration. More...

#include <Object.h>

Inheritance diagram for trUtil::JSON::Object:
Collaboration diagram for trUtil::JSON::Object:

Public Member Functions

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

Private Attributes

Value mRoot = Value(ValueType::ObjectValue)
 The root. More...
 

Additional Inherited Members

Detailed Description

Forward declaration.

A JSON object that is used to store.

Author
Maxim Serebrennik

Definition at line 46 of file Object.h.

Constructor & Destructor Documentation

◆ Object() [1/2]

trUtil::JSON::Object::Object ( )

ctor.

Definition at line 31 of file Object.cpp.

Referenced by Object().

Here is the caller graph for this function:

◆ Object() [2/2]

trUtil::JSON::Object::Object ( const Value Object)

ctor that takes a JSON Value of Object type as input.

Parameters
ObjectThe object.

Definition at line 35 of file Object.cpp.

References mRoot, and Object().

Here is the call graph for this function:

◆ ~Object()

trUtil::JSON::Object::~Object ( )

dtor.

Definition at line 41 of file Object.cpp.

Member Function Documentation

◆ Clear()

void trUtil::JSON::Object::Clear ( )
overridevirtual

Clears the internal JSON Root node.

Implements trUtil::JSON::Base.

Definition at line 69 of file Object.cpp.

References trUtil::JSON::Value::Clear(), and mRoot.

Here is the call graph for this function:

◆ GetArray()

Array trUtil::JSON::Object::GetArray ( const std::string &  key) const
overridevirtual

Returns the Array value stored at the given key.

Parameters
keyThe key.
Returns
The array.

Implements trUtil::JSON::Base.

Definition at line 295 of file Object.cpp.

References trUtil::JSON::Value::GetArray(), and mRoot.

Here is the call graph for this function:

◆ GetBool()

bool trUtil::JSON::Object::GetBool ( const std::string &  key) const
overridevirtual

Returns the Boolean value stored at the given key.

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

Implements trUtil::JSON::Base.

Definition at line 111 of file Object.cpp.

References trUtil::JSON::Value::GetBool(), and mRoot.

Referenced by IsFalse(), and IsTrue().

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

◆ GetComment()

std::string trUtil::JSON::Object::GetComment ( ) const

Returns the internal comment.

Returns
The comment.

Definition at line 63 of file Object.cpp.

References trUtil::JSON::Value::GetComment(), and mRoot.

Here is the call graph for this function:

◆ GetDouble()

double trUtil::JSON::Object::GetDouble ( const std::string &  key) const
overridevirtual

Returns the Double value stored at the given key.

Parameters
keyThe key.
Returns
The double.

Implements trUtil::JSON::Base.

Definition at line 187 of file Object.cpp.

References trUtil::JSON::Value::GetDouble(), and mRoot.

Here is the call graph for this function:

◆ GetFloat()

float trUtil::JSON::Object::GetFloat ( const std::string &  key) const
overridevirtual

Returns the float value stored at the given key.

Parameters
keyThe key.
Returns
The float.

Implements trUtil::JSON::Base.

Definition at line 259 of file Object.cpp.

References trUtil::JSON::Value::GetFloat(), and mRoot.

Here is the call graph for this function:

◆ GetInt()

int trUtil::JSON::Object::GetInt ( const std::string &  key) const
overridevirtual

Returns the Integer value stored at the given key.

Parameters
keyThe key.
Returns
The int.

Implements trUtil::JSON::Base.

Definition at line 169 of file Object.cpp.

References trUtil::JSON::Value::GetInt(), and mRoot.

Here is the call graph for this function:

◆ GetInt64()

Int64 trUtil::JSON::Object::GetInt64 ( const std::string &  key) const
overridevirtual

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

Parameters
keyThe key.
Returns
The int 64.

Implements trUtil::JSON::Base.

Definition at line 223 of file Object.cpp.

References trUtil::JSON::Value::GetInt64(), and mRoot.

Here is the call graph for this function:

◆ GetJSONRoot()

Value & trUtil::JSON::Object::GetJSONRoot ( )
overridevirtual

Returns a reference to the internal JSON Root node.

Returns
The JSON root.

Implements trUtil::JSON::Base.

Definition at line 75 of file Object.cpp.

References mRoot.

Referenced by trUtil::JSON::Array::AddObject(), and trUtil::JSON::Value::SetObject().

Here is the caller graph for this function:

◆ GetMemberNames()

const Value::Members trUtil::JSON::Object::GetMemberNames ( ) const

Returns the value names contained in the object.

Returns
The member names.

Definition at line 45 of file Object.cpp.

References trUtil::JSON::Value::GetMemberNames(), and mRoot.

Here is the call graph for this function:

◆ GetObject()

Object trUtil::JSON::Object::GetObject ( const std::string &  key) const
overridevirtual

Returns the Object value stored at the given key.

Parameters
keyThe key.
Returns
The object.

Implements trUtil::JSON::Base.

Definition at line 313 of file Object.cpp.

References trUtil::JSON::Value::GetObject(), and mRoot.

Here is the call graph for this function:

◆ GetString()

const std::string trUtil::JSON::Object::GetString ( const std::string &  key) const
overridevirtual

Returns the String value stored at the given key.

Parameters
keyThe key.
Returns
The string.

Implements trUtil::JSON::Base.

Definition at line 277 of file Object.cpp.

References trUtil::JSON::Value::GetString(), and mRoot.

Here is the call graph for this function:

◆ GetUInt()

unsigned int trUtil::JSON::Object::GetUInt ( const std::string &  key) const
overridevirtual

Returns the Unsigned Integer value stored at the given key.

Parameters
keyThe key.
Returns
The u int.

Implements trUtil::JSON::Base.

Definition at line 205 of file Object.cpp.

References trUtil::JSON::Value::GetUInt(), and mRoot.

Here is the call graph for this function:

◆ GetUInt64()

UInt64 trUtil::JSON::Object::GetUInt64 ( const std::string &  key) const
overridevirtual

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

Parameters
keyThe key.
Returns
The u int 64.

Implements trUtil::JSON::Base.

Definition at line 241 of file Object.cpp.

References trUtil::JSON::Value::GetUInt64(), and mRoot.

Here is the call graph for this function:

◆ HasComment()

bool trUtil::JSON::Object::HasComment ( ) const

Checks if the internal value has a comment.

Returns
True if comment, false if not.

Definition at line 57 of file Object.cpp.

References trUtil::JSON::Value::HasComment(), and mRoot.

Here is the call graph for this function:

◆ IsArray()

bool trUtil::JSON::Object::IsArray ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 289 of file Object.cpp.

References trUtil::JSON::Value::IsArray(), and mRoot.

Here is the call graph for this function:

◆ IsBool()

bool trUtil::JSON::Object::IsBool ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 105 of file Object.cpp.

References trUtil::JSON::Value::IsBool(), and mRoot.

Here is the call graph for this function:

◆ IsDouble()

bool trUtil::JSON::Object::IsDouble ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 181 of file Object.cpp.

References trUtil::JSON::Value::IsDouble(), and mRoot.

Here is the call graph for this function:

◆ IsFalse()

bool trUtil::JSON::Object::IsFalse ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 140 of file Object.cpp.

References GetBool(), and KeyPresent().

Here is the call graph for this function:

◆ IsFloat()

bool trUtil::JSON::Object::IsFloat ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 253 of file Object.cpp.

References trUtil::JSON::Value::IsFloat(), and mRoot.

Here is the call graph for this function:

◆ IsInt()

bool trUtil::JSON::Object::IsInt ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 163 of file Object.cpp.

References trUtil::JSON::Value::IsInt(), and mRoot.

Here is the call graph for this function:

◆ IsInt64()

bool trUtil::JSON::Object::IsInt64 ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 217 of file Object.cpp.

References trUtil::JSON::Value::IsInt64(), and mRoot.

Here is the call graph for this function:

◆ IsNull()

bool trUtil::JSON::Object::IsNull ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 93 of file Object.cpp.

References trUtil::JSON::Value::IsNull(), and mRoot.

Here is the call graph for this function:

◆ IsNumber()

bool trUtil::JSON::Object::IsNumber ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 157 of file Object.cpp.

References trUtil::JSON::Value::IsNumber(), and mRoot.

Here is the call graph for this function:

◆ IsObject()

bool trUtil::JSON::Object::IsObject ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 307 of file Object.cpp.

References trUtil::JSON::Value::IsObject(), and mRoot.

Here is the call graph for this function:

◆ IsString()

bool trUtil::JSON::Object::IsString ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 271 of file Object.cpp.

References trUtil::JSON::Value::IsString(), and mRoot.

Here is the call graph for this function:

◆ IsTrue()

bool trUtil::JSON::Object::IsTrue ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 123 of file Object.cpp.

References GetBool(), and KeyPresent().

Here is the call graph for this function:

◆ IsUInt()

bool trUtil::JSON::Object::IsUInt ( const std::string &  key) const
overridevirtual

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

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

Implements trUtil::JSON::Base.

Definition at line 199 of file Object.cpp.

References trUtil::JSON::Value::IsUInt(), and mRoot.

Here is the call graph for this function:

◆ IsUInt64()

bool trUtil::JSON::Object::IsUInt64 ( const std::string &  key) const
overridevirtual

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.

Implements trUtil::JSON::Base.

Definition at line 235 of file Object.cpp.

References trUtil::JSON::Value::IsUInt64(), and mRoot.

Here is the call graph for this function:

◆ KeyPresent()

bool trUtil::JSON::Object::KeyPresent ( const std::string &  key) const
overridevirtual

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.

Implements trUtil::JSON::Base.

Definition at line 87 of file Object.cpp.

References trUtil::JSON::Value::KeyPresent(), and mRoot.

Referenced by IsFalse(), and IsTrue().

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

◆ PrintJSONRoot()

void trUtil::JSON::Object::PrintJSONRoot ( )
overridevirtual

Prints out to the screen the whole JSON Root content.

Implements trUtil::JSON::Base.

Definition at line 81 of file Object.cpp.

References mRoot.

◆ SetArray()

void trUtil::JSON::Object::SetArray ( const std::string &  key,
Array value 
)
overridevirtual

Sets the Array to be stored at the given key.

Parameters
keyThe key.
[in,out]valueThe value.

Implements trUtil::JSON::Base.

Definition at line 301 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetArray().

Here is the call graph for this function:

◆ SetBool()

void trUtil::JSON::Object::SetBool ( const std::string &  key,
const bool &  value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 117 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetBool().

Here is the call graph for this function:

◆ SetComment()

void trUtil::JSON::Object::SetComment ( const std::string &  comment)

Sets a comment.

Parameters
commentThe comment.

Definition at line 51 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetComment().

Here is the call graph for this function:

◆ SetDouble()

void trUtil::JSON::Object::SetDouble ( const std::string &  key,
const double &  value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 193 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetDouble().

Here is the call graph for this function:

◆ SetFloat()

void trUtil::JSON::Object::SetFloat ( const std::string &  key,
const float &  value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 265 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetFloat().

Here is the call graph for this function:

◆ SetInt()

void trUtil::JSON::Object::SetInt ( const std::string &  key,
const int &  value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 175 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetInt().

Here is the call graph for this function:

◆ SetInt64()

void trUtil::JSON::Object::SetInt64 ( const std::string &  key,
const Int64 value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 229 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetInt64().

Here is the call graph for this function:

◆ SetNull()

void trUtil::JSON::Object::SetNull ( const std::string &  key)
overridevirtual

Sets the value stored at the specific key to NULL.

Parameters
keyThe key.

Implements trUtil::JSON::Base.

Definition at line 99 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetNull().

Here is the call graph for this function:

◆ SetObject()

void trUtil::JSON::Object::SetObject ( const std::string &  key,
Object value 
)
overridevirtual

Sets the Array to be stored at the given key.

Parameters
keyThe key.
[in,out]valueThe value.

Implements trUtil::JSON::Base.

Definition at line 319 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetObject().

Here is the call graph for this function:

◆ SetString()

void trUtil::JSON::Object::SetString ( const std::string &  key,
const std::string &  value 
)
overridevirtual

Sets the String to be stored at the given key.

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 283 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetString().

Here is the call graph for this function:

◆ SetUInt()

void trUtil::JSON::Object::SetUInt ( const std::string &  key,
const unsigned int &  value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 211 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetUInt().

Here is the call graph for this function:

◆ SetUInt64()

void trUtil::JSON::Object::SetUInt64 ( const std::string &  key,
const UInt64 value 
)
overridevirtual

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

Parameters
keyThe key.
valueThe value.

Implements trUtil::JSON::Base.

Definition at line 247 of file Object.cpp.

References mRoot, and trUtil::JSON::Value::SetUInt64().

Here is the call graph for this function:

Member Data Documentation

◆ mRoot


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