23#include "../H5Exception.hpp"
30template <
typename Size>
31inline std::vector<std::size_t> to_vector_size_t(
const std::vector<Size>& vec) {
32 static_assert(std::is_same<Size, std::size_t>::value ==
false,
33 " hsize_t != size_t mandatory here");
34 std::vector<size_t> res(vec.size());
35 std::transform(vec.cbegin(), vec.cend(), res.begin(), [](Size e) {
36 return static_cast<size_t>(e);
42inline std::vector<std::size_t> to_vector_size_t(
const std::vector<std::size_t>& vec) {
48inline std::string get_name(T fct) {
49 const size_t maxLength = 255;
50 char buffer[maxLength + 1];
51 ssize_t retcode = fct(buffer,
static_cast<hsize_t
>(maxLength) + 1);
53 HDF5ErrMapper::ToException<GroupException>(
"Error accessing object name");
55 const size_t length =
static_cast<std::size_t
>(retcode);
56 if (length <= maxLength) {
57 return std::string(buffer, length);
59 std::vector<char> bigBuffer(length + 1, 0);
60 fct(bigBuffer.data(), length + 1);
61 return std::string(bigBuffer.data(), length);
64template <
class Container>
65inline std::string format_vector(
const Container& container) {
66 auto sout = std::stringstream{};
69 for (
size_t i = 0; i < container.size(); ++i) {
70 sout << container[i] << (i == container.size() - 1 ?
"" :
", ");
Definition assert_compatible_spaces.hpp:15