From a863f9af9fff0ecb276c6769149d9672961b7533 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 4 Dec 2023 17:01:04 +0100 Subject: codec: Moving structure around --- modules/codec/schema_stringify.h | 118 --------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 modules/codec/schema_stringify.h (limited to 'modules/codec/schema_stringify.h') diff --git a/modules/codec/schema_stringify.h b/modules/codec/schema_stringify.h deleted file mode 100644 index a82081a..0000000 --- a/modules/codec/schema_stringify.h +++ /dev/null @@ -1,118 +0,0 @@ -#pragma once - -#include "schema.h" - -#include -#include - -namespace saw { -template -struct schema_stringify { - static_assert(always_false, "Not supported"); -}; - -template -struct schema_stringify> { - static void apply(std::stringstream& iss) { - iss << "saw::schema::Array<"; - schema_stringify::apply(iss); - iss << ","; - iss << ct_convert_to_digits::literal.view(); - iss << ">"; - } -}; - -template -struct schema_stringify> { - static void apply(std::stringstream& iss) { - iss << "saw::schema::Primitive<"; - schema_stringify::apply(iss); - iss << ","; - iss << ct_convert_to_digits::literal.view(); - iss << ">"; - } -}; - -template<> -struct schema_stringify { - static void apply(std::stringstream& iss) { - iss << "saw:schema::SignedInteger"; - } -}; - -template<> -struct schema_stringify { - static void apply(std::stringstream& iss) { - iss << "saw:schema::UnsignedInteger"; - } -}; - -template<> -struct schema_stringify { - static void apply(std::stringstream& iss) { - iss << "saw:schema::FloatingPoint"; - } -}; - -template -struct schema_stringify_member { - static void apply(std::stringstream& iss) { - (void)iss; - } -}; - -template -struct schema_stringify_member, TL...> { - - static void apply(std::stringstream& iss) { - iss << "saw::schema::Member<"; - schema_stringify::apply(iss); - iss << ",\""; - iss << Name.view(); - iss << "\">"; - if constexpr ( sizeof...(TL) > 0){ - iss << ","; - schema_stringify_member::apply(iss); - } - } -}; - -template -struct schema_stringify...>> { - static void apply(std::stringstream& iss) { - iss << "saw::schema::Struct<"; - schema_stringify_member...>::apply(iss); - iss << ">"; - } -}; - -template -struct schema_stringify...>> { - static void apply(std::stringstream& iss) { - iss << "saw::schema::Union<"; - schema_stringify_member...>::apply(iss); - iss << ">"; - } -}; - -template -struct schema_stringify> { - static void apply(std::stringstream& iss){ - iss << "saw::schema::Function<"; - schema_stringify::apply(iss); - iss << ","; - schema_stringify::apply(iss); - iss << ">"; - } -}; - -template -struct schema_stringify...>>{ - static void apply(std::stringstream& iss){ - iss << "saw::schema::Interface<"; - schema_stringify_member...>::apply(iss); - iss << ">"; - } -}; - -} -- cgit v1.2.3