LLVM 22.0.0git
MsgPackReader.h File Reference

This is a MessagePack reader. More...

#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBufferRef.h"
#include <cstdint>

Go to the source code of this file.

Classes

struct  llvm::msgpack::ExtensionType
 Extension types are composed of a user-defined type ID and an uninterpreted sequence of bytes. More...
struct  llvm::msgpack::Object
 MessagePack object, represented as a tagged union of C++ types. More...
class  llvm::msgpack::Reader
 Reads MessagePack objects from memory, one at a time. More...

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::msgpack

Enumerations

enum class  llvm::msgpack::Type : uint8_t {
  llvm::msgpack::Int , llvm::msgpack::UInt , llvm::msgpack::Nil , llvm::msgpack::Boolean ,
  llvm::msgpack::Float , llvm::msgpack::String , llvm::msgpack::Binary , llvm::msgpack::Array ,
  llvm::msgpack::Map , llvm::msgpack::Extension , llvm::msgpack::Empty
}
 MessagePack types as defined in the standard, with the exception of Integer being divided into a signed Int and unsigned UInt variant in order to map directly to C++ types. More...

Detailed Description

This is a MessagePack reader.

See https://github.com/msgpack/msgpack/blob/master/spec.md for the full standard.

Typical usage:

StringRef input = GetInput();
msgpack::Reader MPReader(input);
msgpack::Object Obj;
while (true) {
Expected<bool> ReadObj = MPReader.read(&Obj);
if (!ReadObj)
// Handle error...
if (!ReadObj.get())
break; // Reached end of input
switch (Obj.Kind) {
case msgpack::Type::Int:
// // Use Obj.Int
break;
// ...
}
}

Definition in file MsgPackReader.h.