Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <array>
7 : #include <string>
8 : #include <vector>
9 :
10 : namespace h5::detail {
11 : class OpenGroup;
12 : } // namespace h5::detail
13 :
14 : namespace h5_detail {
15 : /// Write a dictionary as an attribute to the volume file, can be used
16 : /// to decode integer sequence as values[i] represents the string
17 : /// value encoded with integer i in the h5 file
18 : void write_dictionary(const std::string& dict_name,
19 : const std::vector<std::string>& values,
20 : const h5::detail::OpenGroup& observation_group);
21 :
22 : /// A dictionary `dict_name` is used to decode the integer vector `decodable`
23 : /// into an vector of strings. The `dict_name` should correspond to
24 : /// a dictionary written with `h5_detail::write_dictionary`
25 : std::vector<std::string> decode_with_dictionary_name(
26 : const std::string& dict_name, const std::vector<int>& decodable,
27 : const h5::detail::OpenGroup& observation_group);
28 :
29 : } // namespace h5_detail
|