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

Maximum string length constraint ( maxLength ). More...

#include <constraints.hpp>

Collaboration diagram for anch::val::MaxLength:

Public Member Functions

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

Public Attributes

std::size_t value

Detailed Description

Maximum string length constraint ( maxLength ).

Length is the number of Unicode code points (UTF-8), as in JSON Schema.

Author
Vincent Lachenal
Since
0.2

Member Function Documentation

◆ check()

template<anch::val::StringLike V>
bool anch::val::MaxLength::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

Member Data Documentation

◆ value

std::size_t anch::val::MaxLength::value

Maximum length


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