libcdoc 0.1.8
libcdoc::MultiDataConsumer Struct Referenceabstract

An abstract base class for multi-stream consumers. More...

#include <Io.h>

Inherits libcdoc::DataConsumer.

Inherited by libcdoc::FileListConsumer.

Public Member Functions

virtual ~MultiDataConsumer ()=default
 
virtual result_t open (const std::string &name, int64_t size)=0
 create a new named sub-stream
 
- Public Member Functions inherited from libcdoc::DataConsumer
 DataConsumer ()=default
 
virtual ~DataConsumer ()=default
 
virtual result_t write (const uint8_t *src, size_t size)=0
 write write bytes to output object
 
virtual result_t close ()=0
 informs DataConsumer that the writing is finished
 
virtual bool isError ()=0
 checks whether DataSource is in error state
 
virtual std::string getLastErrorStr (result_t code) const
 get textual description of the last error
 
result_t write (const std::vector< uint8_t > &src)
 write all bytes in vector
 
result_t write (const std::string &src)
 write all bytes in string
 
result_t writeAll (DataSource &src)
 write all data from input object
 
 DataConsumer (const DataConsumer &)=delete
 
DataConsumeroperator= (const DataConsumer &)=delete
 

Detailed Description

An abstract base class for multi-stream consumers.

A new sub-stream is created by open and finished either by the next open or by closing the whole stream.

Constructor & Destructor Documentation

◆ ~MultiDataConsumer()

virtual libcdoc::MultiDataConsumer::~MultiDataConsumer ( )
virtualdefault

Member Function Documentation

◆ open()

virtual result_t libcdoc::MultiDataConsumer::open ( const std::string &  name,
int64_t  size 
)
pure virtual

create a new named sub-stream

Creates a new named sub-stream. It is up to implementation to handle the name and optional size.

Parameters
namethe name of sub-stream
sizethe size of sub-stream or -1 if unknown at creation time
Returns
error code or OK

Implemented in libcdoc::FileListConsumer.


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