libopenraw  0.3.7
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
 Error type. More...
 

Public Member Functions

 Stream (const char *filename)
 Construct the stream. More...
 
 Stream (const Stream &f)=delete
 
Streamoperator= (const Stream &)=delete
 
virtual Error open ()=0
 open the file
 
virtual int close ()=0
 close the file
 
virtual int seek (off_t offset, int whence)=0
 seek in the file. Semantics are similar to POSIX lseek()
 
virtual int read (void *buf, size_t count)=0
 read in the file. Semantics are similar to POSIX read()
 
virtual off_t filesize ()=0
 Return the filesize.
 
Error get_error () const
 Obtain the last error.
 
const std::string & get_path () const
 Get the uri path of the file.
 
uint8_t readByte () noexcept(false)
 Read a single byte.
 

Protected Member Functions

void set_error (Error error)
 Set the error. This is calld by implementations.
 

Detailed Description

base virtual class for IO

Definition at line 43 of file stream.hpp.

Member Typedef Documentation

◆ Error

Error type.

See also
or_error

Definition at line 60 of file stream.hpp.

◆ Ptr

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

Shared Ptr stream type

Definition at line 47 of file stream.hpp.

Constructor & Destructor Documentation

◆ Stream()

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

Construct the stream.

Parameters
filenamethe full uri for the file

Definition at line 30 of file stream.cpp.


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