Newer
Older
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include <map>
#include <set>
#include <string>
class MANTID_KERNEL_DLL NexusHDF5Descriptor {
public:
/**
* Unique constructor
* @param filename input HDF5 Nexus file name
*/
NexusHDF5Descriptor(const std::string &filename);
NexusHDF5Descriptor() = delete;
/**
* Using RAII components, no need to deallocate explicitly
*/
~NexusHDF5Descriptor() = default;
/// Returns true if the file is considered to store data in a hierarchy
static bool isReadable(const std::string &filename);
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Returns a copy of the current file name
* @return
*/
std::string getFilename() const noexcept;
/**
* Returns a const reference of the internal map holding all entries in the
* NeXus HDF5 file
* @return map holding all entries by group class
* <pre>
* key: group_class (e.g. NXentry, NXlog)
* value: set with absolute entry names for the group_class key
* (e.g. /entry/log)
* </pre>
*/
const std::map<std::string, std::set<std::string>> &getAllEntries() const
noexcept;
private:
/**
* Sets m_allEntries, called in HDF5 constructor.
* m_filename must be set
*/
std::map<std::string, std::set<std::string>> initAllEntries();
/** NeXus HDF5 file name */
std::string m_filename;
/**
* All entries metadata
* <pre>
* key: group_class (e.g. NXentry, NXlog)
* value: set with absolute entry names for the group_class key
* (e.g. /entry/log)
* </pre>
*/
std::map<std::string, std::set<std::string>> m_allEntries;
};