userver: userver/dump/common.hpp File Reference
Loading...
Searching...
No Matches
common.hpp File Reference

Detailed Description

Serialization and deserialization of integral, floating point, string, std::chrono, enum and uuid types for dumps.

Definition in file common.hpp.

Go to the source code of this file.

#include <chrono>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <boost/numeric/conversion/cast.hpp>
#include <userver/dump/operations.hpp>
#include <userver/dump/unsafe.hpp>
#include <userver/utils/meta_light.hpp>
+ Include dependency graph for common.hpp:
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  decimal64
 Fixed-point decimal data type and related functions.
 
namespace  formats
 Value formats representation, parsing and serialization.
 
namespace  formats::json
 JSON support.
 
namespace  dump
 Dumping of cache-like components.
 

Functions

std::string dump::ReadEntire (Reader &reader)
 Reads the rest of the data from reader
 
void dump::Write (Writer &writer, std::string_view value)
 Write-only std::string_view support.
 
void dump::Write (Writer &writer, const std::string &value)
 std::string serialization support
 
std::string dump::Read (Reader &reader, To< std::string >)
 std::string deserialization support
 
void dump::Write (Writer &writer, const char *value)
 Allows writing string literals.
 
template<typename T >
std::enable_if_t< meta::kIsInteger< T > > dump::Write (Writer &writer, T value)
 Integral types serialization support.
 
template<typename T >
std::enable_if_t< meta::kIsInteger< T >, T > dump::Read (Reader &reader, To< T >)
 Integral types deserialization support.
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > dump::Write (Writer &writer, T value)
 Floating-point serialization support.
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, T > dump::Read (Reader &reader, To< T >)
 Floating-point deserialization support.
 
void dump::Write (Writer &writer, bool value)
 bool serialization support
 
bool dump::Read (Reader &reader, To< bool >)
 bool deserialization support
 
template<typename T >
std::enable_if_t< std::is_enum_v< T > > dump::Write (Writer &writer, T value)
 enum serialization support
 
template<typename T >
std::enable_if_t< std::is_enum_v< T >, T > dump::Read (Reader &reader, To< T >)
 enum deserialization support
 
template<typename Rep , typename Period >
void dump::Write (Writer &writer, std::chrono::duration< Rep, Period > value)
 std::chrono::duration serialization support
 
template<typename Rep , typename Period >
std::chrono::duration< Rep, Period > dump::Read (Reader &reader, To< std::chrono::duration< Rep, Period > >)
 std::chrono::duration deserialization support
 
template<typename Duration >
void dump::Write (Writer &writer, std::chrono::time_point< std::chrono::system_clock, Duration > value)
 std::chrono::time_point serialization support
 
template<typename Duration >
auto dump::Read (Reader &reader, To< std::chrono::time_point< std::chrono::system_clock, Duration > >)
 std::chrono::time_point deserialization support
 
void dump::Write (Writer &writer, const boost::uuids::uuid &value)
 boost::uuids::uuid serialization support
 
boost::uuids::uuid dump::Read (Reader &reader, To< boost::uuids::uuid >)
 boost::uuids::uuid deserialization support
 
template<int Prec, typename RoundPolicy >
void dump::Write (Writer &writer, const decimal64::Decimal< Prec, RoundPolicy > &dec)
 decimal64::Decimal serialization support
 
template<int Prec, typename RoundPolicy >
auto dump::Read (Reader &reader, dump::To< decimal64::Decimal< Prec, RoundPolicy > >)
 decimal64::Decimal deserialization support
 
void dump::Write (Writer &writer, const formats::json::Value &value)
 formats::json::Value serialization support
 
formats::json::Value dump::Read (Reader &reader, To< formats::json::Value >)
 formats::json::Value deserialization support