AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
json.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 standard
3 Copyright (C) 2026 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <https://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "anch-codec-json-export.hpp"
23
24#include <exception>
25
26#include "json/format.hpp"
27
28#include "codec/codec.hpp"
29#include "codec/formatCodec.hpp"
30
31namespace anch::codec {
32
50 template<>
51 struct ANCH_CODEC_JSON_EXPORT FormatPolicy<anch::json::JsonFormat> {
59
65 static void translate(const std::exception& error);
66 };
67
76
77}
78
79// Options of each side are instantiated in anch-codec-json (unique in the program)
80extern template struct ANCH_CODEC_JSON_EXPORT anch::codec::FormatCodec<anch::json::JsonFormat>;
AnCH codec library namespace.
Definition csv.hpp:31
anch::codec::FormatCodec< anch::json::JsonFormat > Json
Definition json.hpp:75
Side
Definition codec.hpp:48
AnCH framework base namespace.
Definition app.hpp:30
Codec of a data format: media type, options of each side ( FormatPolicy ), serialization and deserial...
Definition formatCodec.hpp:130
static void translate(const std::exception &error)
static void configure(anch::json::MappingOptions &options, anch::codec::Side side)
Policy of a format codec: options of each side and errors translation.
Definition formatCodec.hpp:90
JSON format: serialization and deserialization of values with options.
Definition format.hpp:62
JSON mapping options.
Definition mappingOptions.hpp:38