libopenraw
Public Types | Public Member Functions | Protected Member Functions | List of all members
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.

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.

References read().

Referenced by get_path().

Member Function Documentation

◆ close()

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

◆ 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.

References Stream().

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 OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.

Referenced by Stream().

◆ 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 OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.

Referenced by OpenRaw::Internals::LJpegDecompressor::setSlices().


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