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

A file. More...

#include <File.h>

Inheritance diagram for trUtil::JSON::File:
Collaboration diagram for trUtil::JSON::File:

Public Member Functions

 File ()
 ctor. More...
 
 File (std::string fileName)
 Constructor that takes in the file name. More...
 
 ~File ()
 dtor. More...
 
virtual bool ReadFromFile (std::string fileName)
 Reads from a file and parses the JSON into a Root node. More...
 
virtual bool ReadFromFile ()
 Reads from a file and parses the JSON into a Root Node. More...
 
virtual bool WriteToFile (std::string fileName)
 Writes the internal Root Node to a JSON file. More...
 
virtual bool WriteToFile ()
 Writes the Root Node to a JSON file. More...
 
virtual void SetFileName (std::string fileName)
 Sets a new file name. More...
 
virtual std::string GetFileName () const
 Returns the name of the current file. More...
 
virtual void SetFilePath (std::string newPath)
 Sets the path of where the file will be read from or written to. More...
 
virtual std::string GetFilePath () const
 Returns the path of where the file is read or written to. More...
 
virtual bool FileExists ()
 Returns true if the file name and path exist on the HD. 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...
 

Static Public Attributes

static const std::string DEFAULT_JSON_FILE_NAME = std::string("Default.json")
 The default JSON file name. More...
 

Private Attributes

std::string mFileName
 Filename of the file. More...
 
std::string mFilePath
 Full pathname of the file. More...
 
Value mRoot
 The root. More...
 

Additional Inherited Members

Detailed Description

A file.

Author
Maxim Serebrennik

Definition at line 45 of file File.h.

Constructor & Destructor Documentation

◆ File() [1/2]

trUtil::JSON::File::File ( )

ctor.

Definition at line 47 of file File.cpp.

◆ File() [2/2]

trUtil::JSON::File::File ( std::string  fileName)

Constructor that takes in the file name.

The user still needs to Open the file for reading or writing.

Parameters
fileNameFilename of the file.

Definition at line 51 of file File.cpp.

References trUtil::PathUtils::GetUserConfigPath(), mFileName, and mFilePath.

Here is the call graph for this function:

◆ ~File()

trUtil::JSON::File::~File ( )

dtor.

Definition at line 58 of file File.cpp.

Member Function Documentation

◆ Clear()

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

Clears the internal JSON Root node.

Implements trUtil::JSON::Base.

Definition at line 184 of file File.cpp.

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

Here is the call graph for this function:

◆ FileExists()

bool trUtil::JSON::File::FileExists ( )
virtual

Returns true if the file name and path exist on the HD.

Returns
True if it succeeds, false if it fails.

Definition at line 178 of file File.cpp.

References trUtil::FileUtils::FileExists(), trUtil::FileUtils::GetInstance(), mFileName, and mFilePath.

Referenced by trUtil::VersionUtil::VersionUtil().

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

◆ GetArray()

Array trUtil::JSON::File::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 410 of file File.cpp.

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

Here is the call graph for this function:

◆ GetBool()

bool trUtil::JSON::File::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 226 of file File.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:

◆ GetDouble()

double trUtil::JSON::File::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 302 of file File.cpp.

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

Here is the call graph for this function:

◆ GetFileName()

std::string trUtil::JSON::File::GetFileName ( ) const
virtual

Returns the name of the current file.

Returns
The file name.

Definition at line 160 of file File.cpp.

References mFileName.

◆ GetFilePath()

std::string trUtil::JSON::File::GetFilePath ( ) const
virtual

Returns the path of where the file is read or written to.

Returns
The file path.

Definition at line 172 of file File.cpp.

References mFilePath.

Referenced by trUtil::VersionUtil::VersionUtil().

Here is the caller graph for this function:

◆ GetFloat()

float trUtil::JSON::File::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 374 of file File.cpp.

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

Here is the call graph for this function:

◆ GetInt()

int trUtil::JSON::File::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 284 of file File.cpp.

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

Referenced by trUtil::VersionUtil::GetBuildVersion(), trUtil::VersionUtil::GetMajorVersion(), and trUtil::VersionUtil::GetMinorVersion().

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

◆ GetInt64()

Int64 trUtil::JSON::File::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 338 of file File.cpp.

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

Here is the call graph for this function:

◆ GetJSONRoot()

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

Returns a reference to the internal JSON Root node.

Returns
The JSON root.

Implements trUtil::JSON::Base.

Definition at line 190 of file File.cpp.

References mRoot.

◆ GetObject()

Object trUtil::JSON::File::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 428 of file File.cpp.

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

Here is the call graph for this function:

◆ GetString()

const std::string trUtil::JSON::File::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 392 of file File.cpp.

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

Referenced by trUtil::VersionUtil::GetYYMMVersion().

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

◆ GetUInt()

unsigned int trUtil::JSON::File::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 320 of file File.cpp.

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

Here is the call graph for this function:

◆ GetUInt64()

UInt64 trUtil::JSON::File::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 356 of file File.cpp.

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

Here is the call graph for this function:

◆ IsArray()

bool trUtil::JSON::File::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 404 of file File.cpp.

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

Here is the call graph for this function:

◆ IsBool()

bool trUtil::JSON::File::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 220 of file File.cpp.

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

Here is the call graph for this function:

◆ IsDouble()

bool trUtil::JSON::File::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 296 of file File.cpp.

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

Here is the call graph for this function:

◆ IsFalse()

bool trUtil::JSON::File::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 255 of file File.cpp.

References GetBool(), and KeyPresent().

Here is the call graph for this function:

◆ IsFloat()

bool trUtil::JSON::File::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 368 of file File.cpp.

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

Here is the call graph for this function:

◆ IsInt()

bool trUtil::JSON::File::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 278 of file File.cpp.

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

Here is the call graph for this function:

◆ IsInt64()

bool trUtil::JSON::File::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 332 of file File.cpp.

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

Here is the call graph for this function:

◆ IsNull()

bool trUtil::JSON::File::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 208 of file File.cpp.

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

Here is the call graph for this function:

◆ IsNumber()

bool trUtil::JSON::File::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 272 of file File.cpp.

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

Here is the call graph for this function:

◆ IsObject()

bool trUtil::JSON::File::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 422 of file File.cpp.

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

Here is the call graph for this function:

◆ IsString()

bool trUtil::JSON::File::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 386 of file File.cpp.

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

Here is the call graph for this function:

◆ IsTrue()

bool trUtil::JSON::File::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 238 of file File.cpp.

References GetBool(), and KeyPresent().

Here is the call graph for this function:

◆ IsUInt()

bool trUtil::JSON::File::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 314 of file File.cpp.

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

Here is the call graph for this function:

◆ IsUInt64()

bool trUtil::JSON::File::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 350 of file File.cpp.

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

Here is the call graph for this function:

◆ KeyPresent()

bool trUtil::JSON::File::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 202 of file File.cpp.

References trUtil::JSON::Value::HasMember(), 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::File::PrintJSONRoot ( )
overridevirtual

Prints out to the screen the whole JSON Root content.

Implements trUtil::JSON::Base.

Definition at line 196 of file File.cpp.

References mRoot.

◆ ReadFromFile() [1/2]

bool trUtil::JSON::File::ReadFromFile ( std::string  fileName)
virtual

Reads from a file and parses the JSON into a Root node.

Parameters
fileNameFilename of the file.
Returns
True if it succeeds, false if it fails.

Definition at line 69 of file File.cpp.

References trUtil::JSON::Value::Clear(), trUtil::JSON::Value::GetJsonValue(), LOG_D, LOG_E, LOG_ERROR, trUtil::Exception::LogException(), mFileName, mFilePath, and mRoot.

Referenced by trUtil::VersionUtil::VersionUtil().

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

◆ ReadFromFile() [2/2]

bool trUtil::JSON::File::ReadFromFile ( )
virtual

Reads from a file and parses the JSON into a Root Node.

Uses an internally set filename to determine what to open.

Returns
True if it succeeds, false if it fails.

Definition at line 63 of file File.cpp.

References mFileName.

◆ SetArray()

void trUtil::JSON::File::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 416 of file File.cpp.

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

Here is the call graph for this function:

◆ SetBool()

void trUtil::JSON::File::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 232 of file File.cpp.

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

Here is the call graph for this function:

◆ SetDouble()

void trUtil::JSON::File::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 308 of file File.cpp.

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

Here is the call graph for this function:

◆ SetFileName()

void trUtil::JSON::File::SetFileName ( std::string  fileName)
virtual

Sets a new file name.

If a file has been opened already, this will close it.

Parameters
fileNameFilename of the file.

Definition at line 154 of file File.cpp.

References mFileName.

Referenced by trUtil::VersionUtil::VersionUtil().

Here is the caller graph for this function:

◆ SetFilePath()

void trUtil::JSON::File::SetFilePath ( std::string  newPath)
virtual

Sets the path of where the file will be read from or written to.

By default the it sill be saved in the PathUtils::GetUserDataPath() + PathUtils::CONFIG_PATH folder.

Parameters
newPathFull pathname of the new file.

Definition at line 166 of file File.cpp.

References mFilePath.

Referenced by trUtil::VersionUtil::VersionUtil().

Here is the caller graph for this function:

◆ SetFloat()

void trUtil::JSON::File::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 380 of file File.cpp.

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

Here is the call graph for this function:

◆ SetInt()

void trUtil::JSON::File::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 290 of file File.cpp.

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

Referenced by trUtil::VersionUtil::SetBuildVersion(), trUtil::VersionUtil::SetMajorVersion(), trUtil::VersionUtil::SetMinorVersion(), and trUtil::VersionUtil::SetYYMMVersion().

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

◆ SetInt64()

void trUtil::JSON::File::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 344 of file File.cpp.

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

Here is the call graph for this function:

◆ SetNull()

void trUtil::JSON::File::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 214 of file File.cpp.

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

Here is the call graph for this function:

◆ SetObject()

void trUtil::JSON::File::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 434 of file File.cpp.

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

Here is the call graph for this function:

◆ SetString()

void trUtil::JSON::File::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 398 of file File.cpp.

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

Referenced by trUtil::VersionUtil::SetYYMMVersion().

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

◆ SetUInt()

void trUtil::JSON::File::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 326 of file File.cpp.

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

Here is the call graph for this function:

◆ SetUInt64()

void trUtil::JSON::File::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 362 of file File.cpp.

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

Here is the call graph for this function:

◆ WriteToFile() [1/2]

bool trUtil::JSON::File::WriteToFile ( std::string  fileName)
virtual

Writes the internal Root Node to a JSON file.

Parameters
fileNameFilename of the file.
Returns
True if it succeeds, false if it fails.

Definition at line 123 of file File.cpp.

References LOG_D, LOG_ERROR, trUtil::Exception::LogException(), mFileName, mFilePath, and mRoot.

Referenced by trUtil::VersionUtil::SaveVersionFile().

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

◆ WriteToFile() [2/2]

bool trUtil::JSON::File::WriteToFile ( )
virtual

Writes the Root Node to a JSON file.

Uses an internally set filename to determine what to create.

Returns
True if it succeeds, false if it fails.

Definition at line 117 of file File.cpp.

References mFileName.

Member Data Documentation

◆ DEFAULT_JSON_FILE_NAME

const std::string trUtil::JSON::File::DEFAULT_JSON_FILE_NAME = std::string("Default.json")
static

The default JSON file name.

Definition at line 50 of file File.h.

◆ mFileName

std::string trUtil::JSON::File::mFileName
private

Filename of the file.

Definition at line 573 of file File.h.

Referenced by File(), FileExists(), GetFileName(), ReadFromFile(), SetFileName(), and WriteToFile().

◆ mFilePath

std::string trUtil::JSON::File::mFilePath
private

Full pathname of the file.

Definition at line 575 of file File.h.

Referenced by File(), FileExists(), GetFilePath(), ReadFromFile(), SetFilePath(), and WriteToFile().

◆ mRoot


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