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

Exact length constraint (XSD length facet). More...

#include <constraints.hpp>

Collaboration diagram for anch::val::Length:

Public Member Functions

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

Public Attributes

std::size_t value

Detailed Description

Exact length constraint (XSD length facet).

Length of a string is its number of Unicode code points (UTF-8), length of a collection its number of items (XSD lists).

Author
Vincent Lachenal
Since
0.3

Member Function Documentation

◆ check() [1/2]

template<anch::val::Collection V>
bool anch::val::Length::check ( const V & items,
std::string & message ) const

Check number of items

Template Parameters
Vthe collection type
Parameters
itemsthe collection
messagethe error message (set when value is invalid)
Returns
true when value is valid
Here is the call graph for this function:

◆ check() [2/2]

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

Check string length

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::Length::value

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