LLVM  8.0.1
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. More...
 
 Reader (StringRef Input)
 Construct a reader, keeping a reference to the Input. More...
 
 Reader (const Reader &)=delete
 
Readeroperator= (const Reader &)=delete
 
Expected< boolread (Object &Obj)
 Read one object from the input buffer, advancing past it. More...
 
template<class T >
Expected< boolreadRaw (Object &Obj)
 
template<class T >
Expected< boolreadInt (Object &Obj)
 
template<class T >
Expected< boolreadUInt (Object &Obj)
 
template<class T >
Expected< boolreadLength (Object &Obj)
 
template<class T >
Expected< boolreadExt (Object &Obj)
 

Detailed Description

Reads MessagePack objects from memory, one at a time.

Definition at line 99 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

◆ 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::BitsToDouble(), llvm::BitsToFloat(), 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::pdb::Int8, llvm::msgpack::Object::Kind, llvm::msgpack::Object::Length, llvm::make_error_code(), llvm::msgpack::Map, llvm::Intrinsic::memcpy, llvm::msgpack::Nil, Size, llvm::msgpack::String, llvm::msgpack::UInt, llvm::msgpack::Object::UInt, and llvm::pdb::UInt8.

Referenced by llvm::msgpack::Node::read().

◆ readExt()

template<class T >
Expected<bool> llvm::msgpack::Reader::readExt ( Object Obj)

◆ readInt()

template<class T >
Expected<bool> llvm::msgpack::Reader::readInt ( Object Obj)

Definition at line 192 of file MsgPackReader.cpp.

References llvm::msgpack::Object::Int, llvm::make_error_code(), and T.

◆ readLength()

template<class T >
Expected<bool> llvm::msgpack::Reader::readLength ( Object Obj)

Definition at line 212 of file MsgPackReader.cpp.

References llvm::msgpack::Object::Length, llvm::make_error_code(), and T.

◆ readRaw()

template<class T >
Expected<bool> llvm::msgpack::Reader::readRaw ( Object Obj)

Definition at line 182 of file MsgPackReader.cpp.

References llvm::make_error_code(), Size, and T.

◆ readUInt()

template<class T >
Expected<bool> llvm::msgpack::Reader::readUInt ( Object Obj)

Definition at line 202 of file MsgPackReader.cpp.

References llvm::make_error_code(), T, and llvm::msgpack::Object::UInt.


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