#include <json.hpp>
|
| static void | fill_buffer (const WideStringType &str, size_t ¤t_wchar, std::array< std::char_traits< char >::int_type, 4 > &utf8_bytes, size_t &utf8_bytes_index, size_t &utf8_bytes_filled) |
| |
template<typename WideStringType, size_t T>
struct nlohmann::detail::wide_string_input_helper< WideStringType, T >
Definition at line 2173 of file json.hpp.
template<typename WideStringType , size_t T>
Definition at line 2176 of file json.hpp.
Referenced by nlohmann::detail::wide_string_input_adapter< WideStringType >::fill_buffer().
2178 utf8_bytes_index = 0;
2180 if (current_wchar == str.size())
2182 utf8_bytes[0] = std::char_traits<char>::eof();
2183 utf8_bytes_filled = 1;
2188 const auto wc =
static_cast<int>(str[current_wchar++]);
2194 utf8_bytes_filled = 1;
2196 else if (wc <= 0x7FF)
2198 utf8_bytes[0] = 0xC0 | ((wc >> 6) & 0x1F);
2199 utf8_bytes[1] = 0x80 | (wc & 0x3F);
2200 utf8_bytes_filled = 2;
2202 else if (wc <= 0xFFFF)
2204 utf8_bytes[0] = 0xE0 | ((wc >> 12) & 0x0F);
2205 utf8_bytes[1] = 0x80 | ((wc >> 6) & 0x3F);
2206 utf8_bytes[2] = 0x80 | (wc & 0x3F);
2207 utf8_bytes_filled = 3;
2209 else if (wc <= 0x10FFFF)
2211 utf8_bytes[0] = 0xF0 | ((wc >> 18) & 0x07);
2212 utf8_bytes[1] = 0x80 | ((wc >> 12) & 0x3F);
2213 utf8_bytes[2] = 0x80 | ((wc >> 6) & 0x3F);
2214 utf8_bytes[3] = 0x80 | (wc & 0x3F);
2215 utf8_bytes_filled = 4;
2221 utf8_bytes_filled = 1;
The documentation for this struct was generated from the following file: