#include <Json.h>
|
| | Json (std::string filePath) |
| | Constructor that opens and parses a JSON file.
|
| | Json ()=default |
| | Json (const Json &)=default |
| | Json (Json &&)=default |
| | ~Json ()=default |
| auto | data () -> json & |
| auto | jsonDump (int pretty) -> void |
| template<typename T> |
| auto | read (const std::string &keyPath, T &value) const -> bool |
| auto | clear () -> void |
| auto | save () -> void |
| auto | saveAs (const std::string &newFilePath) -> void |
| template<typename T> |
| auto | operator[] (T *key) |
◆ Json() [1/4]
| sys::Json::Json |
( |
std::string | filePath | ) |
|
Constructor that opens and parses a JSON file.
- Parameters
-
| filePath | The path to the JSON file to be opened and parsed. |
◆ Json() [2/4]
◆ Json() [3/4]
| sys::Json::Json |
( |
const Json & | | ) |
|
|
default |
◆ Json() [4/4]
| sys::Json::Json |
( |
Json && | | ) |
|
|
default |
◆ ~Json()
◆ clear()
| auto sys::Json::clear |
( |
| ) |
->void |
clears the current JSON data
◆ data()
| auto sys::Json::data |
( |
| ) |
->json & |
◆ jsonDump()
| auto sys::Json::jsonDump |
( |
int | pretty | ) |
->void |
◆ open()
| auto sys::Json::open |
( |
std::string | filePath | ) |
->bool |
|
private |
Open a stream for reading made private to prevent the stream from being reused
- Parameters
-
| filePath | The path to the JSON file to be opened and parsed. |
- Returns
- true if opened and parsed successfully, false otherwise.
◆ operator[]()
template<typename T>
| auto sys::Json::operator[] |
( |
T * | key | ) |
|
|
inline |
◆ read()
template<typename T>
| auto sys::Json::read |
( |
const std::string & | keyPath, |
|
|
T & | value ) const->bool |
|
inline |
◆ save()
| auto sys::Json::save |
( |
| ) |
->void |
saves current JSON data to the original file path call after modifying the JSON data
◆ saveAs()
| auto sys::Json::saveAs |
( |
const std::string & | newFilePath | ) |
->void |
saves current JSON data to a new file path call after modifying the JSON data
- Parameters
-
| newFilePath | The new path to save the JSON file to. |
◆ savingTest()
| auto sys::Json::savingTest |
( |
| ) |
->void |
|
static |
◆ test()
| auto sys::Json::test |
( |
| ) |
->void |
|
static |
◆ filePath
| std::string sys::Json::filePath |
|
private |
◆ isValid
| bool sys::Json::isValid {false} |
|
private |
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/System/Json.h
- /home/egrazil/sites/Brunot/The House/source/System/Json.cpp