Show
Ignore:
Timestamp:
03/10/09 13:21:13 (6 years ago)
Author:
robert
Message:

From Stephan Huber,
"Attached you'll find a proposal for using different
protocols. The idea behind the new code is:

1.) plugins/apps register protocols which they can handle. This is done
via osgDB::Registry::registerProtocol(aProtocolName). Plugins register
supported protocols as usual via ReaderWriter::supportsProtocol(..), the
Registry is updated accordingly.

2.) osgDB::containsServerAddress checks first for an appearance of "://"
in the filename and then checks the protocol against the set of
registered protocols via Registry::isProtocolRegistered(aProtocollName)

3.) the other getServer*-functions changed as well, there's even a
getServerProtocol-function

With these changes filenames/Urls get routed to loaded plugins even with
different protocols than 'http'."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgDB/Registry.cpp

    r9881 r9884  
    331331    addFileExtensionAlias("pgm", "pnm"); 
    332332    addFileExtensionAlias("ppm", "pnm"); 
     333     
     334    // register http-protocol, so the curl can handle it, if necessary 
     335    registerProtocol("http");  
    333336     
    334337} 
     
    20932096    return _sharedStateManager.get(); 
    20942097} 
     2098 
     2099 
     2100void Registry::registerProtocol(const std::string& protocol)  
     2101 
     2102    _registeredProtocols.insert( convertToLowerCase(protocol) );  
     2103} 
     2104         
     2105bool Registry::isProtocolRegistered(const std::string& protocol)  
     2106{  
     2107    return (_registeredProtocols.find( convertToLowerCase(protocol) ) != _registeredProtocols.end());  
     2108} 
     2109