osgEarth 2.1.1
|
Public Types | |
enum | ResultCode { RESULT_OK, RESULT_CANCELED, RESULT_NOT_FOUND, RESULT_SERVER_ERROR, RESULT_TIMEOUT, RESULT_NO_READER, RESULT_READER_ERROR, RESULT_UNKNOWN_ERROR } |
Public Member Functions | |
URI () | |
URI (const std::string &location) | |
URI (const std::string &location, const URIContext &context) | |
URI (const char *location) | |
const std::string & | base () const |
const std::string & | full () const |
const std::string & | operator* () const |
const URIContext & | context () const |
bool | empty () const |
URI | append (const std::string &suffix) const |
bool | operator< (const URI &rhs) const |
osg::Object * | readObject (const osgDB::Options *options=0L, ResultCode *out_code=0L) const |
osg::Image * | readImage (const osgDB::Options *options=0L, ResultCode *out_code=0L) const |
osg::Node * | readNode (const osgDB::Options *options=0L, ResultCode *out_code=0L) const |
std::string | readString (ResultCode *out_code=0L) const |
URI (const URI &rhs) | |
Protected Attributes | |
std::string | _baseURI |
std::string | _fullURI |
URIContext | _context |
Represents the location of a resource, providing the raw (original, possibly relative) and absolute forms.
URI::URI | ( | ) |
URI::URI | ( | const std::string & | location | ) |
URI::URI | ( | const std::string & | location, |
const URIContext & | context | ||
) |
URI::URI | ( | const char * | location | ) |
osgEarth::URI::URI | ( | const URI & | rhs | ) | [inline] |
URI URI::append | ( | const std::string & | suffix | ) | const |
const std::string& osgEarth::URI::base | ( | ) | const [inline] |
const URIContext& osgEarth::URI::context | ( | ) | const [inline] |
bool osgEarth::URI::empty | ( | ) | const [inline] |
const std::string& osgEarth::URI::full | ( | ) | const [inline] |
const std::string& osgEarth::URI::operator* | ( | ) | const [inline] |
bool osgEarth::URI::operator< | ( | const URI & | rhs | ) | const [inline] |
osg::Image * URI::readImage | ( | const osgDB::Options * | options = 0L , |
ResultCode * | out_code = 0L |
||
) | const |
Reads an image from the URI.
Definition at line 183 of file URI.cpp.
{ if ( empty() ) { if ( out_code ) *out_code = RESULT_NOT_FOUND; return 0L; } osg::ref_ptr<const osgDB::Options> myOptions = fixOptions(options); //OE_INFO << LC << "readImage: " << _fullURI << std::endl; osg::ref_ptr<osg::Image> image; ResultCode result = (ResultCode)HTTPClient::readImageFile( _fullURI, image, myOptions.get() ); if ( out_code ) *out_code = result; return image.release(); }
osg::Node * URI::readNode | ( | const osgDB::Options * | options = 0L , |
ResultCode * | out_code = 0L |
||
) | const |
Reads a node from the URI.
Definition at line 202 of file URI.cpp.
{ if ( empty() ) { if ( out_code ) *out_code = RESULT_NOT_FOUND; return 0L; } osg::ref_ptr<const osgDB::Options> myOptions = fixOptions(options); osg::ref_ptr<osg::Node> node; ResultCode result = (ResultCode)HTTPClient::readNodeFile( _fullURI, node, myOptions.get() ); if ( out_code ) *out_code = result; return node.release(); }
osg::Object * URI::readObject | ( | const osgDB::Options * | options = 0L , |
ResultCode * | out_code = 0L |
||
) | const |
Reads an object from the URI.
Definition at line 166 of file URI.cpp.
{ if ( empty() ) { if ( out_code ) *out_code = RESULT_NOT_FOUND; return 0L; } osg::ref_ptr<const osgDB::Options> myOptions = fixOptions(options); osg::ref_ptr<osg::Object> object; ResultCode result = (ResultCode)HTTPClient::readObjectFile( _fullURI, object, myOptions.get() ); if ( out_code ) *out_code = result; return object.release(); }
std::string URI::readString | ( | ResultCode * | out_code = 0L | ) | const |
Reads a string from the URI.
Definition at line 218 of file URI.cpp.
{ if ( empty() ) { if ( out_code ) *out_code = RESULT_NOT_FOUND; return 0L; } std::string str; ResultCode result = (ResultCode)HTTPClient::readString( _fullURI, str ); if ( out_code ) *out_code = result; return str; }
std::string osgEarth::URI::_baseURI [protected] |
URIContext osgEarth::URI::_context [protected] |
std::string osgEarth::URI::_fullURI [protected] |