libopenraw
OpenRaw::IO::Stream Class Referenceabstract

base virtual class for IO More...

#include <stream.hpp>

Inheritance diagram for OpenRaw::IO::Stream:
OpenRaw::IO::File OpenRaw::IO::MemStream OpenRaw::IO::StreamClone

Public Types

typedef std::shared_ptr< StreamPtr
typedef ::or_error Error

Public Member Functions

 Stream (const char *filename)
virtual Error open ()=0
virtual int close ()=0
virtual int seek (off_t offset, int whence)=0
virtual int read (void *buf, size_t count)=0
virtual off_t filesize ()=0
Error get_error ()
const std::string & get_path () const
uint8_t readByte () noexcept(false)

Protected Member Functions

void set_error (Error error)

Detailed Description

base virtual class for IO

Definition at line 41 of file stream.hpp.

Member Typedef Documentation

◆ Error

typedef ::or_error OpenRaw::IO::Stream::Error

Error type.

See also
or_error

Definition at line 54 of file stream.hpp.

◆ Ptr

typedef std::shared_ptr<Stream> OpenRaw::IO::Stream::Ptr

Definition at line 44 of file stream.hpp.

Constructor & Destructor Documentation

◆ Stream()

OpenRaw::IO::Stream::Stream ( const char * filename)

Construct the file

Parameters
filenamethe full uri for the file

Definition at line 30 of file stream.cpp.

Referenced by OpenRaw::IO::File::File().

◆ ~Stream()

OpenRaw::IO::Stream::~Stream ( )
virtual

Definition at line 36 of file stream.cpp.

Member Function Documentation

◆ close()

virtual int OpenRaw::IO::Stream::close ( )
pure virtual

◆ get_error()

Error OpenRaw::IO::Stream::get_error ( )
inline

Definition at line 69 of file stream.hpp.

◆ get_path()

const std::string & OpenRaw::IO::Stream::get_path ( ) const
inline

get the uri path of the file

Definition at line 75 of file stream.hpp.

Referenced by OpenRaw::IO::File::open().

◆ open()

virtual Error OpenRaw::IO::Stream::open ( )
pure virtual

◆ read()

virtual int OpenRaw::IO::Stream::read ( void * buf,
size_t count )
pure virtual

read in the file. Semantics are similar to POSIX read()

Implemented in File, OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.

◆ readByte()

uint8_t OpenRaw::IO::Stream::readByte ( )

Definition at line 40 of file stream.cpp.

◆ seek()

virtual int OpenRaw::IO::Stream::seek ( off_t offset,
int whence )
pure virtual

seek in the file. Semantics are similar to POSIX lseek()

Implemented in File, OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.

◆ set_error()

void OpenRaw::IO::Stream::set_error ( Error error)
inlineprotected

Definition at line 82 of file stream.hpp.


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