AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::val::Format Struct Reference

String format constraint ( format ). More...

#include <constraints.hpp>

Collaboration diagram for anch::val::Format:

Public Member Functions

template<anch::val::StringLike V>
bool check (const V &str, std::string &message) const

Public Attributes

std::string name

Detailed Description

String format constraint ( format ).

The validator is found in the formats registry when the value is checked ( anch::val::registerFormat ). Unknown formats are not checked (formats are annotations in JSON Schema).

Author
Vincent Lachenal
Since
0.2

Member Function Documentation

◆ check()

template<anch::val::StringLike V>
bool anch::val::Format::check ( const V & str,
std::string & message ) const

Check value

Template Parameters
Vthe value type
Parameters
strthe value
messagethe error message (set when value is invalid)
Returns
true when value is valid or format is unknown

Member Data Documentation

◆ name

std::string anch::val::Format::name

Format name


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