]> git.sesse.net Git - xml-template/commitdiff
Add structure test for C++0x. Passes.
authorsgunderson@bigfoot.com <>
Wed, 21 Sep 2011 22:46:15 +0000 (00:46 +0200)
committersgunderson@bigfoot.com <>
Wed, 21 Sep 2011 22:46:15 +0000 (00:46 +0200)
c++0x/Makefile
c++0x/structure.cpp [new file with mode: 0644]

index f79d37af07ff73540ba554cb59528a2e4b4b4616..b2528dfbb78e37062eebbc4d44df0d3294efdb15 100644 (file)
@@ -20,3 +20,6 @@ namespace: namespace.o $(LIBS)
 
 namespace2: namespace2.o $(LIBS)
        $(CXX) -o $@ $< $(LIBS) $(LDFLAGS)
+
+structure: structure.o $(LIBS)
+       $(CXX) -o $@ $< $(LIBS) $(LDFLAGS)
diff --git a/c++0x/structure.cpp b/c++0x/structure.cpp
new file mode 100644 (file)
index 0000000..2447feb
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+#include "xml-template.h"
+
+using namespace std;
+
+int main(int argc, char **argv)
+{
+       Substitute master_directive = {
+               make_pair("#outer", new Clone {
+                       new Substitute { make_pair("#inner", new Replace("One")) },
+                       new Substitute { make_pair("#inner", new Replace("Two")) },
+                       new Substitute { make_pair("#inner", new Replace("Three")) },
+               }),
+       };
+
+       process_file("../xml/structure.xml", argv[1], &master_directive);
+       return(0);
+}