Hymn to Beauty
C++ 3D Engine
Json Namespace Reference

Functions

Value SaveImVec2 (const ImVec2 &value)
 Convert an ImVec2 to a JSON node. More...
 
ImVec2 LoadImVec2 (const Value &value)
 Load an ImVec2 from a JSON node. More...
 
Value SaveImVec4 (const ImVec4 &value)
 Convert an ImVec4 to a JSON node. More...
 
ImVec4 LoadImVec4 (const Value &value)
 Load an ImVec4 from a JSON node. More...
 
void Serialize (Value &node, bool load, const std::string &name, bool &value, bool defaultValue)
 Serialize a boolean value. More...
 
void Serialize (Value &node, bool load, const std::string &name, int32_t &value, int32_t defaultValue)
 Serialize an integer value. More...
 
void Serialize (Value &node, bool load, const std::string &name, uint32_t &value, uint32_t defaultValue)
 Serialize an unsigned integer value. More...
 
void Serialize (Value &node, bool load, const std::string &name, float &value, float defaultValue)
 Serialize a float value. More...
 
void Serialize (Value &node, bool load, const std::string &name, glm::vec2 &value, const glm::vec2 &defaultValue)
 Serialize a vec2 value. More...
 
void Serialize (Value &node, bool load, const std::string &name, glm::vec3 &value, const glm::vec3 &defaultValue)
 Serialize a vec3 value. More...
 
void Serialize (Value &node, bool load, const std::string &name, glm::vec4 &value, const glm::vec4 &defaultValue)
 Serialize a vec4 value. More...
 
void Serialize (Value &node, bool load, const std::string &name, glm::quat &value, const glm::quat &defaultValue)
 Serialize a quaternion value. More...
 
void Serialize (Value &node, bool load, const std::string &name, std::string &value, const std::string &defaultValue)
 Serialize a string value. More...
 
void Serialize (Value &node, bool load, const std::string &name, TextureAsset *&value)
 Serialize a TextureAsset value. More...
 
void Serialize (Value &node, bool load, const std::string &name, Geometry::Model *&value)
 Serialize a Model value. More...
 

Function Documentation

◆ LoadImVec2()

ImVec2 Json::LoadImVec2 ( const Value &  value)

Load an ImVec2 from a JSON node.

Parameters
valueThe JSON node to load from.
Returns
The loaded ImVec2.

◆ LoadImVec4()

ImVec4 Json::LoadImVec4 ( const Value &  value)

Load an ImVec4 from a JSON node.

Parameters
valueThe JSON node to load from.
Returns
The loaded ImVec4.

◆ SaveImVec2()

Json::Value Json::SaveImVec2 ( const ImVec2 &  value)

Convert an ImVec2 to a JSON node.

Parameters
valueValue to convert.
Returns
JSON node.

◆ SaveImVec4()

Json::Value Json::SaveImVec4 ( const ImVec4 &  value)

Convert an ImVec4 to a JSON node.

Parameters
valueValue to convert.
Returns
JSON node.

◆ Serialize() [1/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
bool &  value,
bool  defaultValue 
)

Serialize a boolean value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [2/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
float &  value,
float  defaultValue 
)

Serialize a float value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [3/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
Geometry::Model *&  value 
)

Serialize a Model value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.

◆ Serialize() [4/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
glm::quat &  value,
const glm::quat &  defaultValue 
)

Serialize a quaternion value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [5/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
glm::vec2 &  value,
const glm::vec2 &  defaultValue 
)

Serialize a vec2 value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [6/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
glm::vec3 &  value,
const glm::vec3 &  defaultValue 
)

Serialize a vec3 value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [7/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
glm::vec4 &  value,
const glm::vec4 &  defaultValue 
)

Serialize a vec4 value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [8/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
int32_t &  value,
int32_t  defaultValue 
)

Serialize an integer value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [9/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
std::string &  value,
const std::string &  defaultValue 
)

Serialize a string value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.

◆ Serialize() [10/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
TextureAsset *&  value 
)

Serialize a TextureAsset value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.

◆ Serialize() [11/11]

void Json::Serialize ( Value &  node,
bool  load,
const std::string &  name,
uint32_t &  value,
uint32_t  defaultValue 
)

Serialize an unsigned integer value.

Parameters
nodeJson node to save to/load from.
loadWhether to load (otherwise saves).
nameThe name to store the value under.
valueThe value to save/load.
defaultValueDefault value if loading and node does not exist.