Commit 5a1f06ac authored by Pavel Vaynerman's avatar Pavel Vaynerman

new test: unixmltest

parent deeab0b1
......@@ -2,10 +2,16 @@
# This file is part of the UniSet library #
############################################################################
noinst_PROGRAMS = passivetimer
noinst_PROGRAMS = passivetimer unixml
passivetimer_SOURCES = passivetimer.cc
passivetimer_LDADD = $(top_builddir)/lib/libUniSet.la
passivetimer_CPPFLAGS = -I$(top_builddir)/include
unixml_SOURCES = unixml.cc
unixml_LDADD = $(top_builddir)/lib/libUniSet.la
unixml_CPPFLAGS = -I$(top_builddir)/include
include $(top_builddir)/conf/setting.mk
#include <iostream>
using namespace std;
#include "Exceptions.h"
#include "UniXML.h"
#include "UniSetTypes.h"
int main()
{
try
{
UniXML xml("test.xml");
xmlNode* cnode = xml.findNode(xml.getFirstNode(),"testnode");
if( !cnode )
{
cerr << "<testnode> not found" << endl;
return 1;
}
UniXML_iterator it(cnode);
cout << "string id=" << it.getProp("id")
<< " int id=" << it.getIntProp("id")
<< endl;
}
catch( UniSetTypes::Exception& ex )
{
cerr << ex << endl;
return 1;
}
catch( ... )
{
cerr << "catch ... " << endl;
return 1;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment