Home | Download | Screen shots | Discussion | Documentation |
---|
#include <openvrml/browser.h>
Inherits std::istream.
Public Member Functions | |
virtual | ~resource_istream ()=0 |
Destroy. | |
const std::string | url () const throw ( std::bad_alloc ) |
Get the URL associated with the stream. | |
const std::string | type () const throw ( std::bad_alloc ) |
Get the MIME content type associated with the stream. | |
bool | data_available () const throw () |
Indicates whether data is available to be read from the stream. | |
Protected Member Functions | |
resource_istream (std::streambuf *streambuf) | |
Construct. | |
Private Member Functions | |
virtual const std::string | do_url () const =0 throw ( std::bad_alloc ) |
Get the URL associated with the stream. | |
virtual const std::string | do_type () const =0 throw ( std::bad_alloc ) |
Get the MIME content type associated with the stream. | |
virtual bool | do_data_available () const =0 throw () |
Indicates whether data is available to be read from the stream. |
resource_istream
inherits std::istream
, adding functions to get the URI and the MIME content type associated with the stream. Users of the library must provide an implementation of this class, to be returned from openvrml::resource_fetcher::do_get_resource
.
openvrml::resource_istream::~resource_istream | ( | ) | [pure virtual] |
Destroy.
openvrml::resource_istream::resource_istream | ( | std::streambuf * | streambuf | ) | [explicit, protected] |
Construct.
[in] | streambuf | a stream buffer. |
const std::string openvrml::resource_istream::url | ( | ) | const throw ( std::bad_alloc ) |
Get the URL associated with the stream.
This function delegates to do_url
.
std::bad_alloc | if memory allocation fails. |
const std::string openvrml::resource_istream::type | ( | ) | const throw ( std::bad_alloc ) |
Get the MIME content type associated with the stream.
This function delegates to do_type
.
bool openvrml::resource_istream::data_available | ( | ) | const throw () |
Indicates whether data is available to be read from the stream.
This function delegates to do_data_available
.
true
if there is data in the stream buffer to be read; false
otherwise. const std::string openvrml::resource_istream::do_url | ( | ) | const throw ( std::bad_alloc ) [private, pure virtual] |
Get the URL associated with the stream.
const std::string openvrml::resource_istream::do_type | ( | ) | const throw ( std::bad_alloc ) [private, pure virtual] |
Get the MIME content type associated with the stream.
bool openvrml::resource_istream::do_data_available | ( | ) | const throw () [private, pure virtual] |
Indicates whether data is available to be read from the stream.
true
if there is data in the stream buffer to be read; false
otherwise.