24 #include <sys/types.h>
31 #include <libopenraw/consts.h>
47 typedef std::shared_ptr<Stream>
Ptr;
51 Stream(
const char *filename);
68 virtual int seek(off_t offset,
int whence) = 0;
70 virtual int read(
void *buf,
size_t count) = 0;
98 std::string m_fileName;
base virtual class for IO
const std::string & get_path() const
Get the uri path of the file.
virtual Error open()=0
open the file
virtual int close()=0
close the file
::or_error Error
Error type.
Error get_error() const
Obtain the last error.
Stream(const char *filename)
Construct the stream.
virtual int read(void *buf, size_t count)=0
read in the file. Semantics are similar to POSIX read()
std::shared_ptr< Stream > Ptr
virtual off_t filesize()=0
Return the filesize.
void set_error(Error error)
Set the error. This is calld by implementations.
virtual int seek(off_t offset, int whence)=0
seek in the file. Semantics are similar to POSIX lseek()
uint8_t readByte() noexcept(false)
Read a single byte.
or_error
Error codes returned by libopenraw.
Global namespace for libopenraw.