TuttleOFX  1
InStream Class Reference

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

Detailed Description

Input Stream for reading files.

Definition at line 50 of file DPXStream.h.


Member Enumeration Documentation

file pointing positioning offset

Enumerator:
kStart 

beginning of the file

kCurrent 

current file pointer

kEnd 

end of the file

Definition at line 59 of file DPXStream.h.


Constructor & Destructor Documentation

InStream::InStream ( )

Constructor.

Definition at line 42 of file InStream.cpp.

InStream::~InStream ( ) [virtual]

Destructor.

Definition at line 47 of file InStream.cpp.


Member Function Documentation

void InStream::Close ( ) [virtual]

Close file.

Definition at line 63 of file InStream.cpp.

References fp.

Referenced by Open().

bool InStream::EndOfFile ( ) const [virtual]

Query if end of file has been reached.

Returns:
end of file true/false

Definition at line 117 of file InStream.cpp.

References fp.

bool InStream::Open ( const char *  fn) [virtual]

Open file.

Parameters:
fnFile name
Returns:
success true/false

Definition at line 52 of file InStream.cpp.

References Close(), and fp.

Here is the call graph for this function:

size_t InStream::Read ( void *  buf,
const size_t  size 
) [virtual]

Read data from file.

Parameters:
bufdata buffer
sizebytes to read
Returns:
number of bytes 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.

Parameters:
bufdata buffer
sizebytes to read
Returns:
number of bytes read

Definition at line 111 of file InStream.cpp.

References Read().

Here is the call graph for this function:

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]

Seek to a position in the file.

Parameters:
offsetoffset from originating position
originoriginating position
Returns:
success true/false

Definition at line 80 of file InStream.cpp.

References fp, kCurrent, kEnd, and kStart.


Field Documentation

FILE* InStream::fp [protected]

Definition at line 126 of file DPXStream.h.

Referenced by Close(), EndOfFile(), Open(), Read(), Rewind(), and Seek().


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