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

The Output class is used to generate a yaml document from in-memory structs and vectors. More...

#include "llvm/Support/YAMLTraits.h"

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

Public Member Functions

 Output (raw_ostream &, void *Ctxt=nullptr, int WrapColumn=70)
 
 ~Output () override
 
void setWriteDefaultValues (bool Write)
 Set whether or not to output optional values which are equal to the default value. More...
 
bool outputting () override
 
bool mapTag (StringRef, bool) override
 
void beginMapping () override
 
void endMapping () override
 
bool preflightKey (const char *key, bool, bool, bool &, void *&) override
 
void postflightKey (void *) override
 
std::vector< StringRefkeys () override
 
void beginFlowMapping () override
 
void endFlowMapping () override
 
unsigned beginSequence () override
 
void endSequence () override
 
bool preflightElement (unsigned, void *&) override
 
void postflightElement (void *) override
 
unsigned beginFlowSequence () override
 
bool preflightFlowElement (unsigned, void *&) override
 
void postflightFlowElement (void *) override
 
void endFlowSequence () override
 
void beginEnumScalar () override
 
bool matchEnumScalar (const char *, bool) override
 
bool matchEnumFallback () override
 
void endEnumScalar () override
 
bool beginBitSetScalar (bool &) override
 
bool bitSetMatch (const char *, bool) override
 
void endBitSetScalar () override
 
void scalarString (StringRef &, bool) override
 
void blockScalarString (StringRef &) override
 
void setError (const Twine &message) override
 
bool canElideEmptySequence () override
 
void beginDocuments ()
 
bool preflightDocument (unsigned)
 
void postflightDocument ()
 
void endDocuments ()
 
- 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 Output class is used to generate a yaml document from in-memory structs and vectors.

Definition at line 1260 of file YAMLTraits.h.

Constructor & Destructor Documentation

◆ Output()

Output::Output ( raw_ostream yout,
void *  Ctxt = nullptr,
int  WrapColumn = 70 
)

Definition at line 419 of file YAMLTraits.cpp.

References ~Output().

◆ ~Output()

Output::~Output ( )
overridedefault

Referenced by Output().

Member Function Documentation

◆ beginBitSetScalar()

bool Output::beginBitSetScalar ( bool DoClear)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 598 of file YAMLTraits.cpp.

◆ beginDocuments()

void Output::beginDocuments ( )

Definition at line 508 of file YAMLTraits.cpp.

Referenced by llvm::yaml::operator<<().

◆ beginEnumScalar()

void Output::beginEnumScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 573 of file YAMLTraits.cpp.

◆ beginFlowMapping()

void Output::beginFlowMapping ( )
overridevirtual

◆ beginFlowSequence()

unsigned Output::beginFlowSequence ( )
overridevirtual

◆ beginMapping()

void Output::beginMapping ( )
overridevirtual

◆ beginSequence()

unsigned Output::beginSequence ( )
overridevirtual

◆ bitSetMatch()

bool Output::bitSetMatch ( const char Str,
bool  Matches 
)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 606 of file YAMLTraits.cpp.

◆ blockScalarString()

void Output::blockScalarString ( StringRef S)
overridevirtual

◆ canElideEmptySequence()

bool Output::canElideEmptySequence ( )
overridevirtual

◆ endBitSetScalar()

void Output::endBitSetScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 616 of file YAMLTraits.cpp.

◆ endDocuments()

void Output::endDocuments ( )

Definition at line 521 of file YAMLTraits.cpp.

Referenced by llvm::yaml::operator<<().

◆ endEnumScalar()

void Output::endEnumScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 593 of file YAMLTraits.cpp.

References llvm_unreachable.

◆ endFlowMapping()

void Output::endFlowMapping ( )
overridevirtual

◆ endFlowSequence()

void Output::endFlowSequence ( )
overridevirtual

◆ endMapping()

void Output::endMapping ( )
overridevirtual

◆ endSequence()

void Output::endSequence ( )
overridevirtual

◆ keys()

std::vector< StringRef > Output::keys ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 466 of file YAMLTraits.cpp.

References llvm::report_fatal_error().

◆ mapTag()

bool Output::mapTag ( StringRef  Tag,
bool  Use 
)
overridevirtual

◆ matchEnumFallback()

bool Output::matchEnumFallback ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 586 of file YAMLTraits.cpp.

◆ matchEnumScalar()

bool Output::matchEnumScalar ( const char Str,
bool  Match 
)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 577 of file YAMLTraits.cpp.

◆ outputting()

bool Output::outputting ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 424 of file YAMLTraits.cpp.

◆ postflightDocument()

void Output::postflightDocument ( )

Definition at line 518 of file YAMLTraits.cpp.

Referenced by llvm::yaml::operator<<().

◆ postflightElement()

void Output::postflightElement ( void *  )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 539 of file YAMLTraits.cpp.

◆ postflightFlowElement()

void Output::postflightFlowElement ( void *  )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 569 of file YAMLTraits.cpp.

◆ postflightKey()

void Output::postflightKey ( void *  )
overridevirtual

◆ preflightDocument()

bool Output::preflightDocument ( unsigned  index)

Definition at line 512 of file YAMLTraits.cpp.

Referenced by llvm::yaml::operator<<().

◆ preflightElement()

bool Output::preflightElement ( unsigned  ,
void *&   
)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 535 of file YAMLTraits.cpp.

◆ preflightFlowElement()

bool Output::preflightFlowElement ( unsigned  ,
void *&   
)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 556 of file YAMLTraits.cpp.

◆ preflightKey()

bool Output::preflightKey ( const char key,
bool  Required,
bool  SameAsDefault,
bool UseDefault,
void *&   
)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 470 of file YAMLTraits.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::back().

◆ scalarString()

void Output::scalarString ( StringRef S,
bool  MustQuote 
)
overridevirtual

◆ setError()

void Output::setError ( const Twine message)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 669 of file YAMLTraits.cpp.

◆ setWriteDefaultValues()

void llvm::yaml::Output::setWriteDefaultValues ( bool  Write)
inline

Set whether or not to output optional values which are equal to the default value.

By default, when outputting if you attempt to write a value that is equal to the default, the value gets ignored. Sometimes, it is useful to be able to see these in the resulting YAML anyway.

Definition at line 1270 of file YAMLTraits.h.

Referenced by llvm::MIRPrinter::print().


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