diff options
Diffstat (limited to 'libxsde/xsde/cxx')
43 files changed, 805 insertions, 200 deletions
diff --git a/libxsde/xsde/cxx/hybrid/any-type.hxx b/libxsde/xsde/cxx/hybrid/any-type.hxx index 0517292..a356564 100644 --- a/libxsde/xsde/cxx/hybrid/any-type.hxx +++ b/libxsde/xsde/cxx/hybrid/any-type.hxx @@ -43,22 +43,6 @@ namespace xsde #endif */ }; - - struct any_simple_type - { - }; - - inline bool - operator== (const any_simple_type&, const any_simple_type&) - { - return true; - } - - inline bool - operator!= (const any_simple_type&, const any_simple_type&) - { - return false; - } } } } diff --git a/libxsde/xsde/cxx/hybrid/cdr/istream.hxx b/libxsde/xsde/cxx/hybrid/cdr/istream.hxx index 9dc5cb6..740cfc4 100644 --- a/libxsde/xsde/cxx/hybrid/cdr/istream.hxx +++ b/libxsde/xsde/cxx/hybrid/cdr/istream.hxx @@ -123,7 +123,6 @@ namespace xsde #ifdef XSDE_EXCEPTIONS void operator>> (icdrstream&, any_type&); - void operator>> (icdrstream&, any_simple_type&); void operator>> (icdrstream&, qname&); void operator>> (icdrstream&, string_sequence&); void operator>> (icdrstream&, time_zone&); @@ -138,7 +137,6 @@ namespace xsde void operator>> (icdrstream&, time&); #else bool operator>> (icdrstream&, any_type&); - bool operator>> (icdrstream&, any_simple_type&); bool operator>> (icdrstream&, qname&); bool operator>> (icdrstream&, string_sequence&); bool operator>> (icdrstream&, time_zone&); diff --git a/libxsde/xsde/cxx/hybrid/cdr/istream.ixx b/libxsde/xsde/cxx/hybrid/cdr/istream.ixx index 53a9575..53e7cbf 100644 --- a/libxsde/xsde/cxx/hybrid/cdr/istream.ixx +++ b/libxsde/xsde/cxx/hybrid/cdr/istream.ixx @@ -187,11 +187,6 @@ namespace xsde { } - inline void - operator>> (icdrstream&, any_simple_type&) - { - } - #else // XSDE_EXCEPTIONS inline bool icdrstream:: @@ -373,12 +368,6 @@ namespace xsde return true; } - inline bool - operator>> (icdrstream&, any_simple_type&) - { - return true; - } - #endif // XSDE_EXCEPTIONS } } diff --git a/libxsde/xsde/cxx/hybrid/cdr/ostream.hxx b/libxsde/xsde/cxx/hybrid/cdr/ostream.hxx index 8485241..2c58907 100644 --- a/libxsde/xsde/cxx/hybrid/cdr/ostream.hxx +++ b/libxsde/xsde/cxx/hybrid/cdr/ostream.hxx @@ -123,7 +123,6 @@ namespace xsde #ifdef XSDE_EXCEPTIONS void operator<< (ocdrstream&, const any_type&); - void operator<< (ocdrstream&, const any_simple_type&); void operator<< (ocdrstream&, const qname&); void operator<< (ocdrstream&, const string_sequence&); void operator<< (ocdrstream&, const time_zone&); @@ -138,7 +137,6 @@ namespace xsde void operator<< (ocdrstream&, const time&); #else bool operator<< (ocdrstream&, const any_type&); - bool operator<< (ocdrstream&, const any_simple_type&); bool operator<< (ocdrstream&, const qname&); bool operator<< (ocdrstream&, const string_sequence&); bool operator<< (ocdrstream&, const time_zone&); diff --git a/libxsde/xsde/cxx/hybrid/cdr/ostream.ixx b/libxsde/xsde/cxx/hybrid/cdr/ostream.ixx index aa01ad1..d2b38b4 100644 --- a/libxsde/xsde/cxx/hybrid/cdr/ostream.ixx +++ b/libxsde/xsde/cxx/hybrid/cdr/ostream.ixx @@ -131,11 +131,6 @@ namespace xsde { } - inline void - operator<< (ocdrstream&, const any_simple_type&) - { - } - #else // XSDE_EXCEPTIONS inline bool ocdrstream:: @@ -233,12 +228,6 @@ namespace xsde return true; } - inline bool - operator<< (ocdrstream&, const any_simple_type&) - { - return true; - } - #endif // XSDE_EXCEPTIONS } } diff --git a/libxsde/xsde/cxx/hybrid/xdr/istream.hxx b/libxsde/xsde/cxx/hybrid/xdr/istream.hxx index 188ee58..b7185c3 100644 --- a/libxsde/xsde/cxx/hybrid/xdr/istream.hxx +++ b/libxsde/xsde/cxx/hybrid/xdr/istream.hxx @@ -124,7 +124,6 @@ namespace xsde #ifdef XSDE_EXCEPTIONS void operator>> (ixdrstream&, any_type&); - void operator>> (ixdrstream&, any_simple_type&); void operator>> (ixdrstream&, qname&); void operator>> (ixdrstream&, string_sequence&); void operator>> (ixdrstream&, time_zone&); @@ -139,7 +138,6 @@ namespace xsde void operator>> (ixdrstream&, time&); #else bool operator>> (ixdrstream&, any_type&); - bool operator>> (ixdrstream&, any_simple_type&); bool operator>> (ixdrstream&, qname&); bool operator>> (ixdrstream&, string_sequence&); bool operator>> (ixdrstream&, time_zone&); diff --git a/libxsde/xsde/cxx/hybrid/xdr/istream.ixx b/libxsde/xsde/cxx/hybrid/xdr/istream.ixx index f11fd5c..4c9c585 100644 --- a/libxsde/xsde/cxx/hybrid/xdr/istream.ixx +++ b/libxsde/xsde/cxx/hybrid/xdr/istream.ixx @@ -163,11 +163,6 @@ namespace xsde { } - inline void - operator>> (ixdrstream&, any_simple_type&) - { - } - #else // XSDE_EXCEPTIONS inline bool ixdrstream:: @@ -301,12 +296,6 @@ namespace xsde return true; } - inline bool - operator>> (ixdrstream&, any_simple_type&) - { - return true; - } - #endif // XSDE_EXCEPTIONS } } diff --git a/libxsde/xsde/cxx/hybrid/xdr/ostream.hxx b/libxsde/xsde/cxx/hybrid/xdr/ostream.hxx index bf6a3fe..1af22dd 100644 --- a/libxsde/xsde/cxx/hybrid/xdr/ostream.hxx +++ b/libxsde/xsde/cxx/hybrid/xdr/ostream.hxx @@ -124,7 +124,6 @@ namespace xsde #ifdef XSDE_EXCEPTIONS void operator<< (oxdrstream&, const any_type&); - void operator<< (oxdrstream&, const any_simple_type&); void operator<< (oxdrstream&, const qname&); void operator<< (oxdrstream&, const string_sequence&); void operator<< (oxdrstream&, const time_zone&); @@ -139,7 +138,6 @@ namespace xsde void operator<< (oxdrstream&, const time&); #else bool operator<< (oxdrstream&, const any_type&); - bool operator<< (oxdrstream&, const any_simple_type&); bool operator<< (oxdrstream&, const qname&); bool operator<< (oxdrstream&, const string_sequence&); bool operator<< (oxdrstream&, const time_zone&); diff --git a/libxsde/xsde/cxx/hybrid/xdr/ostream.ixx b/libxsde/xsde/cxx/hybrid/xdr/ostream.ixx index f31968f..4dc9bd9 100644 --- a/libxsde/xsde/cxx/hybrid/xdr/ostream.ixx +++ b/libxsde/xsde/cxx/hybrid/xdr/ostream.ixx @@ -153,11 +153,6 @@ namespace xsde { } - inline void - operator<< (oxdrstream&, const any_simple_type&) - { - } - #else // XSDE_EXCEPTIONS inline bool oxdrstream:: @@ -265,12 +260,6 @@ namespace xsde return true; } - inline bool - operator<< (oxdrstream&, const any_simple_type&) - { - return true; - } - #endif // XSDE_EXCEPTIONS } } diff --git a/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.cxx b/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.cxx new file mode 100644 index 0000000..5ebccaf --- /dev/null +++ b/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.cxx @@ -0,0 +1,38 @@ +// file : xsde/cxx/parser/non-validating/any-simple-type-stl.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/parser/non-validating/any-simple-type-stl.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace non_validating + { + void any_simple_type_pimpl:: + _pre () + { + str_.erase (); + } + + void any_simple_type_pimpl:: + _characters (const ro_string& s) + { + str_ += s; + } + + std::string any_simple_type_pimpl:: + post_any_simple_type () + { + std::string r; + r.swap (str_); + return r; + } + } + } + } +} diff --git a/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.hxx b/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.hxx new file mode 100644 index 0000000..94c061f --- /dev/null +++ b/libxsde/xsde/cxx/parser/non-validating/any-simple-type-stl.hxx @@ -0,0 +1,44 @@ +// file : xsde/cxx/parser/non-validating/any-simple-type-stl.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX +#define XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX + +#include <string> + +#include <xsde/cxx/parser/non-validating/xml-schema-pskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace non_validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_pimpl: virtual any_simple_type_pskel +#else + struct any_simple_type_pimpl: any_simple_type_pskel +#endif + { + virtual void + _pre (); + + virtual void + _characters (const ro_string&); + + virtual std::string + post_any_simple_type (); + + protected: + std::string str_; + }; + } + } + } +} + +#endif // XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX diff --git a/libxsde/xsde/cxx/parser/non-validating/any-simple-type.cxx b/libxsde/xsde/cxx/parser/non-validating/any-simple-type.cxx new file mode 100644 index 0000000..342f98c --- /dev/null +++ b/libxsde/xsde/cxx/parser/non-validating/any-simple-type.cxx @@ -0,0 +1,48 @@ +// file : xsde/cxx/parser/non-validating/any-simple-type.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/config.hxx> + +#include <xsde/cxx/parser/non-validating/any-simple-type.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace non_validating + { + void any_simple_type_pimpl:: + _pre () + { +#ifdef XSDE_EXCEPTIONS + str_.assign ("", 0); +#else + if (str_.assign ("", 0)) + _sys_error (sys_error::no_memory); +#endif + } + + void any_simple_type_pimpl:: + _characters (const ro_string& s) + { +#ifdef XSDE_EXCEPTIONS + str_.append (s.data (), s.size ()); +#else + if (str_.append (s.data (), s.size ())) + _sys_error (sys_error::no_memory); +#endif + } + + char* any_simple_type_pimpl:: + post_any_simple_type () + { + return str_.detach (); + } + } + } + } +} diff --git a/libxsde/xsde/cxx/parser/non-validating/any-simple-type.hxx b/libxsde/xsde/cxx/parser/non-validating/any-simple-type.hxx new file mode 100644 index 0000000..612f976 --- /dev/null +++ b/libxsde/xsde/cxx/parser/non-validating/any-simple-type.hxx @@ -0,0 +1,44 @@ +// file : xsde/cxx/parser/non-validating/any-simple-type.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX +#define XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX + +#include <xsde/cxx/string.hxx> + +#include <xsde/cxx/parser/non-validating/xml-schema-pskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace non_validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_pimpl: virtual any_simple_type_pskel +#else + struct any_simple_type_pimpl: any_simple_type_pskel +#endif + { + virtual void + _pre (); + + virtual void + _characters (const ro_string&); + + virtual char* + post_any_simple_type (); + + protected: + string str_; + }; + } + } + } +} + +#endif // XSDE_CXX_PARSER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX diff --git a/libxsde/xsde/cxx/parser/non-validating/any-type.hxx b/libxsde/xsde/cxx/parser/non-validating/any-type.hxx index 3b7b68e..0587872 100644 --- a/libxsde/xsde/cxx/parser/non-validating/any-type.hxx +++ b/libxsde/xsde/cxx/parser/non-validating/any-type.hxx @@ -16,8 +16,6 @@ namespace xsde { namespace non_validating { - // any_type - // #ifdef XSDE_REUSE_STYLE_MIXIN struct any_type_pimpl: virtual any_type_pskel #else @@ -25,16 +23,6 @@ namespace xsde #endif { }; - - // any_simple_type - // -#ifdef XSDE_REUSE_STYLE_MIXIN - struct any_simple_type_pimpl: virtual any_simple_type_pskel -#else - struct any_simple_type_pimpl: any_simple_type_pskel -#endif - { - }; } } } diff --git a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pimpl.hxx b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pimpl.hxx index c150fdf..756e11a 100644 --- a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pimpl.hxx +++ b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pimpl.hxx @@ -9,6 +9,13 @@ #include <xsde/cxx/parser/non-validating/xml-schema-pskel.hxx> #include <xsde/cxx/parser/non-validating/any-type.hxx> + +#ifdef XSDE_STL +# include <xsde/cxx/parser/non-validating/any-simple-type-stl.hxx> +#else +# include <xsde/cxx/parser/non-validating/any-simple-type.hxx> +#endif + #include <xsde/cxx/parser/non-validating/boolean.hxx> #include <xsde/cxx/parser/non-validating/byte.hxx> #include <xsde/cxx/parser/non-validating/unsigned-byte.hxx> diff --git a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.cxx b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.cxx index 67ac5c8..e673a65 100644 --- a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.cxx +++ b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.cxx @@ -67,24 +67,6 @@ namespace xsde #endif } - // any_simple_type - // - - bool any_simple_type_pskel:: - _characters_impl (const ro_string&) - { - return false; - } - - void any_simple_type_pskel:: - post_any_simple_type () - { -#ifdef XSDE_REUSE_STYLE_TIEIN - if (any_simple_type_impl_) - any_simple_type_impl_->post_any_simple_type (); -#endif - } - // static/dynamic_type function implementations. // @@ -609,4 +591,3 @@ namespace xsde } } } - diff --git a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx index 6b98277..17e4578 100644 --- a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx +++ b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx @@ -74,11 +74,12 @@ namespace xsde struct any_simple_type_pskel: simple_content { - virtual bool - _characters_impl (const ro_string&); - - virtual void - post_any_simple_type (); +#ifdef XSDE_STL + virtual std::string +#else + virtual char* +#endif + post_any_simple_type () = 0; #ifdef XSDE_POLYMORPHIC static const char* @@ -97,7 +98,6 @@ namespace xsde #endif }; - // Boolean. // diff --git a/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.cxx b/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.cxx new file mode 100644 index 0000000..b8fef17 --- /dev/null +++ b/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.cxx @@ -0,0 +1,38 @@ +// file : xsde/cxx/parser/validating/any-simple-type-stl.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/parser/validating/any-simple-type-stl.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace validating + { + void any_simple_type_pimpl:: + _pre () + { + str_.erase (); + } + + void any_simple_type_pimpl:: + _characters (const ro_string& s) + { + str_ += s; + } + + std::string any_simple_type_pimpl:: + post_any_simple_type () + { + std::string r; + r.swap (str_); + return r; + } + } + } + } +} diff --git a/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.hxx b/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.hxx new file mode 100644 index 0000000..71931b8 --- /dev/null +++ b/libxsde/xsde/cxx/parser/validating/any-simple-type-stl.hxx @@ -0,0 +1,44 @@ +// file : xsde/cxx/parser/validating/any-simple-type-stl.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX +#define XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX + +#include <string> + +#include <xsde/cxx/parser/validating/xml-schema-pskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_pimpl: virtual any_simple_type_pskel +#else + struct any_simple_type_pimpl: any_simple_type_pskel +#endif + { + virtual void + _pre (); + + virtual void + _characters (const ro_string&); + + virtual std::string + post_any_simple_type (); + + protected: + std::string str_; + }; + } + } + } +} + +#endif // XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX diff --git a/libxsde/xsde/cxx/parser/validating/any-simple-type.cxx b/libxsde/xsde/cxx/parser/validating/any-simple-type.cxx new file mode 100644 index 0000000..943e600 --- /dev/null +++ b/libxsde/xsde/cxx/parser/validating/any-simple-type.cxx @@ -0,0 +1,48 @@ +// file : xsde/cxx/parser/validating/any-simple-type.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/config.hxx> + +#include <xsde/cxx/parser/validating/any-simple-type.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace validating + { + void any_simple_type_pimpl:: + _pre () + { +#ifdef XSDE_EXCEPTIONS + str_.assign ("", 0); +#else + if (str_.assign ("", 0)) + _sys_error (sys_error::no_memory); +#endif + } + + void any_simple_type_pimpl:: + _characters (const ro_string& s) + { +#ifdef XSDE_EXCEPTIONS + str_.append (s.data (), s.size ()); +#else + if (str_.append (s.data (), s.size ())) + _sys_error (sys_error::no_memory); +#endif + } + + char* any_simple_type_pimpl:: + post_any_simple_type () + { + return str_.detach (); + } + } + } + } +} diff --git a/libxsde/xsde/cxx/parser/validating/any-simple-type.hxx b/libxsde/xsde/cxx/parser/validating/any-simple-type.hxx new file mode 100644 index 0000000..2aa6b9a --- /dev/null +++ b/libxsde/xsde/cxx/parser/validating/any-simple-type.hxx @@ -0,0 +1,44 @@ +// file : xsde/cxx/parser/validating/any-simple-type.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_HXX +#define XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_HXX + +#include <xsde/cxx/string.hxx> + +#include <xsde/cxx/parser/validating/xml-schema-pskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace parser + { + namespace validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_pimpl: virtual any_simple_type_pskel +#else + struct any_simple_type_pimpl: any_simple_type_pskel +#endif + { + virtual void + _pre (); + + virtual void + _characters (const ro_string&); + + virtual char* + post_any_simple_type (); + + protected: + string str_; + }; + } + } + } +} + +#endif // XSDE_CXX_PARSER_VALIDATING_ANY_SIMPLE_TYPE_HXX diff --git a/libxsde/xsde/cxx/parser/validating/any-type.hxx b/libxsde/xsde/cxx/parser/validating/any-type.hxx index a8b2cb5..f8d1c08 100644 --- a/libxsde/xsde/cxx/parser/validating/any-type.hxx +++ b/libxsde/xsde/cxx/parser/validating/any-type.hxx @@ -16,8 +16,6 @@ namespace xsde { namespace validating { - // any_type - // #ifdef XSDE_REUSE_STYLE_MIXIN struct any_type_pimpl: virtual any_type_pskel #else @@ -25,16 +23,6 @@ namespace xsde #endif { }; - - // any_simple_type - // -#ifdef XSDE_REUSE_STYLE_MIXIN - struct any_simple_type_pimpl: virtual any_simple_type_pskel -#else - struct any_simple_type_pimpl: any_simple_type_pskel -#endif - { - }; } } } diff --git a/libxsde/xsde/cxx/parser/validating/xml-schema-pimpl.hxx b/libxsde/xsde/cxx/parser/validating/xml-schema-pimpl.hxx index 6353607..4a898ce 100644 --- a/libxsde/xsde/cxx/parser/validating/xml-schema-pimpl.hxx +++ b/libxsde/xsde/cxx/parser/validating/xml-schema-pimpl.hxx @@ -9,6 +9,13 @@ #include <xsde/cxx/parser/validating/xml-schema-pskel.hxx> #include <xsde/cxx/parser/validating/any-type.hxx> + +#ifdef XSDE_STL +# include <xsde/cxx/parser/validating/any-simple-type-stl.hxx> +#else +# include <xsde/cxx/parser/validating/any-simple-type.hxx> +#endif + #include <xsde/cxx/parser/validating/boolean.hxx> #include <xsde/cxx/parser/validating/byte.hxx> #include <xsde/cxx/parser/validating/unsigned-byte.hxx> diff --git a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.cxx b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.cxx index a94766c..2e0a02c 100644 --- a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.cxx +++ b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.cxx @@ -73,24 +73,6 @@ namespace xsde #endif } - // any_simple_type - // - bool any_simple_type_pskel:: - _characters_impl (const ro_string& s) - { - _any_characters (s); - return true; - } - - void any_simple_type_pskel:: - post_any_simple_type () - { -#ifdef XSDE_REUSE_STYLE_TIEIN - if (any_simple_type_impl_) - any_simple_type_impl_->post_any_simple_type (); -#endif - } - // static/dynamic_type function implementations. // #ifdef XSDE_POLYMORPHIC @@ -614,4 +596,3 @@ namespace xsde } } } - diff --git a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx index f794188..0879bb3 100644 --- a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx +++ b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx @@ -76,11 +76,12 @@ namespace xsde struct any_simple_type_pskel: simple_content { - virtual bool - _characters_impl (const ro_string&); - - virtual void - post_any_simple_type (); +#ifdef XSDE_STL + virtual std::string +#else + virtual char* +#endif + post_any_simple_type () = 0; #ifdef XSDE_POLYMORPHIC static const char* @@ -99,7 +100,6 @@ namespace xsde #endif }; - // Boolean. // struct boolean_pskel: simple_content diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.cxx b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.cxx new file mode 100644 index 0000000..f7f16c9 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.cxx @@ -0,0 +1,35 @@ +// file : xsde/cxx/serializer/non-validating/any-simple-type-stl.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace non_validating + { + void any_simple_type_simpl:: + pre (const std::string& value) + { + value_ = value; + } + + void any_simple_type_simpl:: + _serialize_content () + { + // Make sure we don't hold any references to the string. + // + std::string tmp; + tmp.swap (value_); + + _characters (tmp.c_str (), tmp.size ()); + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx new file mode 100644 index 0000000..a97609d --- /dev/null +++ b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx @@ -0,0 +1,41 @@ +// file : xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX +#define XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX + +#include <string> + +#include <xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace non_validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_simpl: virtual any_simple_type_sskel +#else + struct any_simple_type_simpl: any_simple_type_sskel +#endif + { + virtual void + pre (const std::string&); + + virtual void + _serialize_content (); + + protected: + std::string value_; + }; + } + } + } +} + +#endif // XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.cxx b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.cxx new file mode 100644 index 0000000..e81c9c6 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.cxx @@ -0,0 +1,59 @@ +// file : xsde/cxx/serializer/non-validating/any-simple-type.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/serializer/non-validating/any-simple-type.hxx> + +#ifdef XSDE_CUSTOM_ALLOCATOR +# include <xsde/cxx/allocator.hxx> +#endif + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace non_validating + { + any_simple_type_simpl:: + ~any_simple_type_simpl () + { + if (free_ && value_) + { + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif + } + } + + void any_simple_type_simpl:: + pre (const char* value) + { + value_ = value; + } + + void any_simple_type_simpl:: + _serialize_content () + { + _characters (value_); + + if (free_) + { + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif + value_ = 0; + } + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.hxx b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.hxx new file mode 100644 index 0000000..d41660c --- /dev/null +++ b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.hxx @@ -0,0 +1,47 @@ +// file : xsde/cxx/serializer/non-validating/any-simple-type.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX +#define XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX + +#include <xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace non_validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_simpl: virtual any_simple_type_sskel +#else + struct any_simple_type_simpl: any_simple_type_sskel +#endif + { + virtual + ~any_simple_type_simpl (); + + any_simple_type_simpl (bool free = false); + + virtual void + pre (const char*); + + virtual void + _serialize_content (); + + protected: + bool free_; + const char* value_; + }; + } + } + } +} + +#include <xsde/cxx/serializer/non-validating/any-simple-type.ixx> + +#endif // XSDE_CXX_SERIALIZER_NON_VALIDATING_ANY_SIMPLE_TYPE_HXX diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.ixx b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.ixx new file mode 100644 index 0000000..e94c905 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/non-validating/any-simple-type.ixx @@ -0,0 +1,22 @@ +// file : xsde/cxx/serializer/non-validating/any-simple-type.ixx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace non_validating + { + inline any_simple_type_simpl:: + any_simple_type_simpl (bool free) + : free_ (free), value_ (0) + { + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/non-validating/any-type.hxx b/libxsde/xsde/cxx/serializer/non-validating/any-type.hxx index 7eb966d..6795abc 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/any-type.hxx +++ b/libxsde/xsde/cxx/serializer/non-validating/any-type.hxx @@ -25,16 +25,6 @@ namespace xsde #endif { }; - - // any_simple_type - // -#ifdef XSDE_REUSE_STYLE_MIXIN - struct any_simple_type_simpl: virtual any_simple_type_sskel -#else - struct any_simple_type_simpl: any_simple_type_sskel -#endif - { - }; } } } diff --git a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-simpl.hxx b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-simpl.hxx index 98b3d38..c8e8baf 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-simpl.hxx +++ b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-simpl.hxx @@ -9,6 +9,13 @@ #include <xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx> #include <xsde/cxx/serializer/non-validating/any-type.hxx> + +#ifdef XSDE_STL +# include <xsde/cxx/serializer/non-validating/any-simple-type-stl.hxx> +#else +# include <xsde/cxx/serializer/non-validating/any-simple-type.hxx> +#endif + #include <xsde/cxx/serializer/non-validating/boolean.hxx> #include <xsde/cxx/serializer/non-validating/byte.hxx> #include <xsde/cxx/serializer/non-validating/unsigned-byte.hxx> diff --git a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.cxx b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.cxx index 0eda610..ab9dd98 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.cxx +++ b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.cxx @@ -24,17 +24,6 @@ namespace xsde #endif } - // any_simple_type_sskel - // - void any_simple_type_sskel:: - pre () - { -#ifdef XSDE_REUSE_STYLE_TIEIN - if (any_simple_type_impl_) - any_simple_type_impl_->pre (); -#endif - } - // static/dynamic_type function implementations. // #ifdef XSDE_POLYMORPHIC diff --git a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx index 9a72338..508197a 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx +++ b/libxsde/xsde/cxx/serializer/non-validating/xml-schema-sskel.hxx @@ -61,14 +61,11 @@ namespace xsde struct any_simple_type_sskel: simple_content { virtual void - pre (); - - // Override the following function to implement your - // logic. - // - - // virtual void - // _serialize_content (); +#ifdef XSDE_STL + pre (const std::string&) = 0; +#else + pre (const char*) = 0; +#endif #ifdef XSDE_POLYMORPHIC static const char* diff --git a/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.cxx b/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.cxx new file mode 100644 index 0000000..f308e6c --- /dev/null +++ b/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.cxx @@ -0,0 +1,34 @@ +// file : xsde/cxx/serializer/validating/any-simple-type-stl.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/serializer/validating/any-simple-type-stl.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace validating + { + void any_simple_type_simpl:: + pre (const std::string& value) + { + value_ = value; + } + + void any_simple_type_simpl:: + _serialize_content () + { + // Make sure we don't hold any references to the string. + // + std::string tmp; + tmp.swap (value_); + _characters (tmp.c_str (), tmp.size ()); + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.hxx b/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.hxx new file mode 100644 index 0000000..0990b85 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/validating/any-simple-type-stl.hxx @@ -0,0 +1,41 @@ +// file : xsde/cxx/serializer/validating/any-simple-type-stl.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX +#define XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX + +#include <string> + +#include <xsde/cxx/serializer/validating/xml-schema-sskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_simpl: virtual any_simple_type_sskel +#else + struct any_simple_type_simpl: any_simple_type_sskel +#endif + { + virtual void + pre (const std::string&); + + virtual void + _serialize_content (); + + protected: + std::string value_; + }; + } + } + } +} + +#endif // XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_STL_HXX diff --git a/libxsde/xsde/cxx/serializer/validating/any-simple-type.cxx b/libxsde/xsde/cxx/serializer/validating/any-simple-type.cxx new file mode 100644 index 0000000..6de1db8 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/validating/any-simple-type.cxx @@ -0,0 +1,59 @@ +// file : xsde/cxx/serializer/validating/any-simple-type.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/serializer/validating/any-simple-type.hxx> + +#ifdef XSDE_CUSTOM_ALLOCATOR +# include <xsde/cxx/allocator.hxx> +#endif + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace validating + { + any_simple_type_simpl:: + ~any_simple_type_simpl () + { + if (free_ && value_) + { + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif + } + } + + void any_simple_type_simpl:: + pre (const char* value) + { + value_ = value; + } + + void any_simple_type_simpl:: + _serialize_content () + { + _characters (value_); + + if (free_) + { + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif + value_ = 0; + } + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/validating/any-simple-type.hxx b/libxsde/xsde/cxx/serializer/validating/any-simple-type.hxx new file mode 100644 index 0000000..7499a21 --- /dev/null +++ b/libxsde/xsde/cxx/serializer/validating/any-simple-type.hxx @@ -0,0 +1,47 @@ +// file : xsde/cxx/serializer/validating/any-simple-type.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_HXX +#define XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_HXX + +#include <xsde/cxx/serializer/validating/xml-schema-sskel.hxx> + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace validating + { +#ifdef XSDE_REUSE_STYLE_MIXIN + struct any_simple_type_simpl: virtual any_simple_type_sskel +#else + struct any_simple_type_simpl: any_simple_type_sskel +#endif + { + virtual + ~any_simple_type_simpl (); + + any_simple_type_simpl (bool free = false); + + virtual void + pre (const char*); + + virtual void + _serialize_content (); + + protected: + bool free_; + const char* value_; + }; + } + } + } +} + +#include <xsde/cxx/serializer/validating/any-simple-type.ixx> + +#endif // XSDE_CXX_SERIALIZER_VALIDATING_ANY_SIMPLE_TYPE_HXX diff --git a/libxsde/xsde/cxx/serializer/validating/any-simple-type.ixx b/libxsde/xsde/cxx/serializer/validating/any-simple-type.ixx new file mode 100644 index 0000000..f5fea6a --- /dev/null +++ b/libxsde/xsde/cxx/serializer/validating/any-simple-type.ixx @@ -0,0 +1,22 @@ +// file : xsde/cxx/serializer/validating/any-simple-type.ixx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +namespace xsde +{ + namespace cxx + { + namespace serializer + { + namespace validating + { + inline any_simple_type_simpl:: + any_simple_type_simpl (bool free) + : free_ (free), value_ (0) + { + } + } + } + } +} diff --git a/libxsde/xsde/cxx/serializer/validating/any-type.hxx b/libxsde/xsde/cxx/serializer/validating/any-type.hxx index dfa0b87..e1df6e1 100644 --- a/libxsde/xsde/cxx/serializer/validating/any-type.hxx +++ b/libxsde/xsde/cxx/serializer/validating/any-type.hxx @@ -25,16 +25,6 @@ namespace xsde #endif { }; - - // any_simple_type - // -#ifdef XSDE_REUSE_STYLE_MIXIN - struct any_simple_type_simpl: virtual any_simple_type_sskel -#else - struct any_simple_type_simpl: any_simple_type_sskel -#endif - { - }; } } } diff --git a/libxsde/xsde/cxx/serializer/validating/xml-schema-simpl.hxx b/libxsde/xsde/cxx/serializer/validating/xml-schema-simpl.hxx index 9a81eed..d2bc3a7 100644 --- a/libxsde/xsde/cxx/serializer/validating/xml-schema-simpl.hxx +++ b/libxsde/xsde/cxx/serializer/validating/xml-schema-simpl.hxx @@ -9,6 +9,13 @@ #include <xsde/cxx/serializer/validating/xml-schema-sskel.hxx> #include <xsde/cxx/serializer/validating/any-type.hxx> + +#ifdef XSDE_STL +# include <xsde/cxx/serializer/validating/any-simple-type-stl.hxx> +#else +# include <xsde/cxx/serializer/validating/any-simple-type.hxx> +#endif + #include <xsde/cxx/serializer/validating/boolean.hxx> #include <xsde/cxx/serializer/validating/byte.hxx> #include <xsde/cxx/serializer/validating/unsigned-byte.hxx> diff --git a/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.cxx b/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.cxx index 6ca2101..6154746 100644 --- a/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.cxx +++ b/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.cxx @@ -24,17 +24,6 @@ namespace xsde #endif } - // any_simple_type_sskel - // - void any_simple_type_sskel:: - pre () - { -#ifdef XSDE_REUSE_STYLE_TIEIN - if (any_simple_type_impl_) - any_simple_type_impl_->pre (); -#endif - } - // static/dynamic_type function implementations. // #ifdef XSDE_POLYMORPHIC diff --git a/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.hxx b/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.hxx index c8e7466..7ccb233 100644 --- a/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.hxx +++ b/libxsde/xsde/cxx/serializer/validating/xml-schema-sskel.hxx @@ -65,14 +65,11 @@ namespace xsde struct any_simple_type_sskel: simple_content { virtual void - pre (); - - // Override the following function to implement your - // logic. - // - - // virtual void - // _serialize_content (); +#ifdef XSDE_STL + pre (const std::string&) = 0; +#else + pre (const char*) = 0; +#endif #ifdef XSDE_POLYMORPHIC static const char* |