Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_HandleBlockInStream Class Reference

Inheritance diagram for CP_HandleBlockInStream:

CP_InStream List of all members.

Public Member Functions

Constructor / Destructor
 CP_HandleBlockInStream (const CP_HandleBlock *inBlock, bool inHasHeader=true)
 Constructor.
 CP_HandleBlockInStream (const CP_HandleBlock *inBlock, UInt32 inBeginPosition, bool inHasHeader=true)
virtual ~CP_HandleBlockInStream () throw ()
 Destructor.
Getters
virtual UInt32 GetLength () const
HandleBlock
const CP_HandleBlockGetHandleBlock () const
void SetHandleBlock (const CP_HandleBlock *inHandleBlock)
Positioners
virtual UInt32 GetPosition () const
virtual void SetPosition (UInt32 inPosition)

Protected Member Functions

Reading
virtual UInt32 OnReadBytes (void *inDestBuffer, UInt32 inNumberBytes)

Protected Attributes

const CP_HandleBlockfHandleBlock
UInt32 fCurrentPosition
bool fHasReadHeader
bool fNeedsByteSwap
UInt16 fCPLATStreamVersion
bool fHasTaggedData
bool fHasHeader
char fDesiredEdian

Constructor & Destructor Documentation

CP_HandleBlockInStream::CP_HandleBlockInStream const CP_HandleBlock inBlock,
bool  inHasHeader = true
 

Constructor.

Parameters:
inBlock The handle block that we are going to read our data from.
inHasHeader Flag to indicate if the data in the file was written by CPLAT, and therefore will have a header at the beginning of the streamed data.
Exceptions:
none 

CP_HandleBlockInStream::CP_HandleBlockInStream const CP_HandleBlock inBlock,
UInt32  inBeginPosition,
bool  inHasHeader = true
 

Constructor.

Parameters:
inBlock The handle block that we are going to read our data from.
inBeginPosition The initial position within our block to begin reading data from.
inHasHeader Flag to indicate if the data in the file was written by CPLAT, and therefore will have a header at the beginning of the streamed data.
Exceptions:
none 

CP_HandleBlockInStream::~CP_HandleBlockInStream  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

UInt32 CP_HandleBlockInStream::GetLength  )  const [virtual]
 

Returns the length of the handle block used with this stream.

Exceptions:
OSStatus exceptions from the handle block.
Returns:
SInt32 const The length of the handle block used with this stream.

Implements CP_InStream.

const CP_HandleBlock* CP_HandleBlockInStream::GetHandleBlock  )  const
 

void CP_HandleBlockInStream::SetHandleBlock const CP_HandleBlock inHandleBlock  ) 
 

Sets the CP_HandleBlock associated with this stream. The handle block must exist as long as this object still needs it.

Parameters:
inHandleBlock The handle block object to associate with this stream.
Exceptions:
none 
Returns:
void

UInt32 CP_HandleBlockInStream::GetPosition  )  const [virtual]
 

Returns the current position marker to indicate the current position we are writing to our stream.

Exceptions:
none 
Returns:
SInt32 const The current position of the handle block marker.

Implements CP_InStream.

void CP_HandleBlockInStream::SetPosition UInt32  inNewPosition  )  [virtual]
 

Sets the current position marker to mark the current position in our output stream.

Parameters:
inPosition The position to set the current stream position marker to.
Exceptions:
none 
Returns:
void

Implements CP_InStream.

UInt32 CP_HandleBlockInStream::OnReadBytes void *  inBuffer,
UInt32  inBytesToRead
[protected, virtual]
 

Reads data from our handle block, placing the data in the passed in buffer. The buffer should be at least as large as the passed in inBytesToRead. This method will return the actual number of bytes read.

Parameters:
inBuffer The buffer to hold the data.
inBytesToRead The number of bytes to read from the buffer. The buffer should be at least this many bytes.
Exceptions:
none 
Returns:
Actual number of bytes read.

Implements CP_InStream.

UInt32 CP_InStream::ReadBytes void *  inDestBuffer,
UInt32  inNumberBytes,
bool  inAllowPartialData = false
[virtual, inherited]
 

Reads some data from the stream. Used by the >> operators to read the data, but can also be used in an application.

Parameters:
inDestBuffer Location to read the data into.
inNumberBytes Length of the buffer to hold the data.
inAllowPartialData If true, less than the requested number of bytes may be read. Otherwise, if not enough data is available, an exception is raised.
Exceptions:
CP_OSErrorException(eofErr) raised if inAllowPartialData is false and not enough data can be read.
Returns:
UInt32 The number of bytes actually read. If inAllowPartialData is true, this may be less than the requested number of bytes.

bool CP_InStream::NeedsByteSwap  )  const [inherited]
 

void CP_InStream::SetNeedsByteSwap bool  doSwap  )  [inherited]
 

UInt16 CP_InStream::GetStreamVersion  )  const [inherited]
 

bool CP_InStream::HasHeader  )  const [inherited]
 

bool CP_InStream::IsEOF  )  const [virtual, inherited]
 

Returns true if the stream has reached the end.

Exceptions:
none 
Returns:
bool const True if the stream is at the end.

Reimplemented in CP_SocketInStream.

bool CP_InStream::HasTaggedData  )  const [inherited]
 

Returns true if the data type is written before each elemement. This is intended in debugging the stream data since it increases the size of the resulting stream.

Exceptions:
none 
Returns:
bool const True, if the stream has tags before each data element.

SInt32 CP_InStream::GetTag  )  [inherited]
 

Reads the tag before a data element if the streamed data has tagged data.

Exceptions:
none 
Returns:
SInt32 The tag being read.

void CP_InStream::ReadHeader  )  [protected, virtual, inherited]
 

Reads the header portion of our stream.

Exceptions:
none 
Returns:
void


Member Data Documentation

const CP_HandleBlock* CP_HandleBlockInStream::fHandleBlock [protected]
 

UInt32 CP_HandleBlockInStream::fCurrentPosition [protected]
 

The CP_HandleBlock object we are reading from.

bool CP_InStream::fHasReadHeader [protected, inherited]
 

bool CP_InStream::fNeedsByteSwap [protected, inherited]
 

Flag to indicate if we have read the header.

UInt16 CP_InStream::fCPLATStreamVersion [protected, inherited]
 

Flag to indicate if we need to byte swap the data.

bool CP_InStream::fHasTaggedData [protected, inherited]
 

CPLAT stream version used to write this stream.

bool CP_InStream::fHasHeader [protected, inherited]
 

Flag to indicate if the data has its type written out also.

char CP_InStream::fDesiredEdian [protected, inherited]
 

Flag to indicate if we are want to read data not created by this framework and therefore won't have a correct header.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:44 2005 for CPLAT by  doxygen 1.4.0