Remove enumeration function from ::wire reading and writing (#84)

This commit is contained in:
Lee *!* Clagett
2023-12-05 20:24:22 -05:00
committed by Lee *!* Clagett
parent 9f98d2a8c9
commit 6fa2d6799b
11 changed files with 5 additions and 55 deletions

View File

@@ -59,11 +59,14 @@
} \
void read_bytes(::wire::reader& source, type_& dest) \
{ \
dest = type_(source.enumeration(map)); \
const auto val = type_ ## _from_string(source.string()); \
if (!val) \
WIRE_DLOG_THROW(::wire::error::schema::enumeration, #type_); \
dest = *val; \
} \
void write_bytes(::wire::writer& dest, const type_ source) \
{ \
dest.enumeration(std::size_t(source), map); \
dest.string(get_string(source)); \
}
#define WIRE_DEFINE_OBJECT(type, map) \