LLVM 22.0.0git
|
This class should be specialized by type that requires custom conversion to/from a YAML scalar with optional tags. More...
#include "llvm/Support/YAMLTraits.h"
This class should be specialized by type that requires custom conversion to/from a YAML scalar with optional tags.
For example:
template <> struct TaggedScalarTraits<MyType> { static void output(const MyType &Value, void*, llvm::raw_ostream &ScalarOut, llvm::raw_ostream &TagOut) { // stream out custom formatting including optional Tag Out << Value; } static StringRef input(StringRef Scalar, StringRef Tag, void*, MyType &Value) { // parse scalar and set value // return empty string on success, or error string return StringRef(); } static QuotingType mustQuote(const MyType &Value, StringRef) { return QuotingType::Single; } };
Definition at line 215 of file YAMLTraits.h.