#pragma once #include "schema.hpp" #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 << ">"; } }; }