1 // props.cxx - implementation of a property list.
2 // Started Fall 2000 by David Megginson, david@megginson.com
3 // This code is released into the Public Domain.
5 // See props.html for documentation [replace with URL when available].
9 #include <simgear/compiler.h>
10 #include <simgear/debug/logstream.hxx>
22 ////////////////////////////////////////////////////////////////////////
24 ////////////////////////////////////////////////////////////////////////
27 * Comparator class for sorting by index.
32 int operator() (const SGPropertyNode * n1, const SGPropertyNode *n2) const {
33 return (n1->getIndex() < n2->getIndex());
39 ////////////////////////////////////////////////////////////////////////
40 // Convenience macros for value access.
41 ////////////////////////////////////////////////////////////////////////
43 #define TEST_READ(dflt) if (!getAttribute(READ)) return dflt
44 #define TEST_WRITE if (!getAttribute(WRITE)) return false
46 #define DO_TRACE_READ(type) if(getAttribute(TRACE_READ)) trace_read(type)
47 #define DO_TRACE_WRITE(type) if (getAttribute(TRACE_WRITE)) trace_write(type)
49 #define GET_BOOL (_value.bool_val->getValue())
50 #define GET_INT (_value.int_val->getValue())
51 #define GET_LONG (_value.long_val->getValue())
52 #define GET_FLOAT (_value.float_val->getValue())
53 #define GET_DOUBLE (_value.double_val->getValue())
54 #define GET_STRING (_value.string_val->getValue())
56 #define SET_BOOL(val) (_value.bool_val->setValue(val))
57 #define SET_INT(val) (_value.int_val->setValue(val))
58 #define SET_LONG(val) (_value.long_val->setValue(val))
59 #define SET_FLOAT(val) (_value.float_val->setValue(val))
60 #define SET_DOUBLE(val) (_value.double_val->setValue(val))
61 #define SET_STRING(val) (_value.string_val->setValue(val))
65 ////////////////////////////////////////////////////////////////////////
66 // Default values for every type.
67 ////////////////////////////////////////////////////////////////////////
69 const bool SGRawValue<bool>::DefaultValue = false;
70 const int SGRawValue<int>::DefaultValue = 0;
71 const long SGRawValue<long>::DefaultValue = 0L;
72 const float SGRawValue<float>::DefaultValue = 0.0;
73 const double SGRawValue<double>::DefaultValue = 0.0L;
74 const string SGRawValue<string>::DefaultValue = "";
78 ////////////////////////////////////////////////////////////////////////
79 // Local path normalization code.
80 ////////////////////////////////////////////////////////////////////////
83 * A component in a path.
92 * Parse the name for a path component.
94 * Name: [_a-zA-Z][-._a-zA-Z0-9]*
97 parse_name (const string &path, int &i)
100 int max = path.size();
102 if (path[i] == '.') {
104 if (i < max && path[i] == '.') {
110 if (i < max && path[i] != '/')
111 throw string(string("Illegal character after ") + name);
114 else if (isalpha(path[i]) || path[i] == '_') {
118 // The rules inside a name are a little
121 if (isalpha(path[i]) || isdigit(path[i]) || path[i] == '_' ||
122 path[i] == '-' || path[i] == '.') {
124 } else if (path[i] == '[' || path[i] == '/') {
127 throw string("name may contain only ._- and alphanumeric characters");
134 if (name.size() == 0)
135 throw string("name must begin with alpha or '_'");
143 * Parse the optional integer index for a path component.
145 * Index: "[" [0-9]+ "]"
148 parse_index (const string &path, int &i)
157 for (int max = path.size(); i < max; i++) {
158 if (isdigit(path[i])) {
159 index = (index * 10) + (path[i] - '0');
160 } else if (path[i] == ']') {
168 throw string("unterminated index (looking for ']')");
173 * Parse a single path component.
175 * Component: Name Index?
177 static inline PathComponent
178 parse_component (const string &path, int &i)
180 PathComponent component;
181 component.name = parse_name(path, i);
182 if (component.name[0] != '.')
183 component.index = parse_index(path, i);
185 component.index = -1;
191 * Parse a path into its components.
194 parse_path (const string &path, vector<PathComponent> &components)
197 int max = path.size();
199 // Check for initial '/'
200 if (path[pos] == '/') {
204 components.push_back(root);
206 while (pos < max && path[pos] == '/')
211 components.push_back(parse_component(path, pos));
212 while (pos < max && path[pos] == '/')
219 ////////////////////////////////////////////////////////////////////////
220 // Other static utility functions.
221 ////////////////////////////////////////////////////////////////////////
225 * Locate a child node by name and index.
228 find_child (const string &name, int index, vector<SGPropertyNode *> nodes)
230 int nNodes = nodes.size();
231 for (int i = 0; i < nNodes; i++) {
232 SGPropertyNode * node = nodes[i];
233 if (node->getName() == name && node->getIndex() == index)
241 * Locate another node, given a relative path.
243 static SGPropertyNode *
244 find_node (SGPropertyNode * current,
245 const vector<PathComponent> &components,
249 // Run off the end of the list
254 // Success! This is the one we want.
255 else if (position >= (int)components.size()) {
259 // Empty component means root.
260 else if (components[position].name == "") {
261 return find_node(current->getRootNode(), components, position + 1, create);
264 // . means current directory
265 else if (components[position].name == ".") {
266 return find_node(current, components, position + 1, create);
269 // .. means parent directory
270 else if (components[position].name == "..") {
271 SGPropertyNode * parent = current->getParent();
273 throw string("Attempt to move past root with '..'");
275 return find_node(parent, components, position + 1, create);
278 // Otherwise, a child name
280 SGPropertyNode * child =
281 current->getChild(components[position].name,
282 components[position].index,
284 return find_node(child, components, position + 1, create);
290 ////////////////////////////////////////////////////////////////////////
291 // Implementation of SGPropertyNode.
292 ////////////////////////////////////////////////////////////////////////
296 * Default constructor: always creates a root node.
298 SGPropertyNode::SGPropertyNode ()
313 SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
316 _parent(0), // don't copy the parent
326 _value.alias = node._value.alias;
329 _value.bool_val = node._value.bool_val->clone();
332 _value.int_val = node._value.int_val->clone();
335 _value.long_val = node._value.long_val->clone();
338 _value.float_val = node._value.float_val->clone();
341 _value.double_val = node._value.double_val->clone();
345 _value.string_val = node._value.string_val->clone();
352 * Convenience constructor.
354 SGPropertyNode::SGPropertyNode (const string &name,
355 int index, SGPropertyNode * parent)
370 SGPropertyNode::~SGPropertyNode ()
372 for (int i = 0; i < (int)_children.size(); i++) {
381 * Delete and clear the current value.
384 SGPropertyNode::clear_value ()
392 delete _value.bool_val;
396 delete _value.int_val;
400 delete _value.long_val;
401 _value.long_val = 0L;
404 delete _value.float_val;
405 _value.float_val = 0;
408 delete _value.double_val;
409 _value.double_val = 0;
413 delete _value.string_val;
414 _value.string_val = 0;
422 * Get the value as a string.
425 SGPropertyNode::get_string () const
432 return _value.alias->getStringValue();
439 sprintf(buf, "%d", GET_INT);
442 sprintf(buf, "%ld", GET_LONG);
445 sprintf(buf, "%f", GET_FLOAT);
448 sprintf(buf, "%f", GET_DOUBLE);
461 * Trace a read access for a property.
464 SGPropertyNode::trace_read (SGPropertyNode::Type accessType) const
466 SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Read node " << getPath()
467 << ", value \"" << get_string() << '"');
472 * Trace a write access for a property.
475 SGPropertyNode::trace_write (SGPropertyNode::Type accessType) const
477 SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Write node " << getPath()
478 << ", value\"" << get_string() << '"');
483 * Alias to another node.
486 SGPropertyNode::alias (SGPropertyNode * target)
488 if (target == 0 || _type == ALIAS || _tied)
491 _value.alias = target;
498 * Alias to another node by path.
501 SGPropertyNode::alias (const string &path)
503 return alias(getNode(path, true));
511 SGPropertyNode::unalias ()
522 * Get the target of an alias.
525 SGPropertyNode::getAliasTarget ()
527 return (_type == ALIAS ? _value.alias : 0);
531 const SGPropertyNode *
532 SGPropertyNode::getAliasTarget () const
534 return (_type == ALIAS ? _value.alias : 0);
539 * Get a non-const child by index.
542 SGPropertyNode::getChild (int position)
544 if (position >= 0 && position < nChildren())
545 return _children[position];
552 * Get a const child by index.
554 const SGPropertyNode *
555 SGPropertyNode::getChild (int position) const
557 if (position >= 0 && position < nChildren())
558 return _children[position];
565 * Get a non-const child by name and index, creating if necessary.
568 SGPropertyNode::getChild (const string &name, int index, bool create)
570 int pos = find_child(name, index, _children);
572 return _children[pos];
574 _children.push_back(new SGPropertyNode(name, index, this));
575 return _children[_children.size()-1];
583 * Get a const child by name and index.
585 const SGPropertyNode *
586 SGPropertyNode::getChild (const string &name, int index) const
588 int pos = find_child(name, index, _children);
590 return _children[pos];
597 * Get all children with the same name (but different indices).
599 vector<SGPropertyNode *>
600 SGPropertyNode::getChildren (const string &name)
602 vector<SGPropertyNode *> children;
603 int max = _children.size();
605 for (int i = 0; i < max; i++)
606 if (_children[i]->getName() == name)
607 children.push_back(_children[i]);
609 sort(children.begin(), children.end(), CompareIndices());
615 * Get all children const with the same name (but different indices).
617 vector<const SGPropertyNode *>
618 SGPropertyNode::getChildren (const string &name) const
620 vector<const SGPropertyNode *> children;
621 int max = _children.size();
623 for (int i = 0; i < max; i++)
624 if (_children[i]->getName() == name)
625 children.push_back(_children[i]);
627 sort(children.begin(), children.end(), CompareIndices());
633 SGPropertyNode::getPath (bool simplify) const
638 string path = _parent->getPath(simplify);
641 if (_index != 0 || !simplify) {
643 sprintf(buffer, "[%d]", _index);
650 SGPropertyNode::getType () const
653 return _value.alias->getType();
660 SGPropertyNode::getBoolValue () const
666 return _value.alias->getBoolValue();
670 return GET_INT == 0 ? false : true;
672 return GET_LONG == 0L ? false : true;
674 return GET_FLOAT == 0.0 ? false : true;
676 return GET_DOUBLE == 0.0L ? false : true;
679 return (GET_STRING == "true" || getDoubleValue() != 0.0L);
687 SGPropertyNode::getIntValue () const
693 return _value.alias->getIntValue();
695 return int(GET_BOOL);
699 return int(GET_LONG);
701 return int(GET_FLOAT);
703 return int(GET_DOUBLE);
706 return atoi(GET_STRING.c_str());
714 SGPropertyNode::getLongValue () const
720 return _value.alias->getLongValue();
722 return long(GET_BOOL);
724 return long(GET_INT);
728 return long(GET_FLOAT);
730 return long(GET_DOUBLE);
733 return strtol(GET_STRING.c_str(), 0, 0);
741 SGPropertyNode::getFloatValue () const
743 DO_TRACE_READ(FLOAT);
747 return _value.alias->getFloatValue();
749 return float(GET_BOOL);
751 return float(GET_INT);
753 return float(GET_LONG);
757 return float(GET_DOUBLE);
760 return atof(GET_STRING.c_str());
768 SGPropertyNode::getDoubleValue () const
770 DO_TRACE_READ(DOUBLE);
774 return _value.alias->getDoubleValue();
776 return double(GET_BOOL);
778 return double(GET_INT);
780 return double(GET_LONG);
782 return double(GET_FLOAT);
787 return strtod(GET_STRING.c_str(), 0);
795 SGPropertyNode::getStringValue () const
797 DO_TRACE_READ(STRING);
802 SGPropertyNode::setBoolValue (bool value)
806 if (_type == NONE || _type == UNSPECIFIED) {
808 _value.bool_val = new SGRawValueInternal<bool>;
814 result = _value.alias->setBoolValue(value);
817 result = SET_BOOL(value);
820 result = SET_INT(int(value));
823 result = SET_LONG(long(value));
826 result = SET_FLOAT(float(value));
829 result = SET_DOUBLE(double(value));
833 result = SET_STRING(value ? "true" : "false");
840 DO_TRACE_WRITE(BOOL);
845 SGPropertyNode::setIntValue (int value)
849 if (_type == NONE || _type == UNSPECIFIED) {
851 _value.int_val = new SGRawValueInternal<int>;
857 result = _value.alias->setIntValue(value);
860 result = SET_BOOL(value == 0 ? false : true);
863 result = SET_INT(value);
866 result = SET_LONG(long(value));
869 result = SET_FLOAT(float(value));
872 result = SET_DOUBLE(double(value));
877 sprintf(buf, "%d", value);
878 result = SET_STRING(buf);
891 SGPropertyNode::setLongValue (long value)
895 if (_type == NONE || _type == UNSPECIFIED) {
897 _value.long_val = new SGRawValueInternal<long>;
903 result = _value.alias->setLongValue(value);
906 result = SET_BOOL(value == 0L ? false : true);
909 result = SET_INT(int(value));
912 result = SET_LONG(value);
915 result = SET_FLOAT(float(value));
918 result = SET_DOUBLE(double(value));
923 sprintf(buf, "%ld", value);
924 result = SET_STRING(buf);
932 DO_TRACE_WRITE(LONG);
937 SGPropertyNode::setFloatValue (float value)
941 if (_type == NONE || _type == UNSPECIFIED) {
943 _value.float_val = new SGRawValueInternal<float>;
949 result = _value.alias->setFloatValue(value);
952 result = SET_BOOL(value == 0.0 ? false : true);
955 result = SET_INT(int(value));
958 result = SET_LONG(long(value));
961 result = SET_FLOAT(value);
964 result = SET_DOUBLE(double(value));
969 sprintf(buf, "%f", value);
970 result = SET_STRING(buf);
978 DO_TRACE_WRITE(FLOAT);
983 SGPropertyNode::setDoubleValue (double value)
987 if (_type == NONE || _type == UNSPECIFIED) {
989 _value.double_val = new SGRawValueInternal<double>;
995 result = _value.alias->setDoubleValue(value);
998 result = SET_BOOL(value == 0.0L ? false : true);
1001 result = SET_INT(int(value));
1004 result = SET_LONG(long(value));
1007 result = SET_FLOAT(float(value));
1010 result = SET_DOUBLE(value);
1015 sprintf(buf, "%f", value);
1016 result = SET_STRING(buf);
1024 DO_TRACE_WRITE(DOUBLE);
1029 SGPropertyNode::setStringValue (string value)
1031 bool result = false;
1033 if (_type == NONE || _type == UNSPECIFIED) {
1035 _value.string_val = new SGRawValueInternal<string>;
1041 result = _value.alias->setStringValue(value);
1044 result = SET_BOOL((value == "true" || atoi(value.c_str())) ? true : false);
1047 result = SET_INT(atoi(value.c_str()));
1050 result = SET_LONG(strtol(value.c_str(), 0, 0));
1053 result = SET_FLOAT(atof(value.c_str()));
1056 result = SET_DOUBLE(strtod(value.c_str(), 0));
1060 result = SET_STRING(value);
1067 DO_TRACE_WRITE(STRING);
1072 SGPropertyNode::setUnspecifiedValue (string value)
1074 bool result = false;
1076 if (_type == NONE) {
1078 _value.string_val = new SGRawValueInternal<string>;
1079 _type = UNSPECIFIED;
1084 result = _value.alias->setUnspecifiedValue(value);
1087 result = SET_BOOL((value == "true" || atoi(value.c_str())) ? true : false);
1090 result = SET_INT(atoi(value.c_str()));
1093 result = SET_LONG(strtol(value.c_str(), 0, 0));
1096 result = SET_FLOAT(atof(value.c_str()));
1099 result = SET_DOUBLE(strtod(value.c_str(), 0));
1103 result = SET_STRING(value);
1110 DO_TRACE_WRITE(UNSPECIFIED);
1115 SGPropertyNode::tie (const SGRawValue<bool> &rawValue, bool useDefault)
1117 if (_type == ALIAS || _tied)
1120 bool old_val = false;
1122 old_val = getBoolValue();
1127 _value.bool_val = rawValue.clone();
1130 setBoolValue(old_val);
1136 SGPropertyNode::tie (const SGRawValue<int> &rawValue, bool useDefault)
1138 if (_type == ALIAS || _tied)
1143 old_val = getIntValue();
1148 _value.int_val = rawValue.clone();
1151 setIntValue(old_val);
1157 SGPropertyNode::tie (const SGRawValue<long> &rawValue, bool useDefault)
1159 if (_type == ALIAS || _tied)
1164 old_val = getLongValue();
1169 _value.long_val = rawValue.clone();
1172 setLongValue(old_val);
1178 SGPropertyNode::tie (const SGRawValue<float> &rawValue, bool useDefault)
1180 if (_type == ALIAS || _tied)
1183 float old_val = 0.0;
1185 old_val = getFloatValue();
1190 _value.float_val = rawValue.clone();
1193 setFloatValue(old_val);
1199 SGPropertyNode::tie (const SGRawValue<double> &rawValue, bool useDefault)
1201 if (_type == ALIAS || _tied)
1204 double old_val = 0.0;
1206 old_val = getDoubleValue();
1211 _value.double_val = rawValue.clone();
1214 setDoubleValue(old_val);
1221 SGPropertyNode::tie (const SGRawValue<string> &rawValue, bool useDefault)
1223 if (_type == ALIAS || _tied)
1228 old_val = getStringValue();
1233 _value.string_val = rawValue.clone();
1236 setStringValue(old_val);
1242 SGPropertyNode::untie ()
1249 bool val = getBoolValue();
1252 _value.bool_val = new SGRawValueInternal<bool>;
1257 int val = getIntValue();
1260 _value.int_val = new SGRawValueInternal<int>;
1265 long val = getLongValue();
1268 _value.long_val = new SGRawValueInternal<long>;
1273 float val = getFloatValue();
1276 _value.float_val = new SGRawValueInternal<float>;
1281 double val = getDoubleValue();
1284 _value.double_val = new SGRawValueInternal<double>;
1290 string val = getStringValue();
1293 _value.string_val = new SGRawValueInternal<string>;
1307 SGPropertyNode::getRootNode ()
1312 return _parent->getRootNode();
1315 const SGPropertyNode *
1316 SGPropertyNode::getRootNode () const
1321 return _parent->getRootNode();
1325 SGPropertyNode::getNode (const string &relative_path, bool create)
1327 if (_path_cache == 0)
1328 _path_cache = new cache_map;
1330 SGPropertyNode * result = (*_path_cache)[relative_path];
1332 vector<PathComponent> components;
1333 parse_path(relative_path, components);
1334 result = find_node(this, components, 0, create);
1335 (*_path_cache)[relative_path] = result;
1342 SGPropertyNode::getNode (const string &relative_path, int index, bool create)
1344 vector<PathComponent> components;
1345 parse_path(relative_path, components);
1346 if (components.size() > 0)
1347 components[components.size()-1].index = index;
1348 return find_node(this, components, 0, create);
1351 const SGPropertyNode *
1352 SGPropertyNode::getNode (const string &relative_path) const
1354 return ((SGPropertyNode *)this)->getNode(relative_path, false);
1357 const SGPropertyNode *
1358 SGPropertyNode::getNode (const string &relative_path, int index) const
1360 return ((SGPropertyNode *)this)->getNode(relative_path, index, false);
1364 ////////////////////////////////////////////////////////////////////////
1365 // Convenience methods using relative paths.
1366 ////////////////////////////////////////////////////////////////////////
1370 * Test whether another node has a value attached.
1373 SGPropertyNode::hasValue (const string &relative_path) const
1375 const SGPropertyNode * node = getNode(relative_path);
1376 return (node == 0 ? false : node->hasValue());
1381 * Get the value type for another node.
1383 SGPropertyNode::Type
1384 SGPropertyNode::getType (const string &relative_path) const
1386 const SGPropertyNode * node = getNode(relative_path);
1387 return (node == 0 ? UNSPECIFIED : (Type)(node->getType()));
1392 * Get a bool value for another node.
1395 SGPropertyNode::getBoolValue (const string &relative_path,
1396 bool defaultValue) const
1398 const SGPropertyNode * node = getNode(relative_path);
1399 return (node == 0 ? defaultValue : node->getBoolValue());
1404 * Get an int value for another node.
1407 SGPropertyNode::getIntValue (const string &relative_path,
1408 int defaultValue) const
1410 const SGPropertyNode * node = getNode(relative_path);
1411 return (node == 0 ? defaultValue : node->getIntValue());
1416 * Get a long value for another node.
1419 SGPropertyNode::getLongValue (const string &relative_path,
1420 long defaultValue) const
1422 const SGPropertyNode * node = getNode(relative_path);
1423 return (node == 0 ? defaultValue : node->getLongValue());
1428 * Get a float value for another node.
1431 SGPropertyNode::getFloatValue (const string &relative_path,
1432 float defaultValue) const
1434 const SGPropertyNode * node = getNode(relative_path);
1435 return (node == 0 ? defaultValue : node->getFloatValue());
1440 * Get a double value for another node.
1443 SGPropertyNode::getDoubleValue (const string &relative_path,
1444 double defaultValue) const
1446 const SGPropertyNode * node = getNode(relative_path);
1447 return (node == 0 ? defaultValue : node->getDoubleValue());
1452 * Get a string value for another node.
1455 SGPropertyNode::getStringValue (const string &relative_path,
1456 string defaultValue) const
1458 const SGPropertyNode * node = getNode(relative_path);
1459 return (node == 0 ? defaultValue : node->getStringValue());
1464 * Set a bool value for another node.
1467 SGPropertyNode::setBoolValue (const string &relative_path, bool value)
1469 return getNode(relative_path, true)->setBoolValue(value);
1474 * Set an int value for another node.
1477 SGPropertyNode::setIntValue (const string &relative_path, int value)
1479 return getNode(relative_path, true)->setIntValue(value);
1484 * Set a long value for another node.
1487 SGPropertyNode::setLongValue (const string &relative_path, long value)
1489 return getNode(relative_path, true)->setLongValue(value);
1494 * Set a float value for another node.
1497 SGPropertyNode::setFloatValue (const string &relative_path, float value)
1499 return getNode(relative_path, true)->setFloatValue(value);
1504 * Set a double value for another node.
1507 SGPropertyNode::setDoubleValue (const string &relative_path, double value)
1509 return getNode(relative_path, true)->setDoubleValue(value);
1514 * Set a string value for another node.
1517 SGPropertyNode::setStringValue (const string &relative_path, string value)
1519 return getNode(relative_path, true)->setStringValue(value);
1524 * Set an unknown value for another node.
1527 SGPropertyNode::setUnspecifiedValue (const string &relative_path, string value)
1529 return getNode(relative_path, true)->setUnspecifiedValue(value);
1534 * Test whether another node is tied.
1537 SGPropertyNode::isTied (const string &relative_path) const
1539 const SGPropertyNode * node = getNode(relative_path);
1540 return (node == 0 ? false : node->isTied());
1545 * Tie a node reached by a relative path, creating it if necessary.
1548 SGPropertyNode::tie (const string &relative_path,
1549 const SGRawValue<bool> &rawValue,
1552 return getNode(relative_path, true)->tie(rawValue, useDefault);
1557 * Tie a node reached by a relative path, creating it if necessary.
1560 SGPropertyNode::tie (const string &relative_path,
1561 const SGRawValue<int> &rawValue,
1564 return getNode(relative_path, true)->tie(rawValue, useDefault);
1569 * Tie a node reached by a relative path, creating it if necessary.
1572 SGPropertyNode::tie (const string &relative_path,
1573 const SGRawValue<long> &rawValue,
1576 return getNode(relative_path, true)->tie(rawValue, useDefault);
1581 * Tie a node reached by a relative path, creating it if necessary.
1584 SGPropertyNode::tie (const string &relative_path,
1585 const SGRawValue<float> &rawValue,
1588 return getNode(relative_path, true)->tie(rawValue, useDefault);
1593 * Tie a node reached by a relative path, creating it if necessary.
1596 SGPropertyNode::tie (const string &relative_path,
1597 const SGRawValue<double> &rawValue,
1600 return getNode(relative_path, true)->tie(rawValue, useDefault);
1605 * Tie a node reached by a relative path, creating it if necessary.
1608 SGPropertyNode::tie (const string &relative_path,
1609 const SGRawValue<string> &rawValue,
1612 return getNode(relative_path, true)->tie(rawValue, useDefault);
1617 * Attempt to untie another node reached by a relative path.
1620 SGPropertyNode::untie (const string &relative_path)
1622 SGPropertyNode * node = getNode(relative_path);
1623 return (node == 0 ? false : node->untie());