aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/tree-inline.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-01-22 15:40:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-01-22 15:40:12 +0200
commitf60df03e3cedb86508645357e17003eb9281f31a (patch)
treed65c9cd62a6500b7d0f8303caf64797d08f508c0 /xsd/cxx/tree/tree-inline.cxx
parent55ffb84acf75d3fa475dfe21d053e404eb753e5a (diff)
Add support for detaching subtrees in C++/Tree
New option: --generate-detach. New test: cxx/tree/detach.
Diffstat (limited to 'xsd/cxx/tree/tree-inline.cxx')
-rw-r--r--xsd/cxx/tree/tree-inline.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/xsd/cxx/tree/tree-inline.cxx b/xsd/cxx/tree/tree-inline.cxx
index a075d3f..6a983af 100644
--- a/xsd/cxx/tree/tree-inline.cxx
+++ b/xsd/cxx/tree/tree-inline.cxx
@@ -593,6 +593,18 @@ namespace CXX
<< "{"
<< "this->" << member << ".set (x);"
<< "}";
+
+ // auto_ptr<type>
+ // detach_name ();
+ //
+ if (detach && !fund)
+ os << inl
+ << "::std::auto_ptr< " << q_type << " > " <<
+ scope_ << "::" << endl
+ << edname (m) << " ()"
+ << "{"
+ << "return this->" << member << ".detach ();"
+ << "}";
}
}
@@ -979,6 +991,18 @@ namespace CXX
<< "return this->" << member << ".set (p);"
<< "}";
}
+
+ // auto_ptr<type>
+ // detach_name ();
+ //
+ if (detach && !fund)
+ os << inl
+ << "::std::auto_ptr< " << name << "::" << type << " > " <<
+ name << "::" << endl
+ << edname (e) << " ()"
+ << "{"
+ << "return this->" << member << ".detach ();"
+ << "}";
}
};
}