summaryrefslogtreecommitdiff
path: root/fluid/nodes/Node.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2025-12-06 02:50:28 +0100
committerMatthias Melcher <github@matthiasm.com>2025-12-06 02:50:28 +0100
commitb1d3ee13bd1be3fefda2be490ce773afab2ade04 (patch)
tree84e182175cc6403dadce8c28604afd3edbe4304f /fluid/nodes/Node.cxx
parent5e7ed2f6534bf8d99688e375c56f44f792bdf7bb (diff)
Fluid: modernize Function Node class
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
*/