| 101 | } |
| 102 | |
| 103 | SceneInterfacePtr SceneInterface::create( const std::string &path, IndexedIO::OpenMode mode ) |
| 104 | { |
| 105 | SceneInterfacePtr result = nullptr; |
| 106 | |
| 107 | std::string extension = boost::filesystem::path( path ).extension().string(); |
| 108 | boost::algorithm::to_lower( extension ); |
| 109 | IndexedIO::OpenModeFlags openMode = IndexedIO::OpenModeFlags( mode & (IndexedIO::Read|IndexedIO::Write|IndexedIO::Append) ); |
| 110 | std::pair< std::string, IndexedIO::OpenModeFlags > key( extension, openMode ); |
| 111 | |
| 112 | const CreatorMap &createFns = fileCreators(); |
| 113 | |
| 114 | CreatorMap::const_iterator it = createFns.find(key); |
| 115 | if (it == createFns.end()) |
| 116 | { |
| 117 | throw IOException( path + " : No SceneInterface file handler registered for extension \"" + extension + "\" in mode " + std::to_string( mode ) ); |
| 118 | } |
| 119 | |
| 120 | return (it->second)(path, mode); |
| 121 | } |
| 122 | |
| 123 | SceneInterface::~SceneInterface() |
| 124 | { |
no test coverage detected