base virtual class for IO More...
#include <stream.h>
Public Types | |
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 () throw (Internals::IOException) |
Protected Member Functions | |
void | set_error (Error error) |
base virtual class for IO
Definition at line 40 of file stream.h.
typedef ::or_error OpenRaw::IO::Stream::Error |
OpenRaw::IO::Stream::Stream | ( | const char * | filename | ) |
Construct the file
filename | the full uri for the file |
Definition at line 28 of file stream.cpp.
virtual int OpenRaw::IO::Stream::close | ( | ) | [pure virtual] |
close the file
Implemented in OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.
Referenced by OpenRaw::Internals::RawContainer::~RawContainer().
const std::string& OpenRaw::IO::Stream::get_path | ( | ) | const [inline] |
get the uri path of the file
Definition at line 73 of file stream.h.
Referenced by OpenRaw::IO::File::open().
virtual Error OpenRaw::IO::Stream::open | ( | ) | [pure virtual] |
open the file
Implemented in OpenRaw::IO::File, OpenRaw::IO::MemStream, and OpenRaw::IO::StreamClone.
Referenced by OpenRaw::Internals::RawContainer::RawContainer().
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 OpenRaw::Internals::RawContainer::fetchData(), OpenRaw::Internals::IFDDir::load(), OpenRaw::IO::StreamClone::read(), OpenRaw::Internals::RawContainer::readInt16(), OpenRaw::Internals::RawContainer::readInt32(), OpenRaw::Internals::RawContainer::readUInt16(), and OpenRaw::Internals::RawContainer::readUInt32().
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::CRWFile::_getRawData(), OpenRaw::Internals::RawContainer::fetchData(), OpenRaw::Internals::IFDFileContainer::getDirectoryDataSize(), OpenRaw::Internals::MRW::DataBlock::int8_val(), OpenRaw::Internals::IFDDir::load(), OpenRaw::Internals::MRWContainer::locateDirsPreHook(), OpenRaw::Internals::IFDDir::nextIFD(), OpenRaw::IO::StreamClone::open(), OpenRaw::Internals::RawContainer::RawContainer(), OpenRaw::Internals::CIFF::ImageSpec::readFrom(), OpenRaw::IO::StreamClone::seek(), OpenRaw::Internals::MRW::DataBlock::uint16_val(), and OpenRaw::Internals::MRW::DataBlock::uint8_val().