libopenraw  0.3.7
Public Member Functions | List of all members
OpenRaw::IO::MemStream Class Reference

Memory based stream to read memory like a file IO. More...

#include <memstream.hpp>

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

Public Member Functions

 MemStream (const uint8_t *ptr, size_t s)
 Construct a new memory base stream. More...
 
 MemStream (const MemStream &f)=delete
 
MemStreamoperator= (const MemStream &)=delete
 
virtual or_error open () override
 open the file
 
virtual int close () override
 close the file
 
virtual int seek (off_t offset, int whence) override
 seek in the file. Semantics are similar to POSIX lseek()
 
virtual int read (void *buf, size_t count) override
 read in the file. Semantics are similar to POSIX read()
 
virtual off_t filesize () override
 Return the filesize.
 
- Public Member Functions inherited from OpenRaw::IO::Stream
 Stream (const char *filename)
 Construct the stream. More...
 
 Stream (const Stream &f)=delete
 
Streamoperator= (const Stream &)=delete
 
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.
 

Additional Inherited Members

- Public Types inherited from OpenRaw::IO::Stream
typedef std::shared_ptr< StreamPtr
 
typedef ::or_error Error
 Error type. More...
 
- Protected Member Functions inherited from OpenRaw::IO::Stream
void set_error (Error error)
 Set the error. This is calld by implementations.
 

Detailed Description

Memory based stream to read memory like a file IO.

Definition at line 38 of file memstream.hpp.

Constructor & Destructor Documentation

◆ MemStream()

OpenRaw::IO::MemStream::MemStream ( const uint8_t *  ptr,
size_t  s 
)

Construct a new memory base stream.

Parameters
ptrthe pointer to the memory area
sthe size of the memory area for the stream.

Definition at line 36 of file memstream.cpp.


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