LLVM API Documentation

llvm::yaml::ScalarTraits< T > Struct Template Reference

#include <YAMLTraits.h>


Detailed Description

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

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 bool mustQuote(StringRef) { return true; } };

Definition at line 105 of file YAMLTraits.h.


The documentation for this struct was generated from the following file: