From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- libcutl/cutl/xml/value-traits.hxx | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 libcutl/cutl/xml/value-traits.hxx (limited to 'libcutl/cutl/xml/value-traits.hxx') diff --git a/libcutl/cutl/xml/value-traits.hxx b/libcutl/cutl/xml/value-traits.hxx new file mode 100644 index 0000000..0b95205 --- /dev/null +++ b/libcutl/cutl/xml/value-traits.hxx @@ -0,0 +1,53 @@ +// file : cutl/xml/value-traits.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_XML_VALUE_TRAITS_HXX +#define CUTL_XML_VALUE_TRAITS_HXX + +#include +#include // std::size_t + +#include + +namespace cutl +{ + namespace xml + { + class parser; + class serializer; + + template + struct default_value_traits + { + static T + parse (std::string, const parser&); + + static std::string + serialize (const T&, const serializer&); + }; + + template <> + struct LIBCUTL_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 + +#endif // CUTL_XML_VALUE_TRAITS_HXX -- cgit v1.2.3