7#include <nlohmann/json.hpp>
39 explicit Metadata(
const filesystem::path& fileLocation);
44 [[nodiscard]]
auto path() const -> filesystem::
path;
62 [[nodiscard]] auto
hasKey(const std::
string& key) const ->
bool;
79 auto
get(const std::
string& key) const -> std::optional<T>
81 if (not
json_.contains(key)) {
82 const auto msg =
"could not find key '" + key +
"' in metadata";
83 throw std::runtime_error(msg);
86 if (
json_[key].is_null()) {
87 return std::optional<T>();
90 return json_[key].get<T>();
99 void set(
const std::string& key, T value)
Volume Cartographer library