Inviwo
0.9.10.1
Inviwo documentation
|
Public Types | |
using | Map = std::unordered_map< FileExtension, DataReader * > |
Public Member Functions | |
bool | registerObject (DataReader *reader) |
bool | unRegisterObject (DataReader *reader) |
virtual std::unique_ptr< DataReader > | create (const FileExtension &key) const override |
virtual std::unique_ptr< DataReader > | create (const std::string &key) const |
virtual bool | hasKey (const std::string &key) const |
virtual bool | hasKey (const FileExtension &key) const override |
template<typename T > | |
std::vector< FileExtension > | getExtensionsForType () const |
template<typename T > | |
std::unique_ptr< DataReaderType< T > > | getReaderForTypeAndExtension (const std::string &ext) const |
template<typename T > | |
std::unique_ptr< DataReaderType< T > > | getReaderForTypeAndExtension (const FileExtension &ext) const |
template<typename T > | |
std::unique_ptr< DataReaderType< T > > | getReaderForTypeAndExtension (const FileExtension &ext, const std::string &fallbackExt) const |
template<typename T > | |
bool | hasReaderForTypeAndExtension (const std::string &ext) const |
template<typename T > | |
bool | hasReaderForTypeAndExtension (const FileExtension &ext) const |
Public Member Functions inherited from inviwo::Factory< DataReader, const FileExtension & > | |
virtual std::unique_ptr< DataReader > | create (const FileExtension & key, Args... args) const=0 |
Public Member Functions inherited from inviwo::FactoryBase | |
FactoryBase (const FactoryBase &)=delete | |
FactoryBase & | operator= (const FactoryBase &)=delete |
FactoryBase (FactoryBase &&)=default | |
FactoryBase & | operator= (FactoryBase &&)=default |
Protected Attributes | |
Map | map_ |
std::unique_ptr< DataReaderType< T > > inviwo::DataReaderFactory::getReaderForTypeAndExtension | ( | const FileExtension & | ext, |
const std::string & | fallbackExt | ||
) | const |
First look for a reader using the FileExtension ext, and if no reader was found look for a reader using the fallbackExt. This is often used with a file open dialog, where the dialog will have a selectedFileExtension that will be used as ext, and the fallbackExt is taken from the file to be opened. This way any selected reader will have priority over the file extension.