diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-12-06 02:50:28 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2025-12-06 02:50:28 +0100 |
| commit | b1d3ee13bd1be3fefda2be490ce773afab2ade04 (patch) | |
| tree | 84e182175cc6403dadce8c28604afd3edbe4304f /fluid/nodes/Node.cxx | |
| parent | 5e7ed2f6534bf8d99688e375c56f44f792bdf7bb (diff) | |
Fluid: modernize Function Node class
Diffstat (limited to 'fluid/nodes/Node.cxx')
| -rw-r--r-- | fluid/nodes/Node.cxx | 13 |
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 */ |
