8#ifndef CSV_MULTIARRAY_COPY_HPP_
9#define CSV_MULTIARRAY_COPY_HPP_
34 inline csv_col_str(std::string prp, std::stringstream & str)
41template<
typename T,
size_t N1>
44 inline csv_col_str(std::string prp, std::stringstream & str)
46 for (
size_t i = 0 ; i < N1 ; i++)
47 str <<
"," << prp <<
"_" <<
"[" << i <<
"]";
52template<
typename T,
size_t N1,
size_t N2>
55 inline csv_col_str(std::string prp, std::stringstream & str)
57 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
59 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
61 str <<
"," << prp <<
"_" <<
"[" << i1 <<
"]" <<
"[" << i2 <<
"]";
68template<
typename T,
size_t N1,
size_t N2,
size_t N3>
71 inline csv_col_str(std::string prp, std::stringstream & str)
73 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
75 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
77 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
79 str <<
"," << prp <<
"_" <<
"[" << i1 <<
"]" <<
"[" << i2 <<
"]" <<
"[" << i3 <<
"]";
87template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4>
90 inline csv_col_str(std::string prp, std::stringstream & str)
92 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
94 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
96 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
98 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
100 str <<
"," << prp <<
"_" <<
"[" << i1 <<
"]" <<
"[" << i2 <<
"]" <<
"[" << i3 <<
"]" <<
"[" << i4 <<
"]";
127template<
typename T,
bool is_writable>
137template<
typename T,
size_t N1,
bool is_writable>
140 template<
typename ArrObject>
141 inline csv_value_str(
const ArrObject v, std::stringstream & str)
143 for (
size_t i = 0 ; i < N1 ; i++)
149template<
typename T,
size_t N1,
size_t N2,
bool is_writable>
152 template<
typename ArrObject>
153 inline csv_value_str(
const ArrObject v, std::stringstream & str)
155 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
157 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
159 str <<
"," << v[i1][i2];
166template<
typename T,
size_t N1,
size_t N2,
size_t N3,
bool is_writable>
169 template<
typename ArrObject>
170 inline csv_value_str(
const ArrObject v, std::stringstream & str)
172 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
174 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
176 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
178 str <<
"," << v[i1][i2][i3];
186template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
bool is_writable>
189 template<
typename ArrObject>
190 inline csv_value_str(
const ArrObject v, std::stringstream & str)
192 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
194 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
196 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
198 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
200 str <<
"," << v[i1][i2][i3][i4];
This class is an helper to produce csv headers from multi-array.
This class is an helper to produce csv data from multi-array.