From 8b40de25a607057b9192f2966bb550c92714ac20 Mon Sep 17 00:00:00 2001
From: Pete Peterson <petersonpf@ornl.gov>
Date: Tue, 31 Mar 2020 08:12:40 -0400
Subject: [PATCH] Rename method to NexusDescriptor::isReadable

---
 Framework/API/src/FileLoaderRegistry.cpp                | 4 ++--
 Framework/DataHandling/src/LoadGeometry.cpp             | 2 +-
 Framework/DataHandling/src/UpdateInstrumentFromFile.cpp | 2 +-
 Framework/Kernel/inc/MantidKernel/NexusDescriptor.h     | 4 ++--
 Framework/Kernel/src/NexusDescriptor.cpp                | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Framework/API/src/FileLoaderRegistry.cpp b/Framework/API/src/FileLoaderRegistry.cpp
index f97452a75e6..cafcb92f7b1 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 fd5fedf9543..66d2d37e30b 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 75fe0a1740e..b566f0dbed6 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 40830564ed2..3673f5bdae1 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 a6637d6dc47..bc36db78610 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) {
-- 
GitLab