DWFCore::DWFInputStream Interface Reference

#include "dwfcore/InputStream.h"

Inheritance diagram for DWFCore::DWFInputStream:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interface for input (reader) streams.

Since:
1.0.1
This class defines a contract for a streamable data source. Implementors of this interface are considered valid sources from which input data may be obtained.

Generally, the stream consumer would read from the stream until it reports zero available bytes:

                size_t          nBytesRead = 0;
                DWFInputStream* pInputStream;
   
                while (pInputStream->available() > 0)
                {
                    nBytesRead = pInputStream->read( pBuffer, nBufferBytes );
                }
Examples:

Files/Files.cpp.

Definition at line 60 of file InputStream.h.

Public Member Functions

virtual _DWFCORE_API ~DWFInputStream () throw ()
virtual _DWFCORE_API size_t available () const =0 throw ( DWFException )
virtual _DWFCORE_API size_t read (void *pBuffer, size_t nBytesToRead)=0 throw ( DWFException )
virtual _DWFCORE_API off_t seek (int eOrigin, off_t nOffset)=0 throw ( DWFException )

Protected Member Functions

_DWFCORE_API DWFInputStream () throw ()


Constructor & Destructor Documentation

virtual _DWFCORE_API DWFCore::DWFInputStream::~DWFInputStream  )  throw () [inline, virtual]
 

Destructor

Exceptions:
None 

Definition at line 71 of file InputStream.h.

_DWFCORE_API DWFCore::DWFInputStream::DWFInputStream  )  throw () [inline, protected]
 

Constructor

Exceptions:
None 

Definition at line 134 of file InputStream.h.


Member Function Documentation

virtual _DWFCORE_API size_t DWFCore::DWFInputStream::available  )  const throw ( DWFException ) [pure virtual]
 

Used to determine the availablity of data that can be provided by the stream. This method is not required to report the exact number of bytes that will be obtain from a subsequent read() invocation. This method must report zero bytes once the stream data has been expired. Once this method returns zero, it may never again report a non-zero value.

Returns:
The number of bytes available to read from the stream.
Exceptions:
DWFException 

Implemented in DWFCore::DWFBufferInputStream, DWFCore::DWFDecompressingInputStream, DWFCore::DWFDigestInputStream, DWFCore::DWFCompressingInputStream, DWFCore::DWFDecryptingInputStream, DWFCore::DWFEncryptingInputStream, DWFCore::DWFFileInputStream, DWFCore::DWFMonitoredInputStream, and DWFCore::DWFUnzippingInputStream.

virtual _DWFCORE_API size_t DWFCore::DWFInputStream::read void *  pBuffer,
size_t  nBytesToRead
throw ( DWFException ) [pure virtual]
 

Reads at most nBytesToRead from the stream into the buffer provided. The stream is not required to fill the read buffer but it must always report the number of bytes, including zero, that were obtained.

Parameters:
pBuffer A pointer to a block of memory to receive the bytes. Any implementation receiving a NULL buffer pointer should throw a DWFInvalidArgumentException.
nBytesToRead The number of bytes to copy into pBuffer. This value should not exceed the capacity of the memory block at pBuffer.
Returns:
The number of actual bytes read.
Exceptions:
DWFException 

Implemented in DWFCore::DWFBufferInputStream, DWFCore::DWFDecompressingInputStream, DWFCore::DWFDigestInputStream, DWFCore::DWFCompressingInputStream, DWFCore::DWFDecryptingInputStream, DWFCore::DWFEncryptingInputStream, DWFCore::DWFFileInputStream, DWFCore::DWFMonitoredInputStream, and DWFCore::DWFUnzippingInputStream.

virtual _DWFCORE_API off_t DWFCore::DWFInputStream::seek int  eOrigin,
off_t  nOffset
throw ( DWFException ) [pure virtual]
 

Repositions the internal cursor for subsequent read invocations. Not all implementations will support this method; it is recommended that a DWFNotImplementedException be thrown if not.

Warning:
This method may not be supported by all streams.
Parameters:
eOrigin One of SEEK_SET, SEEK_CUR or SEEK_END.
nOffset The number of bytes from eOrigin to move the internal cursor.
Returns:
The previous cursor offset before the seek.
Exceptions:
DWFException 

Implemented in DWFCore::DWFBufferInputStream, DWFCore::DWFDecompressingInputStream, DWFCore::DWFDigestInputStream, DWFCore::DWFCompressingInputStream, DWFCore::DWFDecryptingInputStream, DWFCore::DWFEncryptingInputStream, DWFCore::DWFFileInputStream, DWFCore::DWFMonitoredInputStream, and DWFCore::DWFUnzippingInputStream.


The documentation for this interface was generated from the following file:
Generated on Tue Jan 6 22:39:37 2009 for Autodesk DWF Core Library by  doxygen 1.4.5