From: sgunderson@bigfoot.com <> Date: Wed, 21 Sep 2011 22:18:58 +0000 (+0200) Subject: Add a C++0x attribute test. Does not pass yet. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=eec78fce81e81ed3386af841083ab17dee6f1a85;p=xml-template Add a C++0x attribute test. Does not pass yet. --- diff --git a/c++0x/Makefile b/c++0x/Makefile index 939c748..ee41b66 100644 --- a/c++0x/Makefile +++ b/c++0x/Makefile @@ -11,3 +11,6 @@ simple: simple.o $(LIBS) clone: clone.o $(LIBS) $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) + +attribute: attribute.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) diff --git a/c++0x/attribute.cpp b/c++0x/attribute.cpp new file mode 100644 index 0000000..70b2391 --- /dev/null +++ b/c++0x/attribute.cpp @@ -0,0 +1,33 @@ +#include + +#include "xml-template.h" + +using namespace std; + +int main(int argc, char **argv) +{ + Substitute master_directive = { + make_pair("color", new Replace("blue")), + make_pair("#things", new Clone { + new Substitute { + make_pair("li", new Replace("Raindrops on roses")), + make_pair("li/class", new Replace("odd")), + }, + new Substitute { + make_pair("li", new Replace("Whiskers on kittens")), + make_pair("li/class", new Replace("even")), + }, + new Substitute { + make_pair("li", new Replace("Bright copper kettles")), + make_pair("li/class", new Replace("odd")), + }, + new Substitute { + make_pair("li", new Replace("Warm, woolen mittens")), + make_pair("li/class", new Replace("even")), + }, + }), + }; + + process_file("../xml/clone.xml", argv[1], &master_directive); + return(0); +}