TuttleOFX
1
|
Input Stream for reading files. More...
#include <DPXStream.h>
Public Types | |
enum | Origin { kStart, kCurrent, kEnd } |
file pointing positioning offset More... | |
Public Member Functions | |
InStream () | |
Constructor. | |
virtual | ~InStream () |
Destructor. | |
virtual bool | Open (const char *fn) |
Open file. | |
virtual void | Close () |
Close file. | |
virtual void | Rewind () |
Rewind file pointer to beginning of file. | |
virtual size_t | Read (void *buf, const size_t size) |
Read data from file. | |
virtual size_t | ReadDirect (void *buf, const size_t size) |
Read data from file without any buffering as fast as possible. | |
virtual bool | EndOfFile () const |
Query if end of file has been reached. | |
virtual bool | Seek (long offset, Origin origin) |
Seek to a position in the file. | |
Protected Attributes | |
FILE * | fp |
Input Stream for reading files.
Definition at line 50 of file DPXStream.h.
enum InStream::Origin |
file pointing positioning offset
Definition at line 59 of file DPXStream.h.
InStream::InStream | ( | ) |
Constructor.
Definition at line 42 of file InStream.cpp.
InStream::~InStream | ( | ) | [virtual] |
Destructor.
Definition at line 47 of file InStream.cpp.
void InStream::Close | ( | ) | [virtual] |
bool InStream::EndOfFile | ( | ) | const [virtual] |
Query if end of file has been reached.
Definition at line 117 of file InStream.cpp.
References fp.
bool InStream::Open | ( | const char * | fn | ) | [virtual] |
Open file.
fn | File name |
Definition at line 52 of file InStream.cpp.
size_t InStream::Read | ( | void * | buf, |
const size_t | size | ||
) | [virtual] |
Read data from file.
buf | data buffer |
size | bytes to read |
Definition at line 103 of file InStream.cpp.
References fp.
Referenced by dpx::IdentifyFile(), dpx::Header::Read(), and ReadDirect().
size_t InStream::ReadDirect | ( | void * | buf, |
const size_t | size | ||
) | [virtual] |
Read data from file without any buffering as fast as possible.
buf | data buffer |
size | bytes to read |
Definition at line 111 of file InStream.cpp.
References Read().
void InStream::Rewind | ( | ) | [virtual] |
Rewind file pointer to beginning of file.
Definition at line 73 of file InStream.cpp.
References fp.
Referenced by dpx::IdentifyFile(), and dpx::Header::Read().
bool InStream::Seek | ( | long | offset, |
Origin | origin | ||
) | [virtual] |
FILE* InStream::fp [protected] |
Definition at line 126 of file DPXStream.h.
Referenced by Close(), EndOfFile(), Open(), Read(), Rewind(), and Seek().