22 using namespace folly;
29 template <
typename... ARGS>
32 std::forward<ARGS>(args)...,
35 " bytes remaining in cursor"));
51 curs,
"invalid integer encoding detected (", (
int8_t)enc,
")");
60 throw std::range_error(
"string length must not be negative");
71 if (pulled !=
size_t(len)) {
76 "no data available while decoding a string, header was " 77 "not decoded properly");
110 throw std::runtime_error(
"Expected array encoding for property names");
119 for (
auto&
name : names) {
122 obj[
name.getString()] =
nullptr;
148 curs.
pull((
void*)&dval,
sizeof(dval));
166 throw std::runtime_error(
167 "Skip not valid at this location in the bser stream");
169 throw std::runtime_error(
"invalid bser encoding");
174 char header[
sizeof(
kMagic)];
175 curs.
pull(header,
sizeof(header));
177 throw std::runtime_error(
"invalid BSER magic header");
static ObjectMaker object()
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
constexpr detail::Map< Move > move
constexpr size_type size() const
static dynamic decodeObject(Cursor &curs)
size_t decodePduLength(const folly::IOBuf *)
size_t pullAtMost(void *buf, size_t len)
—— Concurrent Priority Queue Implementation ——
static int64_t decodeInt(Cursor &curs)
void pull(void *buf, size_t len)
static size_t decodeHeader(Cursor &curs)
constexpr auto size(C const &c) -> decltype(c.size())
static void throwDecodeError(Cursor &curs, ARGS &&...args)
constexpr Iter data() const
size_t skipAtMost(size_t len)
static dynamic decodeArray(Cursor &curs)
void push_back(dynamic const &)
Range< const unsigned char * > ByteRange
static void array(EmptyArrayTag)
value_type & at(size_t i)
folly::dynamic parseBser(folly::StringPiece)
static std::string decodeString(Cursor &curs)
static dynamic decodeTemplate(Cursor &curs)