LLVM 20.0.0git
Public Member Functions | List of all members
llvm::msgpack::Reader Class Reference

Reads MessagePack objects from memory, one at a time. More...

#include "llvm/BinaryFormat/MsgPackReader.h"

Public Member Functions

 Reader (MemoryBufferRef InputBuffer)
 Construct a reader, keeping a reference to the InputBuffer.
 
 Reader (StringRef Input)
 Construct a reader, keeping a reference to the Input.
 
 Reader (const Reader &)=delete
 
Readeroperator= (const Reader &)=delete
 
Expected< boolread (Object &Obj)
 Read one object from the input buffer, advancing past it.
 

Detailed Description

Reads MessagePack objects from memory, one at a time.

Definition at line 104 of file MsgPackReader.h.

Constructor & Destructor Documentation

◆ Reader() [1/3]

Reader::Reader ( MemoryBufferRef  InputBuffer)

Construct a reader, keeping a reference to the InputBuffer.

Definition at line 23 of file MsgPackReader.cpp.

◆ Reader() [2/3]

Reader::Reader ( StringRef  Input)

Construct a reader, keeping a reference to the Input.

Definition at line 27 of file MsgPackReader.cpp.

◆ Reader() [3/3]

llvm::msgpack::Reader::Reader ( const Reader )
delete

Member Function Documentation

◆ operator=()

Reader & llvm::msgpack::Reader::operator= ( const Reader )
delete

References End.

◆ read()

Expected< bool > Reader::read ( Object Obj)

Read one object from the input buffer, advancing past it.

The Obj is updated with the kind of the object read, and the corresponding union member is updated.

For the collection objects (Array and Map), only the length is read, and the caller must make and additional N calls (in the case of Array) or N*2 calls (in the case of Map) to Read to retrieve the collection elements.

Parameters
[out]Objfilled with next object on success.
Returns
true when object successfully read, false when at end of input (and so Obj was not updated), otherwise an error.

Definition at line 29 of file MsgPackReader.cpp.

References llvm::msgpack::Array, llvm::msgpack::Binary, llvm::msgpack::Object::Bool, llvm::msgpack::Boolean, llvm::msgpack::Extension, llvm::msgpack::Float, llvm::msgpack::Object::Float, I, llvm::msgpack::Int, llvm::msgpack::Object::Int, llvm::msgpack::Object::Kind, llvm::msgpack::Object::Length, llvm::msgpack::Map, llvm::msgpack::Nil, Size, llvm::msgpack::String, llvm::msgpack::UInt, and llvm::msgpack::Object::UInt.

Referenced by llvm::msgpack::Document::readFromBlob().


The documentation for this class was generated from the following files: