- const_iterator it = FGPropertyList::begin();
- FG_LOG(FG_GENERAL, FG_INFO, "Begin property list dump...");
- while (it != end()) {
- FG_LOG(FG_GENERAL, FG_INFO, "Property: " << it->first);
+ string::size_type pos = _path.rfind('/');
+ if (pos != string::npos) {
+ _name = _path.substr(pos+1);
+ return _name;
+ } else {
+ return empty_string;
+ }
+}
+
+
+/**
+ * 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.
+ */
+FGValue *
+FGPropertyNode::getValue ()
+{
+ if (_props == 0 || _path.size() == 0)
+ return 0;
+ else
+ return _props->getValue(_path);
+}
+
+
+/**
+ * Return the number of children for the current node.
+ */
+int
+FGPropertyNode::size () const
+{
+ if (_props == 0)
+ return 0;
+
+ int s = 0;
+
+ string base;
+ string lastBase;
+ string pattern = _path;
+ pattern += '/';
+
+ FGPropertyList::const_iterator it = _props->begin();
+ FGPropertyList::const_iterator end = _props->end();
+ while (it != end) {
+ if (get_base(pattern, it->first, base) && base != lastBase) {
+ s++;
+ lastBase = base;
+ }