Added new ReaderWriter methods for recording what protocols, extensions and options are

support by ReaderWriters
This commit is contained in:
Robert Osfield
2008-07-13 15:24:45 +00:00
parent 6aa604f31a
commit cb98cddc31
8 changed files with 85 additions and 72 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osgDB/ReaderWriter>
#include <osgDB/FileNameUtils>
#include <osgDB/Archive>
using namespace osgDB;
@@ -33,3 +34,24 @@ osg::Shader* ReaderWriter::ReadResult::takeShader() { osg::Shader* shader=dynami
ReaderWriter::~ReaderWriter()
{
}
bool ReaderWriter::acceptsExtension(const std::string& extension) const
{
std::string lowercase_ext = convertToLowerCase(extension);
return (_supportedExtensions.count(lowercase_ext)!=0);
}
void ReaderWriter::supportsProtocol(const std::string& fmt, const std::string& description)
{
_supportedProtocols[convertToLowerCase(fmt)] = description;
}
void ReaderWriter::supportsExtension(const std::string& fmt, const std::string& description)
{
_supportedExtensions[convertToLowerCase(fmt)] = description;
}
void ReaderWriter::supportsOption(const std::string& fmt, const std::string& description)
{
_supportedOptions[fmt] = description;
}