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);
455 return ""; // if NONE
460 * Trace a read access for a property.
463 SGPropertyNode::trace_read (SGPropertyNode::Type accessType) const
465 SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Read node " << getPath()
466 << ", value \"" << get_string() << '"');
471 * Trace a write access for a property.
474 SGPropertyNode::trace_write (SGPropertyNode::Type accessType) const
476 SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Write node " << getPath()
477 << ", value\"" << get_string() << '"');
482 * Alias to another node.
485 SGPropertyNode::alias (SGPropertyNode * target)
487 if (target == 0 || _type == ALIAS || _tied)
490 _value.alias = target;
497 * Alias to another node by path.
500 SGPropertyNode::alias (const string &path)
502 return alias(getNode(path, true));
510 SGPropertyNode::unalias ()
521 * Get the target of an alias.
524 SGPropertyNode::getAliasTarget ()
526 return (_type == ALIAS ? _value.alias : 0);
530 const SGPropertyNode *
531 SGPropertyNode::getAliasTarget () const
533 return (_type == ALIAS ? _value.alias : 0);
538 * Get a non-const child by index.
541 SGPropertyNode::getChild (int position)
543 if (position >= 0 && position < nChildren())
544 return _children[position];
551 * Get a const child by index.
553 const SGPropertyNode *
554 SGPropertyNode::getChild (int position) const
556 if (position >= 0 && position < nChildren())
557 return _children[position];
564 * Get a non-const child by name and index, creating if necessary.
567 SGPropertyNode::getChild (const string &name, int index, bool create)
569 int pos = find_child(name, index, _children);
571 return _children[pos];
573 _children.push_back(new SGPropertyNode(name, index, this));
574 return _children[_children.size()-1];
582 * Get a const child by name and index.
584 const SGPropertyNode *
585 SGPropertyNode::getChild (const string &name, int index) const
587 int pos = find_child(name, index, _children);
589 return _children[pos];
596 * Get all children with the same name (but different indices).
598 vector<SGPropertyNode *>
599 SGPropertyNode::getChildren (const string &name)
601 vector<SGPropertyNode *> children;
602 int max = _children.size();
604 for (int i = 0; i < max; i++)
605 if (_children[i]->getName() == name)
606 children.push_back(_children[i]);
608 sort(children.begin(), children.end(), CompareIndices());
614 * Get all children const with the same name (but different indices).
616 vector<const SGPropertyNode *>
617 SGPropertyNode::getChildren (const string &name) const
619 vector<const SGPropertyNode *> children;
620 int max = _children.size();
622 for (int i = 0; i < max; i++)
623 if (_children[i]->getName() == name)
624 children.push_back(_children[i]);
626 sort(children.begin(), children.end(), CompareIndices());
632 SGPropertyNode::getPath (bool simplify) const
637 string path = _parent->getPath(simplify);
640 if (_index != 0 || !simplify) {
642 sprintf(buffer, "[%d]", _index);
649 SGPropertyNode::getType () const
652 return _value.alias->getType();
659 SGPropertyNode::getBoolValue () const
665 return _value.alias->getBoolValue();
669 return GET_INT == 0 ? false : true;
671 return GET_LONG == 0L ? false : true;
673 return GET_FLOAT == 0.0 ? false : true;
675 return GET_DOUBLE == 0.0L ? false : true;
678 return (GET_STRING == "true" || getDoubleValue() != 0.0L);
681 return false; // if NONE
685 SGPropertyNode::getIntValue () const
691 return _value.alias->getIntValue();
693 return int(GET_BOOL);
697 return int(GET_LONG);
699 return int(GET_FLOAT);
701 return int(GET_DOUBLE);
704 return atoi(GET_STRING.c_str());
711 SGPropertyNode::getLongValue () const
717 return _value.alias->getLongValue();
719 return long(GET_BOOL);
721 return long(GET_INT);
725 return long(GET_FLOAT);
727 return long(GET_DOUBLE);
730 return strtol(GET_STRING.c_str(), 0, 0);
733 return 0L; // if NONE
737 SGPropertyNode::getFloatValue () const
739 DO_TRACE_READ(FLOAT);
743 return _value.alias->getFloatValue();
745 return float(GET_BOOL);
747 return float(GET_INT);
749 return float(GET_LONG);
753 return float(GET_DOUBLE);
756 return atof(GET_STRING.c_str());
759 return 0.0; // if NONE
763 SGPropertyNode::getDoubleValue () const
765 DO_TRACE_READ(DOUBLE);
769 return _value.alias->getDoubleValue();
771 return double(GET_BOOL);
773 return double(GET_INT);
775 return double(GET_LONG);
777 return double(GET_FLOAT);
782 return strtod(GET_STRING.c_str(), 0);
785 return 0.0L; // if NONE
789 SGPropertyNode::getStringValue () const
791 DO_TRACE_READ(STRING);
796 SGPropertyNode::setBoolValue (bool value)
800 if (_type == NONE || _type == UNSPECIFIED) {
802 _value.bool_val = new SGRawValueInternal<bool>;
808 result = _value.alias->setBoolValue(value);
811 result = SET_BOOL(value);
814 result = SET_INT(int(value));
817 result = SET_LONG(long(value));
820 result = SET_FLOAT(float(value));
823 result = SET_DOUBLE(double(value));
826 result = SET_STRING(value ? "true" : "false");
830 DO_TRACE_WRITE(BOOL);
835 SGPropertyNode::setIntValue (int value)
839 if (_type == NONE || _type == UNSPECIFIED) {
841 _value.int_val = new SGRawValueInternal<int>;
847 result = _value.alias->setIntValue(value);
850 result = SET_BOOL(value == 0 ? false : true);
853 result = SET_INT(value);
856 result = SET_LONG(long(value));
859 result = SET_FLOAT(float(value));
862 result = SET_DOUBLE(double(value));
866 sprintf(buf, "%d", value);
867 result = SET_STRING(buf);
877 SGPropertyNode::setLongValue (long value)
881 if (_type == NONE || _type == UNSPECIFIED) {
883 _value.long_val = new SGRawValueInternal<long>;
889 result = _value.alias->setLongValue(value);
892 result = SET_BOOL(value == 0L ? false : true);
895 result = SET_INT(int(value));
898 result = SET_LONG(value);
901 result = SET_FLOAT(float(value));
904 result = SET_DOUBLE(double(value));
908 sprintf(buf, "%d", value);
909 result = SET_STRING(buf);
914 DO_TRACE_WRITE(LONG);
919 SGPropertyNode::setFloatValue (float value)
923 if (_type == NONE || _type == UNSPECIFIED) {
925 _value.float_val = new SGRawValueInternal<float>;
931 result = _value.alias->setFloatValue(value);
934 result = SET_BOOL(value == 0.0 ? false : true);
937 result = SET_INT(int(value));
940 result = SET_LONG(long(value));
943 result = SET_FLOAT(value);
946 result = SET_DOUBLE(double(value));
950 sprintf(buf, "%f", value);
951 result = SET_STRING(buf);
956 DO_TRACE_WRITE(FLOAT);
961 SGPropertyNode::setDoubleValue (double value)
965 if (_type == NONE || _type == UNSPECIFIED) {
967 _value.double_val = new SGRawValueInternal<double>;
973 result = _value.alias->setDoubleValue(value);
976 result = SET_BOOL(value == 0.0L ? false : true);
979 result = SET_INT(int(value));
982 result = SET_LONG(long(value));
985 result = SET_FLOAT(float(value));
988 result = SET_DOUBLE(value);
992 sprintf(buf, "%lf", value);
993 result = SET_STRING(buf);
998 DO_TRACE_WRITE(DOUBLE);
1003 SGPropertyNode::setStringValue (string value)
1005 bool result = false;
1007 if (_type == NONE || _type == UNSPECIFIED) {
1009 _value.string_val = new SGRawValueInternal<string>;
1015 result = _value.alias->setStringValue(value);
1018 result = SET_BOOL((value == "true" || atoi(value.c_str())) ? true : false);
1021 result = SET_INT(atoi(value.c_str()));
1024 result = SET_LONG(strtol(value.c_str(), 0, 0));
1027 result = SET_FLOAT(atof(value.c_str()));
1030 result = SET_DOUBLE(strtod(value.c_str(), 0));
1033 result = SET_STRING(value);
1037 DO_TRACE_WRITE(STRING);
1042 SGPropertyNode::setUnspecifiedValue (string value)
1044 bool result = false;
1046 if (_type == NONE) {
1048 _value.string_val = new SGRawValueInternal<string>;
1049 _type = UNSPECIFIED;
1054 result = _value.alias->setUnspecifiedValue(value);
1057 result = SET_BOOL((value == "true" || atoi(value.c_str())) ? true : false);
1060 result = SET_INT(atoi(value.c_str()));
1063 result = SET_LONG(strtol(value.c_str(), 0, 0));
1066 result = SET_FLOAT(atof(value.c_str()));
1069 result = SET_DOUBLE(strtod(value.c_str(), 0));
1073 result = SET_STRING(value);
1077 DO_TRACE_WRITE(UNSPECIFIED);
1082 SGPropertyNode::tie (const SGRawValue<bool> &rawValue, bool useDefault)
1084 if (_type == ALIAS || _tied)
1087 bool old_val = false;
1089 old_val = getBoolValue();
1094 _value.bool_val = rawValue.clone();
1097 setBoolValue(old_val);
1103 SGPropertyNode::tie (const SGRawValue<int> &rawValue, bool useDefault)
1105 if (_type == ALIAS || _tied)
1110 old_val = getIntValue();
1115 _value.int_val = rawValue.clone();
1118 setIntValue(old_val);
1124 SGPropertyNode::tie (const SGRawValue<long> &rawValue, bool useDefault)
1126 if (_type == ALIAS || _tied)
1131 old_val = getLongValue();
1136 _value.long_val = rawValue.clone();
1139 setLongValue(old_val);
1145 SGPropertyNode::tie (const SGRawValue<float> &rawValue, bool useDefault)
1147 if (_type == ALIAS || _tied)
1150 float old_val = 0.0;
1152 old_val = getFloatValue();
1157 _value.float_val = rawValue.clone();
1160 setFloatValue(old_val);
1166 SGPropertyNode::tie (const SGRawValue<double> &rawValue, bool useDefault)
1168 if (_type == ALIAS || _tied)
1171 double old_val = 0.0;
1173 old_val = getDoubleValue();
1178 _value.double_val = rawValue.clone();
1181 setDoubleValue(old_val);
1188 SGPropertyNode::tie (const SGRawValue<string> &rawValue, bool useDefault)
1190 if (_type == ALIAS || _tied)
1195 old_val = getStringValue();
1200 _value.string_val = rawValue.clone();
1203 setStringValue(old_val);
1209 SGPropertyNode::untie ()
1216 bool val = getBoolValue();
1219 _value.bool_val = new SGRawValueInternal<bool>;
1224 int val = getIntValue();
1227 _value.int_val = new SGRawValueInternal<int>;
1232 long val = getLongValue();
1235 _value.long_val = new SGRawValueInternal<long>;
1240 float val = getFloatValue();
1243 _value.float_val = new SGRawValueInternal<float>;
1248 double val = getDoubleValue();
1251 _value.double_val = new SGRawValueInternal<double>;
1256 string val = getStringValue();
1259 _value.string_val = new SGRawValueInternal<string>;
1270 SGPropertyNode::getRootNode ()
1275 return _parent->getRootNode();
1278 const SGPropertyNode *
1279 SGPropertyNode::getRootNode () const
1284 return _parent->getRootNode();
1288 SGPropertyNode::getNode (const string &relative_path, bool create)
1290 if (_path_cache == 0)
1291 _path_cache = new cache_map;
1293 SGPropertyNode * result = (*_path_cache)[relative_path];
1295 vector<PathComponent> components;
1296 parse_path(relative_path, components);
1297 result = find_node(this, components, 0, create);
1298 (*_path_cache)[relative_path] = result;
1305 SGPropertyNode::getNode (const string &relative_path, int index, bool create)
1307 vector<PathComponent> components;
1308 parse_path(relative_path, components);
1309 if (components.size() > 0)
1310 components[components.size()-1].index = index;
1311 return find_node(this, components, 0, create);
1314 const SGPropertyNode *
1315 SGPropertyNode::getNode (const string &relative_path) const
1317 return ((SGPropertyNode *)this)->getNode(relative_path, false);
1320 const SGPropertyNode *
1321 SGPropertyNode::getNode (const string &relative_path, int index) const
1323 return ((SGPropertyNode *)this)->getNode(relative_path, index, false);
1327 ////////////////////////////////////////////////////////////////////////
1328 // Convenience methods using relative paths.
1329 ////////////////////////////////////////////////////////////////////////
1333 * Test whether another node has a value attached.
1336 SGPropertyNode::hasValue (const string &relative_path) const
1338 const SGPropertyNode * node = getNode(relative_path);
1339 return (node == 0 ? false : node->hasValue());
1344 * Get the value type for another node.
1346 SGPropertyNode::Type
1347 SGPropertyNode::getType (const string &relative_path) const
1349 const SGPropertyNode * node = getNode(relative_path);
1350 return (node == 0 ? UNSPECIFIED : (Type)(node->getType()));
1355 * Get a bool value for another node.
1358 SGPropertyNode::getBoolValue (const string &relative_path,
1359 bool defaultValue) const
1361 const SGPropertyNode * node = getNode(relative_path);
1362 return (node == 0 ? defaultValue : node->getBoolValue());
1367 * Get an int value for another node.
1370 SGPropertyNode::getIntValue (const string &relative_path,
1371 int defaultValue) const
1373 const SGPropertyNode * node = getNode(relative_path);
1374 return (node == 0 ? defaultValue : node->getIntValue());
1379 * Get a long value for another node.
1382 SGPropertyNode::getLongValue (const string &relative_path,
1383 long defaultValue) const
1385 const SGPropertyNode * node = getNode(relative_path);
1386 return (node == 0 ? defaultValue : node->getLongValue());
1391 * Get a float value for another node.
1394 SGPropertyNode::getFloatValue (const string &relative_path,
1395 float defaultValue) const
1397 const SGPropertyNode * node = getNode(relative_path);
1398 return (node == 0 ? defaultValue : node->getFloatValue());
1403 * Get a double value for another node.
1406 SGPropertyNode::getDoubleValue (const string &relative_path,
1407 double defaultValue) const
1409 const SGPropertyNode * node = getNode(relative_path);
1410 return (node == 0 ? defaultValue : node->getDoubleValue());
1415 * Get a string value for another node.
1418 SGPropertyNode::getStringValue (const string &relative_path,
1419 string defaultValue) const
1421 const SGPropertyNode * node = getNode(relative_path);
1422 return (node == 0 ? defaultValue : node->getStringValue());
1427 * Set a bool value for another node.
1430 SGPropertyNode::setBoolValue (const string &relative_path, bool value)
1432 return getNode(relative_path, true)->setBoolValue(value);
1437 * Set an int value for another node.
1440 SGPropertyNode::setIntValue (const string &relative_path, int value)
1442 return getNode(relative_path, true)->setIntValue(value);
1447 * Set a long value for another node.
1450 SGPropertyNode::setLongValue (const string &relative_path, long value)
1452 return getNode(relative_path, true)->setLongValue(value);
1457 * Set a float value for another node.
1460 SGPropertyNode::setFloatValue (const string &relative_path, float value)
1462 return getNode(relative_path, true)->setFloatValue(value);
1467 * Set a double value for another node.
1470 SGPropertyNode::setDoubleValue (const string &relative_path, double value)
1472 return getNode(relative_path, true)->setDoubleValue(value);
1477 * Set a string value for another node.
1480 SGPropertyNode::setStringValue (const string &relative_path, string value)
1482 return getNode(relative_path, true)->setStringValue(value);
1487 * Set an unknown value for another node.
1490 SGPropertyNode::setUnspecifiedValue (const string &relative_path, string value)
1492 return getNode(relative_path, true)->setUnspecifiedValue(value);
1497 * Test whether another node is tied.
1500 SGPropertyNode::isTied (const string &relative_path) const
1502 const SGPropertyNode * node = getNode(relative_path);
1503 return (node == 0 ? false : node->isTied());
1508 * Tie a node reached by a relative path, creating it if necessary.
1511 SGPropertyNode::tie (const string &relative_path,
1512 const SGRawValue<bool> &rawValue,
1515 return getNode(relative_path, true)->tie(rawValue, useDefault);
1520 * Tie a node reached by a relative path, creating it if necessary.
1523 SGPropertyNode::tie (const string &relative_path,
1524 const SGRawValue<int> &rawValue,
1527 return getNode(relative_path, true)->tie(rawValue, useDefault);
1532 * Tie a node reached by a relative path, creating it if necessary.
1535 SGPropertyNode::tie (const string &relative_path,
1536 const SGRawValue<long> &rawValue,
1539 return getNode(relative_path, true)->tie(rawValue, useDefault);
1544 * Tie a node reached by a relative path, creating it if necessary.
1547 SGPropertyNode::tie (const string &relative_path,
1548 const SGRawValue<float> &rawValue,
1551 return getNode(relative_path, true)->tie(rawValue, useDefault);
1556 * Tie a node reached by a relative path, creating it if necessary.
1559 SGPropertyNode::tie (const string &relative_path,
1560 const SGRawValue<double> &rawValue,
1563 return getNode(relative_path, true)->tie(rawValue, useDefault);
1568 * Tie a node reached by a relative path, creating it if necessary.
1571 SGPropertyNode::tie (const string &relative_path,
1572 const SGRawValue<string> &rawValue,
1575 return getNode(relative_path, true)->tie(rawValue, useDefault);
1580 * Attempt to untie another node reached by a relative path.
1583 SGPropertyNode::untie (const string &relative_path)
1585 SGPropertyNode * node = getNode(relative_path);
1586 return (node == 0 ? false : node->untie());