cppfig 0.1.0
Modern C++20 compile-time type-safe configuration library
Loading...
Searching...
No Matches
cppfig::ConfigTraitsFromJsonAdl< T > Struct Template Reference

Helper to create ConfigTraits for types with nlohmann::json ADL. More...

#include <json.h>

Static Public Member Functions

static auto Serialize (const T &value) -> Value
 
static auto Deserialize (const Value &value) -> std::optional< T >
 
static auto ToString (const T &value) -> std::string
 
static auto FromString (std::string_view str) -> std::optional< T >
 

Detailed Description

template<typename T>
requires HasJsonAdl<T>
struct cppfig::ConfigTraitsFromJsonAdl< T >

Helper to create ConfigTraits for types with nlohmann::json ADL.

Users can inherit from this to get automatic trait implementation:

#include <cppfig/json.h>
template<>
Helper to create ConfigTraits for types with nlohmann::json ADL.
Definition json.h:138
Primary template for configuration type traits.
Definition traits.h:21

Member Function Documentation

◆ Deserialize()

template<typename T >
static auto cppfig::ConfigTraitsFromJsonAdl< T >::Deserialize ( const Value value) -> std::optional<T>
inlinestatic

◆ FromString()

template<typename T >
static auto cppfig::ConfigTraitsFromJsonAdl< T >::FromString ( std::string_view  str) -> std::optional<T>
inlinestatic

◆ Serialize()

template<typename T >
static auto cppfig::ConfigTraitsFromJsonAdl< T >::Serialize ( const T &  value) -> Value
inlinestatic

◆ ToString()

template<typename T >
static auto cppfig::ConfigTraitsFromJsonAdl< T >::ToString ( const T &  value) -> std::string
inlinestatic

The documentation for this struct was generated from the following file: