diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-05 13:38:04 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-05 13:38:04 +0100 |
| commit | b9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e (patch) | |
| tree | bec510bca7b72b8fe63b7f8cec1fd78b7ff03bc2 /lib/core/c++/write_json.hpp | |
| parent | f5c40005f576b5a3416c2cda8c60e5f100810ddb (diff) | |
| download | libs-lbm-b9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e.tar.gz | |
Reworking structure
Diffstat (limited to 'lib/core/c++/write_json.hpp')
| -rw-r--r-- | lib/core/c++/write_json.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/core/c++/write_json.hpp b/lib/core/c++/write_json.hpp new file mode 100644 index 0000000..19bbfa6 --- /dev/null +++ b/lib/core/c++/write_json.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include <forstio/error.hpp> + +#include <forstio/codec/data.hpp> +#include <forstio/codec/data_math.hpp> + +#include <forstio/codec/json/json.hpp> + + +namespace kel { +namespace lbm { + +template<typename Schema> +saw::error_or<void> write_json(const std::filesystem::path& file_name, const saw::data<Schema>& field){ + saw::data<Schema, saw::encode::Json> j_data; + { + saw::codec<Schema, saw::encode::Json> j_codec; + auto eov = j_codec.encode(field, j_data); + if(eov.is_error()){ + return eov; + } + } + return saw::make_void(); +} +} +} |
