From b1d3ee13bd1be3fefda2be490ce773afab2ade04 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 6 Dec 2025 02:50:28 +0100 Subject: Fluid: modernize Function Node class --- fluid/nodes/Node.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fluid/nodes/Node.cxx') 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 */ -- cgit v1.2.3