libcdoc 0.5.0
libcdoc::FileListSource Struct Reference

#include <Io.h>

Inherits libcdoc::MultiDataSource.

Public Member Functions

 FileListSource (const std::string &base, const std::vector< std::string > &files)
result_t read (uint8_t *dst, size_t size) noexcept final
 read bytes from input object
bool isError () noexcept final
 check whether DataConsumer is in error state
bool isEof () noexcept final
 check whether DataConsumer is reached to the end of data
result_t getNumComponents () final
result_t next (std::string &name, int64_t &size) final
Public Member Functions inherited from libcdoc::MultiDataSource
result_t next (FileInfo &info)
Public Member Functions inherited from libcdoc::DataSource
 DataSource ()=default
virtual ~DataSource ()=default
virtual result_t seek (size_t pos)
 set stream input pointer
virtual std::string getLastErrorStr (result_t code) const
 get textual description of the last error
result_t skip (size_t size)
 skip specified number of bytes
result_t readAll (DataConsumer &dst) noexcept
 read all data and writes to output object
 DataSource (const DataSource &)=delete
DataSourceoperator= (const DataSource &)=delete

Protected Attributes

std::filesystem::path _base
const std::vector< std::string > & _files
int64_t _current = -1
std::ifstream _ifs

Constructor & Destructor Documentation

◆ FileListSource()

libcdoc::FileListSource::FileListSource ( const std::string & base,
const std::vector< std::string > & files )

Member Function Documentation

◆ getNumComponents()

result_t libcdoc::FileListSource::getNumComponents ( )
finalvirtual

Reimplemented from libcdoc::MultiDataSource.

References getNumComponents().

Referenced by getNumComponents().

◆ isEof()

bool libcdoc::FileListSource::isEof ( )
finalvirtualnoexcept

check whether DataConsumer is reached to the end of data

Returns
true if end of stream

Reimplemented from libcdoc::DataSource.

References isEof().

Referenced by isEof().

◆ isError()

bool libcdoc::FileListSource::isError ( )
finalvirtualnoexcept

check whether DataConsumer is in error state

Returns
true if error state

Reimplemented from libcdoc::DataSource.

◆ next()

result_t libcdoc::FileListSource::next ( std::string & name,
int64_t & size )
finalvirtual

Implements libcdoc::MultiDataSource.

References next().

Referenced by next().

◆ read()

result_t libcdoc::FileListSource::read ( uint8_t * dst,
size_t size )
finalvirtualnoexcept

read bytes from input object

The following invariant holds:

  • if there is neither error nor eof then result == size
  • if there is no errors but end of stream is reached then 0 <= result <= size
  • if there is error then result < 0
    Parameters
    dstthe destination block
    sizethe number of bytes to read
    Returns
    the number of bytes read or error code

Reimplemented from libcdoc::DataSource.

Member Data Documentation

◆ _base

std::filesystem::path libcdoc::FileListSource::_base
protected

◆ _current

int64_t libcdoc::FileListSource::_current = -1
protected

◆ _files

const std::vector<std::string>& libcdoc::FileListSource::_files
protected

◆ _ifs

std::ifstream libcdoc::FileListSource::_ifs
protected

The documentation for this struct was generated from the following file:
  • Io.h