aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid/tree-header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-11 17:32:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-11 17:32:01 +0200
commit0bfda486167432a9da8eec62b4578a22592a9275 (patch)
tree968d622d3918c9ac969de8b9c1e97e67b6cbee8b /xsde/cxx/hybrid/tree-header.cxx
parentf8bb2faef4b272ed150eb3ca4cedaa79da410694 (diff)
Add generation of detach functions
New option: --generate-detach. Also added detach/attach functionality to var_seq, non-STL str_seq, and string_base.
Diffstat (limited to 'xsde/cxx/hybrid/tree-header.cxx')
-rw-r--r--xsde/cxx/hybrid/tree-header.cxx82
1 files changed, 82 insertions, 0 deletions
diff --git a/xsde/cxx/hybrid/tree-header.cxx b/xsde/cxx/hybrid/tree-header.cxx
index 2412b86..dc378fe 100644
--- a/xsde/cxx/hybrid/tree-header.cxx
+++ b/xsde/cxx/hybrid/tree-header.cxx
@@ -178,6 +178,16 @@ namespace CXX
os << "void" << endl
<< value << " (char*);"
<< endl;
+
+ // char*
+ // detach ()
+ //
+ if (detach)
+ {
+ os << "char*" << endl
+ << uc.get<String> ("value-detach") << " ();"
+ << endl;
+ }
}
// Custom data.
@@ -1050,6 +1060,17 @@ namespace CXX
arg_.dispatch (t);
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fixed_length (t))
+ {
+ arg_.dispatch (t);
+ os << endl
+ << edetach (a) << " ();"
+ << endl;
+ }
}
private:
@@ -1150,6 +1171,17 @@ namespace CXX
arg_.dispatch (t);
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fixed_length (t))
+ {
+ arg_.dispatch (t);
+ os << endl
+ << edetach (e) << " ();"
+ << endl;
+ }
}
}
@@ -1293,6 +1325,16 @@ namespace CXX
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fl)
+ {
+ os << type << "*" << endl
+ << edetach (a) << " ();"
+ << endl;
+ }
}
else
All::contains (a);
@@ -1571,6 +1613,16 @@ namespace CXX
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fl)
+ {
+ os << type << "*" << endl
+ << edetach (c) << " ();"
+ << endl;
+ }
}
}
@@ -1786,6 +1838,16 @@ namespace CXX
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fl)
+ {
+ os << type << "*" << endl
+ << edetach (c) << " ();"
+ << endl;
+ }
}
}
@@ -1970,6 +2032,16 @@ namespace CXX
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fl)
+ {
+ os << type << "*" << endl
+ << edetach (s) << " ();"
+ << endl;
+ }
}
}
@@ -2149,6 +2221,16 @@ namespace CXX
os << ");"
<< endl;
+
+ // type*
+ // detach ()
+ //
+ if (detach && !fl)
+ {
+ os << type << "*" << endl
+ << edetach (s) << " ();"
+ << endl;
+ }
}
}