ultimatepp/uppdev/XmlBug/XmlBug.cpp
cxl 4a1c627474 Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

61 lines
1 KiB
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
try {
String d = LoadFile(GetDataFile("XmlBug.xml"));
XmlParser p(d);
while(!p.IsTag()) p.Skip();
p.PassTag("Settings");
String Host, CustomersUrl, CustomersSince, ProductsUrl, ProductsSince, OrdersUrl, OrdersSince;
int Port, CycleTime;
while(!p.IsEof())
{
if(p.Tag("WebServer"))
{
Host = p["Host"];
Port = atoi(p["Port"]);
}
else if(p.Tag("CustomerList"))
{
CustomersUrl = p["Url"];
DUMP(CustomersUrl);
CustomersSince = p["Since"];
}
else if(p.Tag("ProductList"))
{
ProductsUrl = p["Url"];
ProductsSince = p["Since"];
}
else if(p.Tag("OrderList"))
{
OrdersUrl = p["Url"];
OrdersSince = p["Since"];
}
else if(p.Tag("Cycle"))
{
CycleTime = atoi(p["Time"]);
if (CycleTime <= 0)
{
CycleTime = 10;
}
}
else
{
p.Skip();
}
}
}
catch(XmlError)
{
LOG("Error");
}
}