galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages Concepts
galaxy::json Namespace Reference

Functions

nlohmann::json read (const std::string &file)
 Read a json file in the vfs.
 
nlohmann::json read_raw (const std::string &json)
 Read raw json string.
 
bool write (const std::string &file, const nlohmann::json &json)
 Write json to vfs.
 
std::string dump (const nlohmann::json &json)
 Dump json to string.
 

Function Documentation

◆ read()

nlohmann::json galaxy::json::read ( const std::string & file)
nodiscard

Read a json file in the vfs.

Parameters
fileFile in vfs to read and parse.
Returns
Fully parsed json object.

Definition at line 19 of file JSON.cpp.

◆ read_raw()

nlohmann::json galaxy::json::read_raw ( const std::string & json)
nodiscard

Read raw json string.

Parameters
jsonRaw json string to parse.
Returns
Fully parsed json object.

Definition at line 27 of file JSON.cpp.

◆ write()

bool galaxy::json::write ( const std::string & file,
const nlohmann::json & json )
nodiscard

Write json to vfs.

Parameters
fileFile in the vfs to write to.
jsonJson data to write.
Returns
True if file successfully saved.

Definition at line 32 of file JSON.cpp.

◆ dump()

std::string galaxy::json::dump ( const nlohmann::json & json)
nodiscard

Dump json to string.

Parameters
jsonJson data to dump.
Returns
Json in string format.

Definition at line 38 of file JSON.cpp.

+ Here is the caller graph for this function: