From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- libxsd/xsd/cxx/tree/bits/literals.hxx | 183 ++++++++++ libxsd/xsd/cxx/tree/bits/literals.ixx | 606 ++++++++++++++++++++++++++++++++++ 2 files changed, 789 insertions(+) create mode 100644 libxsd/xsd/cxx/tree/bits/literals.hxx create mode 100644 libxsd/xsd/cxx/tree/bits/literals.ixx (limited to 'libxsd/xsd/cxx/tree/bits') diff --git a/libxsd/xsd/cxx/tree/bits/literals.hxx b/libxsd/xsd/cxx/tree/bits/literals.hxx new file mode 100644 index 0000000..186e0dc --- /dev/null +++ b/libxsd/xsd/cxx/tree/bits/literals.hxx @@ -0,0 +1,183 @@ +// file : xsd/cxx/tree/bits/literals.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_BITS_LITERALS_HXX +#define XSD_CXX_TREE_BITS_LITERALS_HXX + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // Boolean literals + // + template + const C* + true_ (); + + template + const C* + one (); + + // Float literals: INF -INF NaN. + // + template + const C* + positive_inf (); + + template + const C* + negative_inf (); + + template + const C* + nan (); + + // Optional "not present" literal. + // + template + const C* + not_present (); + + // XML Schema namespace + // + template + const C* + xml_schema (); + + // Built-in XML Schema type names. + // + template + const C* + any_type (); + + template + const C* + any_simple_type (); + + template + const C* + string (); + + template + const C* + normalized_string (); + + template + const C* + token (); + + template + const C* + name (); + + template + const C* + nmtoken (); + + template + const C* + nmtokens (); + + template + const C* + ncname (); + + template + const C* + language (); + + template + const C* + id (); + + template + const C* + idref (); + + template + const C* + idrefs (); + + template + const C* + any_uri (); + + template + const C* + qname (); + + template + const C* + base64_binary (); + + template + const C* + hex_binary (); + + template + const C* + date (); + + template + const C* + date_time (); + + template + const C* + duration (); + + template + const C* + gday (); + + template + const C* + gmonth (); + + template + const C* + gmonth_day (); + + template + const C* + gyear (); + + template + const C* + gyear_month (); + + template + const C* + time (); + + template + const C* + entity (); + + template + const C* + entities (); + + // gday ("---") and gmonth ("--") prefixes. + // + template + const C* + gday_prefix (); + + template + const C* + gmonth_prefix (); + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_HXX + +#include diff --git a/libxsd/xsd/cxx/tree/bits/literals.ixx b/libxsd/xsd/cxx/tree/bits/literals.ixx new file mode 100644 index 0000000..d2620e6 --- /dev/null +++ b/libxsd/xsd/cxx/tree/bits/literals.ixx @@ -0,0 +1,606 @@ +// file : xsd/cxx/tree/bits/literals.ixx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX +#define XSD_CXX_TREE_BITS_LITERALS_IXX + +// The char versions of the following literals are required even +// if we are using wchar_t as the character type. +// +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const char* + positive_inf () + { + return "INF"; + } + + template<> + inline const char* + negative_inf () + { + return "-INF"; + } + + template<> + inline const char* + nan () + { + return "NaN"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX + + +#if defined(XSD_CXX_TREE_USE_CHAR) || !defined(XSD_CXX_TREE_USE_WCHAR) + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR +#define XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const char* + true_ () + { + return "true"; + } + + template<> + inline const char* + one () + { + return "1"; + } + + // + // + template<> + inline const char* + not_present () + { + return ""; + } + + // + // + template <> + inline const char* + xml_schema () + { + return "http://www.w3.org/2001/XMLSchema"; + } + + // + // + template <> + inline const char* + any_type () + { + return "anyType"; + } + + template <> + inline const char* + any_simple_type () + { + return "anySimpleType"; + } + + template <> + inline const char* + string () + { + return "string"; + } + + template <> + inline const char* + normalized_string () + { + return "normalizedString"; + } + + template <> + inline const char* + token () + { + return "token"; + } + + template <> + inline const char* + name () + { + return "Name"; + } + + template <> + inline const char* + nmtoken () + { + return "NMTOKEN"; + } + + template <> + inline const char* + nmtokens () + { + return "NMTOKENS"; + } + + template <> + inline const char* + ncname () + { + return "NCName"; + } + + template <> + inline const char* + language () + { + return "language"; + } + + + template <> + inline const char* + id () + { + return "ID"; + } + + template <> + inline const char* + idref () + { + return "IDREF"; + } + + template <> + inline const char* + idrefs () + { + return "IDREFS"; + } + + template <> + inline const char* + any_uri () + { + return "anyURI"; + } + + template <> + inline const char* + qname () + { + return "QName"; + } + + template <> + inline const char* + base64_binary () + { + return "base64Binary"; + } + + template <> + inline const char* + hex_binary () + { + return "hexBinary"; + } + + template <> + inline const char* + date () + { + return "date"; + } + + template <> + inline const char* + date_time () + { + return "dateTime"; + } + + template <> + inline const char* + duration () + { + return "duration"; + } + + template <> + inline const char* + gday () + { + return "gDay"; + } + + template <> + inline const char* + gmonth () + { + return "gMonth"; + } + + template <> + inline const char* + gmonth_day () + { + return "gMonthDay"; + } + + template <> + inline const char* + gyear () + { + return "gYear"; + } + + template <> + inline const char* + gyear_month () + { + return "gYearMonth"; + } + + template <> + inline const char* + time () + { + return "time"; + } + + template <> + inline const char* + entity () + { + return "ENTITY"; + } + + template <> + inline const char* + entities () + { + return "ENTITIES"; + } + + template <> + inline const char* + gday_prefix () + { + return "---"; + } + + template <> + inline const char* + gmonth_prefix () + { + return "--"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR +#endif // XSD_CXX_TREE_USE_CHAR + + +#if defined(XSD_CXX_TREE_USE_WCHAR) || !defined(XSD_CXX_TREE_USE_CHAR) + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR +#define XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const wchar_t* + true_ () + { + return L"true"; + } + + template<> + inline const wchar_t* + one () + { + return L"1"; + } + + // + // + template<> + inline const wchar_t* + positive_inf () + { + return L"INF"; + } + + template<> + inline const wchar_t* + negative_inf () + { + return L"-INF"; + } + + template<> + inline const wchar_t* + nan () + { + return L"NaN"; + } + + // + // + template<> + inline const wchar_t* + not_present () + { + return L""; + } + + // + // + template <> + inline const wchar_t* + xml_schema () + { + return L"http://www.w3.org/2001/XMLSchema"; + } + + // + // + template <> + inline const wchar_t* + any_type () + { + return L"anyType"; + } + + template <> + inline const wchar_t* + any_simple_type () + { + return L"anySimpleType"; + } + + template <> + inline const wchar_t* + string () + { + return L"string"; + } + + template <> + inline const wchar_t* + normalized_string () + { + return L"normalizedString"; + } + + template <> + inline const wchar_t* + token () + { + return L"token"; + } + + template <> + inline const wchar_t* + name () + { + return L"Name"; + } + + template <> + inline const wchar_t* + nmtoken () + { + return L"NMTOKEN"; + } + + template <> + inline const wchar_t* + nmtokens () + { + return L"NMTOKENS"; + } + + template <> + inline const wchar_t* + ncname () + { + return L"NCName"; + } + + template <> + inline const wchar_t* + language () + { + return L"language"; + } + + + template <> + inline const wchar_t* + id () + { + return L"ID"; + } + + template <> + inline const wchar_t* + idref () + { + return L"IDREF"; + } + + template <> + inline const wchar_t* + idrefs () + { + return L"IDREFS"; + } + + template <> + inline const wchar_t* + any_uri () + { + return L"anyURI"; + } + + template <> + inline const wchar_t* + qname () + { + return L"QName"; + } + + template <> + inline const wchar_t* + base64_binary () + { + return L"base64Binary"; + } + + template <> + inline const wchar_t* + hex_binary () + { + return L"hexBinary"; + } + + template <> + inline const wchar_t* + date () + { + return L"date"; + } + + template <> + inline const wchar_t* + date_time () + { + return L"dateTime"; + } + + template <> + inline const wchar_t* + duration () + { + return L"duration"; + } + + template <> + inline const wchar_t* + gday () + { + return L"gDay"; + } + + template <> + inline const wchar_t* + gmonth () + { + return L"gMonth"; + } + + template <> + inline const wchar_t* + gmonth_day () + { + return L"gMonthDay"; + } + + template <> + inline const wchar_t* + gyear () + { + return L"gYear"; + } + + template <> + inline const wchar_t* + gyear_month () + { + return L"gYearMonth"; + } + + template <> + inline const wchar_t* + time () + { + return L"time"; + } + + template <> + inline const wchar_t* + entity () + { + return L"ENTITY"; + } + + template <> + inline const wchar_t* + entities () + { + return L"ENTITIES"; + } + + template <> + inline const wchar_t* + gday_prefix () + { + return L"---"; + } + + template <> + inline const wchar_t* + gmonth_prefix () + { + return L"--"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR +#endif // XSD_CXX_TREE_USE_WCHAR -- cgit v1.1