3 #include "JsonHandler.h"
20 template <
typename TAccessor,
typename TProperty>
22 property(
const char* currentKey, TAccessor& accessor, TProperty& value) {
23 this->_currentKey = currentKey;
25 if constexpr (isOptional<TProperty>::value) {
27 accessor.reset(
this, &value.value());
29 accessor.reset(
this, &value);
35 const char* getCurrentKey()
const noexcept;
37 virtual void reportWarning(
38 const std::string& warning,
39 std::vector<std::string>&& context = std::vector<std::string>())
override;
42 void setCurrentKey(
const char* key) noexcept;
45 template <
typename T>
struct isOptional {
46 static constexpr
bool value =
false;
49 template <
typename T>
struct isOptional<std::optional<T>> {
50 static constexpr
bool value =
true;
54 const char* _currentKey =
nullptr;
Classes for reading JSON.