zorba::StreamResource

#include <zorba/uri_resolvers.h>

Inherited from: zorba::Resource

Concrete Resource subclass representing access to an entity via a stream.

Public Static Functions

StreamResource *

create(std::istream *aStream, StreamReleaser aStreamReleaser, bool aIsStreamSeekable=false)

Public factory method from istream.

Public Functions

void

destroy() const =0

Destroy/clean up this Resource.

std::istream *

getStream()=0

Retrieve the istream associated with this Resource.

StreamReleaser

getStreamReleaser()=0

Retrieve the stream-releaser function.

bool

isStreamSeekable() const =0

~StreamResource()=0

Public Static Functions

create

StreamResource * create(std::istream *aStream, StreamReleaser aStreamReleaser, bool aIsStreamSeekable=false)

Public factory method from istream.

The Resource object will take memory ownership of the istream. Zorba will pass it to aStreamReleaser when it is no longer needed, so that the original client may delete it.

Parameters

aStream An istream whence to read the string's content.
aStreamReleaser A function pointer which is invoked once the StreamResource is destroyed. Normally this function will delete the std::istream object passed to it.
aIsStreamSeekable Determines whether the given stream is arbitrarily seekable without throwing errors.

Public Functions

destroy

void destroy() const =0

Destroy/clean up this Resource.

Zorba will call this method when it no longer needs the Resource. It is the responsibility of subclasses to clean up appropriate when this method is called, including calling "delete this" if the Resource was allocated with "new".

getStream

std::istream * getStream()=0

Retrieve the istream associated with this Resource.

getStreamReleaser

StreamReleaser getStreamReleaser()=0

Retrieve the stream-releaser function.

isStreamSeekable

bool isStreamSeekable() const =0

~StreamResource

 ~StreamResource()=0