+ if (attval != 0) {
+ index = atoi(attval);
+ st.counters[name] = SG_MAX2(st.counters[name], index+1);
+ } else {
+ index = st.counters[name];
+ st.counters[name]++;
+ }
+
+ // Got the index, so grab the node.
+ SGPropertyNode * node = st.node->getChild(name, index, true);
+
+ // Get the access-mode attributes,
+ // but don't set yet (in case they
+ // prevent us from recording the value).
+ int mode = 0;
+
+ attval = atts.getValue("read");
+ if (checkFlag(attval, true))
+ mode |= SGPropertyNode::READ;
+ attval = atts.getValue("write");
+ if (checkFlag(attval, true))
+ mode |= SGPropertyNode::WRITE;
+ attval = atts.getValue("archive");
+ if (checkFlag(attval, false))
+ mode |= SGPropertyNode::ARCHIVE;
+ attval = atts.getValue("trace-read");
+ if (checkFlag(attval, false))
+ mode |= SGPropertyNode::TRACE_READ;
+ attval = atts.getValue("trace-write");
+ if (checkFlag(attval, false))
+ mode |= SGPropertyNode::TRACE_WRITE;
+
+ // Check for an alias.
+ attval = atts.getValue("alias");
+ if (attval != 0) {
+ if (!node->alias(attval))
+ SG_LOG(SG_INPUT, SG_ALERT, "Failed to set alias to " << attval);
+ }
+
+ // Check for an include.
+ attval = atts.getValue("include");
+ if (attval != 0) {
+ SGPath path(SGPath(_base).dir());
+ path.append(attval);
+ try {
+ readProperties(path.str(), node);
+ } catch (sg_io_exception &e) {
+ setException(e);
+ }
+ }
+
+ push_state(node, atts.getValue("type"), mode);