struct ScalarTraits

Declaration

template <typename T, typename Enable = void>
struct ScalarTraits { /* full declaration omitted */ };

Description

This class should be specialized by type that requires custom conversion to/from a yaml scalar. For example: template < > struct ScalarTraits <MyType > { static void output(const MyType &val , void*, llvm::raw_ostream &out ) { // stream out custom formatting out < < llvm::format("%x", val); } static StringRef input(StringRef scalar, void*, MyType &value ) { // parse scalar and set `value` // return empty string on success, or error string return StringRef(); } static QuotingType mustQuote(StringRef) { return QuotingType::Single; } };

Declared at: llvm/include/llvm/Support/YAMLTraits.h:146

Templates

T
Enable = void