ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
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
13namespace ritsuko {
14
15namespace hdf5 {
16
27inline 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
39inline bool is_utf8_string(const H5::DataSet& data) {
40 if (data.getTypeClass() != H5T_STRING) {
41 return false;
42 }
43 return is_utf8_string(H5::StrType(data));
44}
45
53inline bool is_utf8_string(const H5::Attribute& attr) {
54 if (attr.getTypeClass() != H5T_STRING) {
55 return false;
56 }
57 return is_utf8_string(attr.getStrType());
58}
59
60}
61
62}
63
64#endif
bool is_utf8_string(const H5::StrType &stype)
Definition is_utf8_string.hpp:27
Helper functions for ArtifactDB parsing and validation.
Definition Pointer.hpp:21