MCPcopy Create free account
hub / github.com/ElementsProject/elements / Ser

Method Ser

src/serialize.h:470–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468 static constexpr uint64_t MAX = 0xffffffffffffffff >> (8 * (8 - Bytes));
469
470 template <typename Stream, typename I> void Ser(Stream& s, I v)
471 {
472 if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range");
473 if (BigEndian) {
474 uint64_t raw = htobe64(v);
475 s.write({BytePtr(&raw) + 8 - Bytes, Bytes});
476 } else {
477 uint64_t raw = htole64(v);
478 s.write({BytePtr(&raw), Bytes});
479 }
480 }
481
482 template <typename Stream, typename I> void Unser(Stream& s, I& v)
483 {

Callers

nothing calls this directly

Calls 4

htobe64Function · 0.85
BytePtrFunction · 0.85
htole64Function · 0.85
writeMethod · 0.45

Tested by

no test coverage detected