void DeepImageWriter::registerDeepImageWriter( const std::string &extensions, CanWriteFn canWrite, CreatorFn creator, TypeId typeId ) { assert( canWrite ); assert( creator ); assert( typeId != InvalidTypeId ); ExtensionsToFnsMap *m = extensionsToFns(); std::vector<std::string> splitExt; boost::split( splitExt, extensions, boost::is_any_of( " " ) ); DeepImageWriterFns w; w.creator = creator; w.canWrite = canWrite; w.typeId = typeId; for ( std::vector<std::string>::const_iterator it=splitExt.begin(); it != splitExt.end(); it++ ) { m->insert( ExtensionsToFnsMap::value_type( "." + *it, w ) ); } }
void Reader::registerReader( const std::string &extensions, CanReadFn canRead, CreatorFn creator, TypeId typeId ) { assert( canRead ); assert( creator ); assert( typeId != InvalidTypeId ); ExtensionsToFnsMap *m = extensionsToFns(); assert( m ); vector<string> splitExt; split( splitExt, extensions, is_any_of( " " ) ); ReaderFns r; r.creator = creator; r.canRead = canRead; r.typeId = typeId; for( vector<string>::const_iterator it=splitExt.begin(); it!=splitExt.end(); it++ ) { m->insert( ExtensionsToFnsMap::value_type( "." + *it, r ) ); } }