Interface for serialization write backends. More...
#include <eagine/serialize/write_backend.hpp>
Public Types | |
using | result = serialization_errors |
Alias for the serialization operations result type. | |
Public Member Functions | |
virtual auto | type_id () -> identifier=0 |
Returns a descriptive identifier of the implementation. | |
virtual auto | sink () -> serializer_data_sink *=0 |
Returns a pointer to the associated data sink, if any. | |
virtual auto | enum_as_string () -> bool=0 |
@brie Indicates if the backed stores enumerators as strings (or numeric values). | |
virtual auto | begin () -> result=0 |
Starts the serialization of a potentially complex structured value. | |
virtual auto | write (span< const bool >, span_size_t &) -> result=0 |
Writes boolean values, returns how many were done through second argument. | |
virtual auto | write (span< const char >, span_size_t &) -> result=0 |
Writes character values, returns how many were done through second argument. | |
virtual auto | write (span< const std::int8_t >, span_size_t &) -> result=0 |
Writes 8-bit int values, returns how many were done through second argument. | |
virtual auto | write (span< const short >, span_size_t &) -> result=0 |
Writes short int values, returns how many were done through second argument. | |
virtual auto | write (span< const int >, span_size_t &) -> result=0 |
Writes int values, returns how many were done through second argument. | |
virtual auto | write (span< const long >, span_size_t &) -> result=0 |
Writes long values, returns how many were done through second argument. | |
virtual auto | write (span< const long long >, span_size_t &) -> result=0 |
Writes long long values, returns how many were done through second argument. | |
virtual auto | write (span< const std::uint8_t >, span_size_t &) -> result=0 |
Writes 8-bit uint values, returns how many were done through second argument. | |
virtual auto | write (span< const unsigned short >, span_size_t &) -> result=0 |
Writes ushort values, returns how many were done through second argument. | |
virtual auto | write (span< const unsigned >, span_size_t &) -> result=0 |
Writes uint values, returns how many were done through second argument. | |
virtual auto | write (span< const unsigned long >, span_size_t &) -> result=0 |
Writes ulong values, returns how many were done through second argument. | |
virtual auto | write (span< const unsigned long long >, span_size_t &) -> result=0 |
Writes ulong long values, returns how many were done through second argument. | |
virtual auto | write (span< const float >, span_size_t &) -> result=0 |
Writes float values, returns how many were done through second argument. | |
virtual auto | write (span< const double >, span_size_t &) -> result=0 |
Writes double values, returns how many were done through second argument. | |
virtual auto | write (span< const identifier >, span_size_t &) -> result=0 |
Writes identifier values, returns how many were done through second argument. | |
virtual auto | write (span< const decl_name >, span_size_t &) -> result=0 |
Writes decl_name values, returns how many were done through second argument. | |
virtual auto | write (span< const string_view >, span_size_t &) -> result=0 |
Writes string values, returns how many were done through second argument. | |
virtual auto | begin_struct (span_size_t member_count) -> result=0 |
Begins the serialization of a structure instance. | |
virtual auto | begin_member (string_view name) -> result=0 |
Begins the serialization of a structure data member. | |
virtual auto | finish_member (string_view name) -> result=0 |
Finishes the serialization of a structure data member. | |
virtual auto | finish_struct () -> result=0 |
Finishes the serialization of a structure instance. | |
virtual auto | begin_list (span_size_t element_count) -> result=0 |
Begins the serialization of a container instance. | |
virtual auto | begin_element (span_size_t index) -> result=0 |
Begins the serialization of a container element. | |
virtual auto | finish_element (span_size_t index) -> result=0 |
Finishes the serialization of a container element. | |
virtual auto | finish_list () -> result=0 |
Finishes the serialization of a container instance. | |
virtual auto | finish () -> result=0 |
Finishes the serialization of a potentially complex structured value. | |
![]() | |
constexpr | interface (const interface &)=delete |
Not copyable. | |
auto | operator= (interface &&)=delete |
Not move assignable. | |
auto | operator= (const interface &)=delete |
Not copy assignable. | |
Additional Inherited Members | |
![]() | |
constexpr | interface () noexcept=default |
Default constructible by derived. | |
constexpr | interface (interface &&) noexcept=default |
Move constructible by derived. | |
Interface for serialization write backends.