diff --git a/modules/gui/src/remote_loader.cc b/modules/gui/src/remote_loader.cc index c79abbbcf4d470a0a545eb6af96d84667ece4c30..60ae7c60aec99da21148b038df11a912ae74aeb7 100644 --- a/modules/gui/src/remote_loader.cc +++ b/modules/gui/src/remote_loader.cc @@ -164,4 +164,3 @@ OST_REGISTER_WIDGET_WITH_DEFAULT_FACTORY(ost::gui, RemoteLoader, "Remote Loader" }} - diff --git a/modules/io/src/img/map_io_dat_handler.cc b/modules/io/src/img/map_io_dat_handler.cc index e9642373c020854ba18f8a0a3e4e9d508a14d527..988d590e5a333a8ab9a6d9ac17c175f17833d549 100644 --- a/modules/io/src/img/map_io_dat_handler.cc +++ b/modules/io/src/img/map_io_dat_handler.cc @@ -74,9 +74,9 @@ bool MapIODatHandler::MatchType(const ImageFormatBase& type) return false; } -bool MapIODatHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIODatHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".dat") || detail::FilenameEndsWith(loc.string(),".img") ) { + if(detail::FilenameEndsWith(loc,".dat") || detail::FilenameEndsWith(loc,".img") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_dat_handler.hh b/modules/io/src/img/map_io_dat_handler.hh index e6964f819fa4096b42b7f9851eb65d1b27e1790b..92335aa170b08ef1ac32b36b25436471810c0746 100644 --- a/modules/io/src/img/map_io_dat_handler.hh +++ b/modules/io/src/img/map_io_dat_handler.hh @@ -60,7 +60,7 @@ class DLLEXPORT_OST_IO MapIODatHandler: public MapIOHandler virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Dat"); } static String GetFormatDescription() {return String("Simple binary format for square images");} }; diff --git a/modules/io/src/img/map_io_dm3_handler.cc b/modules/io/src/img/map_io_dm3_handler.cc index 2ff70625db3c6f6a5f4a480635850b9ea79d2409..c8da380849039d1e61c2412c5b55a11867c835a3 100644 --- a/modules/io/src/img/map_io_dm3_handler.cc +++ b/modules/io/src/img/map_io_dm3_handler.cc @@ -636,9 +636,9 @@ bool MapIODm3Handler::MatchType(const ImageFormatBase& type) } return false; } -bool MapIODm3Handler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIODm3Handler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".dm3") ) { + if(detail::FilenameEndsWith(loc,".dm3") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_dm3_handler.hh b/modules/io/src/img/map_io_dm3_handler.hh index c09832a5a7110bd2d17e8e0343d07e8bc8513eb0..e958de070963fd50ef91b4a5737fbed6daf5a5fc 100644 --- a/modules/io/src/img/map_io_dm3_handler.hh +++ b/modules/io/src/img/map_io_dm3_handler.hh @@ -48,7 +48,7 @@ class DLLEXPORT_OST_IO MapIODm3Handler: public MapIOHandler virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Dm3"); } static String GetFormatDescription() {return String("Format used by Gatan Inc.'s Digital Micrograph software");} diff --git a/modules/io/src/img/map_io_dx_handler.cc b/modules/io/src/img/map_io_dx_handler.cc index 7c564eaaba5ab132fcefcfb9432949e146d25538..f8f38fad1440e19503b1dd6560ec96d60e7ffacf 100644 --- a/modules/io/src/img/map_io_dx_handler.cc +++ b/modules/io/src/img/map_io_dx_handler.cc @@ -264,9 +264,9 @@ bool MapIODxHandler::MatchType(const ImageFormatBase& formatstruct) } return false; } -bool MapIODxHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIODxHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".dx") ) { + if(detail::FilenameEndsWith(loc,".dx") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_dx_handler.hh b/modules/io/src/img/map_io_dx_handler.hh index f54c6ca86abb9511d20398a3156add794c9f16e5..991c9b8206afaeacb331d801a977b6a17a2b77d4 100644 --- a/modules/io/src/img/map_io_dx_handler.hh +++ b/modules/io/src/img/map_io_dx_handler.hh @@ -62,7 +62,7 @@ class DLLEXPORT_OST_IO MapIODxHandler: public MapIOHandler std::ostream& loc, const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& locx); + static bool MatchSuffix(const String& locx); static String GetFormatName() { return String("Dx"); }; static String GetFormatDescription() { return String("Format used by the OpenDX software package"); }; diff --git a/modules/io/src/img/map_io_handler.hh b/modules/io/src/img/map_io_handler.hh index 3be88313a5f2df7b3ebe1e5b984c45352fb46fa0..1912b9c6093133e3658b55a2356fb8271e19109f 100644 --- a/modules/io/src/img/map_io_handler.hh +++ b/modules/io/src/img/map_io_handler.hh @@ -46,7 +46,7 @@ public: virtual ~MapIOHandlerFactoryBase() {} virtual bool MatchContent(unsigned char* header) const = 0; virtual bool MatchType(const ImageFormatBase& type) const = 0; - virtual bool MatchSuffix(const boost::filesystem::path& loc) const =0 ; + virtual bool MatchSuffix(const String& loc) const =0 ; virtual MapIOHandlerPtr Create() const = 0 ; virtual String GetFormatName() const =0; virtual String GetFormatDescription() const =0; @@ -67,7 +67,7 @@ class MapIOHandlerFactory: public MapIOHandlerFactoryBase return HANDLER::MatchType(type); } - virtual bool MatchSuffix(const boost::filesystem::path& loc) const { + virtual bool MatchSuffix(const String& loc) const { return HANDLER::MatchSuffix(loc); } diff --git a/modules/io/src/img/map_io_jpk_handler.cc b/modules/io/src/img/map_io_jpk_handler.cc index f941c37dfeb9f0f2ad2c53a3689b7e96904c3a33..2f36a21ed7504da5c89956479ed2e73d2b2e7780 100644 --- a/modules/io/src/img/map_io_jpk_handler.cc +++ b/modules/io/src/img/map_io_jpk_handler.cc @@ -300,9 +300,9 @@ bool MapIOJpkHandler::MatchType(const ImageFormatBase& formatstruct) return false; } -bool MapIOJpkHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOJpkHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".jpk") ) { + if(detail::FilenameEndsWith(loc,".jpk") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_jpk_handler.hh b/modules/io/src/img/map_io_jpk_handler.hh index 074c632deadc7ba2dea32ff7eb3b0e00d9d17e92..be93eb916b9b547f8957b4ef4121feddada22d78 100644 --- a/modules/io/src/img/map_io_jpk_handler.hh +++ b/modules/io/src/img/map_io_jpk_handler.hh @@ -48,7 +48,7 @@ class DLLEXPORT_OST_IO MapIOJpkHandler: public MapIOTiffHandler void Export(const img::MapHandle& image, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Jpk");} static String GetFormatDescription() { return String("Format used by JPK Instruments AG's software (Customized Tiff format)"); } diff --git a/modules/io/src/img/map_io_mrc_handler.cc b/modules/io/src/img/map_io_mrc_handler.cc index 80ee6025057a01b494dfd086fd18cfc9273539c5..924af5c13e8c34398e5916dde07eb185aa6dca8b 100644 --- a/modules/io/src/img/map_io_mrc_handler.cc +++ b/modules/io/src/img/map_io_mrc_handler.cc @@ -1003,10 +1003,10 @@ bool MapIOMrcHandler::MatchType(const ImageFormatBase& type) return false; } -bool MapIOMrcHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOMrcHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".mrc") || detail::FilenameEndsWith(loc.string(),".map") || - detail::FilenameEndsWith(loc.string(),".ccp4") || detail::FilenameEndsWith(loc.string(),".map.gz")) { + if(detail::FilenameEndsWith(loc,".mrc") || detail::FilenameEndsWith(loc,".map") || + detail::FilenameEndsWith(loc,".ccp4") || detail::FilenameEndsWith(loc,".map.gz")) { return true; } return false; diff --git a/modules/io/src/img/map_io_mrc_handler.hh b/modules/io/src/img/map_io_mrc_handler.hh index 76a6b9d369af0321a63e3da2c72cbcfd33166e9b..673fac913ec9932fb561bc5211cfa2526208cf74 100644 --- a/modules/io/src/img/map_io_mrc_handler.hh +++ b/modules/io/src/img/map_io_mrc_handler.hh @@ -74,7 +74,7 @@ public: virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Mrc"); }; static String GetFormatDescription() { return String("Format used by the MRC software package"); }; diff --git a/modules/io/src/img/map_io_nanoscope_handler.cc b/modules/io/src/img/map_io_nanoscope_handler.cc index 32ce6ccd162fa940800ae9e13b6f99e806355c11..0019fa320092cd330c9b601181a153559c58dbff 100644 --- a/modules/io/src/img/map_io_nanoscope_handler.cc +++ b/modules/io/src/img/map_io_nanoscope_handler.cc @@ -234,9 +234,9 @@ bool MapIONanoscopeHandler::MatchType(const ImageFormatBase& type) return false; } -bool MapIONanoscopeHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIONanoscopeHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".mod") ) { + if(detail::FilenameEndsWith(loc,".mod") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_nanoscope_handler.hh b/modules/io/src/img/map_io_nanoscope_handler.hh index 6758897691f0206046a9feb7f6490806aaca6f58..99a457a1a35c0cfff99255705c0decf649537c9d 100644 --- a/modules/io/src/img/map_io_nanoscope_handler.hh +++ b/modules/io/src/img/map_io_nanoscope_handler.hh @@ -57,7 +57,7 @@ public: virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Nanoscope"); } static String GetFormatDescription() { return String("Format used by software from Veeco"); } }; diff --git a/modules/io/src/img/map_io_png_handler.cc b/modules/io/src/img/map_io_png_handler.cc index 38d88be665497120b7cec05c148d59d0b5f0b1f9..84b290d2e22214c3ee31a662c30c402fb941358e 100644 --- a/modules/io/src/img/map_io_png_handler.cc +++ b/modules/io/src/img/map_io_png_handler.cc @@ -311,9 +311,9 @@ bool MapIOPngHandler::MatchType(const ImageFormatBase& type) } return false; } -bool MapIOPngHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOPngHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".png") ) { + if(detail::FilenameEndsWith(loc,".png") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_png_handler.hh b/modules/io/src/img/map_io_png_handler.hh index d5267a6da98f939827679fe49c76d07dc117b180..156d684d4f6bbf2273ee3a9eecb852fc1bea1688 100644 --- a/modules/io/src/img/map_io_png_handler.hh +++ b/modules/io/src/img/map_io_png_handler.hh @@ -52,7 +52,7 @@ public: virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Png");} static String GetFormatDescription() { return String("Portable Network Graphic image format");} }; diff --git a/modules/io/src/img/map_io_situs_handler.cc b/modules/io/src/img/map_io_situs_handler.cc index f31444b3004afde7a02ac6964a1919775d19fe61..a7e12da30beb181738c49fc71eb2ed9b91a9101f 100644 --- a/modules/io/src/img/map_io_situs_handler.cc +++ b/modules/io/src/img/map_io_situs_handler.cc @@ -272,9 +272,9 @@ bool MapIOSitusHandler::MatchType(const ImageFormatBase& type) return false; } -bool MapIOSitusHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOSitusHandler::MatchSuffix(const String& loc) { - if(detail::FilenameEndsWith(loc.string(),".situs") || detail::FilenameEndsWith(loc.string(),".sit") ) { + if(detail::FilenameEndsWith(loc,".situs") || detail::FilenameEndsWith(loc,".sit") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_situs_handler.hh b/modules/io/src/img/map_io_situs_handler.hh index a5d64a72796f77c5d3a5df55d0acbd56fb550e2f..f3e3d6b782f09ee610508c3d54aac8ea5a94afbc 100644 --- a/modules/io/src/img/map_io_situs_handler.hh +++ b/modules/io/src/img/map_io_situs_handler.hh @@ -54,7 +54,7 @@ class DLLEXPORT_OST_IO MapIOSitusHandler: public MapIOHandler virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return "Situs"; }; static String GetFormatDescription() { return "Format used by the Situs software package"; }; }; diff --git a/modules/io/src/img/map_io_spi_handler.cc b/modules/io/src/img/map_io_spi_handler.cc index 6e10c30ccd01968ebfee27f4edee2be5e7ae46f7..63b5e1e4ca4f88e584a7eceaf1855c29a457876b 100644 --- a/modules/io/src/img/map_io_spi_handler.cc +++ b/modules/io/src/img/map_io_spi_handler.cc @@ -512,9 +512,9 @@ bool MapIOSpiHandler::MatchType(const ImageFormatBase& type) } return false; } -bool MapIOSpiHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOSpiHandler::MatchSuffix(const String& loc) { - if (detail::FilenameEndsWith(loc.string(),".spi") ) { + if (detail::FilenameEndsWith(loc,".spi") ) { return true; } return false; diff --git a/modules/io/src/img/map_io_spi_handler.hh b/modules/io/src/img/map_io_spi_handler.hh index df2d6152647c66482fb33a750c1223bb72fb2e85..ac62117b1b45066e0a1709e2a8d3982e1022d913 100644 --- a/modules/io/src/img/map_io_spi_handler.hh +++ b/modules/io/src/img/map_io_spi_handler.hh @@ -64,7 +64,7 @@ class DLLEXPORT_OST_IO MapIOSpiHandler: public MapIOHandler virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String("Spider"); }; static String GetFormatDescription() { return String("Format sued by the Spider software package"); }; diff --git a/modules/io/src/img/map_io_tiff_handler.cc b/modules/io/src/img/map_io_tiff_handler.cc index 863013dd00055a8cee87c913a9dd307df443e839..233a43c2d4b0069df0b4543c930ac3f174984463 100644 --- a/modules/io/src/img/map_io_tiff_handler.cc +++ b/modules/io/src/img/map_io_tiff_handler.cc @@ -427,9 +427,9 @@ bool MapIOTiffHandler::MatchType(const ImageFormatBase& type) return (type.GetFormatString()=="defined_tiff"); } -bool MapIOTiffHandler::MatchSuffix(const boost::filesystem::path& loc) +bool MapIOTiffHandler::MatchSuffix(const String& loc) { - return (detail::FilenameEndsWith(loc.string(),".tif") || detail::FilenameEndsWith(loc.string(),".tiff") ); + return (detail::FilenameEndsWith(loc,".tif") || detail::FilenameEndsWith(loc,".tiff") ); } diff --git a/modules/io/src/img/map_io_tiff_handler.hh b/modules/io/src/img/map_io_tiff_handler.hh index 8d9a9e3a6426677d6ee4160b5635f5557c2b5d69..7fbfb901e8b44cc6d6616648a70abf842ec26505 100644 --- a/modules/io/src/img/map_io_tiff_handler.hh +++ b/modules/io/src/img/map_io_tiff_handler.hh @@ -90,7 +90,7 @@ class DLLEXPORT_OST_IO MapIOTiffHandler: public MapIOHandler virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const; static bool MatchContent(unsigned char* header); static bool MatchType(const ImageFormatBase& type); - static bool MatchSuffix(const boost::filesystem::path& loc); + static bool MatchSuffix(const String& loc); static String GetFormatName() { return String( "Tiff"); } static String GetFormatDescription() { return String("Tagged Image File Format"); } diff --git a/modules/io/src/io_manager.cc b/modules/io/src/io_manager.cc index d64358ffa2de7f22119d3ac86727bcdce533187f..88451aeed283e0ab984ac3fca1c143d33f0d7ddf 100644 --- a/modules/io/src/io_manager.cc +++ b/modules/io/src/io_manager.cc @@ -140,13 +140,14 @@ MapIOHandlerPtr IOManager::FindMapImportHandlerFile(const boost::filesystem::pat } throw IOException("Unsupported type in FindMapImportHandle."); }else{ - for(MapIOFList::const_iterator it=map_io_list_.begin(); it!=map_io_list_.end();++it) { - if((*it)->MatchSuffix(loc)) { + String match_suf_string=loc.string(); + std::transform(match_suf_string.begin(),match_suf_string.end(),match_suf_string.begin(),tolower); + for(MapIOFList::const_iterator it=map_io_list_.begin(); it!=map_io_list_.end();++it) { + if((*it)->MatchSuffix(match_suf_string)) { return (*it)->Create(); } } unsigned char header[256]; - boost::filesystem::ifstream infile(loc, std::ios::binary); if(!infile) { @@ -206,8 +207,10 @@ MapIOHandlerPtr IOManager::FindMapExportHandlerFile(const boost::filesystem::pat if (pos == String::npos){ throw IOException("No file suffix given for " + filename+", please indicate file type."); } + String match_suf_string=loc.string(); + std::transform(match_suf_string.begin(),match_suf_string.end(),match_suf_string.begin(),tolower); for(MapIOFList::const_iterator it=map_io_list_.begin(); it!=map_io_list_.end();++it) { - if((*it)->MatchSuffix(loc)) { + if((*it)->MatchSuffix(match_suf_string)) { return(*it)->Create(); } }