From 7ba484914b601e7ec9a1cf0aae3ac68cda86bdae Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Thu, 8 Feb 2024 10:14:38 +0100 Subject: [PATCH] More migration to `read_raw`. (#945) --- include/highfive/h5easy_bits/H5Easy_Eigen.hpp | 4 ++-- include/highfive/h5easy_bits/H5Easy_opencv.hpp | 4 ++-- include/highfive/h5easy_bits/H5Easy_xtensor.hpp | 4 ++-- tests/unit/tests_high_five_base.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/highfive/h5easy_bits/H5Easy_Eigen.hpp b/include/highfive/h5easy_bits/H5Easy_Eigen.hpp index 5b5d3b9a5..a2e23bc0f 100644 --- a/include/highfive/h5easy_bits/H5Easy_Eigen.hpp +++ b/include/highfive/h5easy_bits/H5Easy_Eigen.hpp @@ -98,7 +98,7 @@ struct io_impl, T DataSet dataset = file.getDataSet(path); std::vector dims = shape(file, path, dataset, T::RowsAtCompileTime); T data(dims[0], dims[1]); - dataset.read(data.data()); + dataset.read_raw(data.data()); if (data.IsVectorAtCompileTime || data.IsRowMajor) { return data; } @@ -130,7 +130,7 @@ struct io_impl, T DataSpace dataspace = attribute.getSpace(); std::vector dims = shape(file, path, dataspace, T::RowsAtCompileTime); T data(dims[0], dims[1]); - attribute.read(data.data()); + attribute.read_raw(data.data()); if (data.IsVectorAtCompileTime || data.IsRowMajor) { return data; } diff --git a/include/highfive/h5easy_bits/H5Easy_opencv.hpp b/include/highfive/h5easy_bits/H5Easy_opencv.hpp index b640cd854..7be19f1e3 100644 --- a/include/highfive/h5easy_bits/H5Easy_opencv.hpp +++ b/include/highfive/h5easy_bits/H5Easy_opencv.hpp @@ -61,7 +61,7 @@ struct io_impl::value>::type> { DataSet dataset = file.getDataSet(path); std::vector dims = shape(file, path, dataset.getDimensions()); T data(dims[0], dims[1]); - dataset.read(reinterpret_cast(data.data)); + dataset.read_raw(reinterpret_cast(data.data)); return data; } @@ -89,7 +89,7 @@ struct io_impl::value>::type> { DataSpace dataspace = attribute.getSpace(); std::vector dims = shape(file, path, dataspace.getDimensions()); T data(dims[0], dims[1]); - attribute.read(reinterpret_cast(data.data)); + attribute.read_raw(reinterpret_cast(data.data)); return data; } }; diff --git a/include/highfive/h5easy_bits/H5Easy_xtensor.hpp b/include/highfive/h5easy_bits/H5Easy_xtensor.hpp index 6b0238c4d..9b737f03b 100644 --- a/include/highfive/h5easy_bits/H5Easy_xtensor.hpp +++ b/include/highfive/h5easy_bits/H5Easy_xtensor.hpp @@ -44,7 +44,7 @@ struct io_impl::value>::type> { DataSet dataset = file.getDataSet(path); std::vector dims = dataset.getDimensions(); T data = T::from_shape(dims); - dataset.read(data.data()); + dataset.read_raw(data.data()); return data; } @@ -73,7 +73,7 @@ struct io_impl::value>::type> { DataSpace dataspace = attribute.getSpace(); std::vector dims = dataspace.getDimensions(); T data = T::from_shape(dims); - attribute.read(data.data()); + attribute.read_raw(data.data()); return data; } }; diff --git a/tests/unit/tests_high_five_base.cpp b/tests/unit/tests_high_five_base.cpp index 95a6e7d44..f7cf67532 100644 --- a/tests/unit/tests_high_five_base.cpp +++ b/tests/unit/tests_high_five_base.cpp @@ -2433,7 +2433,7 @@ TEST_CASE("HighFiveFixedString") { #if HIGHFIVE_CXX_STD >= 17 { auto expected = std::string(value.size(), '-'); - ds.read(expected.data(), datatype); + ds.read_raw(expected.data(), datatype); REQUIRE(expected == value); }