summaryrefslogtreecommitdiff
path: root/modules/codec/c++/csv.h
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-01-07 00:00:50 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-01-07 00:00:50 +0100
commit2778f650bfd8b7ba7825e1cf8a1a28899458649d (patch)
tree306ca4d63d64422d612c1126687d85609b87e3f8 /modules/codec/c++/csv.h
parent8f56be892fe95bbd7b533c9701e68d46f69351c9 (diff)
core,codec: Adding dangling changes
Diffstat (limited to 'modules/codec/c++/csv.h')
-rw-r--r--modules/codec/c++/csv.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/codec/c++/csv.h b/modules/codec/c++/csv.h
index 3727829..f40376f 100644
--- a/modules/codec/c++/csv.h
+++ b/modules/codec/c++/csv.h
@@ -12,10 +12,10 @@ struct Csv {};
namespace impl {
template<typename Schema, typename FromDecode>
struct csv_encode {
- static_assert(always_false<T>, "Case not supported");
+ static_assert(always_false<Schema, FromDecode>, "Case not supported");
};
-template<typename T, size_t Dim>
+template<typename T, size_t Dim, typename FromDecode>
struct csv_encode<schema::Array<T,Dim>, FromDecode> {
static_assert(Dim == 1, "Only one dimension is allowed.");
static_assert(!is_array<T>::value, "Array of an array is not allowed.");
@@ -42,13 +42,23 @@ struct csv_encode<schema::Array<T,Dim>, FromDecode> {
}
};
-template<>
+template<typename FromDecode>
struct csv_encode<schema::String, FromDecode> {
using Schema = schema::String;
static error_or<void> encode(const data<Schema, FromDecode>& from, data<Schema, encode::Csv>& to){
- return void_t{};
+ return make_error<err::not_implemented>();
+ }
+};
+
+template<class T, size_t N, typename FromDecode>
+struct csv_encode<schema::Primitive<T,N>, FromDecode> {
+ using Schema = schema::Primitive<T,N>;
+
+ static error_or<void> encode(const data<Schema, FromDecode>& from, data<Schema, encode::Csv>& to){
+
+ return make_error<err::not_implemented>();
}
};
}