CAPIO-CL 2.0.1
CAPIO-CL: Cross Application Programmable I/O - Coordination Language
Loading...
Searching...
No Matches
serializer.h
1#ifndef CAPIO_CL_SERIALIZER_H
2#define CAPIO_CL_SERIALIZER_H
3
4#include <filesystem>
5#include <utility>
6#include <vector>
7
8#include "capiocl.hpp"
9
12
16class SerializerException final : public std::exception {
17 std::string message;
18
19 public:
24 explicit SerializerException(const std::string &msg);
29 [[nodiscard]] const char *what() const noexcept override { return message.c_str(); }
30};
31
34class Serializer final {
40 static std::vector<std::pair<std::string, std::string>>
41 compressedPaths(const engine::Engine &engine);
42
47 static void sortPathsByDecreasingLength(std::vector<std::string> &paths);
48
50 struct available_serializers {
60 static void serialize_v1(const engine::Engine &engine,
61 const std::filesystem::path &filename, bool compress = false);
62
72 static void serialize_v1_1(const engine::Engine &engine,
73 const std::filesystem::path &filename, bool compress = false);
74 };
75
76 public:
86 static void dump(const engine::Engine &engine, const std::filesystem::path &filename,
87 bool compress = false, const std::string &version = CAPIO_CL_VERSION::V1);
88};
89} // namespace capiocl::serializer
90#endif // CAPIO_CL_SERIALIZER_H
Engine for managing CAPIO-CL configuration entries. The CapioCLEngine class stores and manages config...
Definition engine.h:83
SerializerException(const std::string &msg)
Construct a new CAPIO-CL Exception.
Definition Serializer.cpp:32
const char * what() const noexcept override
Definition serializer.h:29
Dump the current loaded CAPIO-CL configuration from class Engine to a CAPIO-CL configuration file.
Definition serializer.h:34
static void dump(const engine::Engine &engine, const std::filesystem::path &filename, bool compress=false, const std::string &version=CAPIO_CL_VERSION::V1)
Dump the current configuration loaded into an instance of Engine to a CAPIO-CL configuration file.
Definition Serializer.cpp:13
Namespace containing the CAPIO-CL Engine.
Definition engine.h:13
Namespace containing the CAPIO-CL Serializer component.
Definition serializer.h:11
static constexpr char V1[]
Release 1.0 of CAPIO-CL.
Definition capiocl.hpp:71