LLVM 22.0.0git
|
The Input class is used to parse a yaml document into in-memory structs and vectors. More...
#include "llvm/Support/YAMLTraits.h"
Public Member Functions | |
Input (StringRef InputContent, void *Ctxt=nullptr, SourceMgr::DiagHandlerTy DiagHandler=nullptr, void *DiagHandlerCtxt=nullptr) | |
Input (MemoryBufferRef Input, void *Ctxt=nullptr, SourceMgr::DiagHandlerTy DiagHandler=nullptr, void *DiagHandlerCtxt=nullptr) | |
~Input () override | |
std::error_code | error () override |
bool | setCurrentDocument () |
bool | nextDocument () |
const Node * | getCurrentNode () const |
Returns the current node that's being parsed by the YAML Parser. | |
void | setAllowUnknownKeys (bool Allow) override |
Public Member Functions inherited from llvm::yaml::IO | |
IO (void *Ctxt=nullptr) | |
virtual | ~IO () |
virtual void | scalarString (StringRef &, QuotingType)=0 |
template<typename T> | |
void | enumCase (T &Val, StringRef Str, const T ConstVal) |
template<typename T> | |
void | enumCase (T &Val, StringRef Str, const uint32_t ConstVal) |
template<typename FBT, typename T> | |
void | enumFallback (T &Val) |
template<typename T> | |
void | bitSetCase (T &Val, StringRef Str, const T ConstVal) |
template<typename T> | |
void | bitSetCase (T &Val, StringRef Str, const uint32_t ConstVal) |
template<typename T> | |
void | maskedBitSetCase (T &Val, StringRef Str, T ConstVal, T Mask) |
template<typename T> | |
void | maskedBitSetCase (T &Val, StringRef Str, uint32_t ConstVal, uint32_t Mask) |
void * | getContext () const |
void | setContext (void *) |
template<typename T> | |
void | mapRequired (StringRef Key, T &Val) |
template<typename T, typename Context> | |
void | mapRequired (StringRef Key, T &Val, Context &Ctx) |
template<typename T> | |
void | mapOptional (StringRef Key, T &Val) |
template<typename T, typename DefaultT> | |
void | mapOptional (StringRef Key, T &Val, const DefaultT &Default) |
template<typename T, typename Context> | |
void | mapOptionalWithContext (StringRef Key, T &Val, Context &Ctx) |
template<typename T, typename Context> | |
void | mapOptionalWithContext (StringRef Key, std::optional< T > &Val, Context &Ctx) |
template<typename T, typename Context, typename DefaultT> | |
void | mapOptionalWithContext (StringRef Key, T &Val, const DefaultT &Default, Context &Ctx) |
The Input class is used to parse a yaml document into in-memory structs and vectors.
It works by using YAMLParser to do a syntax parse of the entire yaml document, then the Input class builds a graph of HNodes which wraps each yaml Node. The extra layer is buffering. The low level yaml parser only lets you look at each node once. The buffering layer lets you search and interate multiple times. This is necessary because the mapRequired() method calls may not be in the same order as the keys in the document.
Definition at line 1313 of file YAMLTraits.h.
Input::Input | ( | StringRef | InputContent, |
void * | Ctxt = nullptr, | ||
SourceMgr::DiagHandlerTy | DiagHandler = nullptr, | ||
void * | DiagHandlerCtxt = nullptr ) |
Definition at line 57 of file YAMLTraits.cpp.
Input::Input | ( | MemoryBufferRef | Input, |
void * | Ctxt = nullptr, | ||
SourceMgr::DiagHandlerTy | DiagHandler = nullptr, | ||
void * | DiagHandlerCtxt = nullptr ) |
Definition at line 65 of file YAMLTraits.cpp.
|
overridedefault |
|
overridevirtual |
Implements llvm::yaml::IO.
Definition at line 75 of file YAMLTraits.cpp.
Returns the current node that's being parsed by the YAML Parser.
Definition at line 106 of file YAMLTraits.cpp.
bool Input::nextDocument | ( | ) |
Definition at line 102 of file YAMLTraits.cpp.
|
overridevirtual |
Reimplemented from llvm::yaml::IO.
Definition at line 473 of file YAMLTraits.cpp.
bool Input::setCurrentDocument | ( | ) |
Definition at line 81 of file YAMLTraits.cpp.