userver: userver/formats/json/serialize.hpp File Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
serialize.hpp File Reference

Detailed Description

Parsers and serializers to/from string and stream.

Definition in file serialize.hpp.

Go to the source code of this file.

#include <iosfwd>
#include <string_view>
#include <fmt/format.h>
#include <userver/formats/json/value.hpp>
#include <userver/utils/fast_pimpl.hpp>
#include <userver/utils/fmt_compat.hpp>
+ Include dependency graph for serialize.hpp:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  formats::json::PrettyFormat
 
struct  fmt::formatter<::formats::json::Value >
 

Namespaces

namespace  logging
 Logging macro and utilities.
 
namespace  formats
 Value formats representation, parsing and serialization.
 
namespace  formats::json
 JSON support.
 
namespace  formats::json::blocking
 

Functions

formats::json::Value formats::json::FromString (std::string_view doc)
 Parse JSON from string.
 
formats::json::Value formats::json::FromStream (std::istream &is)
 Parse JSON from stream.
 
void formats::json::Serialize (const formats::json::Value &doc, std::ostream &os)
 Serialize JSON to stream.
 
std::string formats::json::ToString (const formats::json::Value &doc)
 Serialize JSON to string.
 
std::string formats::json::ToStableString (const formats::json::Value &doc)
 
std::string formats::json::ToStableString (formats::json::Value &&doc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string formats::json::ToPrettyString (const formats::json::Value &doc, PrettyFormat format={})
 Serialize JSON to a string, using \n and indents for objects and arrays.
 
logging::LogHelperformats::json::operator<< (logging::LogHelper &, const formats::json::Value &)
 Log JSON.
 
formats::json::Value formats::json::blocking::FromFile (const std::string &path)
 Read JSON from file.
 

Variables

constexpr std::size_t formats::json::kDepthParseLimit = 128