Home | Download | Screen shots | Discussion | Documentation |
---|
An abstract factory for resource_istreams
.
More...
Public Member Functions | |
virtual | ~resource_fetcher ()=0 throw () |
Destroy. | |
std::auto_ptr< resource_istream > | get_resource (const std::string &uri) |
Fetch a network resource. |
Private Member Functions | |
virtual std::auto_ptr < resource_istream > | do_get_resource (const std::string &uri)=0 |
Fetch a network resource. |
An abstract factory for resource_istreams
.
A concrete implementation of this interface must be passed to browser
's constructor.
|
pure virtual |
Destroy.
std::auto_ptr< openvrml::resource_istream > openvrml::resource_fetcher::get_resource | ( | const std::string & | uri | ) |
Fetch a network resource.
[in] | uri | a Uniform Resource Identifier. |
This function delegates to resource_fetcher::do_get_resource
.
std::invalid_argument | if uri is malformed or in an unsupported format. |
|
privatepure virtual |
Fetch a network resource.
Called by get_resource
, clients of OpenVRML are required to provide an implementation for this function. OpenVRML depends on the implementation of this function for all of its input needs. As such, what kinds of resources OpenVRML is capable of resolving are entirely dependent on code provided by the application.
Implementations should throw std::invalid_argument
if uri
is malformed or in an format that is not supported by the implementation.
A trivial implementation designed to handle only file
resources can use std::filebuf:
The uri
parameter is provided by OpenVRML and can be assumed to be an absolute URI. As such, it will always have a scheme through which the client code can choose a resolution mechanism. For more information on URI syntax, see Internet STD 66.
[in] | uri | an absolute Uniform Resource Identifier. |
std::invalid_argument | if uri is malformed or in an unsupported format. |