...
This commit is contained in:
@@ -370,14 +370,36 @@ struct MccDeserializer<VT> : MccDeserializerBase {
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct MccDeserializer<MccCoordPairKind> : MccDeserializerBase {
|
||||
static constexpr std::string_view deserializerName{"MCC-COORDPAIR-DESERIALIZER"};
|
||||
|
||||
template <mcc_serialization_params_c ParamsT = mcc_serialization_params_t>
|
||||
error_t operator ()(
|
||||
traits::mcc_input_char_range auto const& input,
|
||||
MccCoordPairKind& value,
|
||||
ParamsT const& params = mcc_serialization_params_t{})
|
||||
{
|
||||
value = MccCoordStrToPairKind(input);
|
||||
|
||||
if (value == MccCoordPairKind::COORDS_KIND_UNKNOWN) {
|
||||
return MccDeserializerErrorCode::ERROR_INVALID_SERIALIZED_VALUE;
|
||||
}
|
||||
|
||||
return MccDeserializerErrorCode::ERROR_OK;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct MccDeserializer<MccSerializedAngleFormatPrec> : MccDeserializerBase {
|
||||
static constexpr std::string_view deserializerName{"MCC-ANGLE-FORMAT-PREC-DESERIALIZER"};
|
||||
|
||||
template <mcc_serialization_params_c ParamsT = mcc_serialization_params_t>
|
||||
error_t operator()(traits::mcc_input_char_range auto const& input,
|
||||
MccSerializedAngleFormatPrec& value,
|
||||
ParamsT const& params = mcc_serialization_params_t{})
|
||||
error_t operator ()(
|
||||
traits::mcc_input_char_range auto const& input,
|
||||
MccSerializedAngleFormatPrec& value,
|
||||
ParamsT const& params = mcc_serialization_params_t{})
|
||||
{
|
||||
// valid format: hour_prec[<params.elem_delim>deg_prec<params.elem_delim>decimals]
|
||||
|
||||
@@ -408,16 +430,17 @@ struct MccDeserializer<MccSerializedAngleFormatPrec> : MccDeserializerBase {
|
||||
|
||||
template <>
|
||||
struct MccDeserializer<MccSerializedCoordPairFormat> : MccDeserializerBase {
|
||||
static constexpr std::string_view deserializerName{"MCC-COORD-PAIR-FORMAT-DESERIALIZER"};
|
||||
static constexpr std::string_view deserializerName{"MCC-COORDPAIR-FORMAT-DESERIALIZER"};
|
||||
|
||||
template <mcc_serialization_params_c ParamsT = mcc_serialization_params_t>
|
||||
error_t operator()(traits::mcc_input_char_range auto const& input,
|
||||
MccSerializedCoordPairFormat& value,
|
||||
ParamsT const& params = mcc_serialization_params_t{})
|
||||
error_t operator ()(
|
||||
traits::mcc_input_char_range auto const& input,
|
||||
MccSerializedCoordPairFormat& value,
|
||||
ParamsT const& params = mcc_serialization_params_t{})
|
||||
{
|
||||
value = MccSerializedCoordPairFormatStrToValue(input);
|
||||
|
||||
if (value != MccSerializedCoordPairFormat::MCC_SERIALIZED_FORMAT_UNKNOWN){
|
||||
if (value != MccSerializedCoordPairFormat::MCC_SERIALIZED_FORMAT_UNKNOWN) {
|
||||
return MccDeserializerErrorCode::ERROR_OK;
|
||||
} else {
|
||||
return MccDeserializerErrorCode::ERROR_INVALID_SERIALIZED_VALUE;
|
||||
|
||||
Reference in New Issue
Block a user