+void
+Session::get_route_templates (vector<RouteTemplateInfo>& template_names)
+{
+ vector<string *> *templates;
+ PathScanner scanner;
+ string path;
+
+ path = route_template_path ();
+
+ templates = scanner (path, template_filter, 0, false, true);
+
+ if (!templates) {
+ return;
+ }
+
+ for (vector<string*>::iterator i = templates->begin(); i != templates->end(); ++i) {
+ string fullpath = *(*i);
+
+ XMLTree tree;
+
+ if (!tree.read (fullpath.c_str())) {
+ continue;
+ }
+
+ XMLNode* root = tree.root();
+
+ RouteTemplateInfo rti;
+
+ rti.name = IO::name_from_state (*root->children().front());
+ rti.path = fullpath;
+
+ template_names.push_back (rti);
+ }
+
+ delete templates;
+}
+