00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <Sockets/XmlDocument.h>
00023 #include <Sockets/XmlNode.h>
00024 #include <Sockets/Exception.h>
00025 #include "Iconf.h"
00026 #include <iostream>
00027
00028 int main(int argc, char *argv[])
00029 {
00030 try
00031 {
00032 Xml::XmlDocument doc("conf.xml");
00033 Xml::XmlNode n(doc);
00034 AJP13::net_alhem_1_0_server::Configuration_t conf(n);
00035 printf("%s\n", conf.GetRootDir().c_str());
00036 printf("%s\n", conf.GetHosts().GetDefaultHost().ToString("defaultHost").c_str());
00037 std::list<AJP13::net_alhem_1_0_server::Hosts::Host_t>& ref = conf.GetHosts().GetHost();
00038 for (std::list<AJP13::net_alhem_1_0_server::Hosts::Host_t>::const_iterator it = ref.begin(); it != ref.end(); it++)
00039 {
00040 printf(" %s\n", (*it).GetName().c_str());
00041 printf("%s\n\n", (*it).ToString("host").c_str());
00042 }
00043 }
00044 catch (const Exception& e)
00045 {
00046 std::cout << e.ToString() << std::endl;
00047 }
00048 }
00049
00050