From: sgunderson@bigfoot.com <> Date: Wed, 21 Sep 2011 19:42:44 +0000 (+0200) Subject: Add a passthru test for C++0x. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=01379ffa98201067728e63135eb1d6d66266650e;p=xml-template Add a passthru test for C++0x. --- diff --git a/c++0x/Makefile b/c++0x/Makefile index fe1f331..9c74fc0 100644 --- a/c++0x/Makefile +++ b/c++0x/Makefile @@ -1,8 +1,11 @@ CXX=g++ CXXFLAGS=-std=gnu++0x -g -Wall $(shell xml2-config --cflags) LDFLAGS=$(shell xml2-config --libs) -OBJS=simple.o xml-template.o +LIBS=xml-template.o -simple: $(OBJS) - $(CXX) -o $@ $(OBJS) $(LDFLAGS) +passthru: passthru.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) + +simple: simple.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) diff --git a/c++0x/passthru.cpp b/c++0x/passthru.cpp new file mode 100644 index 0000000..2db2e3d --- /dev/null +++ b/c++0x/passthru.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +#include "xml-template.h" + +using namespace std; + +int main(int argc, char **argv) +{ + LIBXML_TEST_VERSION + + unordered_map master_map; + + xmlDocPtr doc = xmlParseFile("../xml/passthru.xml"); + Substitute(master_map).process(xmlDocGetRootElement(doc), false); + xmlSaveFile(argv[1], doc); + + xmlCleanupParser(); + xmlMemoryDump(); + return(0); +}