ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
ritsuko
hdf5
is_utf8_string.hpp
Go to the documentation of this file.
1
#ifndef RITSUKO_IS_UTF8_STRING_HPP
2
#define RITSUKO_IS_UTF8_STRING_HPP
3
4
#include <type_traits>
5
#include <cstdint>
6
#include "H5Cpp.h"
7
13
namespace
ritsuko
{
14
15
namespace
hdf5 {
16
27
inline
bool
is_utf8_string
(
const
H5::StrType& stype) {
28
auto
cset = stype.getCset();
29
return
(cset == H5T_CSET_ASCII || cset == H5T_CSET_UTF8);
30
}
31
37
inline
bool
is_utf8_string
(
const
H5::DataSet& handle) {
38
if
(handle.getTypeClass() != H5T_STRING) {
39
return
false
;
40
}
41
return
is_utf8_string
(H5::StrType(handle));
42
}
43
49
inline
bool
is_utf8_string
(
const
H5::Attribute& handle) {
50
if
(handle.getTypeClass() != H5T_STRING) {
51
return
false
;
52
}
53
return
is_utf8_string
(handle.getStrType());
54
}
55
56
}
57
58
}
59
60
#endif
ritsuko::hdf5::is_utf8_string
bool is_utf8_string(const H5::StrType &stype)
Definition
is_utf8_string.hpp:27
ritsuko
Assorted helper functions for parsing and validation.
Definition
choose_missing_placeholder.hpp:15
Generated by
1.12.0