diff --git a/include/XSLT/impl/xslt_precedence.hpp b/include/XSLT/impl/xslt_precedence.hpp new file mode 100755 index 00000000..12393d5e --- /dev/null +++ b/include/XSLT/impl/xslt_precedence.hpp @@ -0,0 +1,50 @@ +#ifndef ARABICA_XSLT_PRECEDENCE_HPP +#define ARABICA_XSLT_PRECEDENCE_HPP + +class Precedence +{ +public: + Precedence() : + precedence_() + { + } // Precedence + + Precedence(const Precedence& rhs) : + precedence_(rhs.precedence_) + { + } // Precedence + +private: + Precedence(const std::vector precedence) : + precedence_(precedence) + { + } // Precedence + +public: + ~Precedence() { } + + bool operator==(const Precedence& rhs) const + { + return precedence_ == rhs.precedence_; + } // operator== + + Precedence& operator=(const Precedence& rhs) + { + std::vector other(rhs.precedence_); + + precedence_.swap(other); + return *this; + } // operator= + + Precedence nextGeneration(int p) const + { + Precedence next(precedence_); + next.precedence_.push_back(p); + return next; + } // nextGeneration + +private: + std::vector precedence_; +}; // class Precedence + +#endif diff --git a/include/XSLT/impl/xslt_template.hpp b/include/XSLT/impl/xslt_template.hpp index 415dabf0..43f264aa 100755 --- a/include/XSLT/impl/xslt_template.hpp +++ b/include/XSLT/impl/xslt_template.hpp @@ -2,6 +2,7 @@ #define ARABICA_XSLT_TEMPLATE_HPP #include "xslt_item.hpp" +#include "xslt_precedence.hpp" namespace Arabica { @@ -12,8 +13,8 @@ class Template : public ItemContainer { public: Template(const std::pair& name, - const std::pair& mode, - const std::string& priority) : + const std::pair& mode, + const std::string& priority) : matches_(), name_(name), mode_(mode)