Qt 4.8
qdatetimefns_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
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.
16 **
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.
24 **
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.
28 **
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.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
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.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_DateTimeFNs_H
53 #define Patternist_DateTimeFNs_H
54 
55 #include "qatomiccomparator_p.h"
56 #include "qcommonvalues_p.h"
57 #include "qschemadatetime_p.h"
58 #include "qdaytimeduration_p.h"
59 #include "qdecimal_p.h"
60 #include "qinteger_p.h"
61 #include "qfunctioncall_p.h"
62 
73 
75 
76 namespace QPatternist
77 {
93  template<typename TSubClass>
95  {
96  public:
101  virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
102  };
103 
110  class YearsFromDurationFN : public ExtractFromDurationFN<YearsFromDurationFN>
111  {
112  public:
113  inline Item extract(const AbstractDuration *const duration) const;
114  };
115 
122  class MonthsFromDurationFN : public ExtractFromDurationFN<MonthsFromDurationFN>
123  {
124  public:
125  inline Item extract(const AbstractDuration *const duration) const;
126  };
127 
134  class DaysFromDurationFN : public ExtractFromDurationFN<DaysFromDurationFN>
135  {
136  public:
137  inline Item extract(const AbstractDuration *const duration) const;
138  };
139 
146  class HoursFromDurationFN : public ExtractFromDurationFN<HoursFromDurationFN>
147  {
148  public:
149  inline Item extract(const AbstractDuration *const duration) const;
150  };
151 
158  class MinutesFromDurationFN : public ExtractFromDurationFN<MinutesFromDurationFN>
159  {
160  public:
161  inline Item extract(const AbstractDuration *const duration) const;
162  };
163 
170  class SecondsFromDurationFN : public ExtractFromDurationFN<SecondsFromDurationFN>
171  {
172  public:
173  inline Item extract(const AbstractDuration *const duration) const;
174  };
175 
192  template<typename TSubClass>
194  {
195  public:
200  virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
201  };
202 
210  class YearFromAbstractDateTimeFN : public ExtractFromDateTimeFN<YearFromAbstractDateTimeFN>
211  {
212  public:
213  inline Item extract(const QDateTime &dt) const;
214  };
215 
223  class DayFromAbstractDateTimeFN : public ExtractFromDateTimeFN<DayFromAbstractDateTimeFN>
224  {
225  public:
226  inline Item extract(const QDateTime &dt) const;
227  };
228 
237  class HoursFromAbstractDateTimeFN : public ExtractFromDateTimeFN<HoursFromAbstractDateTimeFN>
238  {
239  public:
240  inline Item extract(const QDateTime &dt) const;
241  };
242 
251  class MinutesFromAbstractDateTimeFN : public ExtractFromDateTimeFN<MinutesFromAbstractDateTimeFN>
252  {
253  public:
254  inline Item extract(const QDateTime &dt) const;
255  };
256 
265  class SecondsFromAbstractDateTimeFN : public ExtractFromDateTimeFN<SecondsFromAbstractDateTimeFN>
266  {
267  public:
268  inline Item extract(const QDateTime &dt) const;
269  };
270 
279  class TimezoneFromAbstractDateTimeFN : public ExtractFromDateTimeFN<TimezoneFromAbstractDateTimeFN>
280  {
281  public:
282  inline Item extract(const QDateTime &dt) const;
283  };
284 
291  class MonthFromAbstractDateTimeFN : public ExtractFromDateTimeFN<MonthFromAbstractDateTimeFN>
292  {
293  public:
294  inline Item extract(const QDateTime &dt) const;
295  };
296 
297 #include "qdatetimefns.cpp"
298 
299 }
300 
302 
304 
305 #endif
Implements the function fn:years-from-duration().
Base class for implementations of builtin functions.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
Base class for classes implementing durations.
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
Contains class DateTime. This file was originally called qdatetime_p.h, but various build systems can...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Helper class for implementing functions extracting components from durations.
Extracts the timezone property from a sub-class of AbstractDateTime such as DateTime or Date...
The namespace for the internal API of QtXmlPatterns.
Implements the function fn:months-from-duration().
Extracts the day property from a sub-class of AbstractDateTime such as DateTime or Date...
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
Represents an item in the XPath 2.0 Data Model.
Definition: qitem_p.h:182
Implements the function fn:hours-from-duration().
Implements the function fn:days-from-duration().
Implements the function fn:minutes-from-duration().
implements the functions fn:month-from-dateTime() and fn:month-from-date().
Extracts the minutes property from a sub-class of AbstractDateTime such as DateTime or Date...
Implements the function fn:seconds-from-duration().
Helper class for implementing functions extracting components from date/time values.
Extracts the minute property from a sub-class of AbstractDateTime such as DateTime or SchemaTime...
This file is included by qdatetimefns_p.h. If you need includes in this file, put them in qdatetimefn...
Extracts the seconds property from a sub-class of AbstractDateTime such as DateTime or Date...
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const
Extracts the year property from a sub-class of AbstractDateTime such as DateTime or Date...
#define QT_END_HEADER
Definition: qglobal.h:137