/src/poco/Foundation/include/Poco/Dynamic/Var.h
Line | Count | Source |
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/Types.h" |
25 | | #include "Poco/OrderedMap.h" |
26 | | #include "Poco/OrderedSet.h" |
27 | | #include "Poco/Dynamic/VarHolder.h" |
28 | | #include "Poco/Dynamic/VarIterator.h" |
29 | | #include <typeinfo> |
30 | | #include <map> |
31 | | #include <set> |
32 | | |
33 | | |
34 | | namespace Poco::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 | 11.9M | { |
95 | 11.9M | construct(val); |
96 | 11.9M | } 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 | 3.00M | { | 95 | 3.00M | construct(val); | 96 | 3.00M | } |
Poco::Dynamic::Var::Var<long>(long const&) Line | Count | Source | 94 | 4.47M | { | 95 | 4.47M | construct(val); | 96 | 4.47M | } |
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.57M | { | 95 | 1.57M | construct(val); | 96 | 1.57M | } |
Poco::Dynamic::Var::Var<int>(int const&) Line | Count | Source | 94 | 73.3k | { | 95 | 73.3k | construct(val); | 96 | 73.3k | } |
Poco::Dynamic::Var::Var<bool>(bool const&) Line | Count | Source | 94 | 58.0k | { | 95 | 58.0k | construct(val); | 96 | 58.0k | } |
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 | 1.26M | { | 95 | 1.26M | construct(val); | 96 | 1.26M | } |
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&) Line | Count | Source | 94 | 534 | { | 95 | 534 | construct(val); | 96 | 534 | } |
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&) Line | Count | Source | 94 | 1.06k | { | 95 | 1.06k | construct(val); | 96 | 1.06k | } |
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> > >, unsigned int>, 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> > > >, unsigned int> > >(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> > >, unsigned int>, 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> > > >, unsigned int> > const&) Line | Count | Source | 94 | 144 | { | 95 | 144 | construct(val); | 96 | 144 | } |
Unexecuted instantiation: Poco::Dynamic::Var::Var<unsigned int>(unsigned int const&) Poco::Dynamic::Var::Var<unsigned long>(unsigned long const&) Line | Count | Source | 94 | 40.2k | { | 95 | 40.2k | construct(val); | 96 | 40.2k | } |
Poco::Dynamic::Var::Var<double>(double const&) Line | Count | Source | 94 | 1.46M | { | 95 | 1.46M | construct(val); | 96 | 1.46M | } |
|
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 | | [[nodiscard]] ConstIterator begin() const; |
111 | | /// Returns the const Var iterator. |
112 | | |
113 | | [[nodiscard]] ConstIterator end() const; |
114 | | /// Returns the const Var iterator. |
115 | | |
116 | | [[nodiscard]] Iterator begin(); |
117 | | /// Returns the Var iterator. |
118 | | |
119 | | [[nodiscard]] 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 | | [[nodiscard]] 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 | 4.93M | { |
159 | 4.93M | VarHolder* pHolder = content(); |
160 | | |
161 | 4.93M | if (!pHolder) |
162 | 882 | throw InvalidAccessException("Can not convert empty value."); |
163 | | |
164 | 4.93M | if (typeid(T) == pHolder->type()) return extract<T>(); |
165 | | |
166 | 2.07M | T result; |
167 | 2.07M | pHolder->convert(result); |
168 | 2.07M | return result; |
169 | 4.93M | } 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 | 4.78M | { | 159 | 4.78M | VarHolder* pHolder = content(); | 160 | | | 161 | 4.78M | if (!pHolder) | 162 | 597 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 4.78M | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 1.93M | T result; | 167 | 1.93M | pHolder->convert(result); | 168 | 1.93M | return result; | 169 | 4.78M | } |
bool Poco::Dynamic::Var::convert<bool>() const Line | Count | Source | 158 | 14.3k | { | 159 | 14.3k | VarHolder* pHolder = content(); | 160 | | | 161 | 14.3k | if (!pHolder) | 162 | 30 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 14.3k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 14.1k | T result; | 167 | 14.1k | pHolder->convert(result); | 168 | 14.1k | return result; | 169 | 14.3k | } |
int Poco::Dynamic::Var::convert<int>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
long Poco::Dynamic::Var::convert<long>() const Line | Count | Source | 158 | 22.3k | { | 159 | 22.3k | VarHolder* pHolder = content(); | 160 | | | 161 | 22.3k | if (!pHolder) | 162 | 30 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 22.2k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 11.3k | T result; | 167 | 11.3k | pHolder->convert(result); | 168 | 11.3k | return result; | 169 | 22.2k | } |
unsigned long Poco::Dynamic::Var::convert<unsigned long>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.47k | T result; | 167 | 7.47k | pHolder->convert(result); | 168 | 7.47k | return result; | 169 | 7.50k | } |
double Poco::Dynamic::Var::convert<double>() const Line | Count | Source | 158 | 14.3k | { | 159 | 14.3k | VarHolder* pHolder = content(); | 160 | | | 161 | 14.3k | if (!pHolder) | 162 | 30 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 14.3k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 13.4k | T result; | 167 | 13.4k | pHolder->convert(result); | 168 | 13.4k | return result; | 169 | 14.3k | } |
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 char Poco::Dynamic::Var::convert<char>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
signed char Poco::Dynamic::Var::convert<signed char>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
unsigned char Poco::Dynamic::Var::convert<unsigned char>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
short Poco::Dynamic::Var::convert<short>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
unsigned short Poco::Dynamic::Var::convert<unsigned short>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
unsigned int Poco::Dynamic::Var::convert<unsigned int>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
long long Poco::Dynamic::Var::convert<long long>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
unsigned long long Poco::Dynamic::Var::convert<unsigned long long>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
float Poco::Dynamic::Var::convert<float>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
Poco::Timestamp Poco::Dynamic::Var::convert<Poco::Timestamp>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
Poco::UUID Poco::Dynamic::Var::convert<Poco::UUID>() const Line | Count | Source | 158 | 7.51k | { | 159 | 7.51k | VarHolder* pHolder = content(); | 160 | | | 161 | 7.51k | if (!pHolder) | 162 | 15 | throw InvalidAccessException("Can not convert empty value."); | 163 | | | 164 | 7.50k | if (typeid(T) == pHolder->type()) return extract<T>(); | 165 | | | 166 | 7.50k | T result; | 167 | 7.50k | pHolder->convert(result); | 168 | 7.50k | return result; | 169 | 7.50k | } |
|
170 | | |
171 | | template <typename T> |
172 | | [[nodiscard]] 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 | | [[nodiscard]] 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 | 11.6M | { |
207 | 11.6M | VarHolder* pHolder = content(); |
208 | | |
209 | 11.6M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) |
210 | 11.6M | { |
211 | 11.6M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); |
212 | 11.6M | return pHolderImpl->value(); |
213 | 11.6M | } |
214 | | |
215 | 60 | if (!pHolder) |
216 | 0 | throw InvalidAccessException("Can not extract empty value."); |
217 | 60 | else |
218 | 60 | throw BadCastException(Poco::format("Can not convert %s to %s.", |
219 | 60 | Poco::demangle(pHolder->type().name()), |
220 | 60 | Poco::demangle<T>())); |
221 | 60 | } 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 | 1.72M | { | 207 | 1.72M | VarHolder* pHolder = content(); | 208 | | | 209 | 1.72M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 1.72M | { | 211 | 1.72M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 1.72M | return pHolderImpl->value(); | 213 | 1.72M | } | 214 | | | 215 | 60 | if (!pHolder) | 216 | 0 | throw InvalidAccessException("Can not extract empty value."); | 217 | 60 | else | 218 | 60 | throw BadCastException(Poco::format("Can not convert %s to %s.", | 219 | 60 | Poco::demangle(pHolder->type().name()), | 220 | 60 | Poco::demangle<T>())); | 221 | 60 | } |
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 | 3.02M | { | 207 | 3.02M | VarHolder* pHolder = content(); | 208 | | | 209 | 3.02M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 3.02M | { | 211 | 3.02M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 3.02M | return pHolderImpl->value(); | 213 | 3.02M | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
bool const& Poco::Dynamic::Var::extract<bool>() const Line | Count | Source | 206 | 20.7k | { | 207 | 20.7k | VarHolder* pHolder = content(); | 208 | | | 209 | 20.7k | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 20.7k | { | 211 | 20.7k | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 20.7k | return pHolderImpl->value(); | 213 | 20.7k | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
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 long const& Poco::Dynamic::Var::extract<long>() const Line | Count | Source | 206 | 10.8k | { | 207 | 10.8k | VarHolder* pHolder = content(); | 208 | | | 209 | 10.8k | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 10.8k | { | 211 | 10.8k | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 10.8k | return pHolderImpl->value(); | 213 | 10.8k | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
unsigned long const& Poco::Dynamic::Var::extract<unsigned long>() const Line | Count | Source | 206 | 29 | { | 207 | 29 | VarHolder* pHolder = content(); | 208 | | | 209 | 29 | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 29 | { | 211 | 29 | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 29 | return pHolderImpl->value(); | 213 | 29 | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
Unexecuted instantiation: float const& Poco::Dynamic::Var::extract<float>() const double const& Poco::Dynamic::Var::extract<double>() const Line | Count | Source | 206 | 938 | { | 207 | 938 | VarHolder* pHolder = content(); | 208 | | | 209 | 938 | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 938 | { | 211 | 938 | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 938 | return pHolderImpl->value(); | 213 | 938 | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
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 | 6.86M | { | 207 | 6.86M | VarHolder* pHolder = content(); | 208 | | | 209 | 6.86M | if ( (pHolder != nullptr) && pHolder->type() == typeid(T)) | 210 | 6.86M | { | 211 | 6.86M | auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder); | 212 | 6.86M | return pHolderImpl->value(); | 213 | 6.86M | } | 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 | Poco::demangle(pHolder->type().name()), | 220 | 0 | Poco::demangle<T>())); | 221 | 0 | } |
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 Unexecuted instantiation: long long const& Poco::Dynamic::Var::extract<long long>() const Unexecuted instantiation: unsigned long long const& Poco::Dynamic::Var::extract<unsigned long long>() const Unexecuted instantiation: Poco::Timestamp const& Poco::Dynamic::Var::extract<Poco::Timestamp>() const Unexecuted instantiation: Poco::UUID const& Poco::Dynamic::Var::extract<Poco::UUID>() const |
222 | | |
223 | | template <typename T> |
224 | | Var& operator = (const T& other) |
225 | | /// Assignment operator for assigning POD to Var |
226 | 221k | { |
227 | 221k | clear(); |
228 | 221k | construct(other); |
229 | 221k | return *this; |
230 | 221k | } 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 | 133k | { | 227 | 133k | clear(); | 228 | 133k | construct(other); | 229 | 133k | return *this; | 230 | 133k | } |
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 | 87.7k | { | 227 | 87.7k | clear(); | 228 | 87.7k | construct(other); | 229 | 87.7k | return *this; | 230 | 87.7k | } |
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 | | [[nodiscard]] 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 | | [[nodiscard]] bool operator == (const T& other) const |
338 | | /// Equality operator |
339 | | { |
340 | | if (isEmpty()) return false; |
341 | | return convert<T>() == other; |
342 | | } |
343 | | |
344 | | [[nodiscard]] bool operator == (const char* other) const; |
345 | | /// Equality operator overload for const char* |
346 | | |
347 | | [[nodiscard]] bool operator == (const Var& other) const; |
348 | | /// Equality operator overload for Var |
349 | | |
350 | | template <typename T> |
351 | | [[nodiscard]] bool operator != (const T& other) const |
352 | | /// Inequality operator |
353 | | { |
354 | | if (isEmpty()) return true; |
355 | | return convert<T>() != other; |
356 | | } |
357 | | |
358 | | [[nodiscard]] bool operator != (const Var& other) const; |
359 | | /// Inequality operator overload for Var |
360 | | |
361 | | [[nodiscard]] bool operator != (const char* other) const; |
362 | | /// Inequality operator overload for const char* |
363 | | |
364 | | template <typename T> |
365 | | [[nodiscard]] bool operator < (const T& other) const |
366 | | /// Less than operator |
367 | | { |
368 | | if (isEmpty()) return false; |
369 | | return convert<T>() < other; |
370 | | } |
371 | | |
372 | | [[nodiscard]] bool operator < (const Var& other) const; |
373 | | /// Less than operator overload for Var |
374 | | |
375 | | template <typename T> |
376 | | [[nodiscard]] 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 | | [[nodiscard]] bool operator <= (const Var& other) const; |
384 | | /// Less than or equal operator overload for Var |
385 | | |
386 | | template <typename T> |
387 | | [[nodiscard]] bool operator > (const T& other) const |
388 | | /// Greater than operator |
389 | | { |
390 | | if (isEmpty()) return false; |
391 | | return convert<T>() > other; |
392 | | } |
393 | | |
394 | | [[nodiscard]] bool operator > (const Var& other) const; |
395 | | /// Greater than operator overload for Var |
396 | | |
397 | | template <typename T> |
398 | | [[nodiscard]] 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 | | [[nodiscard]] bool operator >= (const Var& other) const; |
406 | | /// Greater than or equal operator overload for Var |
407 | | |
408 | | template <typename T> |
409 | | [[nodiscard]] bool operator || (const T& other) const |
410 | | /// Logical OR operator |
411 | | { |
412 | | if (isEmpty()) return false; |
413 | | return convert<bool>() || other; |
414 | | } |
415 | | |
416 | | [[nodiscard]] bool operator || (const Var& other) const; |
417 | | /// Logical OR operator operator overload for Var |
418 | | |
419 | | template <typename T> |
420 | | [[nodiscard]] bool operator && (const T& other) const |
421 | | /// Logical AND operator. |
422 | | { |
423 | | if (isEmpty()) return false; |
424 | | return convert<bool>() && other; |
425 | | } |
426 | | |
427 | | [[nodiscard]] bool operator && (const Var& other) const; |
428 | | /// Logical AND operator operator overload for Var. |
429 | | |
430 | | [[nodiscard]] bool isArray() const; |
431 | | /// Returns true if Var is an array. |
432 | | |
433 | | [[nodiscard]] bool isVector() const; |
434 | | /// Returns true if Var represents a vector. |
435 | | |
436 | | [[nodiscard]] bool isList() const; |
437 | | /// Returns true if Var represents a list. |
438 | | |
439 | | [[nodiscard]] bool isDeque() const; |
440 | | /// Returns true if Var represents a deque. |
441 | | |
442 | | [[nodiscard]] bool isStruct() const; |
443 | | /// Returns true if Var represents a struct. |
444 | | |
445 | | [[nodiscard]] bool isOrdered() const; |
446 | | /// Returns true if Var represents an ordered struct, |
447 | | /// false if struct is sorted. |
448 | | |
449 | | [[nodiscard]] 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 | | [[nodiscard]] Var& operator [] (const T& n) |
456 | | { |
457 | | return getAt(n); |
458 | | } |
459 | | |
460 | | template <typename T> |
461 | | [[nodiscard]] const Var& operator [] (const T& n) const |
462 | | { |
463 | | return const_cast<Var*>(this)->getAt(n); |
464 | | } |
465 | | |
466 | | [[nodiscard]] 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 | | [[nodiscard]] 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 | | [[nodiscard]] const std::type_info& type() const; |
475 | | /// Returns the type information of the stored content. |
476 | | |
477 | | [[nodiscard]] 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 | | /// Please use clear(). |
486 | | |
487 | | void clear(); |
488 | | /// Empties Var. |
489 | | |
490 | | [[nodiscard]] bool isEmpty() const; |
491 | | /// Returns true if empty. |
492 | | |
493 | | [[nodiscard]] bool isInteger() const; |
494 | | /// Returns true if stored value is integer. |
495 | | |
496 | | [[nodiscard]] bool isSigned() const; |
497 | | /// Returns true if stored value is signed. |
498 | | |
499 | | [[nodiscard]] bool isNumeric() const; |
500 | | /// Returns true if stored value is numeric. |
501 | | /// Returns false for numeric strings (e.g. "123" is string, not number) |
502 | | |
503 | | [[nodiscard]] bool isBoolean() const; |
504 | | /// Returns true if stored value is boolean. |
505 | | /// Returns false for boolean strings (e.g. "true" is string, not number) |
506 | | |
507 | | [[nodiscard]] bool isString() const; |
508 | | /// Returns true if stored value is std::string. |
509 | | |
510 | | [[nodiscard]] bool isDate() const; |
511 | | /// Returns true if stored value represents a date. |
512 | | |
513 | | [[nodiscard]] bool isTime() const; |
514 | | /// Returns true if stored value represents time or date/time. |
515 | | |
516 | | [[nodiscard]] bool isDateTime() const; |
517 | | /// Returns true if stored value represents a date/time. |
518 | | |
519 | | [[nodiscard]] bool isUUID() const; |
520 | | /// Returns true if stored value is a Poco::UUID. |
521 | | |
522 | | [[nodiscard]] std::size_t size() const; |
523 | | /// Returns the size of this Var. |
524 | | /// This function returns 0 when Var is empty, 1 for POD or the size (i.e. length) |
525 | | /// for held container. |
526 | | |
527 | | [[nodiscard]] std::string toString() const; |
528 | | /// Returns the stored value as string. |
529 | | |
530 | | [[nodiscard]] static Var parse(const std::string& val); |
531 | | /// Parses the string which must be in JSON format. |
532 | | /// Throws a DataFormatException if a separator or a closing bracket is missing, |
533 | | /// or if objects and arrays are nested deeper than 128 levels. |
534 | | |
535 | | [[nodiscard]] static std::string toString(const Var& var); |
536 | | /// Converts the Var to a string in JSON format. Note that toString(const Var&) will return |
537 | | /// a different result than Var::convert<std::string>() and Var::toString()! |
538 | | |
539 | | private: |
540 | | static constexpr std::size_t MAX_PARSE_DEPTH = 128; |
541 | | /// Bounds the recursion of parse() so that nested input cannot exhaust the stack. |
542 | | |
543 | | [[nodiscard]] Var& getAt(std::size_t n); |
544 | | [[nodiscard]] Var& getAt(const std::string& n); |
545 | | |
546 | | [[nodiscard]] static Var parse(const std::string& val, std::string::size_type& pos, std::size_t depth); |
547 | | /// Parses the string which must be in JSON format. |
548 | | /// The depth is the number of objects and arrays that enclose the value. |
549 | | |
550 | | [[nodiscard]] static Var parseObject(const std::string& val, std::string::size_type& pos, std::size_t depth); |
551 | | [[nodiscard]] static Var parseArray(const std::string& val, std::string::size_type& pos, std::size_t depth); |
552 | | [[nodiscard]] static std::string parseString(const std::string& val, std::string::size_type& pos); |
553 | | [[nodiscard]] static std::string parseJSONString(const std::string& val, std::string::size_type& pos); |
554 | | static void skipWhiteSpace(const std::string& val, std::string::size_type& pos); |
555 | | |
556 | | template <typename T> |
557 | | [[nodiscard]] T add(const Var& other) const |
558 | 0 | { |
559 | 0 | return convert<T>() + other.convert<T>(); |
560 | 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 |
561 | | |
562 | | template <typename T> |
563 | | [[nodiscard]] T subtract(const Var& other) const |
564 | 0 | { |
565 | 0 | return convert<T>() - other.convert<T>(); |
566 | 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 |
567 | | |
568 | | template <typename T> |
569 | | [[nodiscard]] T multiply(const Var& other) const |
570 | 0 | { |
571 | 0 | return convert<T>() * other.convert<T>(); |
572 | 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 |
573 | | |
574 | | template <typename T> |
575 | | [[nodiscard]] T divide(const Var& other) const |
576 | 0 | { |
577 | 0 | return convert<T>() / other.convert<T>(); |
578 | 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 |
579 | | |
580 | | template <typename T, typename E> |
581 | | [[nodiscard]] VarHolderImpl<T>* holderImpl(const std::string errorMessage = "") const |
582 | 0 | { |
583 | 0 | VarHolder* pHolder = content(); |
584 | |
|
585 | 0 | if (pHolder && pHolder->type() == typeid(T)) |
586 | 0 | return static_cast<VarHolderImpl<T>*>(pHolder); |
587 | | |
588 | 0 | if (pHolder == nullptr) |
589 | 0 | throw InvalidAccessException("Can not access empty value."); |
590 | 0 | else |
591 | 0 | throw E(errorMessage); |
592 | 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> > >, unsigned int>, 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> >, unsigned 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> > >, unsigned int>, 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> >, unsigned 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> > >, unsigned int>, 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> > > >, unsigned int> > >* 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> > >, unsigned int>, 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> > > >, unsigned 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<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 |
593 | | |
594 | | template <typename T, typename N> |
595 | | [[nodiscard]] Var& structIndexOperator(T* pStr, N n) const |
596 | 0 | { |
597 | 0 | return pStr->operator[](n); |
598 | 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> > >, unsigned int>, 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> >, unsigned 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> > >, unsigned int>, 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> >, unsigned 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> > >, unsigned int>, 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> > > >, unsigned int> > >, 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> > >, unsigned int>, 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> > > >, unsigned int> > >*, 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 |
599 | | |
600 | | [[nodiscard]] VarHolder* content() const |
601 | 147M | { |
602 | 147M | return _placeholder.content(); |
603 | 147M | } |
604 | | |
605 | | void destruct() |
606 | 42.6M | { |
607 | 42.6M | } |
608 | | |
609 | | template<typename ValueType> |
610 | | void construct(const ValueType& value) |
611 | 12.2M | { |
612 | 12.2M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); |
613 | 12.2M | } 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 | 611 | 3.10M | { | 612 | 3.10M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 3.10M | } |
void Poco::Dynamic::Var::construct<int>(int const&) Line | Count | Source | 611 | 73.3k | { | 612 | 73.3k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 73.3k | } |
Unexecuted instantiation: void Poco::Dynamic::Var::construct<unsigned int>(unsigned int const&) void Poco::Dynamic::Var::construct<long>(long const&) Line | Count | Source | 611 | 4.47M | { | 612 | 4.47M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 4.47M | } |
void Poco::Dynamic::Var::construct<unsigned long>(unsigned long const&) Line | Count | Source | 611 | 40.2k | { | 612 | 40.2k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 40.2k | } |
void Poco::Dynamic::Var::construct<double>(double const&) Line | Count | Source | 611 | 1.46M | { | 612 | 1.46M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 1.46M | } |
void Poco::Dynamic::Var::construct<bool>(bool const&) Line | Count | Source | 611 | 58.0k | { | 612 | 58.0k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 58.0k | } |
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 | 611 | 1.70M | { | 612 | 1.70M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 1.70M | } |
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 | 611 | 1.35M | { | 612 | 1.35M | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 1.35M | } |
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&) Line | Count | Source | 611 | 534 | { | 612 | 534 | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 534 | } |
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&) Line | Count | Source | 611 | 1.06k | { | 612 | 1.06k | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 1.06k | } |
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> > >, unsigned int>, 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> > > >, unsigned int> > >(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> > >, unsigned int>, 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> > > >, unsigned int> > const&) Line | Count | Source | 611 | 144 | { | 612 | 144 | _placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value); | 613 | 144 | } |
|
614 | | |
615 | | void construct(const char* value); |
616 | | void construct(const Var& other); |
617 | | |
618 | | Placeholder<VarHolder> _placeholder; |
619 | | }; |
620 | | |
621 | | |
622 | | /// |
623 | | /// inlines |
624 | | /// |
625 | | |
626 | | |
627 | | /// |
628 | | /// Var members |
629 | | /// |
630 | | |
631 | | inline void Var::construct(const char* value) |
632 | 0 | { |
633 | 0 | const std::string val(value); |
634 | 0 | _placeholder.assign<VarHolderImpl<std::string>, std::string>(val); |
635 | 0 | } |
636 | | |
637 | | |
638 | | inline void Var::construct(const Var& other) |
639 | 30.3M | { |
640 | 30.3M | if (!other.isEmpty()) |
641 | 30.3M | (void) other.content()->clone(&_placeholder); |
642 | 30.3M | } |
643 | | |
644 | | |
645 | | inline void Var::swap(Var& other) |
646 | 0 | { |
647 | 0 | if (this == &other) return; |
648 | 0 |
|
649 | 0 | if (!_placeholder.isLocal() && !other._placeholder.isLocal()) |
650 | 0 | { |
651 | 0 | _placeholder.swap(other._placeholder); |
652 | 0 | } |
653 | 0 | else |
654 | 0 | { |
655 | 0 | const Var tmp(*this); |
656 | 0 | try |
657 | 0 | { |
658 | 0 | construct(other); |
659 | 0 | other = tmp; |
660 | 0 | } |
661 | 0 | catch (...) |
662 | 0 | { |
663 | 0 | construct(tmp); |
664 | 0 | throw; |
665 | 0 | } |
666 | 0 | } |
667 | 0 | } |
668 | | |
669 | | |
670 | | |
671 | | inline const std::type_info& Var::type() const |
672 | 26.1M | { |
673 | 26.1M | VarHolder* pHolder = content(); |
674 | 26.1M | return (pHolder != nullptr) ? pHolder->type() : typeid(void); |
675 | 26.1M | } |
676 | | |
677 | | |
678 | | inline std::string Var::typeName(bool demangle) const |
679 | 0 | { |
680 | 0 | VarHolder* pHolder = content(); |
681 | 0 | return (pHolder != nullptr) ? demangle ? Poco::demangle(pHolder->type().name()) : pHolder->type().name() : std::string(); |
682 | 0 | } |
683 | | |
684 | | |
685 | | inline Var::ConstIterator Var::begin() const |
686 | 0 | { |
687 | 0 | if (size() == 0) return {const_cast<Var*>(this), true}; |
688 | 0 |
|
689 | 0 | return {const_cast<Var*>(this), false}; |
690 | 0 | } |
691 | | |
692 | | |
693 | | inline Var::ConstIterator Var::end() const |
694 | 0 | { |
695 | 0 | return {const_cast<Var*>(this), true}; |
696 | 0 | } |
697 | | |
698 | | |
699 | | inline Var::Iterator Var::begin() |
700 | 0 | { |
701 | 0 | if (size() == 0) return {const_cast<Var*>(this), true}; |
702 | 0 |
|
703 | 0 | return {const_cast<Var*>(this), false}; |
704 | 0 | } |
705 | | |
706 | | |
707 | | inline Var::Iterator Var::end() |
708 | 0 | { |
709 | 0 | return {this, true}; |
710 | 0 | } |
711 | | |
712 | | |
713 | | inline Var& Var::operator [] (const std::string& name) |
714 | 0 | { |
715 | 0 | return getAt(name); |
716 | 0 | } |
717 | | |
718 | | |
719 | | inline const Var& Var::operator [] (const std::string& name) const |
720 | 0 | { |
721 | 0 | return const_cast<Var*>(this)->getAt(name); |
722 | 0 | } |
723 | | |
724 | | |
725 | | inline const Var Var::operator + (const char* other) const |
726 | 0 | { |
727 | 0 | return convert<std::string>() + other; |
728 | 0 | } |
729 | | |
730 | | |
731 | | inline Var& Var::operator += (const char*other) |
732 | 0 | { |
733 | 0 | return *this = convert<std::string>() + other; |
734 | 0 | } |
735 | | |
736 | | |
737 | | inline bool Var::operator ! () const |
738 | 0 | { |
739 | 0 | return !convert<bool>(); |
740 | 0 | } |
741 | | |
742 | | |
743 | | inline bool Var::isEmpty() const |
744 | 64.6M | { |
745 | 64.6M | return nullptr == content(); |
746 | 64.6M | } |
747 | | |
748 | | |
749 | | inline bool Var::isArray() const |
750 | 0 | { |
751 | 0 | if (isEmpty() || isString()) return false; |
752 | 0 |
|
753 | 0 | VarHolder* pHolder = content(); |
754 | 0 | return (pHolder != nullptr) ? pHolder->isArray() : false; |
755 | 0 | } |
756 | | |
757 | | |
758 | | inline bool Var::isVector() const |
759 | 0 | { |
760 | 0 | VarHolder* pHolder = content(); |
761 | 0 | return (pHolder != nullptr) ? pHolder->isVector() : false; |
762 | 0 | } |
763 | | |
764 | | |
765 | | inline bool Var::isList() const |
766 | 0 | { |
767 | 0 | VarHolder* pHolder = content(); |
768 | 0 | return (pHolder != nullptr) ? pHolder->isList() : false; |
769 | 0 | } |
770 | | |
771 | | |
772 | | inline bool Var::isDeque() const |
773 | 0 | { |
774 | 0 | VarHolder* pHolder = content(); |
775 | 0 | return (pHolder != nullptr) ? pHolder->isDeque() : false; |
776 | 0 | } |
777 | | |
778 | | |
779 | | inline bool Var::isStruct() const |
780 | 0 | { |
781 | 0 | VarHolder* pHolder = content(); |
782 | 0 | return (pHolder != nullptr) ? pHolder->isStruct() : false; |
783 | 0 | } |
784 | | |
785 | | |
786 | | inline bool Var::isOrdered() const |
787 | 0 | { |
788 | 0 | VarHolder* pHolder = content(); |
789 | 0 | return (pHolder != nullptr) ? pHolder->isOrdered() : false; |
790 | 0 | } |
791 | | |
792 | | |
793 | | inline bool Var::isInteger() const |
794 | 34.1k | { |
795 | 34.1k | VarHolder* pHolder = content(); |
796 | 34.1k | return (pHolder != nullptr) ? pHolder->isInteger() : false; |
797 | 34.1k | } |
798 | | |
799 | | |
800 | | inline bool Var::isSigned() const |
801 | 0 | { |
802 | 0 | VarHolder* pHolder = content(); |
803 | 0 | return (pHolder != nullptr) ? pHolder->isSigned() : false; |
804 | 0 | } |
805 | | |
806 | | |
807 | | inline bool Var::isNumeric() const |
808 | 3.54M | { |
809 | 3.54M | VarHolder* pHolder = content(); |
810 | 3.54M | return (pHolder != nullptr) ? pHolder->isNumeric() : false; |
811 | 3.54M | } |
812 | | |
813 | | |
814 | | inline bool Var::isBoolean() const |
815 | 2.87M | { |
816 | 2.87M | VarHolder* pHolder = content(); |
817 | 2.87M | return (pHolder != nullptr) ? pHolder->isBoolean() : false; |
818 | 2.87M | } |
819 | | |
820 | | |
821 | | inline bool Var::isString() const |
822 | 3.12M | { |
823 | 3.12M | VarHolder* pHolder = content(); |
824 | 3.12M | return (pHolder != nullptr) ? pHolder->isString() : false; |
825 | 3.12M | } |
826 | | |
827 | | |
828 | | inline bool Var::isDate() const |
829 | 0 | { |
830 | 0 | VarHolder* pHolder = content(); |
831 | 0 | return (pHolder != nullptr) ? pHolder->isDate() : false; |
832 | 0 | } |
833 | | |
834 | | |
835 | | inline bool Var::isTime() const |
836 | 0 | { |
837 | 0 | VarHolder* pHolder = content(); |
838 | 0 | return (pHolder != nullptr) ? pHolder->isTime() : false; |
839 | 0 | } |
840 | | |
841 | | |
842 | | inline bool Var::isDateTime() const |
843 | 0 | { |
844 | 0 | VarHolder* pHolder = content(); |
845 | 0 | return (pHolder != nullptr) ? pHolder->isDateTime() : false; |
846 | 0 | } |
847 | | |
848 | | |
849 | | inline bool Var::isUUID() const |
850 | 0 | { |
851 | 0 | VarHolder* pHolder = content(); |
852 | 0 | return (pHolder != nullptr) ? pHolder->isUUID() : false; |
853 | 0 | } |
854 | | |
855 | | |
856 | | inline std::size_t Var::size() const |
857 | 0 | { |
858 | 0 | VarHolder* pHolder = content(); |
859 | 0 | return (pHolder != nullptr) ? pHolder->size() : 0; |
860 | 0 | } |
861 | | |
862 | | |
863 | | /// |
864 | | /// Var non-member functions |
865 | | /// |
866 | | |
867 | | inline const Var operator + (const char* other, const Var& da) |
868 | | /// Addition operator for adding Var to const char* |
869 | 0 | { |
870 | 0 | const std::string tmp = other; |
871 | 0 | return tmp + da.convert<std::string>(); |
872 | 0 | } |
873 | | |
874 | | |
875 | | inline char operator + (const char& other, const Var& da) |
876 | | /// Addition operator for adding Var to char |
877 | 0 | { |
878 | 0 | return other + da.convert<char>(); |
879 | 0 | } |
880 | | |
881 | | |
882 | | inline char operator - (const char& other, const Var& da) |
883 | | /// Subtraction operator for subtracting Var from char |
884 | 0 | { |
885 | 0 | return other - da.convert<char>(); |
886 | 0 | } |
887 | | |
888 | | |
889 | | inline char operator * (const char& other, const Var& da) |
890 | | /// Multiplication operator for multiplying Var with char |
891 | 0 | { |
892 | 0 | return other * da.convert<char>(); |
893 | 0 | } |
894 | | |
895 | | |
896 | | inline char operator / (const char& other, const Var& da) |
897 | | /// Division operator for dividing Var with char |
898 | 0 | { |
899 | 0 | return other / da.convert<char>(); |
900 | 0 | } |
901 | | |
902 | | |
903 | | inline char operator += (char& other, const Var& da) |
904 | | /// Addition assignment operator for adding Var to char |
905 | 0 | { |
906 | 0 | return other += da.convert<char>(); |
907 | 0 | } |
908 | | |
909 | | |
910 | | inline char operator -= (char& other, const Var& da) |
911 | | /// Subtraction assignment operator for subtracting Var from char |
912 | 0 | { |
913 | 0 | return other -= da.convert<char>(); |
914 | 0 | } |
915 | | |
916 | | |
917 | | inline char operator *= (char& other, const Var& da) |
918 | | /// Multiplication assignment operator for multiplying Var with char |
919 | 0 | { |
920 | 0 | return other *= da.convert<char>(); |
921 | 0 | } |
922 | | |
923 | | |
924 | | inline char operator /= (char& other, const Var& da) |
925 | | /// Division assignment operator for dividing Var with char |
926 | 0 | { |
927 | 0 | return other /= da.convert<char>(); |
928 | 0 | } |
929 | | |
930 | | |
931 | | inline bool operator == (const char& other, const Var& da) |
932 | | /// Equality operator for comparing Var with char |
933 | 0 | { |
934 | 0 | if (da.isEmpty()) return false; |
935 | 0 | return other == da.convert<char>(); |
936 | 0 | } |
937 | | |
938 | | |
939 | | inline bool operator != (const char& other, const Var& da) |
940 | | /// Inequality operator for comparing Var with char |
941 | 0 | { |
942 | 0 | if (da.isEmpty()) return true; |
943 | 0 | return other != da.convert<char>(); |
944 | 0 | } |
945 | | |
946 | | |
947 | | inline bool operator < (const char& other, const Var& da) |
948 | | /// Less than operator for comparing Var with char |
949 | 0 | { |
950 | 0 | if (da.isEmpty()) return false; |
951 | 0 | return other < da.convert<char>(); |
952 | 0 | } |
953 | | |
954 | | |
955 | | inline bool operator <= (const char& other, const Var& da) |
956 | | /// Less than or equal operator for comparing Var with char |
957 | 0 | { |
958 | 0 | if (da.isEmpty()) return false; |
959 | 0 | return other <= da.convert<char>(); |
960 | 0 | } |
961 | | |
962 | | |
963 | | inline bool operator > (const char& other, const Var& da) |
964 | | /// Greater than operator for comparing Var with char |
965 | 0 | { |
966 | 0 | if (da.isEmpty())return false; |
967 | 0 | return other > da.convert<char>(); |
968 | 0 | } |
969 | | |
970 | | |
971 | | inline bool operator >= (const char& other, const Var& da) |
972 | | /// Greater than or equal operator for comparing Var with char |
973 | 0 | { |
974 | 0 | if (da.isEmpty())return false; |
975 | 0 | return other >= da.convert<char>(); |
976 | 0 | } |
977 | | |
978 | | |
979 | | inline Poco::Int8 operator + (const Poco::Int8& other, const Var& da) |
980 | | /// Addition operator for adding Var to Poco::Int8 |
981 | 0 | { |
982 | 0 | return other + da.convert<Poco::Int8>(); |
983 | 0 | } |
984 | | |
985 | | |
986 | | inline Poco::Int8 operator - (const Poco::Int8& other, const Var& da) |
987 | | /// Subtraction operator for subtracting Var from Poco::Int8 |
988 | 0 | { |
989 | 0 | return other - da.convert<Poco::Int8>(); |
990 | 0 | } |
991 | | |
992 | | |
993 | | inline Poco::Int8 operator * (const Poco::Int8& other, const Var& da) |
994 | | /// Multiplication operator for multiplying Var with Poco::Int8 |
995 | 0 | { |
996 | 0 | return other * da.convert<Poco::Int8>(); |
997 | 0 | } |
998 | | |
999 | | |
1000 | | inline Poco::Int8 operator / (const Poco::Int8& other, const Var& da) |
1001 | | /// Division operator for dividing Var with Poco::Int8 |
1002 | 0 | { |
1003 | 0 | return other / da.convert<Poco::Int8>(); |
1004 | 0 | } |
1005 | | |
1006 | | |
1007 | | inline Poco::Int8 operator += (Poco::Int8& other, const Var& da) |
1008 | | /// Addition assignment operator for adding Var to Poco::Int8 |
1009 | 0 | { |
1010 | 0 | return other += da.convert<Poco::Int8>(); |
1011 | 0 | } |
1012 | | |
1013 | | |
1014 | | inline Poco::Int8 operator -= (Poco::Int8& other, const Var& da) |
1015 | | /// Subtraction assignment operator for subtracting Var from Poco::Int8 |
1016 | 0 | { |
1017 | 0 | return other -= da.convert<Poco::Int8>(); |
1018 | 0 | } |
1019 | | |
1020 | | |
1021 | | inline Poco::Int8 operator *= (Poco::Int8& other, const Var& da) |
1022 | | /// Multiplication assignment operator for multiplying Var with Poco::Int8 |
1023 | 0 | { |
1024 | 0 | return other *= da.convert<Poco::Int8>(); |
1025 | 0 | } |
1026 | | |
1027 | | |
1028 | | inline Poco::Int8 operator /= (Poco::Int8& other, const Var& da) |
1029 | | /// Division assignment operator for dividing Var with Poco::Int8 |
1030 | 0 | { |
1031 | 0 | return other /= da.convert<Poco::Int8>(); |
1032 | 0 | } |
1033 | | |
1034 | | |
1035 | | inline bool operator == (const Poco::Int8& other, const Var& da) |
1036 | | /// Equality operator for comparing Var with Poco::Int8 |
1037 | 0 | { |
1038 | 0 | if (da.isEmpty()) return false; |
1039 | 0 | return other == da.convert<Poco::Int8>(); |
1040 | 0 | } |
1041 | | |
1042 | | |
1043 | | inline bool operator != (const Poco::Int8& other, const Var& da) |
1044 | | /// Inequality operator for comparing Var with Poco::Int8 |
1045 | 0 | { |
1046 | 0 | if (da.isEmpty()) return true; |
1047 | 0 | return other != da.convert<Poco::Int8>(); |
1048 | 0 | } |
1049 | | |
1050 | | |
1051 | | inline bool operator < (const Poco::Int8& other, const Var& da) |
1052 | | /// Less than operator for comparing Var with Poco::Int8 |
1053 | 0 | { |
1054 | 0 | if (da.isEmpty()) return false; |
1055 | 0 | return other < da.convert<Poco::Int8>(); |
1056 | 0 | } |
1057 | | |
1058 | | |
1059 | | inline bool operator <= (const Poco::Int8& other, const Var& da) |
1060 | | /// Less than or equal operator for comparing Var with Poco::Int8 |
1061 | 0 | { |
1062 | 0 | if (da.isEmpty()) return false; |
1063 | 0 | return other <= da.convert<Poco::Int8>(); |
1064 | 0 | } |
1065 | | |
1066 | | |
1067 | | inline bool operator > (const Poco::Int8& other, const Var& da) |
1068 | | /// Greater than operator for comparing Var with Poco::Int8 |
1069 | 0 | { |
1070 | 0 | if (da.isEmpty()) return false; |
1071 | 0 | return other > da.convert<Poco::Int8>(); |
1072 | 0 | } |
1073 | | |
1074 | | |
1075 | | inline bool operator >= (const Poco::Int8& other, const Var& da) |
1076 | | /// Greater than or equal operator for comparing Var with Poco::Int8 |
1077 | 0 | { |
1078 | 0 | if (da.isEmpty()) return false; |
1079 | 0 | return other >= da.convert<Poco::Int8>(); |
1080 | 0 | } |
1081 | | |
1082 | | |
1083 | | inline Poco::UInt8 operator + (const Poco::UInt8& other, const Var& da) |
1084 | | /// Addition operator for adding Var to Poco::UInt8 |
1085 | 0 | { |
1086 | 0 | return other + da.convert<Poco::UInt8>(); |
1087 | 0 | } |
1088 | | |
1089 | | |
1090 | | inline Poco::UInt8 operator - (const Poco::UInt8& other, const Var& da) |
1091 | | /// Subtraction operator for subtracting Var from Poco::UInt8 |
1092 | 0 | { |
1093 | 0 | return other - da.convert<Poco::UInt8>(); |
1094 | 0 | } |
1095 | | |
1096 | | |
1097 | | inline Poco::UInt8 operator * (const Poco::UInt8& other, const Var& da) |
1098 | | /// Multiplication operator for multiplying Var with Poco::UInt8 |
1099 | 0 | { |
1100 | 0 | return other * da.convert<Poco::UInt8>(); |
1101 | 0 | } |
1102 | | |
1103 | | |
1104 | | inline Poco::UInt8 operator / (const Poco::UInt8& other, const Var& da) |
1105 | | /// Division operator for dividing Var with Poco::UInt8 |
1106 | 0 | { |
1107 | 0 | return other / da.convert<Poco::UInt8>(); |
1108 | 0 | } |
1109 | | |
1110 | | |
1111 | | inline Poco::UInt8 operator += (Poco::UInt8& other, const Var& da) |
1112 | | /// Addition assignment operator for adding Var to Poco::UInt8 |
1113 | 0 | { |
1114 | 0 | return other += da.convert<Poco::UInt8>(); |
1115 | 0 | } |
1116 | | |
1117 | | |
1118 | | inline Poco::UInt8 operator -= (Poco::UInt8& other, const Var& da) |
1119 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt8 |
1120 | 0 | { |
1121 | 0 | return other -= da.convert<Poco::UInt8>(); |
1122 | 0 | } |
1123 | | |
1124 | | |
1125 | | inline Poco::UInt8 operator *= (Poco::UInt8& other, const Var& da) |
1126 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt8 |
1127 | 0 | { |
1128 | 0 | return other *= da.convert<Poco::UInt8>(); |
1129 | 0 | } |
1130 | | |
1131 | | |
1132 | | inline Poco::UInt8 operator /= (Poco::UInt8& other, const Var& da) |
1133 | | /// Division assignment operator for dividing Var with Poco::UInt8 |
1134 | 0 | { |
1135 | 0 | return other /= da.convert<Poco::UInt8>(); |
1136 | 0 | } |
1137 | | |
1138 | | |
1139 | | inline bool operator == (const Poco::UInt8& other, const Var& da) |
1140 | | /// Equality operator for comparing Var with Poco::UInt8 |
1141 | 0 | { |
1142 | 0 | if (da.isEmpty()) return false; |
1143 | 0 | return other == da.convert<Poco::UInt8>(); |
1144 | 0 | } |
1145 | | |
1146 | | |
1147 | | inline bool operator != (const Poco::UInt8& other, const Var& da) |
1148 | | /// Inequality operator for comparing Var with Poco::UInt8 |
1149 | 0 | { |
1150 | 0 | if (da.isEmpty()) return true; |
1151 | 0 | return other != da.convert<Poco::UInt8>(); |
1152 | 0 | } |
1153 | | |
1154 | | |
1155 | | inline bool operator < (const Poco::UInt8& other, const Var& da) |
1156 | | /// Less than operator for comparing Var with Poco::UInt8 |
1157 | 0 | { |
1158 | 0 | if (da.isEmpty()) return false; |
1159 | 0 | return other < da.convert<Poco::UInt8>(); |
1160 | 0 | } |
1161 | | |
1162 | | |
1163 | | inline bool operator <= (const Poco::UInt8& other, const Var& da) |
1164 | | /// Less than or equal operator for comparing Var with Poco::UInt8 |
1165 | 0 | { |
1166 | 0 | if (da.isEmpty()) return false; |
1167 | 0 | return other <= da.convert<Poco::UInt8>(); |
1168 | 0 | } |
1169 | | |
1170 | | |
1171 | | inline bool operator > (const Poco::UInt8& other, const Var& da) |
1172 | | /// Greater than operator for comparing Var with Poco::UInt8 |
1173 | 0 | { |
1174 | 0 | if (da.isEmpty()) return false; |
1175 | 0 | return other > da.convert<Poco::UInt8>(); |
1176 | 0 | } |
1177 | | |
1178 | | |
1179 | | inline bool operator >= (const Poco::UInt8& other, const Var& da) |
1180 | | /// Greater than or equal operator for comparing Var with Poco::UInt8 |
1181 | 0 | { |
1182 | 0 | if (da.isEmpty()) return false; |
1183 | 0 | return other >= da.convert<Poco::UInt8>(); |
1184 | 0 | } |
1185 | | |
1186 | | |
1187 | | inline Poco::Int16 operator + (const Poco::Int16& other, const Var& da) |
1188 | | /// Addition operator for adding Var to Poco::Int16 |
1189 | 0 | { |
1190 | 0 | return other + da.convert<Poco::Int16>(); |
1191 | 0 | } |
1192 | | |
1193 | | |
1194 | | inline Poco::Int16 operator - (const Poco::Int16& other, const Var& da) |
1195 | | /// Subtraction operator for subtracting Var from Poco::Int16 |
1196 | 0 | { |
1197 | 0 | return other - da.convert<Poco::Int16>(); |
1198 | 0 | } |
1199 | | |
1200 | | |
1201 | | inline Poco::Int16 operator * (const Poco::Int16& other, const Var& da) |
1202 | | /// Multiplication operator for multiplying Var with Poco::Int16 |
1203 | 0 | { |
1204 | 0 | return other * da.convert<Poco::Int16>(); |
1205 | 0 | } |
1206 | | |
1207 | | |
1208 | | inline Poco::Int16 operator / (const Poco::Int16& other, const Var& da) |
1209 | | /// Division operator for dividing Var with Poco::Int16 |
1210 | 0 | { |
1211 | 0 | return other / da.convert<Poco::Int16>(); |
1212 | 0 | } |
1213 | | |
1214 | | |
1215 | | inline Poco::Int16 operator += (Poco::Int16& other, const Var& da) |
1216 | | /// Addition assignment operator for adding Var to Poco::Int16 |
1217 | 0 | { |
1218 | 0 | return other += da.convert<Poco::Int16>(); |
1219 | 0 | } |
1220 | | |
1221 | | |
1222 | | inline Poco::Int16 operator -= (Poco::Int16& other, const Var& da) |
1223 | | /// Subtraction assignment operator for subtracting Var from Poco::Int16 |
1224 | 0 | { |
1225 | 0 | return other -= da.convert<Poco::Int16>(); |
1226 | 0 | } |
1227 | | |
1228 | | |
1229 | | inline Poco::Int16 operator *= (Poco::Int16& other, const Var& da) |
1230 | | /// Multiplication assignment operator for multiplying Var with Poco::Int16 |
1231 | 0 | { |
1232 | 0 | return other *= da.convert<Poco::Int16>(); |
1233 | 0 | } |
1234 | | |
1235 | | |
1236 | | inline Poco::Int16 operator /= (Poco::Int16& other, const Var& da) |
1237 | | /// Division assignment operator for dividing Var with Poco::Int16 |
1238 | 0 | { |
1239 | 0 | return other /= da.convert<Poco::Int16>(); |
1240 | 0 | } |
1241 | | |
1242 | | |
1243 | | inline bool operator == (const Poco::Int16& other, const Var& da) |
1244 | | /// Equality operator for comparing Var with Poco::Int16 |
1245 | 0 | { |
1246 | 0 | if (da.isEmpty()) return false; |
1247 | 0 | return other == da.convert<Poco::Int16>(); |
1248 | 0 | } |
1249 | | |
1250 | | |
1251 | | inline bool operator != (const Poco::Int16& other, const Var& da) |
1252 | | /// Inequality operator for comparing Var with Poco::Int16 |
1253 | 0 | { |
1254 | 0 | if (da.isEmpty()) return true; |
1255 | 0 | return other != da.convert<Poco::Int16>(); |
1256 | 0 | } |
1257 | | |
1258 | | |
1259 | | inline bool operator < (const Poco::Int16& other, const Var& da) |
1260 | | /// Less than operator for comparing Var with Poco::Int16 |
1261 | 0 | { |
1262 | 0 | if (da.isEmpty()) return false; |
1263 | 0 | return other < da.convert<Poco::Int16>(); |
1264 | 0 | } |
1265 | | |
1266 | | |
1267 | | inline bool operator <= (const Poco::Int16& other, const Var& da) |
1268 | | /// Less than or equal operator for comparing Var with Poco::Int16 |
1269 | 0 | { |
1270 | 0 | if (da.isEmpty()) return false; |
1271 | 0 | return other <= da.convert<Poco::Int16>(); |
1272 | 0 | } |
1273 | | |
1274 | | |
1275 | | inline bool operator > (const Poco::Int16& other, const Var& da) |
1276 | | /// Greater than operator for comparing Var with Poco::Int16 |
1277 | 0 | { |
1278 | 0 | if (da.isEmpty()) return false; |
1279 | 0 | return other > da.convert<Poco::Int16>(); |
1280 | 0 | } |
1281 | | |
1282 | | |
1283 | | inline bool operator >= (const Poco::Int16& other, const Var& da) |
1284 | | /// Greater than or equal operator for comparing Var with Poco::Int16 |
1285 | 0 | { |
1286 | 0 | if (da.isEmpty()) return false; |
1287 | 0 | return other >= da.convert<Poco::Int16>(); |
1288 | 0 | } |
1289 | | |
1290 | | |
1291 | | inline Poco::UInt16 operator + (const Poco::UInt16& other, const Var& da) |
1292 | | /// Addition operator for adding Var to Poco::UInt16 |
1293 | 0 | { |
1294 | 0 | return other + da.convert<Poco::UInt16>(); |
1295 | 0 | } |
1296 | | |
1297 | | |
1298 | | inline Poco::UInt16 operator - (const Poco::UInt16& other, const Var& da) |
1299 | | /// Subtraction operator for subtracting Var from Poco::UInt16 |
1300 | 0 | { |
1301 | 0 | return other - da.convert<Poco::UInt16>(); |
1302 | 0 | } |
1303 | | |
1304 | | |
1305 | | inline Poco::UInt16 operator * (const Poco::UInt16& other, const Var& da) |
1306 | | /// Multiplication operator for multiplying Var with Poco::UInt16 |
1307 | 0 | { |
1308 | 0 | return other * da.convert<Poco::UInt16>(); |
1309 | 0 | } |
1310 | | |
1311 | | |
1312 | | inline Poco::UInt16 operator / (const Poco::UInt16& other, const Var& da) |
1313 | | /// Division operator for dividing Var with Poco::UInt16 |
1314 | 0 | { |
1315 | 0 | return other / da.convert<Poco::UInt16>(); |
1316 | 0 | } |
1317 | | |
1318 | | |
1319 | | inline Poco::UInt16 operator += (Poco::UInt16& other, const Var& da) |
1320 | | /// Addition assignment operator for adding Var to Poco::UInt16 |
1321 | 0 | { |
1322 | 0 | return other += da.convert<Poco::UInt16>(); |
1323 | 0 | } |
1324 | | |
1325 | | |
1326 | | inline Poco::UInt16 operator -= (Poco::UInt16& other, const Var& da) |
1327 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt16 |
1328 | 0 | { |
1329 | 0 | return other -= da.convert<Poco::UInt16>(); |
1330 | 0 | } |
1331 | | |
1332 | | |
1333 | | inline Poco::UInt16 operator *= (Poco::UInt16& other, const Var& da) |
1334 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt16 |
1335 | 0 | { |
1336 | 0 | return other *= da.convert<Poco::UInt16>(); |
1337 | 0 | } |
1338 | | |
1339 | | |
1340 | | inline Poco::UInt16 operator /= (Poco::UInt16& other, const Var& da) |
1341 | | /// Division assignment operator for dividing Var with Poco::UInt16 |
1342 | 0 | { |
1343 | 0 | return other /= da.convert<Poco::UInt16>(); |
1344 | 0 | } |
1345 | | |
1346 | | |
1347 | | inline bool operator == (const Poco::UInt16& other, const Var& da) |
1348 | | /// Equality operator for comparing Var with Poco::UInt16 |
1349 | 0 | { |
1350 | 0 | if (da.isEmpty()) return false; |
1351 | 0 | return other == da.convert<Poco::UInt16>(); |
1352 | 0 | } |
1353 | | |
1354 | | |
1355 | | inline bool operator != (const Poco::UInt16& other, const Var& da) |
1356 | | /// Inequality operator for comparing Var with Poco::UInt16 |
1357 | 0 | { |
1358 | 0 | if (da.isEmpty()) return true; |
1359 | 0 | return other != da.convert<Poco::UInt16>(); |
1360 | 0 | } |
1361 | | |
1362 | | |
1363 | | inline bool operator < (const Poco::UInt16& other, const Var& da) |
1364 | | /// Less than operator for comparing Var with Poco::UInt16 |
1365 | 0 | { |
1366 | 0 | if (da.isEmpty()) return false; |
1367 | 0 | return other < da.convert<Poco::UInt16>(); |
1368 | 0 | } |
1369 | | |
1370 | | |
1371 | | inline bool operator <= (const Poco::UInt16& other, const Var& da) |
1372 | | /// Less than or equal operator for comparing Var with Poco::UInt16 |
1373 | 0 | { |
1374 | 0 | if (da.isEmpty()) return false; |
1375 | 0 | return other <= da.convert<Poco::UInt16>(); |
1376 | 0 | } |
1377 | | |
1378 | | |
1379 | | inline bool operator > (const Poco::UInt16& other, const Var& da) |
1380 | | /// Greater than operator for comparing Var with Poco::UInt16 |
1381 | 0 | { |
1382 | 0 | if (da.isEmpty()) return false; |
1383 | 0 | return other > da.convert<Poco::UInt16>(); |
1384 | 0 | } |
1385 | | |
1386 | | |
1387 | | inline bool operator >= (const Poco::UInt16& other, const Var& da) |
1388 | | /// Greater than or equal operator for comparing Var with Poco::UInt16 |
1389 | 0 | { |
1390 | 0 | if (da.isEmpty()) return false; |
1391 | 0 | return other >= da.convert<Poco::UInt16>(); |
1392 | 0 | } |
1393 | | |
1394 | | |
1395 | | inline Poco::Int32 operator + (const Poco::Int32& other, const Var& da) |
1396 | | /// Addition operator for adding Var to Poco::Int32 |
1397 | 0 | { |
1398 | 0 | return other + da.convert<Poco::Int32>(); |
1399 | 0 | } |
1400 | | |
1401 | | |
1402 | | inline Poco::Int32 operator - (const Poco::Int32& other, const Var& da) |
1403 | | /// Subtraction operator for subtracting Var from Poco::Int32 |
1404 | 0 | { |
1405 | 0 | return other - da.convert<Poco::Int32>(); |
1406 | 0 | } |
1407 | | |
1408 | | |
1409 | | inline Poco::Int32 operator * (const Poco::Int32& other, const Var& da) |
1410 | | /// Multiplication operator for multiplying Var with Poco::Int32 |
1411 | 0 | { |
1412 | 0 | return other * da.convert<Poco::Int32>(); |
1413 | 0 | } |
1414 | | |
1415 | | |
1416 | | inline Poco::Int32 operator / (const Poco::Int32& other, const Var& da) |
1417 | | /// Division operator for dividing Var with Poco::Int32 |
1418 | 0 | { |
1419 | 0 | return other / da.convert<Poco::Int32>(); |
1420 | 0 | } |
1421 | | |
1422 | | |
1423 | | inline Poco::Int32 operator += (Poco::Int32& other, const Var& da) |
1424 | | /// Addition assignment operator for adding Var to Poco::Int32 |
1425 | 0 | { |
1426 | 0 | return other += da.convert<Poco::Int32>(); |
1427 | 0 | } |
1428 | | |
1429 | | |
1430 | | inline Poco::Int32 operator -= (Poco::Int32& other, const Var& da) |
1431 | | /// Subtraction assignment operator for subtracting Var from Poco::Int32 |
1432 | 0 | { |
1433 | 0 | return other -= da.convert<Poco::Int32>(); |
1434 | 0 | } |
1435 | | |
1436 | | |
1437 | | inline Poco::Int32 operator *= (Poco::Int32& other, const Var& da) |
1438 | | /// Multiplication assignment operator for multiplying Var with Poco::Int32 |
1439 | 0 | { |
1440 | 0 | return other *= da.convert<Poco::Int32>(); |
1441 | 0 | } |
1442 | | |
1443 | | |
1444 | | inline Poco::Int32 operator /= (Poco::Int32& other, const Var& da) |
1445 | | /// Division assignment operator for dividing Var with Poco::Int32 |
1446 | 0 | { |
1447 | 0 | return other /= da.convert<Poco::Int32>(); |
1448 | 0 | } |
1449 | | |
1450 | | |
1451 | | inline bool operator == (const Poco::Int32& other, const Var& da) |
1452 | | /// Equality operator for comparing Var with Poco::Int32 |
1453 | 0 | { |
1454 | 0 | if (da.isEmpty()) return false; |
1455 | 0 | return other == da.convert<Poco::Int32>(); |
1456 | 0 | } |
1457 | | |
1458 | | |
1459 | | inline bool operator != (const Poco::Int32& other, const Var& da) |
1460 | | /// Inequality operator for comparing Var with Poco::Int32 |
1461 | 0 | { |
1462 | 0 | if (da.isEmpty()) return true; |
1463 | 0 | return other != da.convert<Poco::Int32>(); |
1464 | 0 | } |
1465 | | |
1466 | | |
1467 | | inline bool operator < (const Poco::Int32& other, const Var& da) |
1468 | | /// Less than operator for comparing Var with Poco::Int32 |
1469 | 0 | { |
1470 | 0 | if (da.isEmpty()) return false; |
1471 | 0 | return other < da.convert<Poco::Int32>(); |
1472 | 0 | } |
1473 | | |
1474 | | |
1475 | | inline bool operator <= (const Poco::Int32& other, const Var& da) |
1476 | | /// Less than or equal operator for comparing Var with Poco::Int32 |
1477 | 0 | { |
1478 | 0 | if (da.isEmpty()) return false; |
1479 | 0 | return other <= da.convert<Poco::Int32>(); |
1480 | 0 | } |
1481 | | |
1482 | | |
1483 | | inline bool operator > (const Poco::Int32& other, const Var& da) |
1484 | | /// Greater than operator for comparing Var with Poco::Int32 |
1485 | 0 | { |
1486 | 0 | if (da.isEmpty()) return false; |
1487 | 0 | return other > da.convert<Poco::Int32>(); |
1488 | 0 | } |
1489 | | |
1490 | | |
1491 | | inline bool operator >= (const Poco::Int32& other, const Var& da) |
1492 | | /// Greater than or equal operator for comparing Var with Poco::Int32 |
1493 | 0 | { |
1494 | 0 | if (da.isEmpty()) return false; |
1495 | 0 | return other >= da.convert<Poco::Int32>(); |
1496 | 0 | } |
1497 | | |
1498 | | |
1499 | | inline Poco::UInt32 operator + (const Poco::UInt32& other, const Var& da) |
1500 | | /// Addition operator for adding Var to Poco::UInt32 |
1501 | 0 | { |
1502 | 0 | return other + da.convert<Poco::UInt32>(); |
1503 | 0 | } |
1504 | | |
1505 | | |
1506 | | inline Poco::UInt32 operator - (const Poco::UInt32& other, const Var& da) |
1507 | | /// Subtraction operator for subtracting Var from Poco::UInt32 |
1508 | 0 | { |
1509 | 0 | return other - da.convert<Poco::UInt32>(); |
1510 | 0 | } |
1511 | | |
1512 | | |
1513 | | inline Poco::UInt32 operator * (const Poco::UInt32& other, const Var& da) |
1514 | | /// Multiplication operator for multiplying Var with Poco::UInt32 |
1515 | 0 | { |
1516 | 0 | return other * da.convert<Poco::UInt32>(); |
1517 | 0 | } |
1518 | | |
1519 | | |
1520 | | inline Poco::UInt32 operator / (const Poco::UInt32& other, const Var& da) |
1521 | | /// Division operator for dividing Var with Poco::UInt32 |
1522 | 0 | { |
1523 | 0 | return other / da.convert<Poco::UInt32>(); |
1524 | 0 | } |
1525 | | |
1526 | | |
1527 | | inline Poco::UInt32 operator += (Poco::UInt32& other, const Var& da) |
1528 | | /// Addition assignment operator for adding Var to Poco::UInt32 |
1529 | 0 | { |
1530 | 0 | return other += da.convert<Poco::UInt32>(); |
1531 | 0 | } |
1532 | | |
1533 | | |
1534 | | inline Poco::UInt32 operator -= (Poco::UInt32& other, const Var& da) |
1535 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt32 |
1536 | 0 | { |
1537 | 0 | return other -= da.convert<Poco::UInt32>(); |
1538 | 0 | } |
1539 | | |
1540 | | |
1541 | | inline Poco::UInt32 operator *= (Poco::UInt32& other, const Var& da) |
1542 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt32 |
1543 | 0 | { |
1544 | 0 | return other *= da.convert<Poco::UInt32>(); |
1545 | 0 | } |
1546 | | |
1547 | | |
1548 | | inline Poco::UInt32 operator /= (Poco::UInt32& other, const Var& da) |
1549 | | /// Division assignment operator for dividing Var with Poco::UInt32 |
1550 | 0 | { |
1551 | 0 | return other /= da.convert<Poco::UInt32>(); |
1552 | 0 | } |
1553 | | |
1554 | | |
1555 | | inline bool operator == (const Poco::UInt32& other, const Var& da) |
1556 | | /// Equality operator for comparing Var with Poco::UInt32 |
1557 | 0 | { |
1558 | 0 | if (da.isEmpty()) return false; |
1559 | 0 | return other == da.convert<Poco::UInt32>(); |
1560 | 0 | } |
1561 | | |
1562 | | |
1563 | | inline bool operator != (const Poco::UInt32& other, const Var& da) |
1564 | | /// Inequality operator for comparing Var with Poco::UInt32 |
1565 | 0 | { |
1566 | 0 | if (da.isEmpty()) return true; |
1567 | 0 | return other != da.convert<Poco::UInt32>(); |
1568 | 0 | } |
1569 | | |
1570 | | |
1571 | | inline bool operator < (const Poco::UInt32& other, const Var& da) |
1572 | | /// Less than operator for comparing Var with Poco::UInt32 |
1573 | 0 | { |
1574 | 0 | if (da.isEmpty()) return false; |
1575 | 0 | return other < da.convert<Poco::UInt32>(); |
1576 | 0 | } |
1577 | | |
1578 | | |
1579 | | inline bool operator <= (const Poco::UInt32& other, const Var& da) |
1580 | | /// Less than or equal operator for comparing Var with Poco::UInt32 |
1581 | 0 | { |
1582 | 0 | if (da.isEmpty()) return false; |
1583 | 0 | return other <= da.convert<Poco::UInt32>(); |
1584 | 0 | } |
1585 | | |
1586 | | |
1587 | | inline bool operator > (const Poco::UInt32& other, const Var& da) |
1588 | | /// Greater than operator for comparing Var with Poco::UInt32 |
1589 | 0 | { |
1590 | 0 | if (da.isEmpty()) return false; |
1591 | 0 | return other > da.convert<Poco::UInt32>(); |
1592 | 0 | } |
1593 | | |
1594 | | |
1595 | | inline bool operator >= (const Poco::UInt32& other, const Var& da) |
1596 | | /// Greater than or equal operator for comparing Var with Poco::UInt32 |
1597 | 0 | { |
1598 | 0 | if (da.isEmpty()) return false; |
1599 | 0 | return other >= da.convert<Poco::UInt32>(); |
1600 | 0 | } |
1601 | | |
1602 | | |
1603 | | inline Poco::Int64 operator + (const Poco::Int64& other, const Var& da) |
1604 | | /// Addition operator for adding Var to Poco::Int64 |
1605 | 0 | { |
1606 | 0 | return other + da.convert<Poco::Int64>(); |
1607 | 0 | } |
1608 | | |
1609 | | |
1610 | | inline Poco::Int64 operator - (const Poco::Int64& other, const Var& da) |
1611 | | /// Subtraction operator for subtracting Var from Poco::Int64 |
1612 | 0 | { |
1613 | 0 | return other - da.convert<Poco::Int64>(); |
1614 | 0 | } |
1615 | | |
1616 | | |
1617 | | inline Poco::Int64 operator * (const Poco::Int64& other, const Var& da) |
1618 | | /// Multiplication operator for multiplying Var with Poco::Int64 |
1619 | 0 | { |
1620 | 0 | return other * da.convert<Poco::Int64>(); |
1621 | 0 | } |
1622 | | |
1623 | | |
1624 | | inline Poco::Int64 operator / (const Poco::Int64& other, const Var& da) |
1625 | | /// Division operator for dividing Var with Poco::Int64 |
1626 | 0 | { |
1627 | 0 | return other / da.convert<Poco::Int64>(); |
1628 | 0 | } |
1629 | | |
1630 | | |
1631 | | inline Poco::Int64 operator += (Poco::Int64& other, const Var& da) |
1632 | | /// Addition assignment operator for adding Var to Poco::Int64 |
1633 | 0 | { |
1634 | 0 | return other += da.convert<Poco::Int64>(); |
1635 | 0 | } |
1636 | | |
1637 | | |
1638 | | inline Poco::Int64 operator -= (Poco::Int64& other, const Var& da) |
1639 | | /// Subtraction assignment operator for subtracting Var from Poco::Int64 |
1640 | 0 | { |
1641 | 0 | return other -= da.convert<Poco::Int64>(); |
1642 | 0 | } |
1643 | | |
1644 | | |
1645 | | inline Poco::Int64 operator *= (Poco::Int64& other, const Var& da) |
1646 | | /// Multiplication assignment operator for multiplying Var with Poco::Int64 |
1647 | 0 | { |
1648 | 0 | return other *= da.convert<Poco::Int64>(); |
1649 | 0 | } |
1650 | | |
1651 | | |
1652 | | inline Poco::Int64 operator /= (Poco::Int64& other, const Var& da) |
1653 | | /// Division assignment operator for dividing Var with Poco::Int64 |
1654 | 0 | { |
1655 | 0 | return other /= da.convert<Poco::Int64>(); |
1656 | 0 | } |
1657 | | |
1658 | | |
1659 | | inline bool operator == (const Poco::Int64& other, const Var& da) |
1660 | | /// Equality operator for comparing Var with Poco::Int64 |
1661 | 0 | { |
1662 | 0 | if (da.isEmpty()) return false; |
1663 | 0 | return other == da.convert<Poco::Int64>(); |
1664 | 0 | } |
1665 | | |
1666 | | |
1667 | | inline bool operator != (const Poco::Int64& other, const Var& da) |
1668 | | /// Inequality operator for comparing Var with Poco::Int64 |
1669 | 0 | { |
1670 | 0 | if (da.isEmpty()) return true; |
1671 | 0 | return other != da.convert<Poco::Int64>(); |
1672 | 0 | } |
1673 | | |
1674 | | |
1675 | | inline bool operator < (const Poco::Int64& other, const Var& da) |
1676 | | /// Less than operator for comparing Var with Poco::Int64 |
1677 | 0 | { |
1678 | 0 | if (da.isEmpty()) return false; |
1679 | 0 | return other < da.convert<Poco::Int64>(); |
1680 | 0 | } |
1681 | | |
1682 | | |
1683 | | inline bool operator <= (const Poco::Int64& other, const Var& da) |
1684 | | /// Less than or equal operator for comparing Var with Poco::Int64 |
1685 | 0 | { |
1686 | 0 | if (da.isEmpty()) return false; |
1687 | 0 | return other <= da.convert<Poco::Int64>(); |
1688 | 0 | } |
1689 | | |
1690 | | |
1691 | | inline bool operator > (const Poco::Int64& other, const Var& da) |
1692 | | /// Greater than operator for comparing Var with Poco::Int64 |
1693 | 0 | { |
1694 | 0 | if (da.isEmpty()) return false; |
1695 | 0 | return other > da.convert<Poco::Int64>(); |
1696 | 0 | } |
1697 | | |
1698 | | |
1699 | | inline bool operator >= (const Poco::Int64& other, const Var& da) |
1700 | | /// Greater than or equal operator for comparing Var with Poco::Int64 |
1701 | 0 | { |
1702 | 0 | if (da.isEmpty()) return false; |
1703 | 0 | return other >= da.convert<Poco::Int64>(); |
1704 | 0 | } |
1705 | | |
1706 | | |
1707 | | inline Poco::UInt64 operator + (const Poco::UInt64& other, const Var& da) |
1708 | | /// Addition operator for adding Var to Poco::UInt64 |
1709 | 0 | { |
1710 | 0 | return other + da.convert<Poco::UInt64>(); |
1711 | 0 | } |
1712 | | |
1713 | | |
1714 | | inline Poco::UInt64 operator - (const Poco::UInt64& other, const Var& da) |
1715 | | /// Subtraction operator for subtracting Var from Poco::UInt64 |
1716 | 0 | { |
1717 | 0 | return other - da.convert<Poco::UInt64>(); |
1718 | 0 | } |
1719 | | |
1720 | | |
1721 | | inline Poco::UInt64 operator * (const Poco::UInt64& other, const Var& da) |
1722 | | /// Multiplication operator for multiplying Var with Poco::UInt64 |
1723 | 0 | { |
1724 | 0 | return other * da.convert<Poco::UInt64>(); |
1725 | 0 | } |
1726 | | |
1727 | | |
1728 | | inline Poco::UInt64 operator / (const Poco::UInt64& other, const Var& da) |
1729 | | /// Division operator for dividing Var with Poco::UInt64 |
1730 | 0 | { |
1731 | 0 | return other / da.convert<Poco::UInt64>(); |
1732 | 0 | } |
1733 | | |
1734 | | |
1735 | | inline Poco::UInt64 operator += (Poco::UInt64& other, const Var& da) |
1736 | | /// Addition assignment operator for adding Var to Poco::UInt64 |
1737 | 0 | { |
1738 | 0 | return other += da.convert<Poco::UInt64>(); |
1739 | 0 | } |
1740 | | |
1741 | | |
1742 | | inline Poco::UInt64 operator -= (Poco::UInt64& other, const Var& da) |
1743 | | /// Subtraction assignment operator for subtracting Var from Poco::UInt64 |
1744 | 0 | { |
1745 | 0 | return other -= da.convert<Poco::UInt64>(); |
1746 | 0 | } |
1747 | | |
1748 | | |
1749 | | inline Poco::UInt64 operator *= (Poco::UInt64& other, const Var& da) |
1750 | | /// Multiplication assignment operator for multiplying Var with Poco::UInt64 |
1751 | 0 | { |
1752 | 0 | return other *= da.convert<Poco::UInt64>(); |
1753 | 0 | } |
1754 | | |
1755 | | |
1756 | | inline Poco::UInt64 operator /= (Poco::UInt64& other, const Var& da) |
1757 | | /// Division assignment operator for dividing Var with Poco::UInt64 |
1758 | 0 | { |
1759 | 0 | return other /= da.convert<Poco::UInt64>(); |
1760 | 0 | } |
1761 | | |
1762 | | |
1763 | | inline bool operator == (const Poco::UInt64& other, const Var& da) |
1764 | | /// Equality operator for comparing Var with Poco::UInt64 |
1765 | 0 | { |
1766 | 0 | if (da.isEmpty()) return false; |
1767 | 0 | return other == da.convert<Poco::UInt64>(); |
1768 | 0 | } |
1769 | | |
1770 | | |
1771 | | inline bool operator != (const Poco::UInt64& other, const Var& da) |
1772 | | /// Inequality operator for comparing Var with Poco::UInt64 |
1773 | 0 | { |
1774 | 0 | if (da.isEmpty()) return true; |
1775 | 0 | return other != da.convert<Poco::UInt64>(); |
1776 | 0 | } |
1777 | | |
1778 | | |
1779 | | inline bool operator < (const Poco::UInt64& other, const Var& da) |
1780 | | /// Less than operator for comparing Var with Poco::UInt64 |
1781 | 0 | { |
1782 | 0 | if (da.isEmpty()) return false; |
1783 | 0 | return other < da.convert<Poco::UInt64>(); |
1784 | 0 | } |
1785 | | |
1786 | | |
1787 | | inline bool operator <= (const Poco::UInt64& other, const Var& da) |
1788 | | /// Less than or equal operator for comparing Var with Poco::UInt64 |
1789 | 0 | { |
1790 | 0 | if (da.isEmpty()) return false; |
1791 | 0 | return other <= da.convert<Poco::UInt64>(); |
1792 | 0 | } |
1793 | | |
1794 | | |
1795 | | inline bool operator > (const Poco::UInt64& other, const Var& da) |
1796 | | /// Greater than operator for comparing Var with Poco::UInt64 |
1797 | 0 | { |
1798 | 0 | if (da.isEmpty()) return false; |
1799 | 0 | return other > da.convert<Poco::UInt64>(); |
1800 | 0 | } |
1801 | | |
1802 | | |
1803 | | inline bool operator >= (const Poco::UInt64& other, const Var& da) |
1804 | | /// Greater than or equal operator for comparing Var with Poco::UInt64 |
1805 | 0 | { |
1806 | 0 | if (da.isEmpty()) return false; |
1807 | 0 | return other >= da.convert<Poco::UInt64>(); |
1808 | 0 | } |
1809 | | |
1810 | | |
1811 | | inline float operator + (const float& other, const Var& da) |
1812 | | /// Addition operator for adding Var to float |
1813 | 0 | { |
1814 | 0 | return other + da.convert<float>(); |
1815 | 0 | } |
1816 | | |
1817 | | |
1818 | | inline float operator - (const float& other, const Var& da) |
1819 | | /// Subtraction operator for subtracting Var from float |
1820 | 0 | { |
1821 | 0 | return other - da.convert<float>(); |
1822 | 0 | } |
1823 | | |
1824 | | |
1825 | | inline float operator * (const float& other, const Var& da) |
1826 | | /// Multiplication operator for multiplying Var with float |
1827 | 0 | { |
1828 | 0 | return other * da.convert<float>(); |
1829 | 0 | } |
1830 | | |
1831 | | |
1832 | | inline float operator / (const float& other, const Var& da) |
1833 | | /// Division operator for dividing Var with float |
1834 | 0 | { |
1835 | 0 | return other / da.convert<float>(); |
1836 | 0 | } |
1837 | | |
1838 | | |
1839 | | inline float operator += (float& other, const Var& da) |
1840 | | /// Addition assignment operator for adding Var to float |
1841 | 0 | { |
1842 | 0 | return other += da.convert<float>(); |
1843 | 0 | } |
1844 | | |
1845 | | |
1846 | | inline float operator -= (float& other, const Var& da) |
1847 | | /// Subtraction assignment operator for subtracting Var from float |
1848 | 0 | { |
1849 | 0 | return other -= da.convert<float>(); |
1850 | 0 | } |
1851 | | |
1852 | | |
1853 | | inline float operator *= (float& other, const Var& da) |
1854 | | /// Multiplication assignment operator for multiplying Var with float |
1855 | 0 | { |
1856 | 0 | return other *= da.convert<float>(); |
1857 | 0 | } |
1858 | | |
1859 | | |
1860 | | inline float operator /= (float& other, const Var& da) |
1861 | | /// Division assignment operator for dividing Var with float |
1862 | 0 | { |
1863 | 0 | return other /= da.convert<float>(); |
1864 | 0 | } |
1865 | | |
1866 | | |
1867 | | inline bool operator == (const float& other, const Var& da) |
1868 | | /// Equality operator for comparing Var with float |
1869 | 0 | { |
1870 | 0 | if (da.isEmpty()) return false; |
1871 | 0 | // CodeQL [cpp/float-equality]: intentional exact comparison in dynamic type system |
1872 | 0 | return other == da.convert<float>(); |
1873 | 0 | } |
1874 | | |
1875 | | |
1876 | | inline bool operator != (const float& other, const Var& da) |
1877 | | /// Inequality operator for comparing Var with float |
1878 | 0 | { |
1879 | 0 | if (da.isEmpty()) return true; |
1880 | 0 | // CodeQL [cpp/float-equality]: intentional exact comparison in dynamic type system |
1881 | 0 | return other != da.convert<float>(); |
1882 | 0 | } |
1883 | | |
1884 | | |
1885 | | inline bool operator < (const float& other, const Var& da) |
1886 | | /// Less than operator for comparing Var with float |
1887 | 0 | { |
1888 | 0 | if (da.isEmpty()) return false; |
1889 | 0 | return other < da.convert<float>(); |
1890 | 0 | } |
1891 | | |
1892 | | |
1893 | | inline bool operator <= (const float& other, const Var& da) |
1894 | | /// Less than or equal operator for comparing Var with float |
1895 | 0 | { |
1896 | 0 | if (da.isEmpty()) return false; |
1897 | 0 | return other <= da.convert<float>(); |
1898 | 0 | } |
1899 | | |
1900 | | |
1901 | | inline bool operator > (const float& other, const Var& da) |
1902 | | /// Greater than operator for comparing Var with float |
1903 | 0 | { |
1904 | 0 | if (da.isEmpty()) return false; |
1905 | 0 | return other > da.convert<float>(); |
1906 | 0 | } |
1907 | | |
1908 | | |
1909 | | inline bool operator >= (const float& other, const Var& da) |
1910 | | /// Greater than or equal operator for comparing Var with float |
1911 | 0 | { |
1912 | 0 | if (da.isEmpty()) return false; |
1913 | 0 | return other >= da.convert<float>(); |
1914 | 0 | } |
1915 | | |
1916 | | |
1917 | | inline double operator + (const double& other, const Var& da) |
1918 | | /// Addition operator for adding Var to double |
1919 | 0 | { |
1920 | 0 | return other + da.convert<double>(); |
1921 | 0 | } |
1922 | | |
1923 | | |
1924 | | inline double operator - (const double& other, const Var& da) |
1925 | | /// Subtraction operator for subtracting Var from double |
1926 | 0 | { |
1927 | 0 | return other - da.convert<double>(); |
1928 | 0 | } |
1929 | | |
1930 | | |
1931 | | inline double operator * (const double& other, const Var& da) |
1932 | | /// Multiplication operator for multiplying Var with double |
1933 | 0 | { |
1934 | 0 | return other * da.convert<double>(); |
1935 | 0 | } |
1936 | | |
1937 | | |
1938 | | inline double operator / (const double& other, const Var& da) |
1939 | | /// Division operator for dividing Var with double |
1940 | 0 | { |
1941 | 0 | return other / da.convert<double>(); |
1942 | 0 | } |
1943 | | |
1944 | | |
1945 | | inline double operator += (double& other, const Var& da) |
1946 | | /// Addition assignment operator for adding Var to double |
1947 | 0 | { |
1948 | 0 | return other += da.convert<double>(); |
1949 | 0 | } |
1950 | | |
1951 | | |
1952 | | inline double operator -= (double& other, const Var& da) |
1953 | | /// Subtraction assignment operator for subtracting Var from double |
1954 | 0 | { |
1955 | 0 | return other -= da.convert<double>(); |
1956 | 0 | } |
1957 | | |
1958 | | |
1959 | | inline double operator *= (double& other, const Var& da) |
1960 | | /// Multiplication assignment operator for multiplying Var with double |
1961 | 0 | { |
1962 | 0 | return other *= da.convert<double>(); |
1963 | 0 | } |
1964 | | |
1965 | | |
1966 | | inline double operator /= (double& other, const Var& da) |
1967 | | /// Division assignment operator for dividing Var with double |
1968 | 0 | { |
1969 | 0 | return other /= da.convert<double>(); |
1970 | 0 | } |
1971 | | |
1972 | | |
1973 | | inline bool operator == (const double& other, const Var& da) |
1974 | | /// Equality operator for comparing Var with double |
1975 | 0 | { |
1976 | 0 | if (da.isEmpty()) return false; |
1977 | 0 | // CodeQL [cpp/float-equality]: intentional exact comparison in dynamic type system |
1978 | 0 | return other == da.convert<double>(); |
1979 | 0 | } |
1980 | | |
1981 | | |
1982 | | inline bool operator != (const double& other, const Var& da) |
1983 | | /// Inequality operator for comparing Var with double |
1984 | 0 | { |
1985 | 0 | if (da.isEmpty()) return true; |
1986 | 0 | // CodeQL [cpp/float-equality]: intentional exact comparison in dynamic type system |
1987 | 0 | return other != da.convert<double>(); |
1988 | 0 | } |
1989 | | |
1990 | | |
1991 | | inline bool operator < (const double& other, const Var& da) |
1992 | | /// Less than operator for comparing Var with double |
1993 | 0 | { |
1994 | 0 | if (da.isEmpty()) return false; |
1995 | 0 | return other < da.convert<double>(); |
1996 | 0 | } |
1997 | | |
1998 | | |
1999 | | inline bool operator <= (const double& other, const Var& da) |
2000 | | /// Less than or equal operator for comparing Var with double |
2001 | 0 | { |
2002 | 0 | if (da.isEmpty()) return false; |
2003 | 0 | return other <= da.convert<double>(); |
2004 | 0 | } |
2005 | | |
2006 | | |
2007 | | inline bool operator > (const double& other, const Var& da) |
2008 | | /// Greater than operator for comparing Var with double |
2009 | 0 | { |
2010 | 0 | if (da.isEmpty()) return false; |
2011 | 0 | return other > da.convert<double>(); |
2012 | 0 | } |
2013 | | |
2014 | | |
2015 | | inline bool operator >= (const double& other, const Var& da) |
2016 | | /// Greater than or equal operator for comparing Var with double |
2017 | 0 | { |
2018 | 0 | if (da.isEmpty()) return false; |
2019 | 0 | return other >= da.convert<double>(); |
2020 | 0 | } |
2021 | | |
2022 | | |
2023 | | inline bool operator == (const bool& other, const Var& da) |
2024 | | /// Equality operator for comparing Var with bool |
2025 | 0 | { |
2026 | 0 | if (da.isEmpty()) return false; |
2027 | 0 | return other == da.convert<bool>(); |
2028 | 0 | } |
2029 | | |
2030 | | |
2031 | | inline bool operator != (const bool& other, const Var& da) |
2032 | | /// Inequality operator for comparing Var with bool |
2033 | 0 | { |
2034 | 0 | if (da.isEmpty()) return true; |
2035 | 0 | return other != da.convert<bool>(); |
2036 | 0 | } |
2037 | | |
2038 | | |
2039 | | inline bool operator == (const std::string& other, const Var& da) |
2040 | | /// Equality operator for comparing Var with std::string |
2041 | 0 | { |
2042 | 0 | if (da.isEmpty()) return false; |
2043 | 0 | return other == da.convert<std::string>(); |
2044 | 0 | } |
2045 | | |
2046 | | |
2047 | | inline bool operator != (const std::string& other, const Var& da) |
2048 | | /// Inequality operator for comparing Var with std::string |
2049 | 0 | { |
2050 | 0 | if (da.isEmpty()) return true; |
2051 | 0 | return other != da.convert<std::string>(); |
2052 | 0 | } |
2053 | | |
2054 | | |
2055 | | inline bool operator == (const UTF16String& other, const Var& da) |
2056 | | /// Equality operator for comparing Var with UTF16String |
2057 | 0 | { |
2058 | 0 | if (da.isEmpty()) return false; |
2059 | 0 | return other == da.convert<UTF16String>(); |
2060 | 0 | } |
2061 | | |
2062 | | |
2063 | | inline bool operator != (const UTF16String& other, const Var& da) |
2064 | | /// Inequality operator for comparing Var with UTF16String |
2065 | 0 | { |
2066 | 0 | if (da.isEmpty()) return true; |
2067 | 0 | return other != da.convert<UTF16String>(); |
2068 | 0 | } |
2069 | | |
2070 | | |
2071 | | inline bool operator == (const char* other, const Var& da) |
2072 | | /// Equality operator for comparing Var with const char* |
2073 | 0 | { |
2074 | 0 | if (da.isEmpty()) return false; |
2075 | 0 | return da.convert<std::string>() == other; |
2076 | 0 | } |
2077 | | |
2078 | | |
2079 | | inline bool operator != (const char* other, const Var& da) |
2080 | | /// Inequality operator for comparing Var with const char* |
2081 | 0 | { |
2082 | 0 | if (da.isEmpty()) return true; |
2083 | 0 | return da.convert<std::string>() != other; |
2084 | 0 | } |
2085 | | |
2086 | | |
2087 | | #ifndef POCO_INT64_IS_LONG |
2088 | | |
2089 | | |
2090 | | inline long operator + (const long& other, const Var& da) |
2091 | | /// Addition operator for adding Var to long |
2092 | | { |
2093 | | return other + da.convert<long>(); |
2094 | | } |
2095 | | |
2096 | | |
2097 | | inline long operator - (const long& other, const Var& da) |
2098 | | /// Subtraction operator for subtracting Var from long |
2099 | | { |
2100 | | return other - da.convert<long>(); |
2101 | | } |
2102 | | |
2103 | | |
2104 | | inline long operator * (const long& other, const Var& da) |
2105 | | /// Multiplication operator for multiplying Var with long |
2106 | | { |
2107 | | return other * da.convert<long>(); |
2108 | | } |
2109 | | |
2110 | | |
2111 | | inline long operator / (const long& other, const Var& da) |
2112 | | /// Division operator for dividing Var with long |
2113 | | { |
2114 | | return other / da.convert<long>(); |
2115 | | } |
2116 | | |
2117 | | |
2118 | | inline long operator += (long& other, const Var& da) |
2119 | | /// Addition assignment operator for adding Var to long |
2120 | | { |
2121 | | return other += da.convert<long>(); |
2122 | | } |
2123 | | |
2124 | | |
2125 | | inline long operator -= (long& other, const Var& da) |
2126 | | /// Subtraction assignment operator for subtracting Var from long |
2127 | | { |
2128 | | return other -= da.convert<long>(); |
2129 | | } |
2130 | | |
2131 | | |
2132 | | inline long operator *= (long& other, const Var& da) |
2133 | | /// Multiplication assignment operator for multiplying Var with long |
2134 | | { |
2135 | | return other *= da.convert<long>(); |
2136 | | } |
2137 | | |
2138 | | |
2139 | | inline long operator /= (long& other, const Var& da) |
2140 | | /// Division assignment operator for dividing Var with long |
2141 | | { |
2142 | | return other /= da.convert<long>(); |
2143 | | } |
2144 | | |
2145 | | |
2146 | | inline bool operator == (const long& other, const Var& da) |
2147 | | /// Equality operator for comparing Var with long |
2148 | | { |
2149 | | if (da.isEmpty()) return false; |
2150 | | return other == da.convert<long>(); |
2151 | | } |
2152 | | |
2153 | | |
2154 | | inline bool operator != (const long& other, const Var& da) |
2155 | | /// Inequality operator for comparing Var with long |
2156 | | { |
2157 | | if (da.isEmpty()) return true; |
2158 | | return other != da.convert<long>(); |
2159 | | } |
2160 | | |
2161 | | |
2162 | | inline bool operator < (const long& other, const Var& da) |
2163 | | /// Less than operator for comparing Var with long |
2164 | | { |
2165 | | if (da.isEmpty()) return false; |
2166 | | return other < da.convert<long>(); |
2167 | | } |
2168 | | |
2169 | | |
2170 | | inline bool operator <= (const long& other, const Var& da) |
2171 | | /// Less than or equal operator for comparing Var with long |
2172 | | { |
2173 | | if (da.isEmpty()) return false; |
2174 | | return other <= da.convert<long>(); |
2175 | | } |
2176 | | |
2177 | | |
2178 | | inline bool operator > (const long& other, const Var& da) |
2179 | | /// Greater than operator for comparing Var with long |
2180 | | { |
2181 | | if (da.isEmpty()) return false; |
2182 | | return other > da.convert<long>(); |
2183 | | } |
2184 | | |
2185 | | |
2186 | | inline bool operator >= (const long& other, const Var& da) |
2187 | | /// Greater than or equal operator for comparing Var with long |
2188 | | { |
2189 | | if (da.isEmpty()) return false; |
2190 | | return other >= da.convert<long>(); |
2191 | | } |
2192 | | |
2193 | | |
2194 | | inline unsigned long operator + (const unsigned long& other, const Var& da) |
2195 | | /// Addition operator for adding Var to unsigned long |
2196 | | { |
2197 | | return other + da.convert<unsigned long>(); |
2198 | | } |
2199 | | |
2200 | | |
2201 | | inline unsigned long operator - (const unsigned long& other, const Var& da) |
2202 | | /// Subtraction operator for subtracting Var from unsigned long |
2203 | | { |
2204 | | return other - da.convert<unsigned long>(); |
2205 | | } |
2206 | | |
2207 | | |
2208 | | inline unsigned long operator * (const unsigned long& other, const Var& da) |
2209 | | /// Multiplication operator for multiplying Var with unsigned long |
2210 | | { |
2211 | | return other * da.convert<unsigned long>(); |
2212 | | } |
2213 | | |
2214 | | |
2215 | | inline unsigned long operator / (const unsigned long& other, const Var& da) |
2216 | | /// Division operator for dividing Var with unsigned long |
2217 | | { |
2218 | | return other / da.convert<unsigned long>(); |
2219 | | } |
2220 | | |
2221 | | |
2222 | | inline unsigned long operator += (unsigned long& other, const Var& da) |
2223 | | /// Addition assignment operator for adding Var to unsigned long |
2224 | | { |
2225 | | return other += da.convert<unsigned long>(); |
2226 | | } |
2227 | | |
2228 | | |
2229 | | inline unsigned long operator -= (unsigned long& other, const Var& da) |
2230 | | /// Subtraction assignment operator for subtracting Var from unsigned long |
2231 | | { |
2232 | | return other -= da.convert<unsigned long>(); |
2233 | | } |
2234 | | |
2235 | | |
2236 | | inline unsigned long operator *= (unsigned long& other, const Var& da) |
2237 | | /// Multiplication assignment operator for multiplying Var with unsigned long |
2238 | | { |
2239 | | return other *= da.convert<unsigned long>(); |
2240 | | } |
2241 | | |
2242 | | |
2243 | | inline unsigned long operator /= (unsigned long& other, const Var& da) |
2244 | | /// Division assignment operator for dividing Var with unsigned long |
2245 | | { |
2246 | | return other /= da.convert<unsigned long>(); |
2247 | | } |
2248 | | |
2249 | | |
2250 | | inline bool operator == (const unsigned long& other, const Var& da) |
2251 | | /// Equality operator for comparing Var with unsigned long |
2252 | | { |
2253 | | if (da.isEmpty()) return false; |
2254 | | return other == da.convert<unsigned long>(); |
2255 | | } |
2256 | | |
2257 | | |
2258 | | inline bool operator != (const unsigned long& other, const Var& da) |
2259 | | /// Inequality operator for comparing Var with unsigned long |
2260 | | { |
2261 | | if (da.isEmpty()) return true; |
2262 | | return other != da.convert<unsigned long>(); |
2263 | | } |
2264 | | |
2265 | | |
2266 | | inline bool operator < (const unsigned long& other, const Var& da) |
2267 | | /// Less than operator for comparing Var with unsigned long |
2268 | | { |
2269 | | if (da.isEmpty()) return false; |
2270 | | return other < da.convert<unsigned long>(); |
2271 | | } |
2272 | | |
2273 | | |
2274 | | inline bool operator <= (const unsigned long& other, const Var& da) |
2275 | | /// Less than or equal operator for comparing Var with unsigned long |
2276 | | { |
2277 | | if (da.isEmpty()) return false; |
2278 | | return other <= da.convert<unsigned long>(); |
2279 | | } |
2280 | | |
2281 | | |
2282 | | inline bool operator > (const unsigned long& other, const Var& da) |
2283 | | /// Greater than operator for comparing Var with unsigned long |
2284 | | { |
2285 | | if (da.isEmpty()) return false; |
2286 | | return other > da.convert<unsigned long>(); |
2287 | | } |
2288 | | |
2289 | | |
2290 | | inline bool operator >= (const unsigned long& other, const Var& da) |
2291 | | /// Greater than or equal operator for comparing Var with unsigned long |
2292 | | { |
2293 | | if (da.isEmpty()) return false; |
2294 | | return other >= da.convert<unsigned long>(); |
2295 | | } |
2296 | | |
2297 | | |
2298 | | #endif // POCO_INT64_IS_LONG |
2299 | | |
2300 | | |
2301 | | } // namespace Poco::Dynamic |
2302 | | |
2303 | | |
2304 | | namespace Poco { |
2305 | | |
2306 | | |
2307 | | using DynamicAny POCO_DEPRECATED("Replace with Poco::Dynamic::Var") = Dynamic::Var; |
2308 | | |
2309 | | |
2310 | | } // namespace Poco |
2311 | | |
2312 | | |
2313 | | #endif // Foundation_Var_INCLUDED |