9#include "MantidKernel/DllConfig.h"
14#include <unordered_set>
34 enum Version { Version4, Version5, AnyVersion };
38 static const unsigned char HDFMagic[4];
42 static const unsigned char HDF5Signature[8];
45 static bool isReadable(
const std::string &filename,
const Version version = AnyVersion);
71 inline const std::string &
filename()
const {
return m_filename; }
77 inline const std::string &
extension()
const {
return m_extension; }
82 inline ::NeXus::File &
data() {
return *m_file; }
85 const std::pair<std::string, std::string> &firstEntryNameType()
const;
87 bool hasRootAttr(
const std::string &name)
const;
89 bool pathExists(
const std::string &path)
const;
91 bool pathOfTypeExists(
const std::string &path,
const std::string &type)
const;
93 std::string pathOfType(
const std::string &type)
const;
95 bool classTypeExists(
const std::string &classType)
const;
99 void initialize(
const std::string &filename);
101 void walkFile(::NeXus::File &file,
const std::string &rootPath,
const std::string &className,
102 std::map<std::string, std::string> &
pmap,
int level);
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
std::map< std::string, std::string > m_pathsToTypes
Map of full path strings to types. Can check if path exists quickly.
std::unordered_set< std::string > m_rootAttrs
Root attributes.
const std::string & extension() const
Access the file extension.
std::string m_filename
Full filename.
~NexusDescriptor()
Destructor.
std::pair< std::string, std::string > m_firstEntryNameType
First entry name/type.
Version
Enumerate HDF possible versions.
NexusDescriptor()=delete
Disable default constructor.
NexusDescriptor(const NexusDescriptor &)=delete
Disable copy operator.
static const size_t HDFMagicSize
Size of HDF magic number.
inline ::NeXus::File & data()
Access the open NeXus File object.
static size_t HDF5SignatureSize
Size of HDF5 signature.
std::unique_ptr<::NeXus::File > m_file
Open NeXus handle.
std::string m_extension
Extension.
const std::string & filename() const
Access the filename.
NexusDescriptor & operator=(const NexusDescriptor &)=delete
Disable assignment operator.
Helper class which provides the Collimation Length for SANS instruments.
Generate a tableworkspace to store the calibration results.