LLVM: llvm::yaml::TaggedScalarTraits< T > Struct Template Reference (original) (raw)

This class should be specialized by type that requires custom conversion to/from a YAML scalar with optional tags. More...

template<typename T>
struct llvm::yaml::TaggedScalarTraits< T >

This class should be specialized by type that requires custom conversion to/from a YAML scalar with optional tags.

For example:

template <> struct TaggedScalarTraits { 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.