diff --git a/Framework/API/src/FileLoaderRegistry.cpp b/Framework/API/src/FileLoaderRegistry.cpp index f97452a75e6f20d00617e0221f6579dae3e2a862..cafcb92f7b1a530724fd1b76257d6b1b1c891552 100644 --- a/Framework/API/src/FileLoaderRegistry.cpp +++ b/Framework/API/src/FileLoaderRegistry.cpp @@ -109,7 +109,7 @@ FileLoaderRegistryImpl::chooseLoader(const std::string &filename) const { m_log.debug() << "Trying to find loader for '" << filename << "'\n"; IAlgorithm_sptr bestLoader; - if (NexusDescriptor::isHDF(filename)) { + if (NexusDescriptor::isReadable(filename)) { m_log.debug() << filename << " looks like a Nexus file. Checking registered Nexus loaders\n"; @@ -163,7 +163,7 @@ bool FileLoaderRegistryImpl::canLoad(const std::string &algorithmName, std::multimap<std::string, int> names{{algorithmName, -1}}; IAlgorithm_sptr loader; if (nexus) { - if (NexusDescriptor::isHDF(filename)) { + if (NexusDescriptor::isReadable(filename)) { loader = searchForLoader<NexusDescriptor, IFileLoader<NexusDescriptor>>( filename, names, m_log); } diff --git a/Framework/DataHandling/src/LoadGeometry.cpp b/Framework/DataHandling/src/LoadGeometry.cpp index fd5fedf95434363f47655e6991444ef54d3016d1..66d2d37e30ba533e0629ccb2f832269c10225fc3 100644 --- a/Framework/DataHandling/src/LoadGeometry.cpp +++ b/Framework/DataHandling/src/LoadGeometry.cpp @@ -25,7 +25,7 @@ bool LoadGeometry::isNexus(const std::string &filename) { if (!filename.empty() && !Mantid::Kernel::FileDescriptor(filename).isAscii(filename)) { Mantid::Kernel::NexusDescriptor descriptor(filename); - return descriptor.isHDF(filename) && + return descriptor.isReadable(filename) && (descriptor.classTypeExists("NXcylindrical_geometry") || descriptor.classTypeExists("NXoff_geometry") || descriptor.classTypeExists("NXtransformations")); diff --git a/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp b/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp index 75fe0a1740edbc486193337fdfb5706e35be5f27..b566f0dbed6691f50228bd9b89d40e31e72f539b 100644 --- a/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp +++ b/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp @@ -96,7 +96,7 @@ void UpdateInstrumentFromFile::exec() { m_ignoreMonitors = (!moveMonitors); // Check file type - if (NexusDescriptor::isHDF(filename)) { + if (NexusDescriptor::isReadable(filename)) { LoadISISNexus2 isisNexus; LoadEventNexus eventNexus; boost::scoped_ptr<Kernel::NexusDescriptor> descriptor( diff --git a/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h b/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h index 40830564ed2a0472a5985e4b2a295b7669b02728..3673f5bdae10064114cd224fa09f08482b0b1dab 100644 --- a/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h +++ b/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h @@ -42,8 +42,8 @@ public: static const unsigned char HDF5Signature[8]; /// Returns true if the file is considered to store data in a hierarchy - static bool isHDF(const std::string &filename, - const Version version = AnyVersion); + static bool isReadable(const std::string &filename, + const Version version = AnyVersion); public: /// Constructor accepting a filename diff --git a/Framework/Kernel/src/NexusDescriptor.cpp b/Framework/Kernel/src/NexusDescriptor.cpp index a6637d6dc4706844a2c512775e8fc24f49b36262..bc36db78610fdf25f4ff34ba8f62840b138847c3 100644 --- a/Framework/Kernel/src/NexusDescriptor.cpp +++ b/Framework/Kernel/src/NexusDescriptor.cpp @@ -36,7 +36,7 @@ const unsigned char NexusDescriptor::HDF5Signature[8] = { namespace { //--------------------------------------------------------------------------------------------------------------------------- -// Anonymous helper methods to use isHDF methods to use an open file handle +// Anonymous helper methods to use isReadable methods to use an open file handle //--------------------------------------------------------------------------------------------------------------------------- /** @@ -96,7 +96,7 @@ bool isHDFHandle(FILE *fileHandle, NexusDescriptor::Version version) { * the required version * @return True if the file is considered hierarchical, false otherwise */ -bool NexusDescriptor::isHDF(const std::string &filename, +bool NexusDescriptor::isReadable(const std::string &filename, const Version version) { FILE *fd = fopen(filename.c_str(), "rb"); if (!fd) {