userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
validator.hpp
1
#
pragma
once
2
3
#
include
<
utility
>
4
5
USERVER_NAMESPACE_BEGIN
6
7
namespace
formats
::
json
::
parser
{
8
9
template
<
typename
T>
10
class
BaseValidator
{
11
public
:
12
virtual
void
operator()(
const
T& t)
const
= 0;
13
};
10
class
BaseValidator
{
…
};
14
15
template
<
typename
T,
typename
F>
16
class
Validator
final
:
public
BaseValidator
<T> {
17
public
:
18
explicit
Validator(F f) : f_(std::move(f)) {}
19
20
void
operator()(
const
T& t)
const
override
{ f_(t); }
21
22
private
:
23
F f_;
24
};
16
class
Validator
final
:
public
BaseValidator
<T> {
…
};
25
26
template
<
typename
T>
27
class
EmptyValidator
final
:
public
BaseValidator
<T> {
28
public
:
29
void
operator()(
const
T&)
const
override
{}
30
};
27
class
EmptyValidator
final
:
public
BaseValidator
<T> {
…
};
31
32
template
<
typename
T,
typename
F>
33
auto
MakeValidator(F f) {
34
return
Validator<T, F>(std::move(f));
35
}
36
37
template
<
typename
T>
38
inline
constexpr
EmptyValidator<T> kEmptyValidator;
39
40
}
// namespace formats::json::parser
41
42
USERVER_NAMESPACE_END
userver
formats
json
parser
validator.hpp
Generated on Wed Apr 30 2025 15:59:15 for userver by
Doxygen
1.13.2