LLVM
8.0.1
|
Helper for mapping JSON objects onto protocol structs. More...
#include "llvm/Support/JSON.h"
Public Member Functions | |
ObjectMapper (const Value &E) | |
operator bool () | |
True if the expression is an object. More... | |
template<typename T > | |
bool | map (StringRef Prop, T &Out) |
Maps a property to a field, if it exists. More... | |
template<typename T > | |
bool | map (StringRef Prop, llvm::Optional< T > &Out) |
Maps a property to a field, if it exists. More... | |
Helper for mapping JSON objects onto protocol structs.
Example:
Maps a property to a field, if it exists.
Definition at line 661 of file JSON.h.
References assert(), E, llvm::json::fromJSON(), and llvm::RISCVFenceField::O.
|
inline |
Maps a property to a field, if it exists.
(Optional requires special handling, because missing keys are OK).
Definition at line 670 of file JSON.h.
References assert(), E, llvm::json::fromJSON(), llvm::None, llvm::RISCVFenceField::O, and llvm::json::parse().
|
inline |
True if the expression is an object.
Must be checked before calling map().
Definition at line 658 of file JSON.h.
References llvm::RISCVFenceField::O.