An abstract input stream for network resources.
More...
#include <openvrml/browser.h>
Inherits std::istream.
|
virtual | ~resource_istream ()=0 |
| Destroy. More...
|
|
const std::string | url () const throw ( std::bad_alloc ) |
| Get the URL associated with the stream. More...
|
|
const std::string | type () const throw ( std::bad_alloc ) |
| Get the MIME content type associated with the stream. More...
|
|
bool | data_available () const throw () |
| Indicates whether data is available to be read from the stream. More...
|
|
|
virtual const std::string | do_url () const =0 throw ( std::bad_alloc ) |
| Get the URL associated with the stream. More...
|
|
virtual const std::string | do_type () const =0 throw ( std::bad_alloc ) |
| Get the MIME content type associated with the stream. More...
|
|
virtual bool | do_data_available () const =0 throw () |
| Indicates whether data is available to be read from the stream. More...
|
|
An abstract input stream for network resources.
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
.
- See also
- openvrml::resource_fetcher::do_get_resource(const std::string &)
- Examples:
- sdl_viewer.cpp.
openvrml::resource_istream::~resource_istream |
( |
| ) |
|
|
pure virtual |
openvrml::resource_istream::resource_istream |
( |
std::streambuf * |
streambuf | ) |
|
|
explicitprotected |
Construct.
- Parameters
-
[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
.
- Returns
- the URL associated with the stream.
- Exceptions
-
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
.
- Returns
- the MIME content type associated with the stream.
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
.
- Returns
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 |
| ) | | |
|
privatepure virtual |
Get the URL associated with the stream.
- Returns
- the URL associated with the stream.
const std::string openvrml::resource_istream::do_type |
( |
| ) |
const |
throw | ( | std::bad_alloc |
| ) | | |
|
privatepure virtual |
Get the MIME content type associated with the stream.
- Returns
- the MIME content type associated with the stream.
bool openvrml::resource_istream::do_data_available |
( |
| ) |
const |
throw | ( | |
| ) | | |
|
privatepure virtual |
Indicates whether data is available to be read from the stream.
- Returns
true
if there is data in the stream buffer to be read; false
otherwise.