From bbcae98beca8ee9fa4a09e00757d2eb142b33ad7 Mon Sep 17 00:00:00 2001 From: jez Date: Mon, 13 Jul 2009 09:13:11 +0100 Subject: [PATCH] renamed XPath function base classes, moved out of impl namespace --- include/XPath/impl/xpath_function.hpp | 172 +++++++++++++------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/include/XPath/impl/xpath_function.hpp b/include/XPath/impl/xpath_function.hpp index 086716b6..f15b0877 100644 --- a/include/XPath/impl/xpath_function.hpp +++ b/include/XPath/impl/xpath_function.hpp @@ -76,14 +76,11 @@ private: const std::vector > args_; }; // class XPathFunction -namespace impl -{ - -template -class BooleanFunction : public XPathFunction +template > +class BooleanXPathFunction : public XPathFunction { public: - BooleanFunction(int minArgs, int maxArgs, const std::vector >& args) : + BooleanXPathFunction(int minArgs, int maxArgs, const std::vector >& args) : XPathFunction(minArgs, maxArgs, args) { } virtual ValueType type() const { return BOOL; } @@ -97,13 +94,13 @@ public: protected: virtual bool doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const = 0; -}; // class BooleanFunction +}; // class BooleanXPathFunction -template -class NumericFunction : public XPathFunction +template > +class NumericXPathFunction : public XPathFunction { public: - NumericFunction(int minArgs, int maxArgs, const std::vector >& args) : + NumericXPathFunction(int minArgs, int maxArgs, const std::vector >& args) : XPathFunction(minArgs, maxArgs, args) { } virtual ValueType type() const { return NUMBER; } @@ -117,13 +114,13 @@ public: protected: virtual double doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const = 0; -}; // class NumericFunction +}; // class NumericXPathFunction -template -class StringFunction : public XPathFunction +template > +class StringXPathFunction : public XPathFunction { public: - StringFunction(int minArgs, int maxArgs, const std::vector >& args) : + StringXPathFunction(int minArgs, int maxArgs, const std::vector >& args) : XPathFunction(minArgs, maxArgs, args) { } virtual ValueType type() const { return STRING; } @@ -137,16 +134,19 @@ public: protected: virtual string_type doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const = 0; -}; // class StringFunction +}; // class StringXPathFunction + +namespace impl +{ //////////////////////////////// // node-set functions // number last() template -class LastFn : public NumericFunction +class LastFn : public NumericXPathFunction { public: - LastFn(const std::vector >& args) : NumericFunction(0, 0, args) { } + LastFn(const std::vector >& args) : NumericXPathFunction(0, 0, args) { } protected: virtual double doEvaluate(const DOM::Node& context, @@ -158,10 +158,10 @@ protected: // number position() template -class PositionFn : public NumericFunction +class PositionFn : public NumericXPathFunction { public: - PositionFn(const std::vector >& args) : NumericFunction(0, 0, args) { } + PositionFn(const std::vector >& args) : NumericXPathFunction(0, 0, args) { } protected: virtual double doEvaluate(const DOM::Node& context, @@ -173,11 +173,11 @@ protected: // number count(node-set) template -class CountFn : public NumericFunction +class CountFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - CountFn(const std::vector >& args) : NumericFunction(1, 1, args) { } + CountFn(const std::vector >& args) : NumericXPathFunction(1, 1, args) { } virtual double doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const @@ -189,12 +189,12 @@ public: // node-set id(object) // string local-name(node-set?) template -class LocalNameFn : public StringFunction +class LocalNameFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: LocalNameFn(const std::vector >& args) : - StringFunction(0, 1, args) { } + StringXPathFunction(0, 1, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -227,12 +227,12 @@ protected: // string namespace-uri(node-set?) template -class NamespaceURIFn : public StringFunction +class NamespaceURIFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: NamespaceURIFn(const std::vector >& args) : - StringFunction(0, 1, args) { } + StringXPathFunction(0, 1, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -263,12 +263,12 @@ protected: // string name(node-set?) template -class NameFn : public StringFunction +class NameFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: NameFn(const std::vector >& args) : - StringFunction(0, 1, args) { } + StringXPathFunction(0, 1, args) { } protected: @@ -305,12 +305,12 @@ protected: // string string(object?) template -class StringFn : public StringFunction +class StringFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: StringFn(const std::vector >& args) : - StringFunction(0, 1, args) { } + StringXPathFunction(0, 1, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -323,12 +323,12 @@ protected: // string concat(string, string, string*) template -class ConcatFn : public StringFunction +class ConcatFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: ConcatFn(const std::vector >& args) : - StringFunction(2, -1, args) { } + StringXPathFunction(2, -1, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -343,11 +343,11 @@ protected: // boolean starts-with(string, string) template -class StartsWithFn : public BooleanFunction +class StartsWithFn : public BooleanXPathFunction { - typedef BooleanFunction baseT; + typedef BooleanXPathFunction baseT; public: - StartsWithFn(const std::vector >& args) : BooleanFunction(2, 2, args) { } + StartsWithFn(const std::vector >& args) : BooleanXPathFunction(2, 2, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -372,11 +372,11 @@ protected: // boolean contains(string, string) template -class ContainsFn : public BooleanFunction +class ContainsFn : public BooleanXPathFunction { - typedef BooleanFunction baseT; + typedef BooleanXPathFunction baseT; public: - ContainsFn(const std::vector >& args) : BooleanFunction(2, 2, args) { } + ContainsFn(const std::vector >& args) : BooleanXPathFunction(2, 2, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -389,12 +389,12 @@ protected: // string substring-before(string, string) template -class SubstringBeforeFn : public StringFunction +class SubstringBeforeFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: SubstringBeforeFn(const std::vector >& args) : - StringFunction(2, 2, args) { } + StringXPathFunction(2, 2, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -412,12 +412,12 @@ protected: // string substring-after(string, string) template -class SubstringAfterFn : public StringFunction +class SubstringAfterFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: SubstringAfterFn(const std::vector >& args) : - StringFunction(2, 2, args) { } + StringXPathFunction(2, 2, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -436,12 +436,12 @@ protected: // string substring(string, number, number?) template -class SubstringFn : public StringFunction +class SubstringFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: SubstringFn(const std::vector >& args) : - StringFunction(2, 3, args) { } + StringXPathFunction(2, 3, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -468,11 +468,11 @@ protected: // number string-length(string?) template -class StringLengthFn : public NumericFunction +class StringLengthFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - StringLengthFn(const std::vector >& args) : NumericFunction(0, 1, args) { } + StringLengthFn(const std::vector >& args) : NumericXPathFunction(0, 1, args) { } virtual double doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const @@ -484,12 +484,12 @@ public: // string normalize-space(string?) template -class NormalizeSpaceFn : public StringFunction +class NormalizeSpaceFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: NormalizeSpaceFn(const std::vector >& args) : - StringFunction(0, 1, args) { } + StringXPathFunction(0, 1, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -503,12 +503,12 @@ protected: // string translate(string, string, string) template -class TranslateFn : public StringFunction +class TranslateFn : public StringXPathFunction { - typedef StringFunction baseT; + typedef StringXPathFunction baseT; public: TranslateFn(const std::vector >& args) : - StringFunction(3, 3, args) { } + StringXPathFunction(3, 3, args) { } protected: virtual string_type doEvaluate(const DOM::Node& context, @@ -539,11 +539,11 @@ protected: // boolean boolean(object) template -class BooleanFn : public BooleanFunction +class BooleanFn : public BooleanXPathFunction { - typedef BooleanFunction baseT; + typedef BooleanXPathFunction baseT; public: - BooleanFn(const std::vector >& args) : BooleanFunction(1, 1, args) { } + BooleanFn(const std::vector >& args) : BooleanXPathFunction(1, 1, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -555,11 +555,11 @@ protected: // boolean not(boolean) template -class NotFn : public BooleanFunction +class NotFn : public BooleanXPathFunction { - typedef BooleanFunction baseT; + typedef BooleanXPathFunction baseT; public: - NotFn(const std::vector >& args) : BooleanFunction(1, 1, args) { } + NotFn(const std::vector >& args) : BooleanXPathFunction(1, 1, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -571,10 +571,10 @@ protected: // boolean true() template -class TrueFn : public BooleanFunction +class TrueFn : public BooleanXPathFunction { public: - TrueFn(const std::vector >& args) : BooleanFunction(0, 0, args) { } + TrueFn(const std::vector >& args) : BooleanXPathFunction(0, 0, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -586,10 +586,10 @@ protected: // boolean false() template -class FalseFn : public BooleanFunction +class FalseFn : public BooleanXPathFunction { public: - FalseFn(const std::vector >& args) : BooleanFunction(0, 0, args) { } + FalseFn(const std::vector >& args) : BooleanXPathFunction(0, 0, args) { } protected: virtual bool doEvaluate(const DOM::Node& context, @@ -606,11 +606,11 @@ protected: // number number(object?) template -class NumberFn : public NumericFunction +class NumberFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - NumberFn(const std::vector >& args) : NumericFunction(0, 1, args) { } + NumberFn(const std::vector >& args) : NumericXPathFunction(0, 1, args) { } virtual double doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const @@ -623,11 +623,11 @@ public: // number sum(node-set) template -class SumFn : public NumericFunction +class SumFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - SumFn(const std::vector >& args) : NumericFunction(1, 1, args) { } + SumFn(const std::vector >& args) : NumericXPathFunction(1, 1, args) { } protected: virtual double doEvaluate(const DOM::Node& context, @@ -643,11 +643,11 @@ protected: // number floor(number) template -class FloorFn : public NumericFunction +class FloorFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - FloorFn(const std::vector >& args) : NumericFunction(1, 1, args) { } + FloorFn(const std::vector >& args) : NumericXPathFunction(1, 1, args) { } protected: virtual double doEvaluate(const DOM::Node& context, @@ -659,11 +659,11 @@ protected: // number ceiling(number) template -class CeilingFn : public NumericFunction +class CeilingFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - CeilingFn(const std::vector >& args) : NumericFunction(1, 1, args) { } + CeilingFn(const std::vector >& args) : NumericXPathFunction(1, 1, args) { } protected: virtual double doEvaluate(const DOM::Node& context, @@ -675,11 +675,11 @@ protected: // number round(number) template -class RoundFn : public NumericFunction +class RoundFn : public NumericXPathFunction { - typedef NumericFunction baseT; + typedef NumericXPathFunction baseT; public: - RoundFn(const std::vector >& args) : NumericFunction(1, 1, args) { } + RoundFn(const std::vector >& args) : NumericXPathFunction(1, 1, args) { } protected: virtual double doEvaluate(const DOM::Node& context,