PluginQuery 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
  2. *
  3. * This application is open source and may be redistributed and/or modified
  4. * freely and without restriction, both in commercial and non commercial applications,
  5. * as long as this copyright notice is maintained.
  6. *
  7. * This application is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. */
  11. #ifndef PLUGINQUERY_H
  12. #define PLUGINQUERY_H
  13. #include <osgDB/Export>
  14. #include <osgDB/ReaderWriter>
  15. #include <osg/Referenced>
  16. #include <osg/ref_ptr>
  17. #include <list>
  18. #include <string>
  19. namespace osgDB
  20. {
  21. typedef std::list<std::string> FileNameList;
  22. FileNameList OSGDB_EXPORT listAllAvailablePlugins();
  23. class ReaderWriterInfo : public osg::Referenced
  24. {
  25. public:
  26. ReaderWriterInfo():
  27. features(ReaderWriter::FEATURE_NONE) {}
  28. std::string plugin;
  29. std::string description;
  30. ReaderWriter::FormatDescriptionMap protocols;
  31. ReaderWriter::FormatDescriptionMap extensions;
  32. ReaderWriter::FormatDescriptionMap options;
  33. ReaderWriter::Features features;
  34. protected:
  35. virtual ~ReaderWriterInfo() {}
  36. };
  37. typedef std::list< osg::ref_ptr<ReaderWriterInfo> > ReaderWriterInfoList;
  38. bool OSGDB_EXPORT queryPlugin(const std::string& fileName, ReaderWriterInfoList& infoList);
  39. bool OSGDB_EXPORT outputPluginDetails(std::ostream& out, const std::string& fileName);
  40. }
  41. #endif