Hi,
I just encountered an unfortunate detail in using file readers derived from mitk::AbstractFileIO directly. I cannot use QmitkIOUtil because I want to read from a Qt resource and (Qmitk/mitk::)IOUtil verifies _file_ existence before looking for readers (and finds that my Qt resource is not a regular file). Due to AbstractFileIO's double inheritance we need to write code like below to specify an input file location:
MySpecialFileIO_C reader;reader.mitk::AbstractFileReader::SetInput(":/in_exe/my.file");auto result = reader.Read();
AbstractFileReader::SetInput is specified explicitly because AbstractFileIO also inherits AbstractFileWriter::SetInput and the compilerwants a clarification of what we want to call.
As I would prefer to avoid this uncommon syntax:
- was the name of SetInput used in two base classes on purpose? Why not avoid name collissions by different names, e.g. SetInputLocation() and SetInputData()?
- would you mind removing the _file_ existance check from IOUtil (more specifically, from mitk::FileReaderSelector's constructor)? Or could this check be made aware of Qt's resource system?
- I know that the first option would require each reader to handle non-existing files. But this should be a basic check done in every reader anyway, right?
- I know that the first option would require each reader to handle non-existing files. But this should be a basic check done in every reader anyway, right?
I'm curious for your input on this topic.
Kind regards,
Daniel
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
