osgEarth 2.1.1
|
Public Member Functions | |
URIStream (const URI &uri) | |
virtual | ~URIStream () |
operator std::istream & () | |
Protected Attributes | |
std::istream * | _fileStream |
std::stringstream | _bufStream |
Friends | |
class | URI |
URIStream::URIStream | ( | const URI & | uri | ) |
Definition at line 57 of file URI.cpp.
: _fileStream( 0L ) { if ( osgDB::containsServerAddress(uri.full()) ) { HTTPResponse res = HTTPClient::get( uri.full() ); if ( res.isOK() ) { std::string buf = res.getPartAsString(0); _bufStream.str(buf); } } else { _fileStream = new std::ifstream( uri.full().c_str() ); } }
URIStream::~URIStream | ( | ) | [virtual] |
Definition at line 75 of file URI.cpp.
{ if ( _fileStream ) delete _fileStream; }
URIStream::operator std::istream & | ( | ) |
Definition at line 81 of file URI.cpp.
{ static std::istringstream s_nullStream; if ( _fileStream ) return *_fileStream; else return _bufStream; }
std::stringstream osgEarth::URIStream::_bufStream [protected] |
std::istream* osgEarth::URIStream::_fileStream [protected] |