#include <ContainerImplementations.h>
Inherits std::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. | |
| DigitalSpaces::DataResourceIStream::DataResourceIStream | ( | DIDataResource * | pDataResource, | |
| unsigned int | bufferChunkSize = 512 | |||
| ) |
Default constructor that prepares the derived std::istream to use the supplied DIDataResource.
| 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. |
This member is std::streambuf derived implementation that performs the real work.
1.5.6