mirror of
https://github.com/fltk/fltk.git
synced 2026-03-23 15:35:11 +08:00
Fluid: modernize Function Node class
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user