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

File IO stream. More...

#include <file.hpp>

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

Public Member Functions

 File (const char *filename)
 
 File (const File &f)=delete
 
Fileoperator= (const File &)=delete
 
virtual Error open () override
 Open the file. More...
 
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

File IO stream.

Definition at line 39 of file file.hpp.

Constructor & Destructor Documentation

◆ File()

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

Contruct the file

Parameters
filenamethe full pathname for the file

Definition at line 35 of file file.cpp.

Member Function Documentation

◆ open()

File::Error OpenRaw::IO::File::open ( )
overridevirtual

Open the file.

Return OR_ERROR_ALREADY_OPEN if it is already open. The stream is still usable after that.

Implements OpenRaw::IO::Stream.

Definition at line 49 of file file.cpp.

References OpenRaw::IO::Stream::get_path(), OR_ERROR_ALREADY_OPEN, OR_ERROR_CANT_OPEN, OR_ERROR_NONE, and raw_open().


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