3 @implementation JubConfig
4 @synthesize domain, server;
8 - initWithFile: (OFString*)file
13 OFAutoreleasePool *pool = [OFAutoreleasePool new];
14 OFXMLParser *parser = [OFXMLParser parser];
15 OFXMLElementBuilder *builder =
16 [OFXMLElementBuilder elementBuilder];
18 parser.delegate = builder;
19 builder.delegate = self;
21 [parser parseFile: file];
42 - (void)elementBuilder: (OFXMLElementBuilder*)builder
43 didBuildElement: (OFXMLElement*)element
45 // TODO: At error handling for missing elements
46 of_log(@"Parsed file: %@", element);
47 domain = [[[element elementForName: @"domain"
48 namespace: CONFIG_NS] stringValue] copy];
49 server = [[[element elementForName: @"server"
50 namespace: CONFIG_NS] stringValue] copy];
51 username = [[[element elementForName: @"username"
52 namespace: CONFIG_NS] stringValue] copy];
53 password = [[[element elementForName: @"password"
54 namespace: CONFIG_NS] stringValue] copy];