MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / write_uint64_value

Function write_uint64_value

include/jsoncons_ext/cbor/cbor_encoder.hpp:1235–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233 }
1234
1235 void write_uint64_value(uint64_t value)
1236 {
1237 if (value <= 0x17)
1238 {
1239 sink_.push_back(static_cast<uint8_t>(value));
1240 }
1241 else if (value <=(std::numeric_limits<uint8_t>::max)())
1242 {
1243 sink_.push_back(static_cast<uint8_t>(0x18));
1244 sink_.push_back(static_cast<uint8_t>(value));
1245 }
1246 else if (value <=(std::numeric_limits<uint16_t>::max)())
1247 {
1248 sink_.push_back(static_cast<uint8_t>(0x19));
1249 binary::native_to_big(static_cast<uint16_t>(value),
1250 std::back_inserter(sink_));
1251 }
1252 else if (value <=(std::numeric_limits<uint32_t>::max)())
1253 {
1254 sink_.push_back(static_cast<uint8_t>(0x1a));
1255 binary::native_to_big(static_cast<uint32_t>(value),
1256 std::back_inserter(sink_));
1257 }
1258 else if (value <=(std::numeric_limits<uint64_t>::max)())
1259 {
1260 sink_.push_back(static_cast<uint8_t>(0x1b));
1261 binary::native_to_big(static_cast<uint64_t>(value),
1262 std::back_inserter(sink_));
1263 }
1264 }
1265
1266 void write_int64_value(int64_t value)
1267 {

Callers 4

uint64_value_with_tagFunction · 0.70
write_stringFunction · 0.70
visit_byte_stringFunction · 0.70
visit_uint64Function · 0.70

Calls 2

native_to_bigFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected