userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
int_parser.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/formats/json/parser/int_parser.hpp
4
/// @brief SAX parsers for JSON integral numbers.
5
/// @ingroup userver_universal
6
7
#
include
<
cstdint
>
8
9
#
include
<
userver
/
formats
/
json
/
parser
/
typed_parser
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
formats::
json
::
parser
{
14
15
template
<
typename
T =
int
>
16
class
IntegralParser
;
17
18
template
<>
19
class
IntegralParser<std::int32_t>
final
:
public
TypedParser
<std::
int32_t
> {
20
public
:
21
using
TypedParser
<std::int32_t>::TypedParser;
22
23
std::string GetPathItem()
const
override
{
return
{}; }
24
25
std::string Expected()
const
override
{
return
"integer"
; }
26
27
void
Int64(std::int64_t i)
override
;
28
29
void
Uint64(std::uint64_t i)
override
;
30
31
void
Double(
double
value)
override
;
32
};
33
34
template
<>
35
class
IntegralParser<std::int64_t>
final
:
public
TypedParser
<std::
int64_t
> {
36
public
:
37
using
TypedParser
<std::int64_t>::TypedParser;
38
39
std::string GetPathItem()
const
override
{
return
{}; }
40
41
std::string Expected()
const
override
{
return
"integer"
; }
42
43
void
Int64(std::int64_t i)
override
;
44
45
void
Uint64(std::uint64_t i)
override
;
46
47
void
Double(
double
value)
override
;
48
};
49
50
using
IntParser =
IntegralParser
<std::int32_t>;
51
using
Int32Parser =
IntegralParser
<std::int32_t>;
52
using
Int64Parser =
IntegralParser
<std::int64_t>;
53
54
}
// namespace formats::json::parser
55
56
USERVER_NAMESPACE_END
userver
formats
json
parser
int_parser.hpp
Generated on
for userver by
Doxygen
1.17.0