[sword-cvs] sword/tests xmltest.cpp,NONE,1.1 Makefile.am,1.11,1.12
sword@www.crosswire.org
sword@www.crosswire.org
Sun, 25 May 2003 21:32:47 -0700
Update of /usr/local/cvsroot/sword/tests
In directory www:/tmp/cvs-serv8807/tests
Modified Files:
Makefile.am
Added Files:
xmltest.cpp
Log Message:
Added utilfuns/utilxml.cpp and test/xmltest which
include basic xml utility classes
Added comparison operators to SWBuf so it plays
nicely with stl containers
--- NEW FILE: xmltest.cpp ---
#include <utilxml.h>
#include <iostream>
using namespace sword;
using namespace std;
int main(int argc, char **argv) {
XMLTag x((argc > 1) ? argv[1] : "<verse osisID=\"John.1.1\" type=\"test type\" yeah = \"stuff\" />");
x.setAttribute("newOne", "oneValue");
cout << x.toString() << "\n";
cout << "Tag name: [" << x.getName() << "]\n";
ListString attributes = x.getAttributeNames();
for (ListString::iterator it = attributes.begin(); it != attributes.end(); it++) {
const char *name = it->c_str();
cout << " - attribute: [" << name << "] = [";
cout << x.getAttribute(name) << "]\n";
}
cout << " isEmpty: " << x.isEmpty() << "\n";
cout << " isEndTag: " << x.isEndTag() << "\n";
cout << "\n";
}
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/sword/tests/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Makefile.am 20 Feb 2003 03:12:37 -0000 1.11
--- Makefile.am 26 May 2003 04:32:45 -0000 1.12
***************
*** 7,11 ****
compnone complzss localetest keycast introtest indextest configtest \
romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest \
! swbuftest
if ICU
--- 7,11 ----
compnone complzss localetest keycast introtest indextest configtest \
romantest testblocks filtertest rawldidxtest lextest swaptest genbooktest treeidxtest \
! swbuftest xmltest
if ICU
***************
*** 59,61 ****
--- 59,62 ----
genbooktest_SOURCES = genbooktest.cpp
swbuftest_SOURCES = swbuftest.cpp
+ xmltest_SOURCES = xmltest.cpp