SourceArchive.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <hdf5.h>
7 #include <string>
8 #include <vector>
9 
10 #include "IO/H5/Object.hpp"
11 #include "IO/H5/OpenGroup.hpp"
12 
13 namespace h5 {
14 /*!
15  * \ingroup HDF5Group
16  * \brief Writes an archive of the source tree into a dataset.
17  */
18 class SourceArchive : public h5::Object {
19  public:
20  /// \cond HIDDEN_SYMOLS
21  static std::string extension() noexcept { return ".tar.gz"; }
22 
23  SourceArchive(bool exists, detail::OpenGroup&& group, hid_t location,
24  const std::string& name) noexcept;
25 
26  SourceArchive(const SourceArchive&) = delete;
27  SourceArchive& operator=(const SourceArchive&) = delete;
28 
29  SourceArchive(SourceArchive&&) noexcept = delete; // NOLINT
30  SourceArchive& operator=(SourceArchive&&) noexcept = delete; // NOLINT
31 
32  ~SourceArchive() override = default;
33  /// \endcond
34 
35  const std::vector<char>& get_archive() const noexcept {
36  return source_archive_;
37  }
38 
39  private:
40  /// \cond HIDDEN_SYMBOLS
41  detail::OpenGroup group_;
42  std::vector<char> source_archive_;
43  /// \endcond
44 };
45 } // namespace h5
Defines class OpenGroup for opening groups in HDF5.
Contains functions and classes for manipulating HDF5 files.
Definition: AccessType.cpp:10
Defines class h5::Object abstract base class.
Writes an archive of the source tree into a dataset.
Definition: SourceArchive.hpp:18
Abstract base class representing an object in an HDF5 file.
Definition: Object.hpp:14