Loading...
Searching...
No Matches
SerializerUtils.h File Reference
#include <optional>
#include "glm/glm.hpp"
#include "glm/gtc/quaternion.hpp"
#include "hellfire/graphics/Vertex.h"
#include "nlohmann/json.hpp"
Include dependency graph for SerializerUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hellfire::FileHeader
 File Header Validation. More...
 

Namespaces

namespace  hellfire
 
namespace  glm
 

Functions

template<typename T >
void hellfire::write_binary (std::ostream &out, const T &val)
 Binary I/O.
 
template<typename T >
bool hellfire::read_binary (std::istream &in, T &val)
 
template<typename T >
void hellfire::write_binary_vector (std::ostream &out, const std::vector< T > &vec)
 
template<typename T >
bool hellfire::read_binary_vector (std::istream &in, std::vector< T > &vec)
 
void hellfire::write_binary_string (std::ostream &out, const std::string &str)
 
bool hellfire::read_binary_string (std::istream &in, std::string &str)
 
void hellfire::write_binary (std::ostream &out, const glm::vec2 &v)
 GLM Binary I/O.
 
void hellfire::write_binary (std::ostream &out, const glm::vec3 &v)
 
void hellfire::write_binary (std::ostream &out, const glm::vec4 &v)
 
void hellfire::write_binary (std::ostream &out, const glm::quat &q)
 
void hellfire::write_binary (std::ostream &out, const glm::mat4 &m)
 
void hellfire::write_binary (std::ostream &out, const glm::mat3 &m)
 
bool hellfire::read_binary (std::istream &in, glm::vec2 &v)
 
bool hellfire::read_binary (std::istream &in, glm::vec3 &v)
 
bool hellfire::read_binary (std::istream &in, glm::vec4 &v)
 
bool hellfire::read_binary (std::istream &in, glm::quat &q)
 
bool hellfire::read_binary (std::istream &in, glm::mat4 &m)
 
bool hellfire::read_binary (std::istream &in, glm::mat3 &m)
 
void hellfire::write_binary (std::ostream &out, const Vertex &v)
 Vertex I/O.
 
bool hellfire::read_binary (std::istream &in, Vertex &v)
 
void hellfire::write_vertex_vector (std::ostream &out, const std::vector< Vertex > &vec)
 
bool hellfire::read_vertex_vector (std::istream &in, std::vector< Vertex > &vec)
 
std::optional< glm::vec2 > hellfire::json_get_vec2 (const nlohmann::json &j, const std::string &key)
 JSON Helpers.
 
std::optional< glm::vec3 > hellfire::json_get_vec3 (const nlohmann::json &j, const std::string &key)
 
std::optional< glm::vec3 > hellfire::json_to_vec3 (const nlohmann::json &j)
 
std::optional< glm::vec4 > hellfire::json_get_vec4 (const nlohmann::json &j, const std::string &key)
 
nlohmann::json hellfire::vec2_to_json (const glm::vec2 &v)
 
nlohmann::json hellfire::vec3_to_json (const glm::vec3 &v)
 
nlohmann::json hellfire::vec4_to_json (const glm::vec4 &v)
 
bool hellfire::write_header (std::ostream &out, uint32_t magic, uint32_t version)
 
bool hellfire::read_and_validate_header (std::istream &in, uint32_t expected_magic, uint32_t max_version, uint32_t &out_version)
 
void glm::to_json (nlohmann::json &j, const vec3 &v)
 GLM Helper extensions.
 
void glm::from_json (const nlohmann::json &j, vec3 &v)