6#include <unordered_map>
39 std::string
from(
const std::unordered_map<std::string, std::string>& map,
int pretty_print = 4) const noexcept;
45 std::
string from(const std::vector<std::unordered_map<std::
string, std::
string>>& arr,
int pretty_print = 4) const noexcept;
51 bool from(const std::
string& s, std::unordered_map<std::
string, std::
string>& m) const noexcept;
57 bool load(const std::
string& filename, std::unordered_map<std::
string, std::
string>& m) const noexcept;
63 bool from_array(const std::
string& s, std::vector<std::unordered_map<std::
string, std::
string>>& vm) const noexcept;
69 bool load_array(const std::
string& filename, std::vector<std::unordered_map<std::
string, std::
string>>& vm) const noexcept;
73 class json_helper_impl;
74 std::unique_ptr<json_helper_impl> impl;
JSON helper class.
Definition json_helper.h:15
json_helper()
Default constructor.
bool load(const std::string &filename, std::unordered_map< std::string, std::string > &m) const noexcept
Parse a JSON file into a C++ map from a file on disk.
bool from_array(const std::string &s, std::vector< std::unordered_map< std::string, std::string > > &vm) const noexcept
Parse a JSON array string into a vector of maps.
bool load_array(const std::string &filename, std::vector< std::unordered_map< std::string, std::string > > &vm) const noexcept
Load a JSON array file into a vector of maps.
std::string from(const std::unordered_map< std::string, std::string > &map, int pretty_print=4) const noexcept
Get the contents of a map as a string in JSON format.
~json_helper()
Destructor.
Namespace for the maze builder.
Definition algo_interface.h:9