LLVM  6.0.0svn
Classes | Public Member Functions | List of all members
llvm::yaml::Input Class Reference

The Input class is used to parse a yaml document into in-memory structs and vectors. More...

#include "llvm/Support/YAMLTraits.h"

Inheritance diagram for llvm::yaml::Input:
Inheritance graph
[legend]
Collaboration diagram for llvm::yaml::Input:
Collaboration graph
[legend]

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 ()
 
bool setCurrentDocument ()
 
bool nextDocument ()
 
const NodegetCurrentNode () const
 Returns the current node that's being parsed by the YAML Parser. More...
 
- Public Member Functions inherited from llvm::yaml::IO
 IO (void *Ctxt=nullptr)
 
virtual ~IO ()
 
template<typename T >
void enumCase (T &Val, const char *Str, const T ConstVal)
 
template<typename T >
void enumCase (T &Val, const char *Str, const uint32_t ConstVal)
 
template<typename FBT , typename T >
void enumFallback (T &Val)
 
template<typename T >
void bitSetCase (T &Val, const char *Str, const T ConstVal)
 
template<typename T >
void bitSetCase (T &Val, const char *Str, const uint32_t ConstVal)
 
template<typename T >
void maskedBitSetCase (T &Val, const char *Str, T ConstVal, T Mask)
 
template<typename T >
void maskedBitSetCase (T &Val, const char *Str, uint32_t ConstVal, uint32_t Mask)
 
void * getContext ()
 
void setContext (void *)
 
template<typename T >
void mapRequired (const char *Key, T &Val)
 
template<typename T , typename Context >
void mapRequired (const char *Key, T &Val, Context &Ctx)
 
template<typename T >
void mapOptional (const char *Key, T &Val)
 
template<typename T >
void mapOptional (const char *Key, T &Val, const T &Default)
 
template<typename T , typename Context >
std::enable_if< has_SequenceTraits< T >::value, void >::type mapOptionalWithContext (const char *Key, T &Val, Context &Ctx)
 
template<typename T , typename Context >
void mapOptionalWithContext (const char *Key, Optional< T > &Val, Context &Ctx)
 
template<typename T , typename Context >
std::enable_if<!has_SequenceTraits< T >::value, void >::type mapOptionalWithContext (const char *Key, T &Val, Context &Ctx)
 
template<typename T , typename Context >
void mapOptionalWithContext (const char *Key, T &Val, const T &Default, Context &Ctx)
 

Detailed Description

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 1108 of file YAMLTraits.h.

Constructor & Destructor Documentation

◆ Input() [1/2]

Input::Input ( StringRef  InputContent,
void *  Ctxt = nullptr,
SourceMgr::DiagHandlerTy  DiagHandler = nullptr,
void *  DiagHandlerCtxt = nullptr 
)

Definition at line 55 of file YAMLTraits.cpp.

References llvm::SourceMgr::setDiagHandler().

◆ Input() [2/2]

Input::Input ( MemoryBufferRef  Input,
void *  Ctxt = nullptr,
SourceMgr::DiagHandlerTy  DiagHandler = nullptr,
void *  DiagHandlerCtxt = nullptr 
)

Definition at line 63 of file YAMLTraits.cpp.

References llvm::SourceMgr::setDiagHandler(), and ~Input().

◆ ~Input()

Input::~Input ( )
overridedefault

Referenced by Input().

Member Function Documentation

◆ error()

std::error_code Input::error ( )

◆ getCurrentNode()

const Node * Input::getCurrentNode ( ) const

◆ nextDocument()

bool Input::nextDocument ( )

◆ setCurrentDocument()

bool Input::setCurrentDocument ( )

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