From e897aa91a2a5c68a2f795f6a0a995600f13a85f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 May 2014 21:29:29 -0700 Subject: Convert to extension-less headers for API --- xml/value-traits | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 xml/value-traits (limited to 'xml/value-traits') diff --git a/xml/value-traits b/xml/value-traits new file mode 100644 index 0000000..3bf10e0 --- /dev/null +++ b/xml/value-traits @@ -0,0 +1,53 @@ +// file : xml/value-traits -*- C++ -*- +// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef XML_VALUE_TRAITS +#define XML_VALUE_TRAITS + +#include + +#include +#include // std::size_t + +#include + +#include + +namespace xml +{ + template + struct default_value_traits + { + static T + parse (std::string, const parser&); + + static std::string + serialize (const T&, const serializer&); + }; + + template <> + struct LIBSTUDXML_EXPORT default_value_traits + { + static bool + parse (std::string, const parser&); + + static std::string + serialize (bool v, const serializer&) + { + return v ? "true" : "false"; + } + }; + + template + struct value_traits: default_value_traits {}; + + template + struct value_traits: default_value_traits {}; +} + +#include + +#include + +#endif // XML_VALUE_TRAITS -- cgit v1.1