DWFCore::DWFFileInputStream Class Reference

#include "dwfcore/FileInputStream.h"

Inheritance diagram for DWFCore::DWFFileInputStream:

Inheritance graph
[legend]
Collaboration diagram for DWFCore::DWFFileInputStream:

Collaboration graph
[legend]
List of all members.

Detailed Description

An input stream object that provides streaming read functionality from a file descriptor.

Since:
1.0.1
Examples:

Digest/main.cpp, and Files/Files.cpp.

Definition at line 45 of file FileInputStream.h.

Public Member Functions

_DWFCORE_API DWFFileInputStream () throw ()
virtual _DWFCORE_API ~DWFFileInputStream () throw ()
_DWFCORE_API void attach (DWFFileDescriptor *pFileDescriptor, bool bOwnDescriptor) throw ( DWFException )
_DWFCORE_API void detach () throw ( DWFException )
_DWFCORE_API size_t available () const throw ( DWFException )
_DWFCORE_API size_t read (void *pBuffer, size_t nBytesToRead) throw ( DWFException )
_DWFCORE_API off_t seek (int eOrigin, off_t nOffset) throw ( DWFException )
_DWFCORE_API const DWFFileDescriptordescriptor () const throw ()


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFFileInputStream::DWFFileInputStream  )  throw ()
 

Constructor

Exceptions:
None 

virtual _DWFCORE_API DWFCore::DWFFileInputStream::~DWFFileInputStream  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFCORE_API void DWFCore::DWFFileInputStream::attach DWFFileDescriptor pFileDescriptor,
bool  bOwnDescriptor
throw ( DWFException )
 

Binds this stream to the file descriptor.

Parameters:
pFileDescriptor A file descriptor from which to stream the source data. This object should be allocated with the DWFCORE_ALLOC_OBJECT macro if ownership will be transferred.
bOwnDescriptor If true, this object will assume ownership of pFileDescriptor and delete it as necessary using DWFCORE_FREE_OBJECT. If false, the caller retains ownership of pFileDescriptor and is responsible for deleting it.
Exceptions:
DWFException 
Examples:
Digest/main.cpp, and Files/Files.cpp.

_DWFCORE_API size_t DWFCore::DWFFileInputStream::available  )  const throw ( DWFException ) [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 

Implements DWFCore::DWFInputStream.

Examples:
Files/Files.cpp.

_DWFCORE_API const DWFFileDescriptor* DWFCore::DWFFileInputStream::descriptor  )  const throw () [inline]
 

Returns the file descriptor to which this stream is bound.

Returns:
The file descriptor.
Exceptions:
DWFException 
Examples:
Files/Files.cpp.

Definition at line 149 of file FileInputStream.h.

_DWFCORE_API void DWFCore::DWFFileInputStream::detach  )  throw ( DWFException )
 

Unbinds this stream from a previously bound file descriptor.

Exceptions:
DWFException 

_DWFCORE_API size_t DWFCore::DWFFileInputStream::read void *  pBuffer,
size_t  nBytesToRead
throw ( DWFException ) [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.
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 

Implements DWFCore::DWFInputStream.

Examples:
Files/Files.cpp.

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

Repositions the file descriptor for subsequent read invocations.

Warning:
This method may not be supported by all file descriptors.
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 

Implements DWFCore::DWFInputStream.


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