1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
52 #ifndef Patternist_ContextFNs_H
53 #define Patternist_ContextFNs_H
55 #include <private/qfunctioncall_p.h>
59 * @short Contains classes implementing the functions found in
60 * <a href="http://www.w3.org/TR/xpath-functions/#context">XQuery 1.0 and
61 * XPath 2.0 Functions and Operators, 16 Context Functions</a>.
63 * @ingroup Patternist_functions
73 * @short Implements the function <tt>fn:position()</tt>.
75 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-position">XQuery 1.0
76 * and XPath 2.0 Functions and Operators, 16.1 fn:position</a>
77 * @ingroup Patternist_functions
78 * @author Frans Englich <frans.englich@nokia.com>
80 class PositionFN : public FunctionCall
83 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
87 * @short Implements the function <tt>fn:last()</tt>.
89 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-last">XQuery 1.0
90 * and XPath 2.0 Functions and Operators, 16.2 fn:last</a>
91 * @ingroup Patternist_functions
92 * @author Frans Englich <frans.englich@nokia.com>
94 class LastFN : public FunctionCall
97 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
101 * @short Implements the function <tt>fn:implicit-timezone()</tt>.
103 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-implicit-timezone">XQuery 1.0
104 * and XPath 2.0 Functions and Operators, 16.6 fn:implicit-timezone</a>
105 * @ingroup Patternist_functions
106 * @author Frans Englich <frans.englich@nokia.com>
108 class ImplicitTimezoneFN : public FunctionCall
111 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
115 * @short Implements the function <tt>fn:current-dateTime()</tt>.
117 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-current-dateTime">XQuery 1.0
118 * and XPath 2.0 Functions and Operators, 16.3 fn:current-dateTime</a>
119 * @ingroup Patternist_functions
120 * @author Frans Englich <frans.englich@nokia.com>
122 class CurrentDateTimeFN : public FunctionCall
125 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
129 * @short Implements the function <tt>fn:current-date()</tt>.
131 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-current-date">XQuery 1.0
132 * and XPath 2.0 Functions and Operators, 16.4 fn:current-date</a>
133 * @ingroup Patternist_functions
134 * @author Frans Englich <frans.englich@nokia.com>
136 class CurrentDateFN : public FunctionCall
139 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
143 * @short Implements the function <tt>fn:current-time()</tt>.
145 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-current-time">XQuery 1.0
146 * and XPath 2.0 Functions and Operators, 16.5 fn:current-date</a>
147 * @ingroup Patternist_functions
148 * @author Frans Englich <frans.englich@nokia.com>
150 class CurrentTimeFN : public FunctionCall
153 virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
157 * @short Implements the function <tt>fn:default-collation()</tt>.
159 * This is done by rewriting to StaticContext::defaultCollation() at the typeCheck() stage.
161 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-default-collation">XQuery 1.0
162 * and XPath 2.0 Functions and Operators, 16.7 fn:default-collation</a>
163 * @ingroup Patternist_functions
164 * @author Frans Englich <frans.englich@nokia.com>
166 class DefaultCollationFN : public FunctionCall
169 virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context,
170 const SequenceType::Ptr &reqType);
174 * @short Implements the function <tt>fn:static-base-uri()</tt>.
176 * This is done by rewriting to StaticContext::baseURI() at the typeCheck() stage.
178 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-static-base-uri">XQuery 1.0
179 * and XPath 2.0 Functions and Operators, 16.8 fn:static-base-uri</a>
180 * @ingroup Patternist_functions
181 * @author Frans Englich <frans.englich@nokia.com>
183 class StaticBaseURIFN : public FunctionCall
186 virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context,
187 const SequenceType::Ptr &reqType);