SpECTRE  2021.08.02
h5::Header Class Reference

Writes header info about the build, git commit, branch, etc. More...

#include <Header.hpp>

Public Member Functions

const std::stringget_header () const noexcept
 
std::string get_env_variables () const noexcept
 Returns the environment variables at compile time of the simulation that produced the file.
 
std::string get_build_info () const noexcept
 Returns the contents of the BuildInfo.txt file generated by CMake of the simulation that produced the file.
 

Detailed Description

Writes header info about the build, git commit, branch, etc.

A Header object is used to store the info_from_build() result in the HDF5 files. The Header is automatically added to every single file by the constructor of H5File.

Example

You can read the header info out of an H5 file as shown in the example:

h5::H5File<h5::AccessType::ReadWrite> my_file0(h5_file_name);
// Check that the header was written correctly
const std::string header = my_file0.get<h5::Header>("/header").get_header();
Opens an HDF5 file for access and allows manipulation of data.
Definition: File.hpp:60
Writes header info about the build, git commit, branch, etc.
Definition: Header.hpp:28