MCPcopy Create free account
hub / github.com/ImageEngine/cortex / create

Method create

src/IECoreScene/SceneInterface.cpp:103–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103SceneInterfacePtr 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
123SceneInterface::~SceneInterface()
124{

Callers 1

MeshPrimitiveMethod · 0.45

Calls 6

pathFunction · 0.85
OpenModeFlagsEnum · 0.85
IOExceptionFunction · 0.85
extensionMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected