From 921c500a02f1c3926318732bbee80a0c79b55c1f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 8 Jan 2024 00:53:56 +0100 Subject: codec: Bringing testing into a proper state and getting all tests except one to run --- modules/codec/c++/csv.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'modules/codec/c++') diff --git a/modules/codec/c++/csv.h b/modules/codec/c++/csv.h index f40376f..1664c31 100644 --- a/modules/codec/c++/csv.h +++ b/modules/codec/c++/csv.h @@ -25,14 +25,14 @@ struct csv_encode, FromDecode> { static error_or encode(const data& from, data& to){ if constexpr (is_struct::value){ - auto eov = csv_encode::encode_header(to); + auto eov = csv_encode::encode_header(to); if(eov.is_error()){ return eov; } } for(std::size_t i = 0; i < from.size(); ++i){ - auto eov = csv_encode::encode(from.at(i), to); + auto eov = csv_encode::encode(from.at(i), to); if(eov.is_error()){ return eov; } @@ -42,6 +42,21 @@ struct csv_encode, FromDecode> { } }; +template +struct csv_encode...>, FromDecode> { + using Schema = schema::Struct...>; + + static error_or encode_header(const data& to){ + return make_error(); + } + + static error_or encode(const data& from, data& to){ + + + return make_error(); + } +}; + template struct csv_encode { using Schema = schema::String; @@ -63,6 +78,12 @@ struct csv_encode, FromDecode> { }; } +template +class data { + private: + public: +}; + template class codec { static_assert(is_array::value, "Only an Array is allowed as a base value"); @@ -74,7 +95,7 @@ public: } template - static error_or decode(data& from, data& to){ + static error_or decode(data& from, data& to){ return make_error(); } -- cgit v1.2.3