X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=c%2B%2B0x%2Fxml-template.h;h=d29cbaeeb5b17594a5e5db7fd5ea80fcab4fae60;hb=a87410331a3cf42444d92930a9a796a384278c8d;hp=4728dbf088379b5edc998285408e28ed07e06aff;hpb=9479feb34459b0d1fcdaa6a6545827f3243cb513;p=xml-template diff --git a/c++0x/xml-template.h b/c++0x/xml-template.h index 4728dbf..d29cbae 100644 --- a/c++0x/xml-template.h +++ b/c++0x/xml-template.h @@ -25,15 +25,18 @@ class Replace : public Directive { const std::string str; }; +class Substitute; + class Clone : public Directive { public: Clone(const std::vector &subdirectives); + Clone(const std::vector &subdirectives); Clone(std::initializer_list subdirectives); ~Clone(); virtual void process(xmlNode *node, bool clean); private: - const std::vector subdirectives; + std::vector subdirectives; }; class Substitute : public Directive { @@ -45,7 +48,15 @@ class Substitute : public Directive { virtual void process(xmlNode *node, bool clean); private: - const std::unordered_map substitution_map; + friend class Alternate; + std::unordered_map substitution_map; +}; + +class Alternate : public Clone { + public: + Alternate(const std::string &attribute, + const std::vector &subdirectives_subs, + const std::vector &alternatives); }; void process_file(const std::string &input_filename,