class ObjectMapper

Declaration

class ObjectMapper { /* full declaration omitted */ };

Description

Helper for mapping JSON objects onto protocol structs. Example:

Declared at: llvm/include/llvm/Support/JSON.h:652

Method Overview

  • public ObjectMapper(const llvm::json::Value & E)
  • public template <typename T>bool map(llvm::StringRef Prop, T & Out)
  • public template <typename T>bool map(llvm::StringRef Prop, llvm::Optional<T> & Out)
  • public bool operator bool()

Methods

ObjectMapper(const llvm::json::Value& E)

Declared at: llvm/include/llvm/Support/JSON.h:654

Parameters

const llvm::json::Value& E

template <typename T>
bool map(llvm::StringRef Prop, T& Out)

Description

Maps a property to a field, if it exists.

Declared at: llvm/include/llvm/Support/JSON.h:661

Templates

T

Parameters

llvm::StringRef Prop
T& Out

template <typename T>
bool map(llvm::StringRef Prop,
         llvm::Optional<T>& Out)

Description

Maps a property to a field, if it exists. (Optional requires special handling, because missing keys are OK).

Declared at: llvm/include/llvm/Support/JSON.h:670

Templates

T

Parameters

llvm::StringRef Prop
llvm::Optional<T>& Out

bool operator bool()

Description

True if the expression is an object. Must be checked before calling map().

Declared at: llvm/include/llvm/Support/JSON.h:658