Return a std::string result instead of char *.
}
-const char *
+string
SGPropertyNode::getDisplayName (bool simplify) const
{
- _display_name = _name;
+ string display_name = _name;
if (_index != 0 || !simplify) {
stringstream sstr;
sstr << '[' << _index << ']';
- _display_name += sstr.str();
+ display_name += sstr.str();
}
- return _display_name.c_str();
+ return display_name;
}
*/
const char * getName () const { return _name.c_str(); }
-
/**
* Get the node's pretty display name, with subscript when needed.
*/
- const char * getDisplayName (bool simplify = false) const;
+ std::string getDisplayName (bool simplify = false) const;
/**
int _index;
std::string _name;
- mutable std::string _display_name;
/// To avoid cyclic reference counting loops this shall not be a reference
/// counted pointer
SGPropertyNode * _parent;