/src/poco/Foundation/include/Poco/Dynamic/Var.h
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Var.h |
3 | | // |
4 | | // Library: Foundation |
5 | | // Package: Dynamic |
6 | | // Module: Var |
7 | | // |
8 | | // Definition of the Var class. |
9 | | // |
10 | | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. |
11 | | // and Contributors. |
12 | | // |
13 | | // SPDX-License-Identifier: BSL-1.0 |
14 | | // |
15 | | |
16 | | |
17 | | #ifndef Foundation_Var_INCLUDED |
18 | | #define Foundation_Var_INCLUDED |
19 | | |
20 | | |
21 | | #include "Poco/Foundation.h" |
22 | | #include "Poco/Format.h" |
23 | | #include "Poco/SharedPtr.h" |
24 | | #include "Poco/OrderedMap.h" |
25 | | #include "Poco/OrderedSet.h" |
26 | | #include "Poco/Dynamic/VarHolder.h" |
27 | | #include "Poco/Dynamic/VarIterator.h" |
28 | | #include <typeinfo> |
29 | | #include <map> |
30 | | #include <set> |
31 | | |
32 | | |
33 | | namespace Poco { |
34 | | namespace Dynamic { |
35 | | |
36 | | |
37 | | template <typename K, typename M, typename S> |
38 | | class Struct; |
39 | | |
40 | | |
41 | | class Foundation_API Var |
42 | | /// Var allows to store data of different types and to convert between these types transparently. |
43 | | /// Var puts forth the best effort to provide intuitive and reasonable conversion semantics and prevent |
44 | | /// unexpected data loss, particularly when performing narrowing or signedness conversions of numeric data types. |
45 | | /// |
46 | | /// An attempt to convert or extract from a non-initialized ("empty") Var variable shall result |
47 | | /// in an exception being thrown. |
48 | | /// |
49 | | /// Loss of signedness is not allowed for numeric values. This means that if an attempt is made to convert |
50 | | /// the internal value which is a negative signed integer to an unsigned integer type storage, a RangeException is thrown. |
51 | | /// Overflow is not allowed, so if the internal value is a larger number than the target numeric type size can accommodate, |
52 | | /// a RangeException is thrown. |
53 | | /// |
54 | | /// Precision loss, such as in conversion from floating-point types to integers or from double to float on platforms |
55 | | /// where they differ in size (provided internal actual value fits in float min/max range), is allowed. |
56 | | /// |
57 | | /// String truncation is allowed -- it is possible to convert between string and character when string length is |
58 | | /// greater than 1. An empty string gets converted to the char '\0', a non-empty string is truncated to the first character. |
59 | | /// |
60 | | /// Boolean conversion is performed as follows: |
61 | | /// |
62 | | /// A string value "false" (not case sensitive), "0" or "" (empty string) can be converted to a boolean value false, |
63 | | /// any other string not being false by the above criteria evaluates to true (e.g: "hi" -> true). |
64 | | /// Integer 0 values are false, everything else is true. |
65 | | /// Floating point values equal to the minimal FP representation on a given platform are false, everything else is true. |
66 | | /// |
67 | | /// Arithmetic operations with POD types as well as between Var's are supported, subject to following |
68 | | /// limitations: |
69 | | /// |
70 | | /// - for std::string and const char* values, only '+' and '+=' operations are supported |
71 | | /// |
72 | | /// - for integral and floating point numeric values, following operations are supported: |
73 | | /// '+', '+=', '-', '-=', '*', '*=' , '/' and '/=' |
74 | | /// |
75 | | /// - for integral values, following operations are supported: |
76 | | /// prefix and postfix increment (++) and decrement (--) |
77 | | /// |
78 | | /// - for all other types, InvalidArgumentException is thrown upon attempt of an arithmetic operation |
79 | | /// |
80 | | /// A Var can be created from and converted to a value of any type for which a specialization of |
81 | | /// VarHolderImpl is available. For supported types, see VarHolder documentation. |
82 | | { |
83 | | public: |
84 | | using Ptr = SharedPtr<Var>; |
85 | | using Iterator = Poco::Dynamic::VarIterator; |
86 | | using ConstIterator = const VarIterator; |
87 | | |
88 | | Var(); |
89 | | /// Creates an empty Var. |
90 | | |
91 | | template <typename T> |
92 | | Var(const T& val) |
93 | | /// Creates the Var from the given value. |
94 | 8.20M | { |
95 | 8.20M | construct(val); |
96 | 8.20M | } Unexecuted instantiation: Poco::Dynamic::Var::Var<int>(int const&) Unexecuted instantiation: Poco::Dynamic::Var::Var<unsigned int>(unsigned int const&) Poco::Dynamic::Var::Var<long>(long const&) Line | Count | Source | 94 | 2.92M | { | 95 | 2.92M | construct(val); | 96 | 2.92M | } |
Poco::Dynamic::Var::Var<unsigned long>(unsigned long const&) Line | Count | Source | 94 | 15.4k | { | 95 | 15.4k | construct(val); | 96 | 15.4k | } |
Poco::Dynamic::Var::Var<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 94 | 1.62M | { | 95 | 1.62M | construct(val); | 96 | 1.62M | } |
Poco::Dynamic::Var::Var<double>(double const&) Line | Count | Source | 94 | 1.08M | { | 95 | 1.08M | construct(val); | 96 | 1.08M | } |
Poco::Dynamic::Var::Var<bool>(bool const&) Line | Count | Source | 94 | 3.18k | { | 95 | 3.18k | construct(val); | 96 | 3.18k | } |
Poco::Dynamic::Var::Var<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > >(Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > const&) Line | Count | Source | 94 | 1.92M | { | 95 | 1.92M | construct(val); | 96 | 1.92M | } |
Poco::Dynamic::Var::Var<Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > >(Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > const&) Line | Count | Source | 94 | 629k | { | 95 | 629k | construct(val); | 96 | 629k | } |
Unexecuted instantiation: Poco::Dynamic::Var::Var<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >(Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&) Unexecuted instantiation: Poco::Dynamic::Var::Var<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >(std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const&) Unexecuted instantiation: Poco::Dynamic::Var::Var<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >(Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > const&) |
97 | | |
98 | | Var(const char* pVal); |
99 | | // Convenience constructor for const char* which gets mapped to a std::string internally, i.e. pVal is deep-copied. |
100 | | |
101 | | Var(const Var& other); |
102 | | /// Copy constructor. |
103 | | |
104 | | ~Var(); |
105 | | /// Destroys the Var. |
106 | | |
107 | | void swap(Var& other); |
108 | | /// Swaps the content of the this Var with the other Var. |
109 | | |
110 | | ConstIterator begin() const; |
111 | | /// Returns the const Var iterator. |
112 | | |
113 | | ConstIterator end() const; |
114 | | /// Returns the const Var iterator. |
115 | | |
116 | | Iterator begin(); |
117 | | /// Returns the Var iterator. |
118 | | |
119 | | Iterator end(); |
120 | | /// Returns the Var iterator. |
121 | | |
122 | | template <typename T> |
123 | | void convert(T& val) const |
124 | | /// Invoke this method to perform a safe conversion. |
125 | | /// |
126 | | /// Example usage: |
127 | | /// Var any("42"); |
128 | | /// int i; |
129 | | /// any.convert(i); |
130 | | /// |
131 | | /// Throws a RangeException if the value does not fit |
132 | | /// into the result variable. |
133 | | /// Throws a NotImplementedException if conversion is |
134 | | /// not available for the given type. |
135 | | /// Throws InvalidAccessException if Var is empty. |
136 | | { |
137 | | VarHolder* pHolder = content(); |
138 | | |
139 | | if (!pHolder) |
140 | | throw InvalidAccessException("Can not convert empty value."); |
141 | | |
142 | | pHolder->convert(val); |
143 | | } |
144 | | |
145 | | template <typename T> |
146 | | T convert() const |
147 | | /// Invoke this method to perform a safe conversion. |
148 | | /// |
149 | | /// Example usage: |
150 | | /// Var any("42"); |
151 | | /// int i = any.convert<int>(); |
152 | | /// |
153 | | /// Throws a RangeException if the value does not fit |
154 | | /// into the result variable. |
155 | | /// Throws a NotImplementedException if conversion is |
156 | | /// not available for the given type. |
157 | | /// Throws InvalidAccessException if Var is empty. |
158 | 3.32M | { |
159 | 3.32M | VarHolder* pHolder = content(); |
160 | | |
161 | 3.32M | if (!pHolder) |
162 | 54 | throw InvalidAccessException("Can not convert empty value."); |
163 | | |
164 | 3.32M | if (typeid(T) == pHolder->type()) return extract<T>(); |
165 | | |
166 | 1.89M | T result; |
167 | 1.89M | pHolder->convert(result); |
168 | 1.89M | return result; |
169 | 3.32M | } std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Poco::Dynamic::Var::convert<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Line | Count | Source | 158 | 3.32M | { | 159 | 3.32M | VarHolder* pHolder = content(); | 160 | | | 161 | 3.32M | if (!pHolder) | 162 | 54 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 3.32M | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 1.89M | T result; | 167 | 1.89M | pHolder->convert(result); | 168 | 1.89M | return result; | 169 | 3.32M | } |
Unexecuted instantiation: bool Poco::Dynamic::Var::convert<bool>() const Unexecuted instantiation: char Poco::Dynamic::Var::convert<char>() const Unexecuted instantiation: signed char Poco::Dynamic::Var::convert<signed char>() const Unexecuted instantiation: unsigned char Poco::Dynamic::Var::convert<unsigned char>() const Unexecuted instantiation: short Poco::Dynamic::Var::convert<short>() const Unexecuted instantiation: unsigned short Poco::Dynamic::Var::convert<unsigned short>() const Unexecuted instantiation: int Poco::Dynamic::Var::convert<int>() const Unexecuted instantiation: unsigned int Poco::Dynamic::Var::convert<unsigned int>() const Unexecuted instantiation: long Poco::Dynamic::Var::convert<long>() const Unexecuted instantiation: unsigned long Poco::Dynamic::Var::convert<unsigned long>() const Unexecuted instantiation: float Poco::Dynamic::Var::convert<float>() const Unexecuted instantiation: double Poco::Dynamic::Var::convert<double>() const Unexecuted instantiation: std::__1::basic_string<unsigned short, Poco::UTF16CharTraits, std::__1::allocator<unsigned short> > Poco::Dynamic::Var::convert<std::__1::basic_string<unsigned short, Poco::UTF16CharTraits, std::__1::allocator<unsigned short> > >() const |
170 | | |
171 | | template <typename T> |
172 | | operator T () const |
173 | | /// Safe conversion operator for implicit type |
174 | | /// conversions. If the requested type T is same as the |
175 | | /// type being held, the operation performed is direct |
176 | | /// extraction, otherwise it is the conversion of the value |
177 | | /// from type currently held to the one requested. |
178 | | /// |
179 | | /// Throws a RangeException if the value does not fit |
180 | | /// into the result variable. |
181 | | /// Throws a NotImplementedException if conversion is |
182 | | /// not available for the given type. |
183 | | /// Throws InvalidAccessException if Var is empty. |
184 | | { |
185 | | VarHolder* pHolder = content(); |
186 | | |
187 | | if (!pHolder) |
188 | | throw InvalidAccessException("Can not convert empty value."); |
189 | | |
190 | | if (typeid(T) == pHolder->type()) |
191 | | return extract<T>(); |
192 | | |
193 | | T result; |
194 | | pHolder->convert(result); |
195 | | return result; |
196 | | } |
197 | | |
198 | | template <typename T> |
199 | | const T& extract() const |
200 | | /// Returns a const reference to the actual value. |
201 | | /// |
202 | | /// Must be instantiated with the exact type of |
203 | | /// the stored value, otherwise a BadCastException |
204 | | /// is thrown. |
205 | | /// Throws InvalidAccessException if Var is empty. |
206 | 7.45M | { |
207 | 7.45M | VarHolder* pHolder = content(); |
208 | | |
209 | 7.45M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) |
210 | 7.45M | { |
211 | 7.45M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); |
212 | 7.45M | return pHolderImpl->value(); |
213 | 7.45M | } |
214 | | |
215 | 70 | if (!pHolder) |
216 | 0 | throw InvalidAccessException("Can not extract empty value."); |
217 | 70 | else |
218 | 70 | throw BadCastException(Poco::format("Can not convert %s to %s.", |
219 | 70 | std::string(pHolder->type().name()), |
220 | 70 | std::string(typeid(T).name()))); |
221 | 70 | } std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& Poco::Dynamic::Var::extract<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Line | Count | Source | 206 | 1.43M | { | 207 | 1.43M | VarHolder* pHolder = content(); | 208 | | | 209 | 1.43M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 1.43M | { | 211 | 1.43M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 1.43M | return pHolderImpl->value(); | 213 | 1.43M | } | 214 | | | 215 | 0 | if (!pHolder) | 216 | 0 | throw InvalidAccessException("Can not extract empty value."); | 217 | 0 | else | 218 | 0 | throw BadCastException(Poco::format("Can not convert %s to %s.", | 219 | 0 | std::string(pHolder->type().name()), | 220 | 0 | std::string(typeid(T).name()))); | 221 | 0 | } |
Unexecuted instantiation: bool const& Poco::Dynamic::Var::extract<bool>() const Unexecuted instantiation: char const& Poco::Dynamic::Var::extract<char>() const Unexecuted instantiation: signed char const& Poco::Dynamic::Var::extract<signed char>() const Unexecuted instantiation: unsigned char const& Poco::Dynamic::Var::extract<unsigned char>() const Unexecuted instantiation: short const& Poco::Dynamic::Var::extract<short>() const Unexecuted instantiation: unsigned short const& Poco::Dynamic::Var::extract<unsigned short>() const Unexecuted instantiation: int const& Poco::Dynamic::Var::extract<int>() const Unexecuted instantiation: unsigned int const& Poco::Dynamic::Var::extract<unsigned int>() const Unexecuted instantiation: long const& Poco::Dynamic::Var::extract<long>() const Unexecuted instantiation: unsigned long const& Poco::Dynamic::Var::extract<unsigned long>() const Unexecuted instantiation: float const& Poco::Dynamic::Var::extract<float>() const Unexecuted instantiation: double const& Poco::Dynamic::Var::extract<double>() const Unexecuted instantiation: std::__1::basic_string<unsigned short, Poco::UTF16CharTraits, std::__1::allocator<unsigned short> > const& Poco::Dynamic::Var::extract<std::__1::basic_string<unsigned short, Poco::UTF16CharTraits, std::__1::allocator<unsigned short> > >() const Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > const& Poco::Dynamic::Var::extract<Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > >() const Line | Count | Source | 206 | 5.32M | { | 207 | 5.32M | VarHolder* pHolder = content(); | 208 | | | 209 | 5.32M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 5.32M | { | 211 | 5.32M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 5.32M | return pHolderImpl->value(); | 213 | 5.32M | } | 214 | | | 215 | 0 | if (!pHolder) | 216 | 0 | throw InvalidAccessException("Can not extract empty value."); | 217 | 0 | else | 218 | 0 | throw BadCastException(Poco::format("Can not convert %s to %s.", | 219 | 0 | std::string(pHolder->type().name()), | 220 | 0 | std::string(typeid(T).name()))); | 221 | 0 | } |
Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > const& Poco::Dynamic::Var::extract<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > >() const Line | Count | Source | 206 | 697k | { | 207 | 697k | VarHolder* pHolder = content(); | 208 | | | 209 | 697k | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 696k | { | 211 | 696k | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 696k | return pHolderImpl->value(); | 213 | 696k | } | 214 | | | 215 | 70 | if (!pHolder) | 216 | 0 | throw InvalidAccessException("Can not extract empty value."); | 217 | 70 | else | 218 | 70 | throw BadCastException(Poco::format("Can not convert %s to %s.", | 219 | 70 | std::string(pHolder->type().name()), | 220 | 70 | std::string(typeid(T).name()))); | 221 | 70 | } |
Unexecuted instantiation: Poco::JSON::Object const& Poco::Dynamic::Var::extract<Poco::JSON::Object>() const Unexecuted instantiation: Poco::JSON::Array const& Poco::Dynamic::Var::extract<Poco::JSON::Array>() const |
222 | | |
223 | | template <typename T> |
224 | | Var& operator = (const T& other) |
225 | | /// Assignment operator for assigning POD to Var |
226 | 119k | { |
227 | 119k | clear(); |
228 | 119k | construct(other); |
229 | 119k | return *this; |
230 | 119k | } Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > >(Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > const&) Line | Count | Source | 226 | 109k | { | 227 | 109k | clear(); | 228 | 109k | construct(other); | 229 | 109k | return *this; | 230 | 109k | } |
Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > >(Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > const&) Line | Count | Source | 226 | 9.35k | { | 227 | 9.35k | clear(); | 228 | 9.35k | construct(other); | 229 | 9.35k | return *this; | 230 | 9.35k | } |
Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<long>(long const&) Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<unsigned long>(unsigned long const&) Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<double>(double const&) Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::operator=<int>(int const&) |
231 | | |
232 | | bool operator ! () const; |
233 | | /// Logical NOT operator. |
234 | | |
235 | | Var& operator = (const Var& other); |
236 | | /// Assignment operator specialization for Var |
237 | | |
238 | | template <typename T> |
239 | | const Var operator + (const T& other) const |
240 | | /// Addition operator for adding POD to Var |
241 | 0 | { |
242 | 0 | return convert<T>() + other; |
243 | 0 | } |
244 | | |
245 | | const Var operator + (const Var& other) const; |
246 | | /// Addition operator specialization for Var |
247 | | |
248 | | const Var operator + (const char* other) const; |
249 | | /// Addition operator specialization for adding const char* to Var |
250 | | |
251 | | Var& operator ++ (); |
252 | | /// Pre-increment operator |
253 | | |
254 | | const Var operator ++ (int); |
255 | | /// Post-increment operator |
256 | | |
257 | | Var& operator -- (); |
258 | | /// Pre-decrement operator |
259 | | |
260 | | const Var operator -- (int); |
261 | | /// Post-decrement operator |
262 | | |
263 | | template <typename T> |
264 | | Var& operator += (const T& other) |
265 | | /// Addition assignment operator for addition/assignment of POD to Var. |
266 | 0 | { |
267 | 0 | return *this = convert<T>() + other; |
268 | 0 | } |
269 | | |
270 | | Var& operator += (const Var& other); |
271 | | /// Addition assignment operator overload for Var |
272 | | |
273 | | Var& operator += (const char* other); |
274 | | /// Addition assignment operator overload for const char* |
275 | | |
276 | | template <typename T> |
277 | | const Var operator - (const T& other) const |
278 | | /// Subtraction operator for subtracting POD from Var |
279 | 0 | { |
280 | 0 | return convert<T>() - other; |
281 | 0 | } |
282 | | |
283 | | const Var operator - (const Var& other) const; |
284 | | /// Subtraction operator overload for Var |
285 | | |
286 | | template <typename T> |
287 | | Var& operator -= (const T& other) |
288 | | /// Subtraction assignment operator |
289 | 0 | { |
290 | 0 | return *this = convert<T>() - other; |
291 | 0 | } |
292 | | |
293 | | Var& operator -= (const Var& other); |
294 | | /// Subtraction assignment operator overload for Var |
295 | | |
296 | | template <typename T> |
297 | | const Var operator * (const T& other) const |
298 | | /// Multiplication operator for multiplying Var with POD |
299 | | { |
300 | | return convert<T>() * other; |
301 | | } |
302 | | |
303 | | const Var operator * (const Var& other) const; |
304 | | /// Multiplication operator overload for Var |
305 | | |
306 | | template <typename T> |
307 | | Var& operator *= (const T& other) |
308 | | /// Multiplication assignment operator |
309 | | { |
310 | | return *this = convert<T>() * other; |
311 | | } |
312 | | |
313 | | Var& operator *= (const Var& other); |
314 | | /// Multiplication assignment operator overload for Var |
315 | | |
316 | | template <typename T> |
317 | | const Var operator / (const T& other) const |
318 | | /// Division operator for dividing Var with POD |
319 | | { |
320 | | return convert<T>() / other; |
321 | | } |
322 | | |
323 | | const Var operator / (const Var& other) const; |
324 | | /// Division operator overload for Var |
325 | | |
326 | | template <typename T> |
327 | | Var& operator /= (const T& other) |
328 | | /// Division assignment operator |
329 | | { |
330 | | return *this = convert<T>() / other; |
331 | | } |
332 | | |
333 | | Var& operator /= (const Var& other); |
334 | | /// Division assignment operator specialization for Var |
335 | | |
336 | | template <typename T> |
337 | | bool operator == (const T& other) const |
338 | | /// Equality operator |
339 | | { |
340 | | if (isEmpty()) return false; |
341 | | return convert<T>() == other; |
342 | | } |
343 | | |
344 | | bool operator == (const char* other) const; |
345 | | /// Equality operator overload for const char* |
346 | | |
347 | | bool operator == (const Var& other) const; |
348 | | /// Equality operator overload for Var |
349 | | |
350 | | template <typename T> |
351 | | bool operator != (const T& other) const |
352 | | /// Inequality operator |
353 | | { |
354 | | if (isEmpty()) return true; |
355 | | return convert<T>() != other; |
356 | | } |
357 | | |
358 | | bool operator != (const Var& other) const; |
359 | | /// Inequality operator overload for Var |
360 | | |
361 | | bool operator != (const char* other) const; |
362 | | /// Inequality operator overload for const char* |
363 | | |
364 | | template <typename T> |
365 | | bool operator < (const T& other) const |
366 | | /// Less than operator |
367 | | { |
368 | | if (isEmpty()) return false; |
369 | | return convert<T>() < other; |
370 | | } |
371 | | |
372 | | bool operator < (const Var& other) const; |
373 | | /// Less than operator overload for Var |
374 | | |
375 | | template <typename T> |
376 | | bool operator <= (const T& other) const |
377 | | /// Less than or equal operator |
378 | | { |
379 | | if (isEmpty()) return false; |
380 | | return convert<T>() <= other; |
381 | | } |
382 | | |
383 | | bool operator <= (const Var& other) const; |
384 | | /// Less than or equal operator overload for Var |
385 | | |
386 | | template <typename T> |
387 | | bool operator > (const T& other) const |
388 | | /// Greater than operator |
389 | | { |
390 | | if (isEmpty()) return false; |
391 | | return convert<T>() > other; |
392 | | } |
393 | | |
394 | | bool operator > (const Var& other) const; |
395 | | /// Greater than operator overload for Var |
396 | | |
397 | | template <typename T> |
398 | | bool operator >= (const T& other) const |
399 | | /// Greater than or equal operator |
400 | | { |
401 | | if (isEmpty()) return false; |
402 | | return convert<T>() >= other; |
403 | | } |
404 | | |
405 | | bool operator >= (const Var& other) const; |
406 | | /// Greater than or equal operator overload for Var |
407 | | |
408 | | template <typename T> |
409 | | bool operator || (const T& other) const |
410 | | /// Logical OR operator |
411 | | { |
412 | | if (isEmpty()) return false; |
413 | | return convert<bool>() || other; |
414 | | } |
415 | | |
416 | | bool operator || (const Var& other) const; |
417 | | /// Logical OR operator operator overload for Var |
418 | | |
419 | | template <typename T> |
420 | | bool operator && (const T& other) const |
421 | | /// Logical AND operator. |
422 | | { |
423 | | if (isEmpty()) return false; |
424 | | return convert<bool>() && other; |
425 | | } |
426 | | |
427 | | bool operator && (const Var& other) const; |
428 | | /// Logical AND operator operator overload for Var. |
429 | | |
430 | | bool isArray() const; |
431 | | /// Returns true if Var is an array. |
432 | | |
433 | | bool isVector() const; |
434 | | /// Returns true if Var represents a vector. |
435 | | |
436 | | bool isList() const; |
437 | | /// Returns true if Var represents a list. |
438 | | |
439 | | bool isDeque() const; |
440 | | /// Returns true if Var represents a deque. |
441 | | |
442 | | bool isStruct() const; |
443 | | /// Returns true if Var represents a struct. |
444 | | |
445 | | bool isOrdered() const; |
446 | | /// Returns true if Var represents an ordered struct, |
447 | | /// false if struct is sorted. |
448 | | |
449 | | char& at(std::size_t n); |
450 | | /// Returns character at position n. This function only works with |
451 | | /// Var containing a std::string. |
452 | | |
453 | | |
454 | | template <typename T> |
455 | | Var& operator [] (const T& n) |
456 | | { |
457 | | return getAt(n); |
458 | | } |
459 | | |
460 | | template <typename T> |
461 | | const Var& operator [] (const T& n) const |
462 | | { |
463 | | return const_cast<Var*>(this)->getAt(n); |
464 | | } |
465 | | |
466 | | Var& operator [] (const std::string& name); |
467 | | /// Index operator by name, only use on Vars where isStruct |
468 | | /// returns true! In all other cases InvalidAccessException is thrown. |
469 | | |
470 | | const Var& operator [] (const std::string& name) const; |
471 | | /// Index operator by name, only use on Vars where isStruct |
472 | | /// returns true! In all other cases InvalidAccessException is thrown. |
473 | | |
474 | | const std::type_info& type() const; |
475 | | /// Returns the type information of the stored content. |
476 | | |
477 | | std::string typeName(bool demangle = true) const; |
478 | | /// Returns the type name of the stored content. |
479 | | /// If demangling is available and emangle is true, |
480 | | /// the returnsed string will be demangled. |
481 | | |
482 | | POCO_DEPRECATED("Use clear() instead") |
483 | | void empty(); |
484 | | /// Empties Var. |
485 | | /// This function is deprecated and will be removed. |
486 | | /// Please use clear(). |
487 | | |
488 | | void clear(); |
489 | | /// Empties Var. |
490 | | |
491 | | bool isEmpty() const; |
492 | | /// Returns true if empty. |
493 | | |
494 | | bool isInteger() const; |
495 | | /// Returns true if stored value is integer. |
496 | | |
497 | | bool isSigned() const; |
498 | | /// Returns true if stored value is signed. |
499 | | |
500 | | bool isNumeric() const; |
501 | | /// Returns true if stored value is numeric. |
502 | | /// Returns false for numeric strings (e.g. "123" is string, not number) |
503 | | |
504 | | bool isBoolean() const; |
505 | | /// Returns true if stored value is boolean. |
506 | | /// Returns false for boolean strings (e.g. "true" is string, not number) |
507 | | |
508 | | bool isString() const; |
509 | | /// Returns true if stored value is std::string. |
510 | | |
511 | | bool isDate() const; |
512 | | /// Returns true if stored value represents a date. |
513 | | |
514 | | bool isTime() const; |
515 | | /// Returns true if stored value represents time or date/time. |
516 | | |
517 | | bool isDateTime() const; |
518 | | /// Returns true if stored value represents a date/time. |
519 | | |
520 | | bool isUUID() const; |
521 | | /// Returns true if stored value is a Poco::UUID. |
522 | | |
523 | | std::size_t size() const; |
524 | | /// Returns the size of this Var. |
525 | | /// This function returns 0 when Var is empty, 1 for POD or the size (i.e. length) |
526 | | /// for held container. |
527 | | |
528 | | std::string toString() const; |
529 | | /// Returns the stored value as string. |
530 | | |
531 | | static Var parse(const std::string& val); |
532 | | /// Parses the string which must be in JSON format |
533 | | |
534 | | static std::string toString(const Var& var); |
535 | | /// Converts the Var to a string in JSON format. Note that toString(const Var&) will return |
536 | | /// a different result than Var::convert<std::string>() and Var::toString()! |
537 | | |
538 | | private: |
539 | | Var& getAt(std::size_t n); |
540 | | Var& getAt(const std::string& n); |
541 | | |
542 | | static Var parse(const std::string& val, std::string::size_type& offset); |
543 | | /// Parses the string which must be in JSON format |
544 | | |
545 | | static Var parseObject(const std::string& val, std::string::size_type& pos); |
546 | | static Var parseArray(const std::string& val, std::string::size_type& pos); |
547 | | static std::string parseString(const std::string& val, std::string::size_type& pos); |
548 | | static std::string parseJSONString(const std::string& val, std::string::size_type& pos); |
549 | | static void skipWhiteSpace(const std::string& val, std::string::size_type& pos); |
550 | | |
551 | | template <typename T> |
552 | | T add(const Var& other) const |
553 | 0 | { |
554 | 0 | return convert<T>() + other.convert<T>(); |
555 | 0 | } Unexecuted instantiation: long Poco::Dynamic::Var::add<long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: unsigned long Poco::Dynamic::Var::add<unsigned long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: double Poco::Dynamic::Var::add<double>(Poco::Dynamic::Var const&) const Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Poco::Dynamic::Var::add<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(Poco::Dynamic::Var const&) const |
556 | | |
557 | | template <typename T> |
558 | | T subtract(const Var& other) const |
559 | 0 | { |
560 | 0 | return convert<T>() - other.convert<T>(); |
561 | 0 | } Unexecuted instantiation: long Poco::Dynamic::Var::subtract<long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: unsigned long Poco::Dynamic::Var::subtract<unsigned long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: double Poco::Dynamic::Var::subtract<double>(Poco::Dynamic::Var const&) const |
562 | | |
563 | | template <typename T> |
564 | | T multiply(const Var& other) const |
565 | 0 | { |
566 | 0 | return convert<T>() * other.convert<T>(); |
567 | 0 | } Unexecuted instantiation: long Poco::Dynamic::Var::multiply<long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: unsigned long Poco::Dynamic::Var::multiply<unsigned long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: double Poco::Dynamic::Var::multiply<double>(Poco::Dynamic::Var const&) const |
568 | | |
569 | | template <typename T> |
570 | | T divide(const Var& other) const |
571 | 0 | { |
572 | 0 | return convert<T>() / other.convert<T>(); |
573 | 0 | } Unexecuted instantiation: long Poco::Dynamic::Var::divide<long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: unsigned long Poco::Dynamic::Var::divide<unsigned long>(Poco::Dynamic::Var const&) const Unexecuted instantiation: double Poco::Dynamic::Var::divide<double>(Poco::Dynamic::Var const&) const |
574 | | |
575 | | template <typename T, typename E> |
576 | | VarHolderImpl<T>* holderImpl(const std::string errorMessage = "") const |
577 | 0 | { |
578 | 0 | VarHolder* pHolder = content(); |
579 | |
|
580 | 0 | if (pHolder && pHolder->type() == typeid(T)) |
581 | 0 | return static_cast<VarHolderImpl<T>*>(pHolder); |
582 | | |
583 | 0 | if (pHolder == nullptr) |
584 | 0 | throw InvalidAccessException("Can not access empty value."); |
585 | 0 | else |
586 | 0 | throw E(errorMessage); |
587 | 0 | } Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >* Poco::Dynamic::Var::holderImpl<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<std::__1::list<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >* Poco::Dynamic::Var::holderImpl<std::__1::list<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<std::__1::deque<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >* Poco::Dynamic::Var::holderImpl<std::__1::deque<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, tsl::ordered_map<int, Poco::Dynamic::Var, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<int, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> > > >, tsl::ordered_set<int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<int>, std::__1::deque<int, std::__1::allocator<int> > > > >* Poco::Dynamic::Var::holderImpl<Poco::Dynamic::Struct<int, tsl::ordered_map<int, Poco::Dynamic::Var, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<int, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> > > >, tsl::ordered_set<int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<int>, std::__1::deque<int, std::__1::allocator<int> > > >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, std::__1::map<int, Poco::Dynamic::Var, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, Poco::Dynamic::Var> > >, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > >* Poco::Dynamic::Var::holderImpl<Poco::Dynamic::Struct<int, std::__1::map<int, Poco::Dynamic::Var, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, Poco::Dynamic::Var> > >, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >* Poco::Dynamic::Var::holderImpl<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >* Poco::Dynamic::Var::holderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >* Poco::Dynamic::Var::holderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, Poco::InvalidAccessException>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const |
588 | | |
589 | | template <typename T, typename N> |
590 | | Var& structIndexOperator(T* pStr, N n) const |
591 | 0 | { |
592 | 0 | return pStr->operator[](n); |
593 | 0 | } Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::structIndexOperator<Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, tsl::ordered_map<int, Poco::Dynamic::Var, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<int, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> > > >, tsl::ordered_set<int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<int>, std::__1::deque<int, std::__1::allocator<int> > > > >, int>(Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, tsl::ordered_map<int, Poco::Dynamic::Var, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<int, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<int, Poco::Dynamic::Var> > > >, tsl::ordered_set<int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<int>, std::__1::deque<int, std::__1::allocator<int> > > > >*, int) const Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::structIndexOperator<Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, std::__1::map<int, Poco::Dynamic::Var, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, Poco::Dynamic::Var> > >, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > >, int>(Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<int, std::__1::map<int, Poco::Dynamic::Var, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, Poco::Dynamic::Var> > >, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > >*, int) const Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::structIndexOperator<Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const Unexecuted instantiation: Poco::Dynamic::Var& Poco::Dynamic::Var::structIndexOperator<Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(Poco::Dynamic::VarHolderImpl<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const |
594 | | |
595 | | VarHolder* content() const |
596 | 103M | { |
597 | 103M | return _placeholder.content(); |
598 | 103M | } |
599 | | |
600 | | void destruct() |
601 | 30.5M | { |
602 | 30.5M | } |
603 | | |
604 | | template<typename ValueType> |
605 | | void construct(const ValueType& value) |
606 | 8.32M | { |
607 | 8.32M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); |
608 | 8.32M | } void Poco::Dynamic::Var::construct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 606 | 1.62M | { | 607 | 1.62M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 1.62M | } |
Unexecuted instantiation: void Poco::Dynamic::Var::construct<int>(int const&) Unexecuted instantiation: void Poco::Dynamic::Var::construct<unsigned int>(unsigned int const&) void Poco::Dynamic::Var::construct<long>(long const&) Line | Count | Source | 606 | 2.92M | { | 607 | 2.92M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 2.92M | } |
void Poco::Dynamic::Var::construct<unsigned long>(unsigned long const&) Line | Count | Source | 606 | 15.4k | { | 607 | 15.4k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 15.4k | } |
void Poco::Dynamic::Var::construct<double>(double const&) Line | Count | Source | 606 | 1.08M | { | 607 | 1.08M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 1.08M | } |
void Poco::Dynamic::Var::construct<bool>(bool const&) Line | Count | Source | 606 | 3.18k | { | 607 | 3.18k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 3.18k | } |
void Poco::Dynamic::Var::construct<Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > >(Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object> > const&) Line | Count | Source | 606 | 2.03M | { | 607 | 2.03M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 2.03M | } |
void Poco::Dynamic::Var::construct<Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > >(Poco::SharedPtr<Poco::JSON::Array, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Array> > const&) Line | Count | Source | 606 | 638k | { | 607 | 638k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 608 | 638k | } |
Unexecuted instantiation: void Poco::Dynamic::Var::construct<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >(Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, Poco::Dynamic::Var> > >, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&) Unexecuted instantiation: void Poco::Dynamic::Var::construct<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >(std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const&) Unexecuted instantiation: void Poco::Dynamic::Var::construct<Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >(Poco::Dynamic::Struct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, tsl::ordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> >, std::__1::deque<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, Poco::Dynamic::Var> > > >, tsl::ordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > const&) |
609 | | |
610 | | void construct(const char* value); |
611 | | void construct(const Var& other); |
612 | | |
613 | | Placeholder<VarHolder> _placeholder; |
614 | | }; |
615 | | |
616 | | |
617 | | /// |
618 | | /// inlines |
619 | | /// |
620 | | |
621 | | |
622 | | /// |
623 | | /// Var members |
624 | | /// |
625 | | |
626 | | inline void Var::construct(const char* value) |
627 | 0 | { |
628 | 0 | const std::string val(value); |
629 | 0 | _placeholder.assign<VarHolderImpl<std::string>, std::string>(val); |
630 | 0 | } |
631 | | |
632 | | |
633 | | inline void Var::construct(const Var& other) |
634 | 22.3M | { |
635 | 22.3M | if (!other.isEmpty()) |
636 | 22.3M | other.content()->clone(&_placeholder); |
637 | 22.3M | } |
638 | | |
639 | | |
640 | | inline void Var::swap(Var& other) |
641 | 0 | { |
642 | 0 | if (this == &other) return; |
643 | 0 |
|
644 | 0 | if (!_placeholder.isLocal() && !other._placeholder.isLocal()) |
645 | 0 | { |
646 | 0 | _placeholder.swap(other._placeholder); |
647 | 0 | } |
648 | 0 | else |
649 | 0 | { |
650 | 0 | const Var tmp(*this); |
651 | 0 | try |
652 | 0 | { |
653 | 0 | construct(other); |
654 | 0 | other = tmp; |
655 | 0 | } |
656 | 0 | catch (...) |
657 | 0 | { |
658 | 0 | construct(tmp); |
659 | 0 | throw; |
660 | 0 | } |
661 | 0 | } |
662 | 0 | } |
663 | | |
664 | | |
665 | | inline const std::type_info& Var::type() const |
666 | 17.9M | { |
667 | 17.9M | VarHolder* pHolder = content(); |
668 | 17.9M | return (pHolder != nullptr) ? pHolder->type() : typeid(void); |
669 | 17.9M | } |
670 | | |
671 | | |
672 | | inline std::string Var::typeName(bool demangle) const |
673 | 0 | { |
674 | 0 | VarHolder* pHolder = content(); |
675 | 0 | return (pHolder != nullptr) ? demangle ? Poco::demangle(pHolder->type().name()) : pHolder->type().name() : std::string(); |
676 | 0 | } |
677 | | |
678 | | |
679 | | inline Var::ConstIterator Var::begin() const |
680 | 0 | { |
681 | 0 | if (size() == 0) return {const_cast<Var*>(this), true}; |
682 | 0 |
|
683 | 0 | return {const_cast<Var*>(this), false}; |
684 | 0 | } |
685 | | |
686 | | inline Var::ConstIterator Var::end() const |
687 | 0 | { |
688 | 0 | return {const_cast<Var*>(this), true}; |
689 | 0 | } |
690 | | |
691 | | inline Var::Iterator Var::begin() |
692 | 0 | { |
693 | 0 | if (size() == 0) return {const_cast<Var*>(this), true}; |
694 | 0 |
|
695 | 0 | return {const_cast<Var*>(this), false}; |
696 | 0 | } |
697 | | |
698 | | inline Var::Iterator Var::end() |
699 | 0 | { |
700 | 0 | return {this, true}; |
701 | 0 | } |
702 | | |
703 | | |
704 | | inline Var& Var::operator [] (const std::string& name) |
705 | 0 | { |
706 | 0 | return getAt(name); |
707 | 0 | } |
708 | | |
709 | | |
710 | | inline const Var& Var::operator [] (const std::string& name) const |
711 | 0 | { |
712 | 0 | return const_cast<Var*>(this)->getAt(name); |
713 | 0 | } |
714 | | |
715 | | |
716 | | inline const Var Var::operator + (const char* other) const |
717 | 0 | { |
718 | 0 | return convert<std::string>() + other; |
719 | 0 | } |
720 | | |
721 | | |
722 | | inline Var& Var::operator += (const char*other) |
723 | 0 | { |
724 | 0 | return *this = convert<std::string>() + other; |
725 | 0 | } |
726 | | |
727 | | |
728 | | inline bool Var::operator ! () const |
729 | 0 | { |
730 | 0 | return !convert<bool>(); |
731 | 0 | } |
732 | | |
733 | | |
734 | | inline bool Var::isEmpty() const |
735 | 47.2M | { |
736 | 47.2M | return nullptr == content(); |
737 | 47.2M | } |
738 | | |
739 | | |
740 | | inline bool Var::isArray() const |
741 | 0 | { |
742 | 0 | if (isEmpty() || isString()) return false; |
743 | 0 |
|
744 | 0 | VarHolder* pHolder = content(); |
745 | 0 | return (pHolder != nullptr) ? pHolder->isArray() : false; |
746 | 0 | } |
747 | | |
748 | | |
749 | | inline bool Var::isVector() const |
750 | 0 | { |
751 | 0 | VarHolder* pHolder = content(); |
752 | 0 | return (pHolder != nullptr) ? pHolder->isVector() : false; |
753 | 0 | } |
754 | | |
755 | | |
756 | | inline bool Var::isList() const |
757 | 0 | { |
758 | 0 | VarHolder* pHolder = content(); |
759 | 0 | return (pHolder != nullptr) ? pHolder->isList() : false; |
760 | 0 | } |
761 | | |
762 | | |
763 | | inline bool Var::isDeque() const |
764 | 0 | { |
765 | 0 | VarHolder* pHolder = content(); |
766 | 0 | return (pHolder != nullptr) ? pHolder->isDeque() : false; |
767 | 0 | } |
768 | | |
769 | | |
770 | | inline bool Var::isStruct() const |
771 | 0 | { |
772 | 0 | VarHolder* pHolder = content(); |
773 | 0 | return (pHolder != nullptr) ? pHolder->isStruct() : false; |
774 | 0 | } |
775 | | |
776 | | |
777 | | inline bool Var::isOrdered() const |
778 | 0 | { |
779 | 0 | VarHolder* pHolder = content(); |
780 | 0 | return (pHolder != nullptr) ? pHolder->isOrdered() : false; |
781 | 0 | } |
782 | | |
783 | | |
784 | | inline bool Var::isInteger() const |
785 | 0 | { |
786 | 0 | VarHolder* pHolder = content(); |
787 | 0 | return (pHolder != nullptr) ? pHolder->isInteger() : false; |
788 | 0 | } |
789 | | |
790 | | |
791 | | inline bool Var::isSigned() const |
792 | 0 | { |
793 | 0 | VarHolder* pHolder = content(); |
794 | 0 | return (pHolder != nullptr) ? pHolder->isSigned() : false; |
795 | 0 | } |
796 | | |
797 | | |
798 | | inline bool Var::isNumeric() const |
799 | 2.49M | { |
800 | 2.49M | VarHolder* pHolder = content(); |
801 | 2.49M | return (pHolder != nullptr) ? pHolder->isNumeric() : false; |
802 | 2.49M | } |
803 | | |
804 | | |
805 | | inline bool Var::isBoolean() const |
806 | 1.41M | { |
807 | 1.41M | VarHolder* pHolder = content(); |
808 | 1.41M | return (pHolder != nullptr) ? pHolder->isBoolean() : false; |
809 | 1.41M | } |
810 | | |
811 | | |
812 | | inline bool Var::isString() const |
813 | 1.41M | { |
814 | 1.41M | VarHolder* pHolder = content(); |
815 | 1.41M | return (pHolder != nullptr) ? pHolder->isString() : false; |
816 | 1.41M | } |
817 | | |
818 | | |
819 | | inline bool Var::isDate() const |
820 | 0 | { |
821 | 0 | VarHolder* pHolder = content(); |
822 | 0 | return (pHolder != nullptr) ? pHolder->isDate() : false; |
823 | 0 | } |
824 | | |
825 | | |
826 | | inline bool Var::isTime() const |
827 | 0 | { |
828 | 0 | VarHolder* pHolder = content(); |
829 | 0 | return (pHolder != nullptr) ? pHolder->isTime() : false; |
830 | 0 | } |
831 | | |
832 | | |
833 | | inline bool Var::isDateTime() const |
834 | 0 | { |
835 | 0 | VarHolder* pHolder = content(); |
836 | 0 | return (pHolder != nullptr) ? pHolder->isDateTime() : false; |
837 | 0 | } |
838 | | |
839 | | |
840 | | inline bool Var::isUUID() const |
841 | 0 | { |
842 | 0 | VarHolder* pHolder = content(); |
843 | 0 | return (pHolder != nullptr) ? pHolder->isUUID() : false; |
844 | 0 | } |
845 | | |
846 | | |
847 | | inline std::size_t Var::size() const |
848 | 0 | { |
849 | 0 | VarHolder* pHolder = content(); |
850 | 0 | return (pHolder != nullptr) ? pHolder->size() : 0; |
851 | 0 | } |
852 | | |
853 | | |
854 | | /// |
855 | | /// Var non-member functions |
856 | | /// |
857 | | |
858 | | inline const Var operator + (const char* other, const Var& da) |
859 | | /// Addition operator for adding Var to const char* |
860 | 0 | { |
861 | 0 | const std::string tmp = other; |
862 | 0 | return tmp + da.convert<std::string>(); |
863 | 0 | } |
864 | | |
865 | | |
866 | | inline char operator + (const char& other, const Var& da) |
867 | | /// Addition operator for adding Var to char |
868 | 0 | { |
869 | 0 | return other + da.convert<char>(); |
870 | 0 | } |
871 | | |
872 | | |
873 | | inline char operator - (const char& other, const Var& da) |
874 | | /// Subtraction operator for subtracting Var from char |
875 | 0 | { |
876 | 0 | return other - da.convert<char>(); |
877 | 0 | } |
878 | | |
879 | | |
880 | | inline char operator * (const char& other, const Var& da) |
881 | | /// Multiplication operator for multiplying Var with char |
882 | 0 | { |
883 | 0 | return other * da.convert<char>(); |
884 | 0 | } |
885 | | |
886 | | |
887 | | inline char operator / (const char& other, const Var& da) |
888 | | /// Division operator for dividing Var with char |
889 | 0 | { |
890 | 0 | return other / da.convert<char>(); |
891 | 0 | } |
892 | | |
893 | | |
894 | | inline char operator += (char& other, const Var& da) |
895 | | /// Addition assignment operator for adding Var to char |
896 | 0 | { |
897 | 0 | return other += da.convert<char>(); |
898 | 0 | } |
899 | | |
900 | | |
901 | | inline char operator -= (char& other, const Var& da) |
902 | | /// Subtraction assignment operator for subtracting Var from char |
903 | 0 | { |
904 | 0 | return other -= da.convert<char>(); |
905 | 0 | } |
906 | | |
907 | | |
908 | | inline char operator *= (char& other, const Var& da) |
909 | | /// Multiplication assignment operator for multiplying Var with char |
910 | 0 | { |
911 | 0 | return other *= da.convert<char>(); |
912 | 0 | } |
913 | | |
914 | | |
915 | | inline char operator /= (char& other, const Var& da) |
916 | | /// Division assignment operator for dividing Var with char |
917 | 0 | { |
918 | 0 | return other /= da.convert<char>(); |
919 | 0 | } |
920 | | |
921 | | |
922 | | inline bool operator == (const char& other, const Var& da) |
923 | | /// Equality operator for comparing Var with char |
924 | 0 | { |
925 | 0 | if (da.isEmpty()) return false; |
926 | 0 | return other == da.convert<char>(); |
927 | 0 | } |
928 | | |
929 | | |
930 | | inline bool operator != (const char& other, const Var& da) |
931 | | /// Inequality operator for comparing Var with char |
932 | 0 | { |
933 | 0 | if (da.isEmpty()) return true; |
934 | 0 | return other != da.convert<char>(); |
935 | 0 | } |
936 | | |
937 | | |
938 | | inline bool operator < (const char& other, const Var& da) |
939 | | /// Less than operator for comparing Var with char |
940 | 0 | { |
941 | 0 | if (da.isEmpty()) return false; |
942 | 0 | return other < da.convert<char>(); |
943 | 0 | } |
944 | | |
945 | | |
946 | | inline bool operator <= (const char& other, const Var& da) |
947 | | /// Less than or equal operator for comparing Var with char |
948 | 0 | { |
949 | 0 | if (da.isEmpty()) return false; |
950 | 0 | return other <= da.convert<char>(); |
951 | 0 | } |
952 | | |
953 | | |
954 | | inline bool operator > (const char& other, const Var& da) |
955 | | /// Greater than operator for comparing Var with char |
956 | 0 | { |
957 | 0 | if (da.isEmpty())return false; |
958 | 0 | return other > da.convert<char>(); |
959 | 0 | } |
960 | | |
961 | | |
962 | | inline bool operator >= (const char& other, const Var& da) |
963 | | /// Greater than or equal operator for comparing Var with char |
964 | 0 | { |
965 | 0 | if (da.isEmpty())return false; |
966 | 0 | return other >= da.convert<char>(); |
967 | 0 | } |
968 | | |
969 | | |
970 | | inline Poco::Int8 operator + (const Poco::Int8& other, const Var& da) |
971 | | /// Addition operator for adding Var to Poco::Int8 |
972 | 0 | { |
973 | 0 | return other + da.convert<Poco::Int8>(); |
974 | 0 | } |
975 | | |
976 | | |
977 | | inline Poco::Int8 operator - (const Poco::Int8& other, const Var& da) |
978 | | /// Subtraction operator for subtracting Var from Poco::Int8 |
979 | 0 | { |
980 | 0 | return other - da.convert<Poco::Int8>(); |
981 | 0 | } |
982 | | |
983 | | |
984 | | inline Poco::Int8 operator * (const Poco::Int8& other, const Var& da) |
985 | | /// Multiplication operator for multiplying Var with Poco::Int8 |
986 | 0 | { |
987 | 0 | return other * da.convert<Poco::Int8>(); |
988 | 0 | } |
989 | | |
990 | | |
991 | | inline Poco::Int8 operator / (const Poco::Int8& other, const Var& da) |
992 | | /// Division operator for dividing Var with Poco::Int8 |
993 | 0 | { |
994 | 0 | return other / da.convert<Poco::Int8>(); |
995 | 0 | } |
996 | | |
997 | | |
998 | | inline Poco::Int8 operator += (Poco::Int8& other, const Var& da) |
999 | | /// Addition assignment operator for adding Var to Poco::Int8 |
1000 | 0 | { |
1001 | 0 | return other += da.convert<Poco::Int8>(); |
1002 | 0 | } |
1003 | | |
1004 | | |
1005 | | inline Poco::Int8 operator -= (Poco::Int8& other, const Var& da) |
1006 | | /// Subtraction assignment operator for subtracting Var from Poco::Int8 |
1007 | 0 | { |
1008 | 0 | return other -= da.convert<Poco::Int8>(); |
1009 | 0 | } |
1010 | | |
1011 | | |
1012 | | inline Poco::Int8 operator *= (Poco::Int8& other, const Var& da) |
1013 | | /// Multiplication assignment operator for multiplying Var with Poco::Int8 |
1014 | 0 | { |
1015 | 0 | return other *= da.convert<Poco::Int8>(); |
1016 | 0 | } |
1017 | | |
1018 | | |
1019 | | inline Poco::Int8 operator /= (Poco::Int8& other, const Var& da) |
1020 | | /// Division assignment operator for dividing Var with Poco::Int8 |
1021 | 0 | { |
1022 | 0 | return other /= da.convert<Poco::Int8>(); |
1023 | 0 | } |
1024 | | |
1025 | | |
1026 | | inline bool operator == (const Poco::Int8& other, const Var& da) |
1027 | | /// Equality operator for comparing Var with Poco::Int8 |
1028 | 0 | { |
1029 | 0 | if (da.isEmpty()) return false; |
1030 | 0 | return other == da.convert<Poco::Int8>(); |
1031 | 0 | } |
1032 | | |
1033 | | |
1034 | | inline bool operator != (const Poco::Int8& other, const Var& da) |
1035 | | /// Inequality operator for comparing Var with Poco::Int8 |
1036 | 0 | { |
1037 | 0 | if (da.isEmpty()) return true; |
1038 | 0 | return other != da.convert<Poco::Int8>(); |
1039 | 0 | } |
1040 | | |
1041 | | |
1042 | | inline bool operator < (const Poco::Int8& other, const Var& da) |
1043 | | /// Less than operator for comparing Var with Poco::Int8 |
1044 | 0 | { |
1045 | 0 | if (da.isEmpty()) return false; |
1046 | 0 | return other < da.convert<Poco::Int8>(); |
1047 | 0 | } |
1048 | | |
1049 | | |
1050 | | inline bool operator <= (const Poco::Int8& other, const Var& da) |
1051 | | /// Less than or equal operator for comparing Var with Poco::Int8 |
1052 | 0 | { |
1053 | 0 | if (da.isEmpty()) return false; |
1054 | 0 | return other <= da.convert<Poco::Int8>(); |
1055 | 0 | } |
1056 | | |
1057 | | |
1058 | | inline bool operator > (const Poco::Int8& other, const Var& da) |
1059 | | /// Greater than operator for comparing Var with Poco::Int8 |
1060 | 0 | { |
1061 | 0 | if (da.isEmpty()) return false; |
1062 | 0 | return other > da.convert<Poco::Int8>(); |
1063 | 0 | } |
1064 | | |
1065 | | |
1066 | | inline bool operator >= (const Poco::Int8& other, const Var& da) |
1067 | | /// Greater than or equal operator for comparing Var with Poco::Int8 |
1068 | 0 | { |
1069 | 0 | if (da.isEmpty()) return false; |
1070 | 0 | return other >= da.convert<Poco::Int8>(); |
1071 | 0 | } |
1072 | | |
1073 | | |
1074 | | inline Poco::UInt8 operator + (const Poco::UInt8& other, const Var& da) |
1075 | | /// Addition operator for adding Var to Poco::UInt8 |
1076 | 0 | { |
1077 | 0 | return other + da.convert<Poco::UInt8>(); |
1078 | 0 | } |
1079 | | |
1080 | | |
1081 | | inline Poco::UInt8 operator - (const Poco::UInt8& other, const Var& da) |
1082 | | /// Subtraction operator for subtracting Var from Poco::UInt8 |
1083 | 0 | { |
1084 | 0 | return other - da.convert<Poco::UInt8>(); |
1085 | 0 | } |
1086 | | |
1087 | | |
1088 | | inline Poco::UInt8 operator * (const Poco::UInt8& other, const Var& da) |
1089 | | /// Multiplication operator for multiplying Var with Poco::UInt8 |
1090 | 0 | { |
1091 | 0 | return other * da.convert<Poco::UInt8>(); |
1092 | 0 | } |
1093 | | |
1094 | | |
1095 | | inline Poco::UInt8 operator / (const Poco::UInt8& other, const Var& da) |
1096 | | /// Division operator for dividing Var with Poco::UInt8 |
1097 | 0 | { |
1098 | 0 | return other / da.convert<Poco::UInt8>(); |
1099 | 0 | } |
1100 | | |
1101 | | |
1102 | | inline Poco::UInt8 operator += (Poco::UInt8& other, const Var& da) |
1103 | | /// Addition assignment operator for adding Var to Poco::UInt8 |
1104 | 0 | { |
1105 | 0 | return other += da.convert<Poco::UInt8>(); |
1106 | 0 | } |
1107 | | |
1108 | | |
1109 | | inline Poco::UInt8 operator -= (Poco::UInt8& other, const Var& da) |
1110 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt8 |
1111 | 0 | { |
1112 | 0 | return other -= da.convert<Poco::UInt8>(); |
1113 | 0 | } |
1114 | | |
1115 | | |
1116 | | inline Poco::UInt8 operator *= (Poco::UInt8& other, const Var& da) |
1117 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt8 |
1118 | 0 | { |
1119 | 0 | return other *= da.convert<Poco::UInt8>(); |
1120 | 0 | } |
1121 | | |
1122 | | |
1123 | | inline Poco::UInt8 operator /= (Poco::UInt8& other, const Var& da) |
1124 | | /// Division assignment operator for dividing Var with Poco::UInt8 |
1125 | 0 | { |
1126 | 0 | return other /= da.convert<Poco::UInt8>(); |
1127 | 0 | } |
1128 | | |
1129 | | |
1130 | | inline bool operator == (const Poco::UInt8& other, const Var& da) |
1131 | | /// Equality operator for comparing Var with Poco::UInt8 |
1132 | 0 | { |
1133 | 0 | if (da.isEmpty()) return false; |
1134 | 0 | return other == da.convert<Poco::UInt8>(); |
1135 | 0 | } |
1136 | | |
1137 | | |
1138 | | inline bool operator != (const Poco::UInt8& other, const Var& da) |
1139 | | /// Inequality operator for comparing Var with Poco::UInt8 |
1140 | 0 | { |
1141 | 0 | if (da.isEmpty()) return true; |
1142 | 0 | return other != da.convert<Poco::UInt8>(); |
1143 | 0 | } |
1144 | | |
1145 | | |
1146 | | inline bool operator < (const Poco::UInt8& other, const Var& da) |
1147 | | /// Less than operator for comparing Var with Poco::UInt8 |
1148 | 0 | { |
1149 | 0 | if (da.isEmpty()) return false; |
1150 | 0 | return other < da.convert<Poco::UInt8>(); |
1151 | 0 | } |
1152 | | |
1153 | | |
1154 | | inline bool operator <= (const Poco::UInt8& other, const Var& da) |
1155 | | /// Less than or equal operator for comparing Var with Poco::UInt8 |
1156 | 0 | { |
1157 | 0 | if (da.isEmpty()) return false; |
1158 | 0 | return other <= da.convert<Poco::UInt8>(); |
1159 | 0 | } |
1160 | | |
1161 | | |
1162 | | inline bool operator > (const Poco::UInt8& other, const Var& da) |
1163 | | /// Greater than operator for comparing Var with Poco::UInt8 |
1164 | 0 | { |
1165 | 0 | if (da.isEmpty()) return false; |
1166 | 0 | return other > da.convert<Poco::UInt8>(); |
1167 | 0 | } |
1168 | | |
1169 | | |
1170 | | inline bool operator >= (const Poco::UInt8& other, const Var& da) |
1171 | | /// Greater than or equal operator for comparing Var with Poco::UInt8 |
1172 | 0 | { |
1173 | 0 | if (da.isEmpty()) return false; |
1174 | 0 | return other >= da.convert<Poco::UInt8>(); |
1175 | 0 | } |
1176 | | |
1177 | | |
1178 | | inline Poco::Int16 operator + (const Poco::Int16& other, const Var& da) |
1179 | | /// Addition operator for adding Var to Poco::Int16 |
1180 | 0 | { |
1181 | 0 | return other + da.convert<Poco::Int16>(); |
1182 | 0 | } |
1183 | | |
1184 | | |
1185 | | inline Poco::Int16 operator - (const Poco::Int16& other, const Var& da) |
1186 | | /// Subtraction operator for subtracting Var from Poco::Int16 |
1187 | 0 | { |
1188 | 0 | return other - da.convert<Poco::Int16>(); |
1189 | 0 | } |
1190 | | |
1191 | | |
1192 | | inline Poco::Int16 operator * (const Poco::Int16& other, const Var& da) |
1193 | | /// Multiplication operator for multiplying Var with Poco::Int16 |
1194 | 0 | { |
1195 | 0 | return other * da.convert<Poco::Int16>(); |
1196 | 0 | } |
1197 | | |
1198 | | |
1199 | | inline Poco::Int16 operator / (const Poco::Int16& other, const Var& da) |
1200 | | /// Division operator for dividing Var with Poco::Int16 |
1201 | 0 | { |
1202 | 0 | return other / da.convert<Poco::Int16>(); |
1203 | 0 | } |
1204 | | |
1205 | | |
1206 | | inline Poco::Int16 operator += (Poco::Int16& other, const Var& da) |
1207 | | /// Addition assignment operator for adding Var to Poco::Int16 |
1208 | 0 | { |
1209 | 0 | return other += da.convert<Poco::Int16>(); |
1210 | 0 | } |
1211 | | |
1212 | | |
1213 | | inline Poco::Int16 operator -= (Poco::Int16& other, const Var& da) |
1214 | | /// Subtraction assignment operator for subtracting Var from Poco::Int16 |
1215 | 0 | { |
1216 | 0 | return other -= da.convert<Poco::Int16>(); |
1217 | 0 | } |
1218 | | |
1219 | | |
1220 | | inline Poco::Int16 operator *= (Poco::Int16& other, const Var& da) |
1221 | | /// Multiplication assignment operator for multiplying Var with Poco::Int16 |
1222 | 0 | { |
1223 | 0 | return other *= da.convert<Poco::Int16>(); |
1224 | 0 | } |
1225 | | |
1226 | | |
1227 | | inline Poco::Int16 operator /= (Poco::Int16& other, const Var& da) |
1228 | | /// Division assignment operator for dividing Var with Poco::Int16 |
1229 | 0 | { |
1230 | 0 | return other /= da.convert<Poco::Int16>(); |
1231 | 0 | } |
1232 | | |
1233 | | |
1234 | | inline bool operator == (const Poco::Int16& other, const Var& da) |
1235 | | /// Equality operator for comparing Var with Poco::Int16 |
1236 | 0 | { |
1237 | 0 | if (da.isEmpty()) return false; |
1238 | 0 | return other == da.convert<Poco::Int16>(); |
1239 | 0 | } |
1240 | | |
1241 | | |
1242 | | inline bool operator != (const Poco::Int16& other, const Var& da) |
1243 | | /// Inequality operator for comparing Var with Poco::Int16 |
1244 | 0 | { |
1245 | 0 | if (da.isEmpty()) return true; |
1246 | 0 | return other != da.convert<Poco::Int16>(); |
1247 | 0 | } |
1248 | | |
1249 | | |
1250 | | inline bool operator < (const Poco::Int16& other, const Var& da) |
1251 | | /// Less than operator for comparing Var with Poco::Int16 |
1252 | 0 | { |
1253 | 0 | if (da.isEmpty()) return false; |
1254 | 0 | return other < da.convert<Poco::Int16>(); |
1255 | 0 | } |
1256 | | |
1257 | | |
1258 | | inline bool operator <= (const Poco::Int16& other, const Var& da) |
1259 | | /// Less than or equal operator for comparing Var with Poco::Int16 |
1260 | 0 | { |
1261 | 0 | if (da.isEmpty()) return false; |
1262 | 0 | return other <= da.convert<Poco::Int16>(); |
1263 | 0 | } |
1264 | | |
1265 | | |
1266 | | inline bool operator > (const Poco::Int16& other, const Var& da) |
1267 | | /// Greater than operator for comparing Var with Poco::Int16 |
1268 | 0 | { |
1269 | 0 | if (da.isEmpty()) return false; |
1270 | 0 | return other > da.convert<Poco::Int16>(); |
1271 | 0 | } |
1272 | | |
1273 | | |
1274 | | inline bool operator >= (const Poco::Int16& other, const Var& da) |
1275 | | /// Greater than or equal operator for comparing Var with Poco::Int16 |
1276 | 0 | { |
1277 | 0 | if (da.isEmpty()) return false; |
1278 | 0 | return other >= da.convert<Poco::Int16>(); |
1279 | 0 | } |
1280 | | |
1281 | | |
1282 | | inline Poco::UInt16 operator + (const Poco::UInt16& other, const Var& da) |
1283 | | /// Addition operator for adding Var to Poco::UInt16 |
1284 | 0 | { |
1285 | 0 | return other + da.convert<Poco::UInt16>(); |
1286 | 0 | } |
1287 | | |
1288 | | |
1289 | | inline Poco::UInt16 operator - (const Poco::UInt16& other, const Var& da) |
1290 | | /// Subtraction operator for subtracting Var from Poco::UInt16 |
1291 | 0 | { |
1292 | 0 | return other - da.convert<Poco::UInt16>(); |
1293 | 0 | } |
1294 | | |
1295 | | |
1296 | | inline Poco::UInt16 operator * (const Poco::UInt16& other, const Var& da) |
1297 | | /// Multiplication operator for multiplying Var with Poco::UInt16 |
1298 | 0 | { |
1299 | 0 | return other * da.convert<Poco::UInt16>(); |
1300 | 0 | } |
1301 | | |
1302 | | |
1303 | | inline Poco::UInt16 operator / (const Poco::UInt16& other, const Var& da) |
1304 | | /// Division operator for dividing Var with Poco::UInt16 |
1305 | 0 | { |
1306 | 0 | return other / da.convert<Poco::UInt16>(); |
1307 | 0 | } |
1308 | | |
1309 | | |
1310 | | inline Poco::UInt16 operator += (Poco::UInt16& other, const Var& da) |
1311 | | /// Addition assignment operator for adding Var to Poco::UInt16 |
1312 | 0 | { |
1313 | 0 | return other += da.convert<Poco::UInt16>(); |
1314 | 0 | } |
1315 | | |
1316 | | |
1317 | | inline Poco::UInt16 operator -= (Poco::UInt16& other, const Var& da) |
1318 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt16 |
1319 | 0 | { |
1320 | 0 | return other -= da.convert<Poco::UInt16>(); |
1321 | 0 | } |
1322 | | |
1323 | | |
1324 | | inline Poco::UInt16 operator *= (Poco::UInt16& other, const Var& da) |
1325 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt16 |
1326 | 0 | { |
1327 | 0 | return other *= da.convert<Poco::UInt16>(); |
1328 | 0 | } |
1329 | | |
1330 | | |
1331 | | inline Poco::UInt16 operator /= (Poco::UInt16& other, const Var& da) |
1332 | | /// Division assignment operator for dividing Var with Poco::UInt16 |
1333 | 0 | { |
1334 | 0 | return other /= da.convert<Poco::UInt16>(); |
1335 | 0 | } |
1336 | | |
1337 | | |
1338 | | inline bool operator == (const Poco::UInt16& other, const Var& da) |
1339 | | /// Equality operator for comparing Var with Poco::UInt16 |
1340 | 0 | { |
1341 | 0 | if (da.isEmpty()) return false; |
1342 | 0 | return other == da.convert<Poco::UInt16>(); |
1343 | 0 | } |
1344 | | |
1345 | | |
1346 | | inline bool operator != (const Poco::UInt16& other, const Var& da) |
1347 | | /// Inequality operator for comparing Var with Poco::UInt16 |
1348 | 0 | { |
1349 | 0 | if (da.isEmpty()) return true; |
1350 | 0 | return other != da.convert<Poco::UInt16>(); |
1351 | 0 | } |
1352 | | |
1353 | | |
1354 | | inline bool operator < (const Poco::UInt16& other, const Var& da) |
1355 | | /// Less than operator for comparing Var with Poco::UInt16 |
1356 | 0 | { |
1357 | 0 | if (da.isEmpty()) return false; |
1358 | 0 | return other < da.convert<Poco::UInt16>(); |
1359 | 0 | } |
1360 | | |
1361 | | |
1362 | | inline bool operator <= (const Poco::UInt16& other, const Var& da) |
1363 | | /// Less than or equal operator for comparing Var with Poco::UInt16 |
1364 | 0 | { |
1365 | 0 | if (da.isEmpty()) return false; |
1366 | 0 | return other <= da.convert<Poco::UInt16>(); |
1367 | 0 | } |
1368 | | |
1369 | | |
1370 | | inline bool operator > (const Poco::UInt16& other, const Var& da) |
1371 | | /// Greater than operator for comparing Var with Poco::UInt16 |
1372 | 0 | { |
1373 | 0 | if (da.isEmpty()) return false; |
1374 | 0 | return other > da.convert<Poco::UInt16>(); |
1375 | 0 | } |
1376 | | |
1377 | | |
1378 | | inline bool operator >= (const Poco::UInt16& other, const Var& da) |
1379 | | /// Greater than or equal operator for comparing Var with Poco::UInt16 |
1380 | 0 | { |
1381 | 0 | if (da.isEmpty()) return false; |
1382 | 0 | return other >= da.convert<Poco::UInt16>(); |
1383 | 0 | } |
1384 | | |
1385 | | |
1386 | | inline Poco::Int32 operator + (const Poco::Int32& other, const Var& da) |
1387 | | /// Addition operator for adding Var to Poco::Int32 |
1388 | 0 | { |
1389 | 0 | return other + da.convert<Poco::Int32>(); |
1390 | 0 | } |
1391 | | |
1392 | | |
1393 | | inline Poco::Int32 operator - (const Poco::Int32& other, const Var& da) |
1394 | | /// Subtraction operator for subtracting Var from Poco::Int32 |
1395 | 0 | { |
1396 | 0 | return other - da.convert<Poco::Int32>(); |
1397 | 0 | } |
1398 | | |
1399 | | |
1400 | | inline Poco::Int32 operator * (const Poco::Int32& other, const Var& da) |
1401 | | /// Multiplication operator for multiplying Var with Poco::Int32 |
1402 | 0 | { |
1403 | 0 | return other * da.convert<Poco::Int32>(); |
1404 | 0 | } |
1405 | | |
1406 | | |
1407 | | inline Poco::Int32 operator / (const Poco::Int32& other, const Var& da) |
1408 | | /// Division operator for dividing Var with Poco::Int32 |
1409 | 0 | { |
1410 | 0 | return other / da.convert<Poco::Int32>(); |
1411 | 0 | } |
1412 | | |
1413 | | |
1414 | | inline Poco::Int32 operator += (Poco::Int32& other, const Var& da) |
1415 | | /// Addition assignment operator for adding Var to Poco::Int32 |
1416 | 0 | { |
1417 | 0 | return other += da.convert<Poco::Int32>(); |
1418 | 0 | } |
1419 | | |
1420 | | |
1421 | | inline Poco::Int32 operator -= (Poco::Int32& other, const Var& da) |
1422 | | /// Subtraction assignment operator for subtracting Var from Poco::Int32 |
1423 | 0 | { |
1424 | 0 | return other -= da.convert<Poco::Int32>(); |
1425 | 0 | } |
1426 | | |
1427 | | |
1428 | | inline Poco::Int32 operator *= (Poco::Int32& other, const Var& da) |
1429 | | /// Multiplication assignment operator for multiplying Var with Poco::Int32 |
1430 | 0 | { |
1431 | 0 | return other *= da.convert<Poco::Int32>(); |
1432 | 0 | } |
1433 | | |
1434 | | |
1435 | | inline Poco::Int32 operator /= (Poco::Int32& other, const Var& da) |
1436 | | /// Division assignment operator for dividing Var with Poco::Int32 |
1437 | 0 | { |
1438 | 0 | return other /= da.convert<Poco::Int32>(); |
1439 | 0 | } |
1440 | | |
1441 | | |
1442 | | inline bool operator == (const Poco::Int32& other, const Var& da) |
1443 | | /// Equality operator for comparing Var with Poco::Int32 |
1444 | 0 | { |
1445 | 0 | if (da.isEmpty()) return false; |
1446 | 0 | return other == da.convert<Poco::Int32>(); |
1447 | 0 | } |
1448 | | |
1449 | | |
1450 | | inline bool operator != (const Poco::Int32& other, const Var& da) |
1451 | | /// Inequality operator for comparing Var with Poco::Int32 |
1452 | 0 | { |
1453 | 0 | if (da.isEmpty()) return true; |
1454 | 0 | return other != da.convert<Poco::Int32>(); |
1455 | 0 | } |
1456 | | |
1457 | | |
1458 | | inline bool operator < (const Poco::Int32& other, const Var& da) |
1459 | | /// Less than operator for comparing Var with Poco::Int32 |
1460 | 0 | { |
1461 | 0 | if (da.isEmpty()) return false; |
1462 | 0 | return other < da.convert<Poco::Int32>(); |
1463 | 0 | } |
1464 | | |
1465 | | |
1466 | | inline bool operator <= (const Poco::Int32& other, const Var& da) |
1467 | | /// Less than or equal operator for comparing Var with Poco::Int32 |
1468 | 0 | { |
1469 | 0 | if (da.isEmpty()) return false; |
1470 | 0 | return other <= da.convert<Poco::Int32>(); |
1471 | 0 | } |
1472 | | |
1473 | | |
1474 | | inline bool operator > (const Poco::Int32& other, const Var& da) |
1475 | | /// Greater than operator for comparing Var with Poco::Int32 |
1476 | 0 | { |
1477 | 0 | if (da.isEmpty()) return false; |
1478 | 0 | return other > da.convert<Poco::Int32>(); |
1479 | 0 | } |
1480 | | |
1481 | | |
1482 | | inline bool operator >= (const Poco::Int32& other, const Var& da) |
1483 | | /// Greater than or equal operator for comparing Var with Poco::Int32 |
1484 | 0 | { |
1485 | 0 | if (da.isEmpty()) return false; |
1486 | 0 | return other >= da.convert<Poco::Int32>(); |
1487 | 0 | } |
1488 | | |
1489 | | |
1490 | | inline Poco::UInt32 operator + (const Poco::UInt32& other, const Var& da) |
1491 | | /// Addition operator for adding Var to Poco::UInt32 |
1492 | 0 | { |
1493 | 0 | return other + da.convert<Poco::UInt32>(); |
1494 | 0 | } |
1495 | | |
1496 | | |
1497 | | inline Poco::UInt32 operator - (const Poco::UInt32& other, const Var& da) |
1498 | | /// Subtraction operator for subtracting Var from Poco::UInt32 |
1499 | 0 | { |
1500 | 0 | return other - da.convert<Poco::UInt32>(); |
1501 | 0 | } |
1502 | | |
1503 | | |
1504 | | inline Poco::UInt32 operator * (const Poco::UInt32& other, const Var& da) |
1505 | | /// Multiplication operator for multiplying Var with Poco::UInt32 |
1506 | 0 | { |
1507 | 0 | return other * da.convert<Poco::UInt32>(); |
1508 | 0 | } |
1509 | | |
1510 | | |
1511 | | inline Poco::UInt32 operator / (const Poco::UInt32& other, const Var& da) |
1512 | | /// Division operator for dividing Var with Poco::UInt32 |
1513 | 0 | { |
1514 | 0 | return other / da.convert<Poco::UInt32>(); |
1515 | 0 | } |
1516 | | |
1517 | | |
1518 | | inline Poco::UInt32 operator += (Poco::UInt32& other, const Var& da) |
1519 | | /// Addition assignment operator for adding Var to Poco::UInt32 |
1520 | 0 | { |
1521 | 0 | return other += da.convert<Poco::UInt32>(); |
1522 | 0 | } |
1523 | | |
1524 | | |
1525 | | inline Poco::UInt32 operator -= (Poco::UInt32& other, const Var& da) |
1526 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt32 |
1527 | 0 | { |
1528 | 0 | return other -= da.convert<Poco::UInt32>(); |
1529 | 0 | } |
1530 | | |
1531 | | |
1532 | | inline Poco::UInt32 operator *= (Poco::UInt32& other, const Var& da) |
1533 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt32 |
1534 | 0 | { |
1535 | 0 | return other *= da.convert<Poco::UInt32>(); |
1536 | 0 | } |
1537 | | |
1538 | | |
1539 | | inline Poco::UInt32 operator /= (Poco::UInt32& other, const Var& da) |
1540 | | /// Division assignment operator for dividing Var with Poco::UInt32 |
1541 | 0 | { |
1542 | 0 | return other /= da.convert<Poco::UInt32>(); |
1543 | 0 | } |
1544 | | |
1545 | | |
1546 | | inline bool operator == (const Poco::UInt32& other, const Var& da) |
1547 | | /// Equality operator for comparing Var with Poco::UInt32 |
1548 | 0 | { |
1549 | 0 | if (da.isEmpty()) return false; |
1550 | 0 | return other == da.convert<Poco::UInt32>(); |
1551 | 0 | } |
1552 | | |
1553 | | |
1554 | | inline bool operator != (const Poco::UInt32& other, const Var& da) |
1555 | | /// Inequality operator for comparing Var with Poco::UInt32 |
1556 | 0 | { |
1557 | 0 | if (da.isEmpty()) return true; |
1558 | 0 | return other != da.convert<Poco::UInt32>(); |
1559 | 0 | } |
1560 | | |
1561 | | |
1562 | | inline bool operator < (const Poco::UInt32& other, const Var& da) |
1563 | | /// Less than operator for comparing Var with Poco::UInt32 |
1564 | 0 | { |
1565 | 0 | if (da.isEmpty()) return false; |
1566 | 0 | return other < da.convert<Poco::UInt32>(); |
1567 | 0 | } |
1568 | | |
1569 | | |
1570 | | inline bool operator <= (const Poco::UInt32& other, const Var& da) |
1571 | | /// Less than or equal operator for comparing Var with Poco::UInt32 |
1572 | 0 | { |
1573 | 0 | if (da.isEmpty()) return false; |
1574 | 0 | return other <= da.convert<Poco::UInt32>(); |
1575 | 0 | } |
1576 | | |
1577 | | |
1578 | | inline bool operator > (const Poco::UInt32& other, const Var& da) |
1579 | | /// Greater than operator for comparing Var with Poco::UInt32 |
1580 | 0 | { |
1581 | 0 | if (da.isEmpty()) return false; |
1582 | 0 | return other > da.convert<Poco::UInt32>(); |
1583 | 0 | } |
1584 | | |
1585 | | |
1586 | | inline bool operator >= (const Poco::UInt32& other, const Var& da) |
1587 | | /// Greater than or equal operator for comparing Var with Poco::UInt32 |
1588 | 0 | { |
1589 | 0 | if (da.isEmpty()) return false; |
1590 | 0 | return other >= da.convert<Poco::UInt32>(); |
1591 | 0 | } |
1592 | | |
1593 | | |
1594 | | inline Poco::Int64 operator + (const Poco::Int64& other, const Var& da) |
1595 | | /// Addition operator for adding Var to Poco::Int64 |
1596 | 0 | { |
1597 | 0 | return other + da.convert<Poco::Int64>(); |
1598 | 0 | } |
1599 | | |
1600 | | |
1601 | | inline Poco::Int64 operator - (const Poco::Int64& other, const Var& da) |
1602 | | /// Subtraction operator for subtracting Var from Poco::Int64 |
1603 | 0 | { |
1604 | 0 | return other - da.convert<Poco::Int64>(); |
1605 | 0 | } |
1606 | | |
1607 | | |
1608 | | inline Poco::Int64 operator * (const Poco::Int64& other, const Var& da) |
1609 | | /// Multiplication operator for multiplying Var with Poco::Int64 |
1610 | 0 | { |
1611 | 0 | return other * da.convert<Poco::Int64>(); |
1612 | 0 | } |
1613 | | |
1614 | | |
1615 | | inline Poco::Int64 operator / (const Poco::Int64& other, const Var& da) |
1616 | | /// Division operator for dividing Var with Poco::Int64 |
1617 | 0 | { |
1618 | 0 | return other / da.convert<Poco::Int64>(); |
1619 | 0 | } |
1620 | | |
1621 | | |
1622 | | inline Poco::Int64 operator += (Poco::Int64& other, const Var& da) |
1623 | | /// Addition assignment operator for adding Var to Poco::Int64 |
1624 | 0 | { |
1625 | 0 | return other += da.convert<Poco::Int64>(); |
1626 | 0 | } |
1627 | | |
1628 | | |
1629 | | inline Poco::Int64 operator -= (Poco::Int64& other, const Var& da) |
1630 | | /// Subtraction assignment operator for subtracting Var from Poco::Int64 |
1631 | 0 | { |
1632 | 0 | return other -= da.convert<Poco::Int64>(); |
1633 | 0 | } |
1634 | | |
1635 | | |
1636 | | inline Poco::Int64 operator *= (Poco::Int64& other, const Var& da) |
1637 | | /// Multiplication assignment operator for multiplying Var with Poco::Int64 |
1638 | 0 | { |
1639 | 0 | return other *= da.convert<Poco::Int64>(); |
1640 | 0 | } |
1641 | | |
1642 | | |
1643 | | inline Poco::Int64 operator /= (Poco::Int64& other, const Var& da) |
1644 | | /// Division assignment operator for dividing Var with Poco::Int64 |
1645 | 0 | { |
1646 | 0 | return other /= da.convert<Poco::Int64>(); |
1647 | 0 | } |
1648 | | |
1649 | | |
1650 | | inline bool operator == (const Poco::Int64& other, const Var& da) |
1651 | | /// Equality operator for comparing Var with Poco::Int64 |
1652 | 0 | { |
1653 | 0 | if (da.isEmpty()) return false; |
1654 | 0 | return other == da.convert<Poco::Int64>(); |
1655 | 0 | } |
1656 | | |
1657 | | |
1658 | | inline bool operator != (const Poco::Int64& other, const Var& da) |
1659 | | /// Inequality operator for comparing Var with Poco::Int64 |
1660 | 0 | { |
1661 | 0 | if (da.isEmpty()) return true; |
1662 | 0 | return other != da.convert<Poco::Int64>(); |
1663 | 0 | } |
1664 | | |
1665 | | |
1666 | | inline bool operator < (const Poco::Int64& other, const Var& da) |
1667 | | /// Less than operator for comparing Var with Poco::Int64 |
1668 | 0 | { |
1669 | 0 | if (da.isEmpty()) return false; |
1670 | 0 | return other < da.convert<Poco::Int64>(); |
1671 | 0 | } |
1672 | | |
1673 | | |
1674 | | inline bool operator <= (const Poco::Int64& other, const Var& da) |
1675 | | /// Less than or equal operator for comparing Var with Poco::Int64 |
1676 | 0 | { |
1677 | 0 | if (da.isEmpty()) return false; |
1678 | 0 | return other <= da.convert<Poco::Int64>(); |
1679 | 0 | } |
1680 | | |
1681 | | |
1682 | | inline bool operator > (const Poco::Int64& other, const Var& da) |
1683 | | /// Greater than operator for comparing Var with Poco::Int64 |
1684 | 0 | { |
1685 | 0 | if (da.isEmpty()) return false; |
1686 | 0 | return other > da.convert<Poco::Int64>(); |
1687 | 0 | } |
1688 | | |
1689 | | |
1690 | | inline bool operator >= (const Poco::Int64& other, const Var& da) |
1691 | | /// Greater than or equal operator for comparing Var with Poco::Int64 |
1692 | 0 | { |
1693 | 0 | if (da.isEmpty()) return false; |
1694 | 0 | return other >= da.convert<Poco::Int64>(); |
1695 | 0 | } |
1696 | | |
1697 | | |
1698 | | inline Poco::UInt64 operator + (const Poco::UInt64& other, const Var& da) |
1699 | | /// Addition operator for adding Var to Poco::UInt64 |
1700 | 0 | { |
1701 | 0 | return other + da.convert<Poco::UInt64>(); |
1702 | 0 | } |
1703 | | |
1704 | | |
1705 | | inline Poco::UInt64 operator - (const Poco::UInt64& other, const Var& da) |
1706 | | /// Subtraction operator for subtracting Var from Poco::UInt64 |
1707 | 0 | { |
1708 | 0 | return other - da.convert<Poco::UInt64>(); |
1709 | 0 | } |
1710 | | |
1711 | | |
1712 | | inline Poco::UInt64 operator * (const Poco::UInt64& other, const Var& da) |
1713 | | /// Multiplication operator for multiplying Var with Poco::UInt64 |
1714 | 0 | { |
1715 | 0 | return other * da.convert<Poco::UInt64>(); |
1716 | 0 | } |
1717 | | |
1718 | | |
1719 | | inline Poco::UInt64 operator / (const Poco::UInt64& other, const Var& da) |
1720 | | /// Division operator for dividing Var with Poco::UInt64 |
1721 | 0 | { |
1722 | 0 | return other / da.convert<Poco::UInt64>(); |
1723 | 0 | } |
1724 | | |
1725 | | |
1726 | | inline Poco::UInt64 operator += (Poco::UInt64& other, const Var& da) |
1727 | | /// Addition assignment operator for adding Var to Poco::UInt64 |
1728 | 0 | { |
1729 | 0 | return other += da.convert<Poco::UInt64>(); |
1730 | 0 | } |
1731 | | |
1732 | | |
1733 | | inline Poco::UInt64 operator -= (Poco::UInt64& other, const Var& da) |
1734 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt64 |
1735 | 0 | { |
1736 | 0 | return other -= da.convert<Poco::UInt64>(); |
1737 | 0 | } |
1738 | | |
1739 | | |
1740 | | inline Poco::UInt64 operator *= (Poco::UInt64& other, const Var& da) |
1741 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt64 |
1742 | 0 | { |
1743 | 0 | return other *= da.convert<Poco::UInt64>(); |
1744 | 0 | } |
1745 | | |
1746 | | |
1747 | | inline Poco::UInt64 operator /= (Poco::UInt64& other, const Var& da) |
1748 | | /// Division assignment operator for dividing Var with Poco::UInt64 |
1749 | 0 | { |
1750 | 0 | return other /= da.convert<Poco::UInt64>(); |
1751 | 0 | } |
1752 | | |
1753 | | |
1754 | | inline bool operator == (const Poco::UInt64& other, const Var& da) |
1755 | | /// Equality operator for comparing Var with Poco::UInt64 |
1756 | 0 | { |
1757 | 0 | if (da.isEmpty()) return false; |
1758 | 0 | return other == da.convert<Poco::UInt64>(); |
1759 | 0 | } |
1760 | | |
1761 | | |
1762 | | inline bool operator != (const Poco::UInt64& other, const Var& da) |
1763 | | /// Inequality operator for comparing Var with Poco::UInt64 |
1764 | 0 | { |
1765 | 0 | if (da.isEmpty()) return true; |
1766 | 0 | return other != da.convert<Poco::UInt64>(); |
1767 | 0 | } |
1768 | | |
1769 | | |
1770 | | inline bool operator < (const Poco::UInt64& other, const Var& da) |
1771 | | /// Less than operator for comparing Var with Poco::UInt64 |
1772 | 0 | { |
1773 | 0 | if (da.isEmpty()) return false; |
1774 | 0 | return other < da.convert<Poco::UInt64>(); |
1775 | 0 | } |
1776 | | |
1777 | | |
1778 | | inline bool operator <= (const Poco::UInt64& other, const Var& da) |
1779 | | /// Less than or equal operator for comparing Var with Poco::UInt64 |
1780 | 0 | { |
1781 | 0 | if (da.isEmpty()) return false; |
1782 | 0 | return other <= da.convert<Poco::UInt64>(); |
1783 | 0 | } |
1784 | | |
1785 | | |
1786 | | inline bool operator > (const Poco::UInt64& other, const Var& da) |
1787 | | /// Greater than operator for comparing Var with Poco::UInt64 |
1788 | 0 | { |
1789 | 0 | if (da.isEmpty()) return false; |
1790 | 0 | return other > da.convert<Poco::UInt64>(); |
1791 | 0 | } |
1792 | | |
1793 | | |
1794 | | inline bool operator >= (const Poco::UInt64& other, const Var& da) |
1795 | | /// Greater than or equal operator for comparing Var with Poco::UInt64 |
1796 | 0 | { |
1797 | 0 | if (da.isEmpty()) return false; |
1798 | 0 | return other >= da.convert<Poco::UInt64>(); |
1799 | 0 | } |
1800 | | |
1801 | | |
1802 | | inline float operator + (const float& other, const Var& da) |
1803 | | /// Addition operator for adding Var to float |
1804 | 0 | { |
1805 | 0 | return other + da.convert<float>(); |
1806 | 0 | } |
1807 | | |
1808 | | |
1809 | | inline float operator - (const float& other, const Var& da) |
1810 | | /// Subtraction operator for subtracting Var from float |
1811 | 0 | { |
1812 | 0 | return other - da.convert<float>(); |
1813 | 0 | } |
1814 | | |
1815 | | |
1816 | | inline float operator * (const float& other, const Var& da) |
1817 | | /// Multiplication operator for multiplying Var with float |
1818 | 0 | { |
1819 | 0 | return other * da.convert<float>(); |
1820 | 0 | } |
1821 | | |
1822 | | |
1823 | | inline float operator / (const float& other, const Var& da) |
1824 | | /// Division operator for dividing Var with float |
1825 | 0 | { |
1826 | 0 | return other / da.convert<float>(); |
1827 | 0 | } |
1828 | | |
1829 | | |
1830 | | inline float operator += (float& other, const Var& da) |
1831 | | /// Addition assignment operator for adding Var to float |
1832 | 0 | { |
1833 | 0 | return other += da.convert<float>(); |
1834 | 0 | } |
1835 | | |
1836 | | |
1837 | | inline float operator -= (float& other, const Var& da) |
1838 | | /// Subtraction assignment operator for subtracting Var from float |
1839 | 0 | { |
1840 | 0 | return other -= da.convert<float>(); |
1841 | 0 | } |
1842 | | |
1843 | | |
1844 | | inline float operator *= (float& other, const Var& da) |
1845 | | /// Multiplication assignment operator for multiplying Var with float |
1846 | 0 | { |
1847 | 0 | return other *= da.convert<float>(); |
1848 | 0 | } |
1849 | | |
1850 | | |
1851 | | inline float operator /= (float& other, const Var& da) |
1852 | | /// Division assignment operator for dividing Var with float |
1853 | 0 | { |
1854 | 0 | return other /= da.convert<float>(); |
1855 | 0 | } |
1856 | | |
1857 | | |
1858 | | inline bool operator == (const float& other, const Var& da) |
1859 | | /// Equality operator for comparing Var with float |
1860 | 0 | { |
1861 | 0 | if (da.isEmpty()) return false; |
1862 | 0 | return other == da.convert<float>(); |
1863 | 0 | } |
1864 | | |
1865 | | |
1866 | | inline bool operator != (const float& other, const Var& da) |
1867 | | /// Inequality operator for comparing Var with float |
1868 | 0 | { |
1869 | 0 | if (da.isEmpty()) return true; |
1870 | 0 | return other != da.convert<float>(); |
1871 | 0 | } |
1872 | | |
1873 | | |
1874 | | inline bool operator < (const float& other, const Var& da) |
1875 | | /// Less than operator for comparing Var with float |
1876 | 0 | { |
1877 | 0 | if (da.isEmpty()) return false; |
1878 | 0 | return other < da.convert<float>(); |
1879 | 0 | } |
1880 | | |
1881 | | |
1882 | | inline bool operator <= (const float& other, const Var& da) |
1883 | | /// Less than or equal operator for comparing Var with float |
1884 | 0 | { |
1885 | 0 | if (da.isEmpty()) return false; |
1886 | 0 | return other <= da.convert<float>(); |
1887 | 0 | } |
1888 | | |
1889 | | |
1890 | | inline bool operator > (const float& other, const Var& da) |
1891 | | /// Greater than operator for comparing Var with float |
1892 | 0 | { |
1893 | 0 | if (da.isEmpty()) return false; |
1894 | 0 | return other > da.convert<float>(); |
1895 | 0 | } |
1896 | | |
1897 | | |
1898 | | inline bool operator >= (const float& other, const Var& da) |
1899 | | /// Greater than or equal operator for comparing Var with float |
1900 | 0 | { |
1901 | 0 | if (da.isEmpty()) return false; |
1902 | 0 | return other >= da.convert<float>(); |
1903 | 0 | } |
1904 | | |
1905 | | |
1906 | | inline double operator + (const double& other, const Var& da) |
1907 | | /// Addition operator for adding Var to double |
1908 | 0 | { |
1909 | 0 | return other + da.convert<double>(); |
1910 | 0 | } |
1911 | | |
1912 | | |
1913 | | inline double operator - (const double& other, const Var& da) |
1914 | | /// Subtraction operator for subtracting Var from double |
1915 | 0 | { |
1916 | 0 | return other - da.convert<double>(); |
1917 | 0 | } |
1918 | | |
1919 | | |
1920 | | inline double operator * (const double& other, const Var& da) |
1921 | | /// Multiplication operator for multiplying Var with double |
1922 | 0 | { |
1923 | 0 | return other * da.convert<double>(); |
1924 | 0 | } |
1925 | | |
1926 | | |
1927 | | inline double operator / (const double& other, const Var& da) |
1928 | | /// Division operator for dividing Var with double |
1929 | 0 | { |
1930 | 0 | return other / da.convert<double>(); |
1931 | 0 | } |
1932 | | |
1933 | | |
1934 | | inline double operator += (double& other, const Var& da) |
1935 | | /// Addition assignment operator for adding Var to double |
1936 | 0 | { |
1937 | 0 | return other += da.convert<double>(); |
1938 | 0 | } |
1939 | | |
1940 | | |
1941 | | inline double operator -= (double& other, const Var& da) |
1942 | | /// Subtraction assignment operator for subtracting Var from double |
1943 | 0 | { |
1944 | 0 | return other -= da.convert<double>(); |
1945 | 0 | } |
1946 | | |
1947 | | |
1948 | | inline double operator *= (double& other, const Var& da) |
1949 | | /// Multiplication assignment operator for multiplying Var with double |
1950 | 0 | { |
1951 | 0 | return other *= da.convert<double>(); |
1952 | 0 | } |
1953 | | |
1954 | | |
1955 | | inline double operator /= (double& other, const Var& da) |
1956 | | /// Division assignment operator for dividing Var with double |
1957 | 0 | { |
1958 | 0 | return other /= da.convert<double>(); |
1959 | 0 | } |
1960 | | |
1961 | | |
1962 | | inline bool operator == (const double& other, const Var& da) |
1963 | | /// Equality operator for comparing Var with double |
1964 | 0 | { |
1965 | 0 | if (da.isEmpty()) return false; |
1966 | 0 | return other == da.convert<double>(); |
1967 | 0 | } |
1968 | | |
1969 | | |
1970 | | inline bool operator != (const double& other, const Var& da) |
1971 | | /// Inequality operator for comparing Var with double |
1972 | 0 | { |
1973 | 0 | if (da.isEmpty()) return true; |
1974 | 0 | return other != da.convert<double>(); |
1975 | 0 | } |
1976 | | |
1977 | | |
1978 | | inline bool operator < (const double& other, const Var& da) |
1979 | | /// Less than operator for comparing Var with double |
1980 | 0 | { |
1981 | 0 | if (da.isEmpty()) return false; |
1982 | 0 | return other < da.convert<double>(); |
1983 | 0 | } |
1984 | | |
1985 | | |
1986 | | inline bool operator <= (const double& other, const Var& da) |
1987 | | /// Less than or equal operator for comparing Var with double |
1988 | 0 | { |
1989 | 0 | if (da.isEmpty()) return false; |
1990 | 0 | return other <= da.convert<double>(); |
1991 | 0 | } |
1992 | | |
1993 | | |
1994 | | inline bool operator > (const double& other, const Var& da) |
1995 | | /// Greater than operator for comparing Var with double |
1996 | 0 | { |
1997 | 0 | if (da.isEmpty()) return false; |
1998 | 0 | return other > da.convert<double>(); |
1999 | 0 | } |
2000 | | |
2001 | | |
2002 | | inline bool operator >= (const double& other, const Var& da) |
2003 | | /// Greater than or equal operator for comparing Var with double |
2004 | 0 | { |
2005 | 0 | if (da.isEmpty()) return false; |
2006 | 0 | return other >= da.convert<double>(); |
2007 | 0 | } |
2008 | | |
2009 | | |
2010 | | inline bool operator == (const bool& other, const Var& da) |
2011 | | /// Equality operator for comparing Var with bool |
2012 | 0 | { |
2013 | 0 | if (da.isEmpty()) return false; |
2014 | 0 | return other == da.convert<bool>(); |
2015 | 0 | } |
2016 | | |
2017 | | |
2018 | | inline bool operator != (const bool& other, const Var& da) |
2019 | | /// Inequality operator for comparing Var with bool |
2020 | 0 | { |
2021 | 0 | if (da.isEmpty()) return true; |
2022 | 0 | return other != da.convert<bool>(); |
2023 | 0 | } |
2024 | | |
2025 | | |
2026 | | inline bool operator == (const std::string& other, const Var& da) |
2027 | | /// Equality operator for comparing Var with std::string |
2028 | 0 | { |
2029 | 0 | if (da.isEmpty()) return false; |
2030 | 0 | return other == da.convert<std::string>(); |
2031 | 0 | } |
2032 | | |
2033 | | |
2034 | | inline bool operator != (const std::string& other, const Var& da) |
2035 | | /// Inequality operator for comparing Var with std::string |
2036 | 0 | { |
2037 | 0 | if (da.isEmpty()) return true; |
2038 | 0 | return other != da.convert<std::string>(); |
2039 | 0 | } |
2040 | | |
2041 | | |
2042 | | inline bool operator == (const UTF16String& other, const Var& da) |
2043 | | /// Equality operator for comparing Var with UTF16String |
2044 | 0 | { |
2045 | 0 | if (da.isEmpty()) return false; |
2046 | 0 | return other == da.convert<UTF16String>(); |
2047 | 0 | } |
2048 | | |
2049 | | |
2050 | | inline bool operator != (const UTF16String& other, const Var& da) |
2051 | | /// Inequality operator for comparing Var with UTF16String |
2052 | 0 | { |
2053 | 0 | if (da.isEmpty()) return true; |
2054 | 0 | return other != da.convert<UTF16String>(); |
2055 | 0 | } |
2056 | | |
2057 | | |
2058 | | inline bool operator == (const char* other, const Var& da) |
2059 | | /// Equality operator for comparing Var with const char* |
2060 | 0 | { |
2061 | 0 | if (da.isEmpty()) return false; |
2062 | 0 | return da.convert<std::string>() == other; |
2063 | 0 | } |
2064 | | |
2065 | | |
2066 | | inline bool operator != (const char* other, const Var& da) |
2067 | | /// Inequality operator for comparing Var with const char* |
2068 | 0 | { |
2069 | 0 | if (da.isEmpty()) return true; |
2070 | 0 | return da.convert<std::string>() != other; |
2071 | 0 | } |
2072 | | |
2073 | | |
2074 | | #ifndef POCO_INT64_IS_LONG |
2075 | | |
2076 | | |
2077 | | inline long operator + (const long& other, const Var& da) |
2078 | | /// Addition operator for adding Var to long |
2079 | | { |
2080 | | return other + da.convert<long>(); |
2081 | | } |
2082 | | |
2083 | | |
2084 | | inline long operator - (const long& other, const Var& da) |
2085 | | /// Subtraction operator for subtracting Var from long |
2086 | | { |
2087 | | return other - da.convert<long>(); |
2088 | | } |
2089 | | |
2090 | | |
2091 | | inline long operator * (const long& other, const Var& da) |
2092 | | /// Multiplication operator for multiplying Var with long |
2093 | | { |
2094 | | return other * da.convert<long>(); |
2095 | | } |
2096 | | |
2097 | | |
2098 | | inline long operator / (const long& other, const Var& da) |
2099 | | /// Division operator for dividing Var with long |
2100 | | { |
2101 | | return other / da.convert<long>(); |
2102 | | } |
2103 | | |
2104 | | |
2105 | | inline long operator += (long& other, const Var& da) |
2106 | | /// Addition assignment operator for adding Var to long |
2107 | | { |
2108 | | return other += da.convert<long>(); |
2109 | | } |
2110 | | |
2111 | | |
2112 | | inline long operator -= (long& other, const Var& da) |
2113 | | /// Subtraction assignment operator for subtracting Var from long |
2114 | | { |
2115 | | return other -= da.convert<long>(); |
2116 | | } |
2117 | | |
2118 | | |
2119 | | inline long operator *= (long& other, const Var& da) |
2120 | | /// Multiplication assignment operator for multiplying Var with long |
2121 | | { |
2122 | | return other *= da.convert<long>(); |
2123 | | } |
2124 | | |
2125 | | |
2126 | | inline long operator /= (long& other, const Var& da) |
2127 | | /// Division assignment operator for dividing Var with long |
2128 | | { |
2129 | | return other /= da.convert<long>(); |
2130 | | } |
2131 | | |
2132 | | |
2133 | | inline bool operator == (const long& other, const Var& da) |
2134 | | /// Equality operator for comparing Var with long |
2135 | | { |
2136 | | if (da.isEmpty()) return false; |
2137 | | return other == da.convert<long>(); |
2138 | | } |
2139 | | |
2140 | | |
2141 | | inline bool operator != (const long& other, const Var& da) |
2142 | | /// Inequality operator for comparing Var with long |
2143 | | { |
2144 | | if (da.isEmpty()) return true; |
2145 | | return other != da.convert<long>(); |
2146 | | } |
2147 | | |
2148 | | |
2149 | | inline bool operator < (const long& other, const Var& da) |
2150 | | /// Less than operator for comparing Var with long |
2151 | | { |
2152 | | if (da.isEmpty()) return false; |
2153 | | return other < da.convert<long>(); |
2154 | | } |
2155 | | |
2156 | | |
2157 | | inline bool operator <= (const long& other, const Var& da) |
2158 | | /// Less than or equal operator for comparing Var with long |
2159 | | { |
2160 | | if (da.isEmpty()) return false; |
2161 | | return other <= da.convert<long>(); |
2162 | | } |
2163 | | |
2164 | | |
2165 | | inline bool operator > (const long& other, const Var& da) |
2166 | | /// Greater than operator for comparing Var with long |
2167 | | { |
2168 | | if (da.isEmpty()) return false; |
2169 | | return other > da.convert<long>(); |
2170 | | } |
2171 | | |
2172 | | |
2173 | | inline bool operator >= (const long& other, const Var& da) |
2174 | | /// Greater than or equal operator for comparing Var with long |
2175 | | { |
2176 | | if (da.isEmpty()) return false; |
2177 | | return other >= da.convert<long>(); |
2178 | | } |
2179 | | |
2180 | | |
2181 | | inline unsigned long operator + (const unsigned long& other, const Var& da) |
2182 | | /// Addition operator for adding Var to unsigned long |
2183 | | { |
2184 | | return other + da.convert<unsigned long>(); |
2185 | | } |
2186 | | |
2187 | | |
2188 | | inline unsigned long operator - (const unsigned long& other, const Var& da) |
2189 | | /// Subtraction operator for subtracting Var from unsigned long |
2190 | | { |
2191 | | return other - da.convert<unsigned long>(); |
2192 | | } |
2193 | | |
2194 | | |
2195 | | inline unsigned long operator * (const unsigned long& other, const Var& da) |
2196 | | /// Multiplication operator for multiplying Var with unsigned long |
2197 | | { |
2198 | | return other * da.convert<unsigned long>(); |
2199 | | } |
2200 | | |
2201 | | |
2202 | | inline unsigned long operator / (const unsigned long& other, const Var& da) |
2203 | | /// Division operator for dividing Var with unsigned long |
2204 | | { |
2205 | | return other / da.convert<unsigned long>(); |
2206 | | } |
2207 | | |
2208 | | |
2209 | | inline unsigned long operator += (unsigned long& other, const Var& da) |
2210 | | /// Addition assignment operator for adding Var to unsigned long |
2211 | | { |
2212 | | return other += da.convert<unsigned long>(); |
2213 | | } |
2214 | | |
2215 | | |
2216 | | inline unsigned long operator -= (unsigned long& other, const Var& da) |
2217 | | /// Subtraction assignment operator for subtracting Var from unsigned long |
2218 | | { |
2219 | | return other -= da.convert<unsigned long>(); |
2220 | | } |
2221 | | |
2222 | | |
2223 | | inline unsigned long operator *= (unsigned long& other, const Var& da) |
2224 | | /// Multiplication assignment operator for multiplying Var with unsigned long |
2225 | | { |
2226 | | return other *= da.convert<unsigned long>(); |
2227 | | } |
2228 | | |
2229 | | |
2230 | | inline unsigned long operator /= (unsigned long& other, const Var& da) |
2231 | | /// Division assignment operator for dividing Var with unsigned long |
2232 | | { |
2233 | | return other /= da.convert<unsigned long>(); |
2234 | | } |
2235 | | |
2236 | | |
2237 | | inline bool operator == (const unsigned long& other, const Var& da) |
2238 | | /// Equality operator for comparing Var with unsigned long |
2239 | | { |
2240 | | if (da.isEmpty()) return false; |
2241 | | return other == da.convert<unsigned long>(); |
2242 | | } |
2243 | | |
2244 | | |
2245 | | inline bool operator != (const unsigned long& other, const Var& da) |
2246 | | /// Inequality operator for comparing Var with unsigned long |
2247 | | { |
2248 | | if (da.isEmpty()) return true; |
2249 | | return other != da.convert<unsigned long>(); |
2250 | | } |
2251 | | |
2252 | | |
2253 | | inline bool operator < (const unsigned long& other, const Var& da) |
2254 | | /// Less than operator for comparing Var with unsigned long |
2255 | | { |
2256 | | if (da.isEmpty()) return false; |
2257 | | return other < da.convert<unsigned long>(); |
2258 | | } |
2259 | | |
2260 | | |
2261 | | inline bool operator <= (const unsigned long& other, const Var& da) |
2262 | | /// Less than or equal operator for comparing Var with unsigned long |
2263 | | { |
2264 | | if (da.isEmpty()) return false; |
2265 | | return other <= da.convert<unsigned long>(); |
2266 | | } |
2267 | | |
2268 | | |
2269 | | inline bool operator > (const unsigned long& other, const Var& da) |
2270 | | /// Greater than operator for comparing Var with unsigned long |
2271 | | { |
2272 | | if (da.isEmpty()) return false; |
2273 | | return other > da.convert<unsigned long>(); |
2274 | | } |
2275 | | |
2276 | | |
2277 | | inline bool operator >= (const unsigned long& other, const Var& da) |
2278 | | /// Greater than or equal operator for comparing Var with unsigned long |
2279 | | { |
2280 | | if (da.isEmpty()) return false; |
2281 | | return other >= da.convert<unsigned long>(); |
2282 | | } |
2283 | | |
2284 | | |
2285 | | #endif // POCO_INT64_IS_LONG |
2286 | | |
2287 | | |
2288 | | } // namespace Dynamic |
2289 | | |
2290 | | |
2291 | | using DynamicAny POCO_DEPRECATED("") = Dynamic::Var; |
2292 | | |
2293 | | |
2294 | | } // namespace Poco |
2295 | | |
2296 | | |
2297 | | #endif // Foundation_Var_INCLUDED |