1#ifndef CAPIO_CL_PARSER_H
2#define CAPIO_CL_PARSER_H
3#include <jsoncons/basic_json.hpp>
4#include <jsoncons_ext/jsonschema/jsonschema.hpp>
26 [[nodiscard]]
const char *
what() const noexcept
override {
return message.c_str(); }
33 struct available_parsers {
42 static engine::Engine *parse_v1(
const std::filesystem::path &source,
43 const std::filesystem::path &resolve_prefix,
44 bool store_only_in_memory);
54 static engine::Engine *parse_v1_1(
const std::filesystem::path &source,
55 const std::filesystem::path &resolve_prefix,
56 bool store_only_in_memory);
64 static jsoncons::jsonschema::json_schema<jsoncons::json> loadSchema(
const char *data);
73 static std::filesystem::path
resolve(std::filesystem::path path,
74 const std::filesystem::path &prefix);
82 static void validate_json(
const jsoncons::json &doc,
const char *str_schema);
94 const std::filesystem::path &resolve_prefix =
"",
95 bool store_only_in_memory =
false);
Engine for managing CAPIO-CL configuration entries. The CapioCLEngine class stores and manages config...
Definition engine.h:26
ParserException(const std::string &msg)
Construct a new CAPIO-CL Exception.
Definition Parser.cpp:9
const char * what() const noexcept override
Definition parser.h:26
Contains the code to parse a JSON based CAPIO-CL configuration file.
Definition parser.h:30
static std::filesystem::path resolve(std::filesystem::path path, const std::filesystem::path &prefix)
Definition Parser.cpp:18
static engine::Engine * parse(const std::filesystem::path &source, const std::filesystem::path &resolve_prefix="", bool store_only_in_memory=false)
Perform the parsing of the capio_server configuration file.
Definition Parser.cpp:46
static void validate_json(const jsoncons::json &doc, const char *str_schema)
Definition Parser.cpp:35
Namespace containing the CAPIO-CL parsers components.
Definition parser.h:7