+const archive_node &archive_node::find_ex_node(const std::string &name, unsigned index) const
+{
+ archive_atom name_atom = a.atomize(name);
+ archive_node_cit i = props.begin(), iend = props.end();
+ unsigned found_index = 0;
+ while (i != iend) {
+ if (i->type == PTYPE_NODE && i->name == name_atom) {
+ if (found_index == index)
+ return a.get_node(i->value);
+ found_index++;
+ }
+ i++;
+ }
+ throw (std::runtime_error("property with name '" + name + "' not found in archive node"));
+}
+
+
+void archive_node::get_properties(propinfovector &v) const
+{
+ v.clear();
+ archive_node_cit i = props.begin(), iend = props.end();
+ while (i != iend) {
+ property_type type = i->type;
+ std::string name = a.unatomize(i->name);
+
+ propinfovector::iterator a = v.begin(), aend = v.end();
+ bool found = false;
+ while (a != aend) {
+ if (a->type == type && a->name == name) {
+ a->count++;
+ found = true;
+ break;
+ }
+ ++a;
+ }
+ if (!found)
+ v.push_back(property_info(type, name));
+ i++;
+ }