diff options
Diffstat (limited to 'libxsde/xsde/cxx/serializer/validating/any-simple-type.cxx')
-rw-r--r-- | libxsde/xsde/cxx/serializer/validating/any-simple-type.cxx | 59 |
1 files changed, 59 insertions, 0 deletions
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; + } + } + } + } + } +} |