]> git.sesse.net Git - xml-template/blobdiff - c++0x/xml-template.h
Implement attribute handling in C++0x.
[xml-template] / c++0x / xml-template.h
index f0da0b8b0cdd1d007aca0b35f2b33457b2d47c3b..4728dbf088379b5edc998285408e28ed07e06aff 100644 (file)
 
 class Directive {
  public:
+       virtual ~Directive();
        virtual void process(xmlNode *node, bool clean) = 0;
+       virtual std::string get_contents();  // Only makes sense for Replace.
 };
 
 class Replace : public Directive {
  public:
        Replace(const std::string &str);
        virtual void process(xmlNode *node, bool clean);
+       virtual std::string get_contents();
 
  private:
        const std::string str;
@@ -26,6 +29,7 @@ class Clone : public Directive {
  public:
        Clone(const std::vector<Directive *> &subdirectives);
        Clone(std::initializer_list<Directive *> subdirectives);
+       ~Clone();
        virtual void process(xmlNode *node, bool clean);
 
  private:
@@ -36,6 +40,7 @@ class Substitute : public Directive {
  public:
        Substitute(const std::unordered_map<std::string, Directive*> &substitution_map);
        Substitute(std::initializer_list<std::pair<const std::string, Directive*>> substitution_map);
+       ~Substitute();
 
        virtual void process(xmlNode *node, bool clean);