userver
C++ Async Framework
Loading...
Searching...
No Matches
serialize.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/formats/yaml/serialize.hpp
4
/// @brief Parsers and serializers to/from string and stream
5
6
#
include
<
iosfwd
>
7
8
#
include
<
userver
/
formats
/
json_fwd
.
hpp
>
9
#
include
<
userver
/
formats
/
yaml
/
value
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
formats::
parse
{
14
15
/// @brief Converts a YAML value to JSON format
16
///
17
/// @throws formats::yaml::Exception if the YAML value is missing or contains
18
/// an unknown node type that cannot be converted to JSON
19
formats::json::
Value
Parse
(
const
formats::
yaml
::Value& yaml, formats::
parse
::To<formats::json::
Value
>);
20
21
/// @brief Converts a JSON value to YAML format
22
///
23
/// @throws formats::json::Exception if the JSON value is missing or contains
24
/// an unknown node type that cannot be converted to YAML
25
formats::
yaml
::Value
Parse
(
const
formats::json::
Value
& json, formats::
parse
::To<formats::
yaml
::Value>);
26
27
}
// namespace formats::parse
28
29
namespace
formats::
yaml
{
30
31
/// Parse YAML from string
32
formats::
yaml
::Value
FromString
(
const
std::string& doc);
33
34
/// Parse YAML from stream
35
formats::
yaml
::Value
FromStream
(std::istream& is);
36
37
/// Serialize YAML to stream
38
void
Serialize
(
const
formats::
yaml
::Value& doc, std::ostream& os);
39
40
/// Serialize YAML to string
41
std::string
ToString
(
const
formats::
yaml
::Value& doc);
42
43
/// Blocking operations that should not be used on main task processor after
44
/// startup
45
namespace
blocking
{
46
/// @brief Read YAML from file
47
/// @see formats::yaml::FromFile
48
formats::
yaml
::Value
FromFile
(
const
std::string& path);
49
}
// namespace blocking
50
51
namespace
impl {
52
formats::
yaml
::Value FromStringAllowRepeatedKeys(
const
std::string& doc);
53
}
// namespace impl
54
55
}
// namespace formats::yaml
56
57
USERVER_NAMESPACE_END
userver
formats
yaml
serialize.hpp
Generated on Mon Mar 23 2026 21:39:23 for userver by
Doxygen
1.13.2