From 4f38adc11ab1a3a1ab2dd3f958c917182be7d71f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2010 14:48:13 +0200 Subject: Implement generation of clone functions New test: clone. --- libxsde/xsde/cxx/hybrid/base.hxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libxsde/xsde/cxx/hybrid/base.hxx') diff --git a/libxsde/xsde/cxx/hybrid/base.hxx b/libxsde/xsde/cxx/hybrid/base.hxx index 89431a2..a7b1e2a 100644 --- a/libxsde/xsde/cxx/hybrid/base.hxx +++ b/libxsde/xsde/cxx/hybrid/base.hxx @@ -10,6 +10,7 @@ #ifndef XSDE_STL # include // strcmp +# include #endif #ifdef XSDE_CUSTOM_ALLOCATOR @@ -599,6 +600,26 @@ namespace xsde string_base& operator= (char* x) {base_value (x); return *this;} +#ifndef XSDE_EXCEPTIONS + bool +#else + void +#endif + _copy (string_base& c) const + { + char* x = strdupx (x_); + +#ifndef XSDE_EXCEPTIONS + if (x == 0) + return false; +#endif + c.base_value (x); + +#ifndef XSDE_EXCEPTIONS + return true; +#endif + } + protected: char* x_; }; -- cgit v1.1