userver: userver/formats/yaml/serialize.hpp Source File
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/yaml/value.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace formats::yaml {
13
14/// Parse YAML from string
15formats::yaml::Value FromString(const std::string& doc);
16
17/// Parse YAML from stream
18formats::yaml::Value FromStream(std::istream& is);
19
20/// Serialize YAML to stream
21void Serialize(const formats::yaml::Value& doc, std::ostream& os);
22
23/// Serialize YAML to string
24std::string ToString(const formats::yaml::Value& doc);
25
26/// Blocking operations that should not be used on main task processor after
27/// startup
28namespace blocking {
29/// Read YAML from file
30formats::yaml::Value FromFile(const std::string& path);
31} // namespace blocking
32
33} // namespace formats::yaml
34
35USERVER_NAMESPACE_END