summaryrefslogtreecommitdiff
path: root/fluid/nodes/Node.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/nodes/Node.cxx')
-rw-r--r--fluid/nodes/Node.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/fluid/nodes/Node.cxx b/fluid/nodes/Node.cxx
index 7557e61f4..a84528b59 100644
--- a/fluid/nodes/Node.cxx
+++ b/fluid/nodes/Node.cxx
@@ -455,6 +455,19 @@ int storestring(const char *n, const char * & p, int nostrip) {
return 1;
}
+// C++11 version, still using the original to copy all the side effects.
+int storestring(const std::string& n, std::string& p, int nostrip) {
+ const char *buffer { nullptr };
+ int ret = storestring(n.c_str(), buffer);
+ if (buffer) {
+ p = buffer;
+ free((void*)buffer);
+ } else {
+ p.clear();
+ }
+ return ret;
+}
+
/** Update the `visible` flag for `p` and all its descendants.
\param[in] p start here and update all descendants
*/