Disk ARchive  2.6.8
Full featured and portable backup and archiving tool
Public Member Functions | Private Attributes | List of all members
libdar::messaging_encode Class Reference

encoding messages to be sent More...

#include <messaging.hpp>

Public Member Functions

 messaging_encode ()
 constructor
 
 messaging_encode (const messaging_encode &ref)=default
 
 messaging_encode (messaging_encode &&ref) noexcept=default
 
messaging_encodeoperator= (const messaging_encode &ref)=default
 
messaging_encodeoperator= (messaging_encode &&ref) noexcept=default
 
void clear ()
 reset the object to its initial state
 
void set_type (msg_type val)
 define the type of the message to generate
 
void set_infinint (const infinint &val)
 add infininit attribute
 
void set_U_I (U_I val)
 add U_I attribute
 
void set_string (const std::string &val)
 add string attribute
 
void set_bool (bool val)
 set boolean attribute
 
void set_label (const label &val)
 set label attribute
 
void reset_get_block ()
 set the read block pointer to the first block
 
bool get_block (char *ptr, unsigned int &size)
 

Private Attributes

msg_type msgt
 
memory_file buffer
 

Detailed Description

encoding messages to be sent

Definition at line 132 of file messaging.hpp.

Member Function Documentation

◆ get_block()

bool libdar::messaging_encode::get_block ( char *  ptr,
unsigned int &  size 
)

read the next block

Parameters
[in]ptris the address where to write the next block of the message
[in,out]sizeis the maximum amount of byte that can be written to ptr and is modified by this call to the effective number of byte written to ptr
Returns
true if the whole message could be written to block, else false is returned an a new call to get_block is necessary to write down the rest of the message up to the time get_block() returns true
Note
for data encoding, the message is a single byte length. this byte has been placed before the data before in the same block

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