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.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 libcutl/cutl/xml/value-traits.cxx (limited to 'libcutl/cutl/xml/value-traits.cxx') diff --git a/libcutl/cutl/xml/value-traits.cxx b/libcutl/cutl/xml/value-traits.cxx new file mode 100644 index 0000000..7598645 --- /dev/null +++ b/libcutl/cutl/xml/value-traits.cxx @@ -0,0 +1,25 @@ +// file : cutl/xml/value-traits.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include +#include + +using namespace std; + +namespace cutl +{ + namespace xml + { + bool default_value_traits:: + parse (string s, const parser& p) + { + if (s == "true" || s == "1" || s == "True" || s == "TRUE") + return true; + else if (s == "false" || s == "0" || s == "False" || s == "FALSE") + return false; + else + throw parsing (p, "invalid bool value '" + s + "'"); + } + } +} -- cgit v1.2.3