#include <armadillo>
#include <h5cpp/all>
#include <array>
#include <iostream>
#include <string>
#include <vector>
namespace {
int errors = 0;
template <class A, class B>
void check(const char* tag, const A& expected, const B& got) {
const bool ok = (expected == got);
if (!ok) ++errors;
std::cout << (ok ?
"✔ ok " :
"✘ failed ") << tag <<
"\n";
}
"hello world",
"مرحبا بالعالم",
"Բարեւ աշխարհ",
"Здравей свят",
"Прывітанне Сусвет",
"မင်္ဂလာပါကမ္ဘာလောက",
"你好,世界",
"Γειά σου Κόσμε",
"હેલ્લો વિશ્વ",
"Helló Világ",
"こんにちは世界",
"안녕 세상",
"سلام دنیا",
"העלא וועלט",
};
}
int main() {
{
h5::libver_bounds({H5F_LIBVER_V18, H5F_LIBVER_V18}));
for (const auto& phrase : phrases) {
arma::mat M = arma::ones(3, 4);
}
arma::Col<int> v = {1, 2, 3, 4, 5};
}
{
check("file opens by UTF-8 filename", true, H5Iis_valid(static_cast<hid_t>(fd)) > 0);
for (const auto& phrase : phrases) {
}
check("UTF-8 nested group path: 温度/مجموعة/données",
}
<< (errors == 0 ? "✔ all checks passed"
: "✘ some checks failed")
<< ", errors=" << errors << "\n";
return errors;
}
h5::at_t create(const hid_t &parent, const std::string &path, args_t &&... args)
Create a new attribute of element type T on a parent HDF5 object.
Definition H5Acreate.hpp:100
T aread(const hid_t &ds, const std::string &name, const h5::acpl_t &acpl=h5::default_acpl)
Read an attribute by name and return its value as type T.
Definition H5Aread.hpp:76
h5::at_t open(const hid_t &parent, const std::string &path, const h5::acpl_t &acpl=h5::default_acpl)
Open an existing attribute by name on a parent HDF5 object.
Definition H5Aopen.hpp:56
h5::gr_t write(const LOC &parent, const std::string &path, const T &src)
Write a sparse matrix or vector as a CSC group.
Definition H5Dsparse.hpp:185