+
+/**
+ * Return the value of the current node.
+ *
+ * Currently, this does a lookup each time, but we could cache the
+ * value safely as long as it's non-zero.
+ *
+ * Note that this will not create the value if it doesn't already exist.
+ */
+SGValue *
+SGPropertyNode::getValue (const string &subpath)
+{
+ if (_props == 0)
+ return 0;
+
+ if (subpath.size() == 0)
+ return _props->getValue(_path);
+ else
+ return _props->getValue(_path + string("/") + subpath);
+}
+
+
+/**
+ * Return a bool value.
+ */
+bool
+SGPropertyNode::getBoolValue (const string &subpath, bool defaultValue) const
+{
+ if (_props == 0)
+ return defaultValue;
+
+ if (subpath == "")
+ return _props->getBoolValue(_path, defaultValue);
+ else
+ return _props->getBoolValue(_path + string("/") + subpath,
+ defaultValue);
+}
+
+
+/**
+ * Return an int value.
+ */
+int
+SGPropertyNode::getIntValue (const string &subpath, int defaultValue) const
+{
+ if (_props == 0)
+ return defaultValue;
+
+ if (subpath == "")
+ return _props->getIntValue(_path, defaultValue);
+ else
+ return _props->getIntValue(_path + string("/") + subpath,
+ defaultValue);
+}
+
+
+/**
+ * Return a float value.
+ */
+float
+SGPropertyNode::getFloatValue (const string &subpath, float defaultValue) const
+{
+ if (_props == 0)
+ return defaultValue;
+
+ if (subpath == "")
+ return _props->getFloatValue(_path, defaultValue);
+ else
+ return _props->getFloatValue(_path + string("/") + subpath,
+ defaultValue);
+}
+
+
+/**
+ * Return a double value.
+ */
+double
+SGPropertyNode::getDoubleValue (const string &subpath,
+ double defaultValue) const
+{
+ if (_props == 0)
+ return defaultValue;
+
+ if (subpath == "")
+ return _props->getDoubleValue(_path, defaultValue);
+ else
+ return _props->getDoubleValue(_path + string("/") + subpath,
+ defaultValue);
+}
+
+
+/**
+ * Return a string value.
+ */
+const string &
+SGPropertyNode::getStringValue (const string &subpath,
+ const string &defaultValue) const
+{
+ if (_props == 0)
+ return defaultValue;
+
+ if (subpath == "")
+ return _props->getStringValue(_path, defaultValue);
+ else
+ return _props->getStringValue(_path + string("/") + subpath,
+ defaultValue);
+}
+
+