rename symbolifier to denumerizer

This commit is contained in:
Kevin Xu 2021-12-07 15:28:19 -05:00
parent 47fb7942ec
commit 47a50967eb
4 changed files with 30 additions and 30 deletions

View File

@ -20,7 +20,7 @@ namespace nlohmann
namespace detail namespace detail
{ {
struct symbolifier struct denumerizer
{ {
using number_buffer_t = std::array<char, 64>; using number_buffer_t = std::array<char, 64>;

View File

@ -21,7 +21,7 @@
#include <nlohmann/detail/output/binary_writer.hpp> #include <nlohmann/detail/output/binary_writer.hpp>
#include <nlohmann/detail/output/output_adapters.hpp> #include <nlohmann/detail/output/output_adapters.hpp>
#include <nlohmann/detail/value_t.hpp> #include <nlohmann/detail/value_t.hpp>
#include <nlohmann/detail/output/symbolifier.hpp> #include <nlohmann/detail/output/denumerizer.hpp>
namespace nlohmann namespace nlohmann
{ {
@ -39,7 +39,7 @@ enum class error_handler_t
ignore ///< ignore invalid UTF-8 sequences ignore ///< ignore invalid UTF-8 sequences
}; };
template<typename BasicJsonType, typename SymbolifierType = symbolifier> template<typename BasicJsonType, typename DenumerizerType = denumerizer>
class serializer class serializer
{ {
using string_t = typename BasicJsonType::string_t; using string_t = typename BasicJsonType::string_t;
@ -263,10 +263,10 @@ class serializer
for (auto i = val.m_value.binary->cbegin(); for (auto i = val.m_value.binary->cbegin();
i != val.m_value.binary->cend() - 1; ++i) i != val.m_value.binary->cend() - 1; ++i)
{ {
SymbolifierType::dump_integer(o, *i); DenumerizerType::dump_integer(o, *i);
o->write_characters(", ", 2); o->write_characters(", ", 2);
} }
SymbolifierType::dump_integer(o, val.m_value.binary->back()); DenumerizerType::dump_integer(o, val.m_value.binary->back());
} }
o->write_characters("],\n", 3); o->write_characters("],\n", 3);
@ -275,7 +275,7 @@ class serializer
o->write_characters("\"subtype\": ", 11); o->write_characters("\"subtype\": ", 11);
if (val.m_value.binary->has_subtype()) if (val.m_value.binary->has_subtype())
{ {
SymbolifierType::dump_integer(o, val.m_value.binary->subtype()); DenumerizerType::dump_integer(o, val.m_value.binary->subtype());
} }
else else
{ {
@ -294,16 +294,16 @@ class serializer
for (auto i = val.m_value.binary->cbegin(); for (auto i = val.m_value.binary->cbegin();
i != val.m_value.binary->cend() - 1; ++i) i != val.m_value.binary->cend() - 1; ++i)
{ {
SymbolifierType::dump_integer(o, *i); DenumerizerType::dump_integer(o, *i);
o->write_character(','); o->write_character(',');
} }
SymbolifierType::dump_integer(o, val.m_value.binary->back()); DenumerizerType::dump_integer(o, val.m_value.binary->back());
} }
o->write_characters("],\"subtype\":", 12); o->write_characters("],\"subtype\":", 12);
if (val.m_value.binary->has_subtype()) if (val.m_value.binary->has_subtype())
{ {
SymbolifierType::dump_integer(o, val.m_value.binary->subtype()); DenumerizerType::dump_integer(o, val.m_value.binary->subtype());
o->write_character('}'); o->write_character('}');
} }
else else
@ -329,19 +329,19 @@ class serializer
case value_t::number_integer: case value_t::number_integer:
{ {
SymbolifierType::dump_integer(o, val.m_value.number_integer); DenumerizerType::dump_integer(o, val.m_value.number_integer);
return; return;
} }
case value_t::number_unsigned: case value_t::number_unsigned:
{ {
SymbolifierType::dump_integer(o, val.m_value.number_unsigned); DenumerizerType::dump_integer(o, val.m_value.number_unsigned);
return; return;
} }
case value_t::number_float: case value_t::number_float:
{ {
SymbolifierType::dump_float(o, val.m_value.number_float); DenumerizerType::dump_float(o, val.m_value.number_float);
return; return;
} }

View File

@ -34,13 +34,13 @@ struct numerizer;
template<typename BasicJsonType, typename InputAdapterType> template<typename BasicJsonType, typename InputAdapterType>
using basic_lexer = lexer<BasicJsonType, InputAdapterType, numerizer>; using basic_lexer = lexer<BasicJsonType, InputAdapterType, numerizer>;
struct symbolifier; struct denumerizer;
template<typename BasicJsonType, typename SymbolifierType> template<typename BasicJsonType, typename DenumerizerType>
class serializer; class serializer;
template<typename BasicJsonType> template<typename BasicJsonType>
using basic_serializer = serializer<BasicJsonType, symbolifier>; using basic_serializer = serializer<BasicJsonType, denumerizer>;
} }
template<template<typename U, typename V, typename... Args> class ObjectType = template<template<typename U, typename V, typename... Args> class ObjectType =

View File

@ -3446,13 +3446,13 @@ struct numerizer;
template<typename BasicJsonType, typename InputAdapterType> template<typename BasicJsonType, typename InputAdapterType>
using basic_lexer = lexer<BasicJsonType, InputAdapterType, numerizer>; using basic_lexer = lexer<BasicJsonType, InputAdapterType, numerizer>;
struct symbolifier; struct denumerizer;
template<typename BasicJsonType, typename SymbolifierType> template<typename BasicJsonType, typename DenumerizerType>
class serializer; class serializer;
template<typename BasicJsonType> template<typename BasicJsonType>
using basic_serializer = serializer<BasicJsonType, symbolifier>; using basic_serializer = serializer<BasicJsonType, denumerizer>;
} }
template<template<typename U, typename V, typename... Args> class ObjectType = template<template<typename U, typename V, typename... Args> class ObjectType =
@ -16495,7 +16495,7 @@ char* to_chars(char* first, const char* last, FloatType value)
// #include <nlohmann/detail/value_t.hpp> // #include <nlohmann/detail/value_t.hpp>
// #include <nlohmann/detail/output/symbolifier.hpp> // #include <nlohmann/detail/output/denumerizer.hpp>
#include <algorithm> // reverse, remove, fill, find, none_of #include <algorithm> // reverse, remove, fill, find, none_of
@ -16518,7 +16518,7 @@ namespace nlohmann
namespace detail namespace detail
{ {
struct symbolifier struct denumerizer
{ {
using number_buffer_t = std::array<char, 64>; using number_buffer_t = std::array<char, 64>;
@ -16760,7 +16760,7 @@ enum class error_handler_t
ignore ///< ignore invalid UTF-8 sequences ignore ///< ignore invalid UTF-8 sequences
}; };
template<typename BasicJsonType, typename SymbolifierType = symbolifier> template<typename BasicJsonType, typename DenumerizerType = denumerizer>
class serializer class serializer
{ {
using string_t = typename BasicJsonType::string_t; using string_t = typename BasicJsonType::string_t;
@ -16984,10 +16984,10 @@ class serializer
for (auto i = val.m_value.binary->cbegin(); for (auto i = val.m_value.binary->cbegin();
i != val.m_value.binary->cend() - 1; ++i) i != val.m_value.binary->cend() - 1; ++i)
{ {
SymbolifierType::dump_integer(o, *i); DenumerizerType::dump_integer(o, *i);
o->write_characters(", ", 2); o->write_characters(", ", 2);
} }
SymbolifierType::dump_integer(o, val.m_value.binary->back()); DenumerizerType::dump_integer(o, val.m_value.binary->back());
} }
o->write_characters("],\n", 3); o->write_characters("],\n", 3);
@ -16996,7 +16996,7 @@ class serializer
o->write_characters("\"subtype\": ", 11); o->write_characters("\"subtype\": ", 11);
if (val.m_value.binary->has_subtype()) if (val.m_value.binary->has_subtype())
{ {
SymbolifierType::dump_integer(o, val.m_value.binary->subtype()); DenumerizerType::dump_integer(o, val.m_value.binary->subtype());
} }
else else
{ {
@ -17015,16 +17015,16 @@ class serializer
for (auto i = val.m_value.binary->cbegin(); for (auto i = val.m_value.binary->cbegin();
i != val.m_value.binary->cend() - 1; ++i) i != val.m_value.binary->cend() - 1; ++i)
{ {
SymbolifierType::dump_integer(o, *i); DenumerizerType::dump_integer(o, *i);
o->write_character(','); o->write_character(',');
} }
SymbolifierType::dump_integer(o, val.m_value.binary->back()); DenumerizerType::dump_integer(o, val.m_value.binary->back());
} }
o->write_characters("],\"subtype\":", 12); o->write_characters("],\"subtype\":", 12);
if (val.m_value.binary->has_subtype()) if (val.m_value.binary->has_subtype())
{ {
SymbolifierType::dump_integer(o, val.m_value.binary->subtype()); DenumerizerType::dump_integer(o, val.m_value.binary->subtype());
o->write_character('}'); o->write_character('}');
} }
else else
@ -17050,19 +17050,19 @@ class serializer
case value_t::number_integer: case value_t::number_integer:
{ {
SymbolifierType::dump_integer(o, val.m_value.number_integer); DenumerizerType::dump_integer(o, val.m_value.number_integer);
return; return;
} }
case value_t::number_unsigned: case value_t::number_unsigned:
{ {
SymbolifierType::dump_integer(o, val.m_value.number_unsigned); DenumerizerType::dump_integer(o, val.m_value.number_unsigned);
return; return;
} }
case value_t::number_float: case value_t::number_float:
{ {
SymbolifierType::dump_float(o, val.m_value.number_float); DenumerizerType::dump_float(o, val.m_value.number_float);
return; return;
} }