]> git.sesse.net Git - xml-template/blob - c++0x/clone.cpp
Add a clone test for C++0x (no cloning logic yet, so test fails).
[xml-template] / c++0x / clone.cpp
1 #include <stdio.h>
2
3 #include "xml-template.h"
4
5 using namespace std;
6
7 int main(int argc, char **argv)
8 {
9         vector<Directive *> things;
10
11         {
12                 unordered_map<string, Directive *> submap;
13                 submap.insert(make_pair("li", new Replace("Raindrops on roses")));
14                 things.push_back(new Substitute(submap));
15         }
16         {
17                 unordered_map<string, Directive *> submap;
18                 submap.insert(make_pair("li", new Replace("Whiskers on kittens")));
19                 things.push_back(new Substitute(submap));
20         }
21         {
22                 unordered_map<string, Directive *> submap;
23                 submap.insert(make_pair("li", new Replace("Bright copper kettles")));
24                 things.push_back(new Substitute(submap));
25         }
26         {
27                 unordered_map<string, Directive *> submap;
28                 submap.insert(make_pair("li", new Replace("Warm, woolen mittens")));
29                 things.push_back(new Substitute(submap));
30         }
31
32         unordered_map<string, Directive *> master_map;
33         master_map.insert(make_pair("color", new Replace("blue")));
34         master_map.insert(make_pair("#things", new Clone(things)));
35
36         process_file("../xml/clone.xml", argv[1], new Substitute(master_map));
37         return(0);
38 }