1 | /**************************************************************************** |
---|---|
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
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 The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | ** |
25 | ** GNU General Public License Usage |
26 | ** Alternatively, this file may be used under the terms of the GNU |
27 | ** General Public License version 2.0 or (at your option) the GNU General |
28 | ** Public license version 3 or any later version approved by the KDE Free |
29 | ** Qt Foundation. The licenses are as published by the Free Software |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | ** included in the packaging of this file. Please review the following |
32 | ** information to ensure the GNU General Public License requirements will |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | ** |
36 | ** $QT_END_LICENSE$ |
37 | ** |
38 | ****************************************************************************/ |
39 | |
40 | #include <limits> |
41 | |
42 | #include "qabstractfloat_p.h" |
43 | #include "qanyuri_p.h" |
44 | #include "qboolean_p.h" |
45 | #include "qdecimal_p.h" |
46 | #include "qinteger_p.h" |
47 | #include "qatomicstring_p.h" |
48 | #include "quntypedatomic_p.h" |
49 | |
50 | #include "qcommonvalues_p.h" |
51 | |
52 | QT_BEGIN_NAMESPACE |
53 | |
54 | using namespace QPatternist; |
55 | |
56 | // STATIC DATA |
57 | const AtomicString::Ptr CommonValues::EmptyString |
58 | (new AtomicString(QLatin1String(""))); |
59 | const AtomicString::Ptr CommonValues::TrueString |
60 | (new AtomicString(QLatin1String("true"))); |
61 | const AtomicString::Ptr CommonValues::FalseString |
62 | (new AtomicString(QLatin1String("false"))); |
63 | |
64 | const UntypedAtomic::Ptr CommonValues::UntypedAtomicTrue |
65 | (new UntypedAtomic(QLatin1String("true"))); |
66 | const UntypedAtomic::Ptr CommonValues::UntypedAtomicFalse |
67 | (new UntypedAtomic(QLatin1String("false"))); |
68 | |
69 | const AtomicValue::Ptr CommonValues::BooleanTrue |
70 | (new Boolean(true)); |
71 | const AtomicValue::Ptr CommonValues::BooleanFalse(new Boolean(false)); |
72 | |
73 | const AtomicValue::Ptr CommonValues::DoubleNaN |
74 | (Double::fromValue(num: std::numeric_limits<xsDouble>::quiet_NaN())); |
75 | |
76 | const AtomicValue::Ptr CommonValues::FloatNaN |
77 | (Float::fromValue(num: std::numeric_limits<xsFloat>::quiet_NaN())); |
78 | |
79 | const Item CommonValues::IntegerZero |
80 | (Integer::fromValue(num: 0)); |
81 | |
82 | const AtomicValue::Ptr CommonValues::EmptyAnyURI |
83 | (AnyURI::fromValue(value: QLatin1String(""))); |
84 | |
85 | const AtomicValue::Ptr CommonValues::DoubleOne |
86 | (Double::fromValue(num: 1)); |
87 | const AtomicValue::Ptr CommonValues::FloatOne |
88 | (Float::fromValue(num: 1)); |
89 | const AtomicValue::Ptr CommonValues::DecimalOne |
90 | (Decimal::fromValue(num: 1)); |
91 | const Item CommonValues::IntegerOne |
92 | (Integer::fromValue(num: 1)); |
93 | const Item CommonValues::IntegerOneNegative |
94 | (Integer::fromValue(num: -1)); |
95 | |
96 | const AtomicValue::Ptr CommonValues::DoubleZero |
97 | (Double::fromValue(num: 0)); |
98 | const AtomicValue::Ptr CommonValues::FloatZero |
99 | (Float::fromValue(num: 0)); |
100 | const AtomicValue::Ptr CommonValues::DecimalZero |
101 | (Decimal::fromValue(num: 0)); |
102 | |
103 | const Item::EmptyIterator::Ptr CommonValues::emptyIterator |
104 | (new Item::EmptyIterator()); |
105 | |
106 | const AtomicValue::Ptr CommonValues::NegativeInfDouble |
107 | (Double::fromValue(num: -std::numeric_limits<xsDouble>::infinity())); |
108 | const AtomicValue::Ptr CommonValues::InfDouble |
109 | (Double::fromValue(num: std::numeric_limits<xsDouble>::infinity())); |
110 | const AtomicValue::Ptr CommonValues::NegativeInfFloat |
111 | (Float::fromValue(num: -std::numeric_limits<xsFloat>::infinity())); |
112 | const AtomicValue::Ptr CommonValues::InfFloat |
113 | (Float::fromValue(num: std::numeric_limits<xsFloat>::infinity())); |
114 | |
115 | const DayTimeDuration::Ptr CommonValues::DayTimeDurationZero |
116 | (DayTimeDuration::fromSeconds(secs: 0)); |
117 | const YearMonthDuration::Ptr CommonValues::YearMonthDurationZero |
118 | (YearMonthDuration::fromComponents(isPositive: true, years: 0, months: 0)); |
119 | |
120 | |
121 | QT_END_NAMESPACE |
122 |