Coverage Report

Created: 2025-10-14 06:59

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