LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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(); } };

Definition at line 103 of file YAMLTraits.h.


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