summaryrefslogtreecommitdiff
path: root/netfs/fuseConfig.cpp
blob: 26ee6a1eaad093e19cfeeeafecd7825738c527d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "fuseConfig.h"
#include <string.h>

FuseConfigPtr
FuseConfig::Load(const char * path)
{
	xmlDoc * doc = xmlReadFile(path, NULL, 0);
	FuseConfigPtr dc = new FuseConfig(doc->children);
	xmlFreeDoc(doc);
	return dc;
}

FuseConfig::FuseConfig(xmlNodePtr conf)
{
	foreachxml(exp, xmlGetNode(conf, "exports"), "export") {
		ExportPtr e = new Export(exp);
		exports[e->name] = e;
	}
}

FuseConfig::Export::Export(xmlNodePtr conf) :
	name(xmlGetNodeValue(conf, "name"))
{
	foreachxml(ep, xmlGetNode(conf, "endpoints"), "endpoint") {
		endpoints.insert(xmlGetNodeValue(ep));
	}
}