Skip to content
Snippets Groups Projects
Commit 8b40de25 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Rename method to NexusDescriptor::isReadable

parent b02109c3
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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"));
......
......@@ -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(
......
......@@ -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
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment