Add support for showing environment variables provided by osg plugins
This commit is contained in:
parent
1568ff2e2a
commit
792288f8bb
@ -40,7 +40,7 @@ PROJECT(OpenSceneGraph)
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 4)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 2)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 132)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 133)
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
# git tags will be treated as release candidates of given number
|
||||
|
@ -39,6 +39,7 @@ class ReaderWriterInfo : public osg::Referenced
|
||||
ReaderWriter::FormatDescriptionMap protocols;
|
||||
ReaderWriter::FormatDescriptionMap extensions;
|
||||
ReaderWriter::FormatDescriptionMap options;
|
||||
ReaderWriter::FormatDescriptionMap environment;
|
||||
ReaderWriter::Features features;
|
||||
|
||||
protected:
|
||||
|
@ -63,6 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
/** Return which list of file extensions supported by ReaderWriter. */
|
||||
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
|
||||
|
||||
/** Return which list of file environment variables supported by ReaderWriter. */
|
||||
virtual const FormatDescriptionMap& supportedEnvironment() const { return _supportedEnvironment; }
|
||||
|
||||
/** Return true if ReaderWriter accepts specified file extension.*/
|
||||
virtual bool acceptsExtension(const std::string& /*extension*/) const;
|
||||
|
||||
@ -276,11 +279,15 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
* Please note, this should usually only be used internally by subclasses of ReaderWriter. */
|
||||
void supportsOption(const std::string& opt, const std::string& description);
|
||||
|
||||
/** Specify env string as a supported environment string. */
|
||||
void supportsEnvironment(const std::string& opt, const std::string& description);
|
||||
|
||||
protected:
|
||||
|
||||
FormatDescriptionMap _supportedProtocols;
|
||||
FormatDescriptionMap _supportedExtensions;
|
||||
FormatDescriptionMap _supportedOptions;
|
||||
FormatDescriptionMap _supportedEnvironment;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ bool osgDB::queryPlugin(const std::string& fileName, ReaderWriterInfoList& infoL
|
||||
rwi->protocols = rw->supportedProtocols();
|
||||
rwi->extensions = rw->supportedExtensions();
|
||||
rwi->options = rw->supportedOptions();
|
||||
rwi->environment = rw->supportedEnvironment();
|
||||
rwi->features = rw->supportedFeatures();
|
||||
|
||||
infoList.push_back(rwi.get());
|
||||
@ -151,6 +152,13 @@ bool osgDB::outputPluginDetails(std::ostream& out, const std::string& fileName)
|
||||
if (fdm_itr->first.length()>longestOptionLength) longestOptionLength = fdm_itr->first.length();
|
||||
}
|
||||
|
||||
for(fdm_itr = info.environment.begin();
|
||||
fdm_itr != info.environment.end();
|
||||
++fdm_itr)
|
||||
{
|
||||
if (fdm_itr->first.length()>longestOptionLength) longestOptionLength = fdm_itr->first.length();
|
||||
}
|
||||
|
||||
unsigned int padLength = longestOptionLength+4;
|
||||
|
||||
for(fdm_itr = info.protocols.begin();
|
||||
@ -173,6 +181,13 @@ bool osgDB::outputPluginDetails(std::ostream& out, const std::string& fileName)
|
||||
{
|
||||
out<<" options : "<<padwithspaces(fdm_itr->first, padLength)<<fdm_itr->second<<std::endl;
|
||||
}
|
||||
|
||||
for(fdm_itr = info.environment.begin();
|
||||
fdm_itr != info.environment.end();
|
||||
++fdm_itr)
|
||||
{
|
||||
out<<" environment: "<<padwithspaces(fdm_itr->first, padLength)<<fdm_itr->second<<std::endl;
|
||||
}
|
||||
out<<" }"<<std::endl;
|
||||
}
|
||||
out<<"}"<<std::endl<<std::endl;
|
||||
|
@ -68,6 +68,11 @@ void ReaderWriter::supportsOption(const std::string& fmt, const std::string& des
|
||||
_supportedOptions[fmt] = description;
|
||||
}
|
||||
|
||||
void ReaderWriter::supportsEnvironment(const std::string& fmt, const std::string& description)
|
||||
{
|
||||
_supportedEnvironment[fmt] = description;
|
||||
}
|
||||
|
||||
ReaderWriter::Features ReaderWriter::supportedFeatures() const
|
||||
{
|
||||
int features = FEATURE_NONE;
|
||||
|
Loading…
Reference in New Issue
Block a user