30template <std::
size_t N>
31class FixedLenStringArray;
36template <
typename Size>
37inline std::vector<std::size_t> to_vector_size_t(
const std::vector<Size>& vec) {
38 static_assert(std::is_same<Size, std::size_t>::value ==
false,
39 " hsize_t != size_t mandatory here");
40 std::vector<size_t> res(vec.size());
41 std::transform(vec.cbegin(), vec.cend(), res.begin(), [](Size e) {
42 return static_cast<size_t>(e);
48inline std::vector<std::size_t> to_vector_size_t(
const std::vector<std::size_t>& vec) {
54inline std::string get_name(T fct) {
55 const size_t maxLength = 255;
56 char buffer[maxLength + 1];
57 ssize_t retcode = fct(buffer,
static_cast<hsize_t
>(maxLength) + 1);
61 const size_t length =
static_cast<std::size_t
>(retcode);
62 if (length <= maxLength) {
63 return std::string(buffer, length);
65 std::vector<char> bigBuffer(length + 1, 0);
66 fct(bigBuffer.data(), length + 1);
67 return std::string(bigBuffer.data(), length);
70template <
class Container>
71inline std::string format_vector(
const Container& container) {
72 auto sout = std::stringstream{};
75 for (
size_t i = 0; i < container.size(); ++i) {
76 sout << container[i] << (i == container.size() - 1 ?
"" :
", ");
Definition H5_definitions.hpp:22
static void ToException(const std::string &prefix_msg)
Definition H5Exception_misc.hpp:43