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

CP_PtrBlockInStream Class Reference

Inheritance diagram for CP_PtrBlockInStream:

CP_InStream List of all members.

Public Member Functions

Positioning
virtual bool IsEOF () const
Positioning
virtual bool IsEOF () const
Constructor / Destructor
 CP_PtrBlockInStream (const CP_PtrBlock *inBlock, bool inHasHeader=true)
 Constructor.
 CP_PtrBlockInStream (const CP_PtrBlock *inBlock, UInt32 inBeginPosition, bool inHasHeader=true)
virtual ~CP_PtrBlockInStream () throw ()
 Destructor.
Getters
virtual UInt32 GetLength () const
PtrBlock
const CP_PtrBlockGetPtrBlock () const
void SetPtrBlock (const CP_PtrBlock *inPtrBlock)
Positioners
virtual UInt32 GetPosition () const
virtual void SetPosition (UInt32 inPosition)
Positioning
virtual bool IsEOF () const

Protected Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

CP_PtrBlockInStream::CP_PtrBlockInStream const CP_PtrBlock 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_PtrBlockInStream::CP_PtrBlockInStream const CP_PtrBlock 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_PtrBlockInStream::~CP_PtrBlockInStream  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

UInt32 CP_PtrBlockInStream::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_PtrBlock* CP_PtrBlockInStream::GetPtrBlock  )  const
 

void CP_PtrBlockInStream::SetPtrBlock const CP_PtrBlock inPtrBlock  ) 
 

Sets the CP_PtrBlock associated with this stream. The CP_PtrBlock's lifetime must last until the stream is deallocated or until another block is attached to the stream through this call.

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

UInt32 CP_PtrBlockInStream::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_PtrBlockInStream::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_PtrBlockInStream::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_PtrBlock* CP_PtrBlockInStream::fPtrBlock [protected]
 

UInt32 CP_PtrBlockInStream::fCurrentPosition [protected]
 

The CP_PtrBlock 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:02:02 2005 for CPLAT by  doxygen 1.4.0