{
for (ptr = ptr->children; ptr; ptr = ptr->next)
{
if (ptr->type != XML_ELEMENT_NODE)
continue;
if (!strcmp((const char *) ptr->name, "mimetypes"))
{
std::string fname = mp::xml::get_text(ptr);
mp::PlainFile f;
if (!f.open(fname))
{
throw mp::filter::FilterException
("Can not open mime types file " + fname);
}
std::vector<std::string> args;
while (f.getline(args))
{
size_t i;
for (i = 1; i<args.size(); i++)
m_p->m_ext_to_map[args[i]] = args[0];
}
}
else if (!strcmp((const char *) ptr->name, "area"))
{
xmlNode *a_node = ptr->children;
Area a;
for (; a_node; a_node = a_node->next)
{
if (a_node->type != XML_ELEMENT_NODE)
continue;
if (mp::xml::is_element_mp(a_node, "documentroot"))
a.m_file_root = mp::xml::get_text(a_node);
else if (mp::xml::is_element_mp(a_node, "prefix"))
a.m_url_path_prefix = mp::xml::get_text(a_node);
else
throw mp::filter::FilterException
("Bad element "
+ std::string((const char *) a_node->name)
+ " in area section"
);
}
if (a.m_file_root.length())
{
m_p->m_area_list.push_back(a);
}
}
else
{
throw mp::filter::FilterException
("Bad element "
+ std::string((const char *) ptr->name)
+ " in virt_db filter");
}
}
}