DigitalSpaces::DataResourceIStream Class Reference
[DataResources]

#include <ContainerImplementations.h>

Inherits std::istream.


Detailed Description

Class that wraps a DIDataResource to make it usable as a STL istream.

Example usage:

                        DigitalSpaces::DIDataResourceManager* pResourceManager = DigitalSpaces::GetSingleFactoryWithInterface< DigitalSpaces::DIDataResourceManager >();
                        DigitalSpaces::DIDataResource* pDataResource = pResourceManager->GetResource( "http://example.com/example.file" );
                        
                        DigitalSpaces::DataResourceIStream datastream( pDatResource );
                        
                        // Use the DataResourceIStream the same as any std::istream derived object:
                        std::string dataString;
                        datatream >> dataString;

Using this class is a convenience, replacing

                        DigitalSpaces::DataResourceStreambuf databuf( pDataResource, 512);
                        std::istream datastream( databuf );

Public Member Functions

 DataResourceIStream (DIDataResource *pDataResource, unsigned int bufferChunkSize=512)
 Default constructor that prepares the derived std::istream to use the supplied DIDataResource.

Protected Attributes

DataResourceStreambuf m_streambuf
 This member is std::streambuf derived implementation that performs the real work.

Constructor & Destructor Documentation

DigitalSpaces::DataResourceIStream::DataResourceIStream ( DIDataResource pDataResource,
unsigned int  bufferChunkSize = 512 
)

Default constructor that prepares the derived std::istream to use the supplied DIDataResource.

Parameters:
pDataResource The data resource to wrap. For predictable results, this should not have been used (had GetCharacters called).
bufferChunkSize Sets the maximum amount of data that will be extracted from the DIDataResource at one time. Setting this to 0 will cause no data to ever be transferred, and the implementation will halt while waiting for data to transfer.


Field Documentation

This member is std::streambuf derived implementation that performs the real work.


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

Generated on Sun Aug 31 17:46:33 2008 for Digital Spaces by  doxygen 1.5.6