|
| template<typename MapTuple , typename EnumType > |
| static bool | FindEnumMatch (const MapTuple &tuple, const ttv::json::Value &value, EnumType &output) |
| |
| template<int index, typename MapTuple , typename EnumType > |
| static std::enable_if_t<(index< std::tuple_size< MapTuple >::value), bool > | FindEnumMatchFromIndex (const MapTuple &tuple, const ttv::json::Value &value, EnumType &output) |
| |
| template<int index, typename MapTuple , typename EnumType > |
| static std::enable_if_t<(index >=std::tuple_size< MapTuple >::value), bool > | FindEnumMatchFromIndex (const MapTuple &, const ttv::json::Value &, EnumType &output) |
| |
| template<typename Description , typename EnumType , typename = decltype(Description::GetFallbackValue())> |
| static bool | ApplyDefault (EnumType &output, int) |
| |
| template<typename Description , typename EnumType > |
| static bool | ApplyDefault (EnumType &, long) |
| |
| template<typename MapTuple , typename EnumType > |
| static bool | FindStringMatch (const MapTuple &tuple, EnumType input, ttv::json::Value &value) |
| |
| template<int index, typename MapTuple , typename EnumType > |
| static std::enable_if_t<(index< std::tuple_size< MapTuple >::value), bool > | FindStringMatchFromIndex (const MapTuple &tuple, EnumType input, ttv::json::Value &value) |
| |
| template<int index, typename MapTuple , typename EnumType > |
| static std::enable_if_t<(index >=std::tuple_size< MapTuple >::value), bool > | FindStringMatchFromIndex (const MapTuple &, EnumType, ttv::json::Value &) |
| |
template<typename EnumDescription>
struct ttv::json::EnumSchema< EnumDescription >
Enum Schema
The EnumSchema is a reusable schema that takes in an EnumDescription type, which conforms to the following concept:
struct EnumDescription
{
static auto EnumMap() const;
static auto GetDefaultValue() const;
};
The implementation of the static method "EnumField" should return a tuple of "EnumMapping" objects that map the expected strings from the JSON and how they map to individual enumeration values.
The implementation of the static method "GetDefaultValue" is optional. If it is implemented, it will be used when a string is found that does not match any specified in the EnumMap, and parsing will will succeed. If it is not implemented, parsing will fail if the string is not found in the EnumMap.