Lines Matching refs:value
57 @param[in] j JSON value to serialize
87 @param[in] j JSON value to serialize
142 // byte, and the value is converted to a positive number.
411 @param[in] j JSON value to serialize
733 @param[in] j JSON value to serialize
736 @param[in] add_prefix whether prefixes need to be used for this value
985 @brief Writes a BSON element with key @a name and boolean value @a value
988 const bool value)
991 oa->write_character(value ? to_char_type(0x01) : to_char_type(0x00));
995 @brief Writes a BSON element with key @a name and double value @a value
998 const double value)
1001 write_number<double>(value, true);
1005 @return The size of the BSON-encoded string in @a value
1007 static std::size_t calc_bson_string_size(const string_t& value)
1009 return sizeof(std::int32_t) + value.size() + 1ul;
1013 @brief Writes a BSON element with key @a name and string value @a value
1016 const string_t& value)
1020 write_number<std::int32_t>(static_cast<std::int32_t>(value.size() + 1ul), true);
1022 reinterpret_cast<const CharType*>(value.c_str()),
1023 value.size() + 1);
1027 @brief Writes a BSON element with key @a name and null value
1035 @return The size of the BSON-encoded integer @a value
1037 static std::size_t calc_bson_integer_size(const std::int64_t value)
1039 return (std::numeric_limits<std::int32_t>::min)() <= value && value <= (std::numeric_limits<std::int32_t>::max)()
1045 @brief Writes a BSON element with key @a name and integer @a value
1048 const std::int64_t value)
1050 if ((std::numeric_limits<std::int32_t>::min)() <= value && value <= (std::numeric_limits<std::int32_t>::max)())
1053 write_number<std::int32_t>(static_cast<std::int32_t>(value), true);
1058 write_number<std::int64_t>(static_cast<std::int64_t>(value), true);
1065 static constexpr std::size_t calc_bson_unsigned_size(const std::uint64_t value) noexcept
1067 return (value <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)()))
1073 @brief Writes a BSON element with key @a name and unsigned @a value
1095 @brief Writes a BSON element with key @a name and object @a value
1098 const typename BasicJsonType::object_t& value)
1101 write_bson_object(value);
1105 @return The size of the BSON-encoded array @a value
1107 static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value)
1111 const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), static_cast<std::size_t>(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el)
1120 @return The size of the BSON-encoded binary array @a value
1122 static std::size_t calc_bson_binary_size(const typename BasicJsonType::binary_t& value)
1124 return sizeof(std::int32_t) + value.size() + 1ul;
1128 @brief Writes a BSON element with key @a name and array @a value
1131 const typename BasicJsonType::array_t& value)
1134 write_number<std::int32_t>(static_cast<std::int32_t>(calc_bson_array_size(value)), true);
1138 for (const auto& el : value)
1147 @brief Writes a BSON element with key @a name and binary value @a value
1150 const binary_t& value)
1154 write_number<std::int32_t>(static_cast<std::int32_t>(value.size()), true);
1155 write_number(value.has_subtype() ? static_cast<std::uint8_t>(value.subtype()) : static_cast<std::uint8_t>(0x00));
1157 oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
1161 @brief Calculates the size necessary to serialize the JSON value @a j with its @a name
1207 @brief Serializes the JSON value @a j to BSON and associates it with the
1256 @param[in] value JSON value to serialize
1257 @pre value.type() == value_t::object
1259 static std::size_t calc_bson_object_size(const typename BasicJsonType::object_t& value)
1261 std::size_t document_size = std::accumulate(value.begin(), value.end(), static_cast<std::size_t>(0),
1271 @param[in] value JSON value to serialize
1272 @pre value.type() == value_t::object
1274 void write_bson_object(const typename BasicJsonType::object_t& value)
1276 write_number<std::int32_t>(static_cast<std::int32_t>(calc_bson_object_size(value)), true);
1278 for (const auto& el : value)
1320 std::is_floating_point<NumberType>::value, int>::type = 0>
1334 std::is_unsigned<NumberType>::value, int>::type = 0>
1421 std::is_signed<NumberType>::value&&
1422 !std::is_floating_point<NumberType>::value, int >::type = 0 >
1618 bool write_bjdata_ndarray(const typename BasicJsonType::object_t& value, const bool use_count, const bool use_type)
1625 auto it = bjdtype.find(static_cast<string_t>(value.at(key)));
1633 std::size_t len = (value.at(key).empty() ? 0 : 1);
1634 for (const auto& el : value.at(key))
1640 if (value.at(key).size() != len)
1651 write_ubjson(value.at(key), use_count, use_type, true, true);
1656 for (const auto& el : value.at(key))
1663 for (const auto& el : value.at(key))
1670 for (const auto& el : value.at(key))
1677 for (const auto& el : value.at(key))
1684 for (const auto& el : value.at(key))
1691 for (const auto& el : value.at(key))
1698 for (const auto& el : value.at(key))
1705 for (const auto& el : value.at(key))
1712 for (const auto& el : value.at(key))
1719 for (const auto& el : value.at(key))
1794 enable_if_t < std::is_signed<C>::value && std::is_signed<char>::value > * = nullptr >
1801 enable_if_t < std::is_signed<C>::value && std::is_unsigned<char>::value > * = nullptr >
1805 static_assert(std::is_trivial<CharType>::value, "CharType must be trivial");
1812 enable_if_t<std::is_unsigned<C>::value>* = nullptr>
1820 std::is_signed<C>::value &&
1821 std::is_signed<char>::value &&
1822 std::is_same<char, typename std::remove_cv<InputCharType>::type>::value