✏️ fixed some typos

This commit is contained in:
Niels Lohmann 2018-10-28 14:20:20 +01:00
parent f0c1459554
commit d2e4f0b0d9
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
6 changed files with 36 additions and 31 deletions

View file

@ -167,7 +167,7 @@ class parser
template <typename SAX> template <typename SAX>
bool sax_parse_internal(SAX* sax) bool sax_parse_internal(SAX* sax)
{ {
// stack to remember the hieararchy of structured values we are parsing // stack to remember the hierarchy of structured values we are parsing
// true = array; false = object // true = array; false = object
std::vector<bool> states; std::vector<bool> states;
// value to avoid a goto (see comment where set to true) // value to avoid a goto (see comment where set to true)
@ -351,7 +351,7 @@ class parser
// we reached this line after we successfully parsed a value // we reached this line after we successfully parsed a value
if (states.empty()) if (states.empty())
{ {
// empty stack: we reached the end of the hieararchy: done // empty stack: we reached the end of the hierarchy: done
return true; return true;
} }
else else

View file

@ -221,28 +221,28 @@ struct is_compatible_string_type_impl <
std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value; std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value;
}; };
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_compatible_string_type struct is_compatible_string_type
: is_compatible_string_type_impl<BasicJsonType, ConstrutibleStringType> {}; : is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename ConstrutibleStringType, template <typename BasicJsonType, typename ConstructibleStringType,
typename = void> typename = void>
struct is_constructible_string_type_impl : std::false_type {}; struct is_constructible_string_type_impl : std::false_type {};
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type_impl < struct is_constructible_string_type_impl <
BasicJsonType, ConstrutibleStringType, BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type, enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstrutibleStringType>::value >> value_type_t, ConstructibleStringType>::value >>
{ {
static constexpr auto value = static constexpr auto value =
std::is_constructible<ConstrutibleStringType, std::is_constructible<ConstructibleStringType,
typename BasicJsonType::string_t>::value; typename BasicJsonType::string_t>::value;
}; };
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type struct is_constructible_string_type
: is_constructible_string_type_impl<BasicJsonType, ConstrutibleStringType> {}; : is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename CompatibleArrayType, typename = void> template <typename BasicJsonType, typename CompatibleArrayType, typename = void>
struct is_compatible_array_type_impl : std::false_type {}; struct is_compatible_array_type_impl : std::false_type {};

View file

@ -1287,6 +1287,7 @@ class binary_writer
oa->write_characters(vec.data(), sizeof(NumberType)); oa->write_characters(vec.data(), sizeof(NumberType));
} }
public:
// The following to_char_type functions are implement the conversion // The following to_char_type functions are implement the conversion
// between uint8_t and CharType. In case CharType is not unsigned, // between uint8_t and CharType. In case CharType is not unsigned,
// such a conversion is required to allow values greater than 128. // such a conversion is required to allow values greater than 128.

View file

@ -17,6 +17,7 @@
#include <nlohmann/detail/conversions/to_chars.hpp> #include <nlohmann/detail/conversions/to_chars.hpp>
#include <nlohmann/detail/macro_scope.hpp> #include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp> #include <nlohmann/detail/meta/cpp_future.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>
@ -449,9 +450,9 @@ class serializer
} }
else else
{ {
string_buffer[bytes++] = '\xEF'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xEF');
string_buffer[bytes++] = '\xBF'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF');
string_buffer[bytes++] = '\xBD'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD');
} }
bytes_after_last_accept = bytes; bytes_after_last_accept = bytes;
} }

View file

@ -6750,7 +6750,7 @@ class basic_json
map | object | 0xBF map | object | 0xBF
False | `false` | 0xF4 False | `false` | 0xF4
True | `true` | 0xF5 True | `true` | 0xF5
Nill | `null` | 0xF6 Null | `null` | 0xF6
Half-Precision Float | number_float | 0xF9 Half-Precision Float | number_float | 0xF9
Single-Precision Float | number_float | 0xFA Single-Precision Float | number_float | 0xFA
Double-Precision Float | number_float | 0xFB Double-Precision Float | number_float | 0xFB

View file

@ -612,28 +612,28 @@ struct is_compatible_string_type_impl <
std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value; std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value;
}; };
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_compatible_string_type struct is_compatible_string_type
: is_compatible_string_type_impl<BasicJsonType, ConstrutibleStringType> {}; : is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename ConstrutibleStringType, template <typename BasicJsonType, typename ConstructibleStringType,
typename = void> typename = void>
struct is_constructible_string_type_impl : std::false_type {}; struct is_constructible_string_type_impl : std::false_type {};
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type_impl < struct is_constructible_string_type_impl <
BasicJsonType, ConstrutibleStringType, BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type, enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstrutibleStringType>::value >> value_type_t, ConstructibleStringType>::value >>
{ {
static constexpr auto value = static constexpr auto value =
std::is_constructible<ConstrutibleStringType, std::is_constructible<ConstructibleStringType,
typename BasicJsonType::string_t>::value; typename BasicJsonType::string_t>::value;
}; };
template <typename BasicJsonType, typename ConstrutibleStringType> template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type struct is_constructible_string_type
: is_constructible_string_type_impl<BasicJsonType, ConstrutibleStringType> {}; : is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename CompatibleArrayType, typename = void> template <typename BasicJsonType, typename CompatibleArrayType, typename = void>
struct is_compatible_array_type_impl : std::false_type {}; struct is_compatible_array_type_impl : std::false_type {};
@ -4979,7 +4979,7 @@ class parser
template <typename SAX> template <typename SAX>
bool sax_parse_internal(SAX* sax) bool sax_parse_internal(SAX* sax)
{ {
// stack to remember the hieararchy of structured values we are parsing // stack to remember the hierarchy of structured values we are parsing
// true = array; false = object // true = array; false = object
std::vector<bool> states; std::vector<bool> states;
// value to avoid a goto (see comment where set to true) // value to avoid a goto (see comment where set to true)
@ -5163,7 +5163,7 @@ class parser
// we reached this line after we successfully parsed a value // we reached this line after we successfully parsed a value
if (states.empty()) if (states.empty())
{ {
// empty stack: we reached the end of the hieararchy: done // empty stack: we reached the end of the hierarchy: done
return true; return true;
} }
else else
@ -6526,7 +6526,7 @@ class binary_reader
@param[in, out] result A reference to the string variable where the read @param[in, out] result A reference to the string variable where the read
string is to be stored. string is to be stored.
@tparam NumberType The type of the length @a len @tparam NumberType The type of the length @a len
@pre len > 0 @pre len >= 1
@return `true` if the string was successfully parsed @return `true` if the string was successfully parsed
*/ */
template<typename NumberType> template<typename NumberType>
@ -9612,6 +9612,7 @@ class binary_writer
oa->write_characters(vec.data(), sizeof(NumberType)); oa->write_characters(vec.data(), sizeof(NumberType));
} }
public:
// The following to_char_type functions are implement the conversion // The following to_char_type functions are implement the conversion
// between uint8_t and CharType. In case CharType is not unsigned, // between uint8_t and CharType. In case CharType is not unsigned,
// such a conversion is required to allow values greater than 128. // such a conversion is required to allow values greater than 128.
@ -10780,6 +10781,8 @@ char* to_chars(char* first, const char* last, FloatType value)
// #include <nlohmann/detail/meta/cpp_future.hpp> // #include <nlohmann/detail/meta/cpp_future.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>
@ -11214,9 +11217,9 @@ class serializer
} }
else else
{ {
string_buffer[bytes++] = '\xEF'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xEF');
string_buffer[bytes++] = '\xBF'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF');
string_buffer[bytes++] = '\xBD'; string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD');
} }
bytes_after_last_accept = bytes; bytes_after_last_accept = bytes;
} }
@ -19011,7 +19014,7 @@ class basic_json
map | object | 0xBF map | object | 0xBF
False | `false` | 0xF4 False | `false` | 0xF4
True | `true` | 0xF5 True | `true` | 0xF5
Nill | `null` | 0xF6 Null | `null` | 0xF6
Half-Precision Float | number_float | 0xF9 Half-Precision Float | number_float | 0xF9
Single-Precision Float | number_float | 0xFA Single-Precision Float | number_float | 0xFA
Double-Precision Float | number_float | 0xFB Double-Precision Float | number_float | 0xFB