#ifndef RFL_CBOR_PARSER_HPP_ #define RFL_CBOR_PARSER_HPP_ #include "../parsing/Parser.hpp" #include "Reader.hpp" #include "Writer.hpp" namespace rfl { namespace parsing { /// CBOR requires us to explicitly set the number of fields in advance. /// Because of that, we require all of the fields and then set them to /// nullptr, if necessary. template requires AreReaderAndWriter< cbor::Reader, cbor::Writer, NamedTuple> struct Parser< cbor::Reader, cbor::Writer, NamedTuple, ProcessorsType> : public NamedTupleParser< cbor::Reader, cbor::Writer, /*_ignore_empty_containers=*/false, /*_all_required=*/true, ProcessorsType, FieldTypes...> {}; template requires AreReaderAndWriter> struct Parser, ProcessorsType> : public TupleParser< cbor::Reader, cbor::Writer, /*_ignore_empty_containers=*/false, /*_all_required=*/true, ProcessorsType, Ts...> {}; } // namespace parsing } // namespace rfl namespace rfl { namespace cbor { template using Parser = parsing::Parser; } } // namespace rfl #endif