userver: dump::Writer Class Reference
Loading...
Searching...
No Matches
dump::Writer Class Referenceabstract

A general interface for binary data output. More...

#include <userver/dump/operations.hpp>

+ Inheritance diagram for dump::Writer:

Public Member Functions

template<typename T >
void Write (const T &data)
 Writes binary data.
 
virtual void Finish ()=0
 Must be called once all data has been written.
 

Protected Member Functions

virtual void WriteRaw (std::string_view data)=0
 Writes binary data.
 

Friends

void WriteStringViewUnsafe (Writer &writer, std::string_view value)
 Writes a non-size-prefixed std::string_view
 

Detailed Description

A general interface for binary data output.

Definition at line 23 of file operations.hpp.

Member Function Documentation

◆ Finish()

virtual void dump::Writer::Finish ( )
pure virtual

Must be called once all data has been written.

Warning
This method must not be called from within Write/Read
Exceptions
`Error`on write operation failure

Implemented in dump::EncryptedWriter, dump::FileWriter, and dump::MockWriter.

◆ Write()

template<typename T >
void dump::Writer::Write ( const T &  data)

Writes binary data.

Calls ADL-found Write(writer, data)

Exceptions
`Error`and any user-thrown std::exception

Definition at line 90 of file operations.hpp.

◆ WriteRaw()

virtual void dump::Writer::WriteRaw ( std::string_view  data)
protectedpure virtual

Writes binary data.

Unlike Write, doesn't write the size of data

Exceptions
`Error`on write operation failure

Friends And Related Symbol Documentation

◆ WriteStringViewUnsafe

void WriteStringViewUnsafe ( Writer writer,
std::string_view  value 
)
friend

Writes a non-size-prefixed std::string_view

Note
writer.Write(str) should normally be used instead to write strings

The documentation for this class was generated from the following file: