userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
tskv_parser.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <cstddef>
7
#include <optional>
8
#include <string>
9
#include <string_view>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
utils::encoding
{
14
36
class
TskvParser final {
37
public
:
41
enum class
[[nodiscard]]
RecordStatus
{
42
kReachedEnd
,
43
kIncomplete
,
45
};
46
47
explicit
TskvParser
(std::string_view in)
noexcept
;
48
54
const
char
*
SkipToRecordBegin
() noexcept;
55
62
RecordStatus
SkipToRecordEnd
() noexcept;
63
68
std
::optional<
RecordStatus
>
ReadKey
(
std
::
string
& result);
69
72
std
::optional<
RecordStatus
>
ReadValue
(
std
::
string
& result);
73
85
std
::optional<
RecordStatus
>
ReadValueView
(
std
::string_view& result,
std
::
string
& storage);
86
90
std
::optional<
RecordStatus
>
SkipValue
() noexcept;
91
93
const
char
*
GetStreamPosition
() const noexcept;
94
95
private:
96
std
::optional<
RecordStatus
> ReadValueFrom(
std
::
string
& result,
std
::
size_t
value_end);
97
98
std
::string_view in_;
99
};
100
101
}
// namespace utils::encoding
102
103
USERVER_NAMESPACE_END
userver
utils
encoding
tskv_parser.hpp
Generated on
for userver by
Doxygen
1.17.0