huanggen hace 1 año
commit
1963b349e1
Se han modificado 100 ficheros con 20131 adiciones y 0 borrados
  1. 366 0
      ThirdParty/include/Poco/AbstractCache.h
  2. 110 0
      ThirdParty/include/Poco/AbstractDelegate.h
  3. 558 0
      ThirdParty/include/Poco/AbstractEvent.h
  4. 50 0
      ThirdParty/include/Poco/AbstractObserver.h
  5. 63 0
      ThirdParty/include/Poco/AbstractPriorityDelegate.h
  6. 77 0
      ThirdParty/include/Poco/AbstractStrategy.h
  7. 83 0
      ThirdParty/include/Poco/AccessExpirationDecorator.h
  8. 63 0
      ThirdParty/include/Poco/AccessExpireCache.h
  9. 62 0
      ThirdParty/include/Poco/AccessExpireLRUCache.h
  10. 74 0
      ThirdParty/include/Poco/AccessExpireStrategy.h
  11. 116 0
      ThirdParty/include/Poco/ActiveDispatcher.h
  12. 218 0
      ThirdParty/include/Poco/ActiveMethod.h
  13. 495 0
      ThirdParty/include/Poco/ActiveResult.h
  14. 231 0
      ThirdParty/include/Poco/ActiveRunnable.h
  15. 48 0
      ThirdParty/include/Poco/ActiveStarter.h
  16. 208 0
      ThirdParty/include/Poco/Activity.h
  17. 246 0
      ThirdParty/include/Poco/Alignment.h
  18. 599 0
      ThirdParty/include/Poco/Any.h
  19. 220 0
      ThirdParty/include/Poco/Ascii.h
  20. 100 0
      ThirdParty/include/Poco/AsyncChannel.h
  21. 417 0
      ThirdParty/include/Poco/AtomicCounter.h
  22. 386 0
      ThirdParty/include/Poco/AutoPtr.h
  23. 86 0
      ThirdParty/include/Poco/AutoReleasePool.h
  24. 60 0
      ThirdParty/include/Poco/BasicEvent.h
  25. 329 0
      ThirdParty/include/Poco/Buffer.h
  26. 52 0
      ThirdParty/include/Poco/BufferAllocator.h
  27. 181 0
      ThirdParty/include/Poco/BufferedBidirectionalStreamBuf.h
  28. 173 0
      ThirdParty/include/Poco/BufferedStreamBuf.h
  29. 206 0
      ThirdParty/include/Poco/Bugcheck.h
  30. 108 0
      ThirdParty/include/Poco/Checksum.h
  31. 207 0
      ThirdParty/include/Poco/Config.h
  32. 138 0
      ThirdParty/include/Poco/Crypto/Cipher.h
  33. 75 0
      ThirdParty/include/Poco/Crypto/CipherFactory.h
  34. 69 0
      ThirdParty/include/Poco/Crypto/CipherImpl.h
  35. 201 0
      ThirdParty/include/Poco/Crypto/CipherKey.h
  36. 168 0
      ThirdParty/include/Poco/Crypto/CipherKeyImpl.h
  37. 195 0
      ThirdParty/include/Poco/Crypto/Crypto.h
  38. 56 0
      ThirdParty/include/Poco/Crypto/CryptoException.h
  39. 192 0
      ThirdParty/include/Poco/Crypto/CryptoStream.h
  40. 87 0
      ThirdParty/include/Poco/Crypto/CryptoTransform.h
  41. 80 0
      ThirdParty/include/Poco/Crypto/DigestEngine.h
  42. 101 0
      ThirdParty/include/Poco/Crypto/ECDSADigestEngine.h
  43. 136 0
      ThirdParty/include/Poco/Crypto/ECKey.h
  44. 174 0
      ThirdParty/include/Poco/Crypto/ECKeyImpl.h
  45. 354 0
      ThirdParty/include/Poco/Crypto/EVPPKey.h
  46. 133 0
      ThirdParty/include/Poco/Crypto/KeyPair.h
  47. 107 0
      ThirdParty/include/Poco/Crypto/KeyPairImpl.h
  48. 115 0
      ThirdParty/include/Poco/Crypto/OpenSSLInitializer.h
  49. 159 0
      ThirdParty/include/Poco/Crypto/PKCS12Container.h
  50. 77 0
      ThirdParty/include/Poco/Crypto/RSACipherImpl.h
  51. 111 0
      ThirdParty/include/Poco/Crypto/RSADigestEngine.h
  52. 125 0
      ThirdParty/include/Poco/Crypto/RSAKey.h
  53. 141 0
      ThirdParty/include/Poco/Crypto/RSAKeyImpl.h
  54. 245 0
      ThirdParty/include/Poco/Crypto/X509Certificate.h
  55. 373 0
      ThirdParty/include/Poco/Data/AbstractBinder.h
  56. 144 0
      ThirdParty/include/Poco/Data/AbstractBinding.h
  57. 278 0
      ThirdParty/include/Poco/Data/AbstractExtraction.h
  58. 351 0
      ThirdParty/include/Poco/Data/AbstractExtractor.h
  59. 71 0
      ThirdParty/include/Poco/Data/AbstractPreparation.h
  60. 388 0
      ThirdParty/include/Poco/Data/AbstractPreparator.h
  61. 315 0
      ThirdParty/include/Poco/Data/AbstractSessionImpl.h
  62. 222 0
      ThirdParty/include/Poco/Data/ArchiveStrategy.h
  63. 35 0
      ThirdParty/include/Poco/Data/AutoTransaction.h
  64. 1496 0
      ThirdParty/include/Poco/Data/Binding.h
  65. 96 0
      ThirdParty/include/Poco/Data/Bulk.h
  66. 148 0
      ThirdParty/include/Poco/Data/BulkBinding.h
  67. 276 0
      ThirdParty/include/Poco/Data/BulkExtraction.h
  68. 490 0
      ThirdParty/include/Poco/Data/Column.h
  69. 56 0
      ThirdParty/include/Poco/Data/Connector.h
  70. 36 0
      ThirdParty/include/Poco/Data/Constants.h
  71. 62 0
      ThirdParty/include/Poco/Data/Data.h
  72. 50 0
      ThirdParty/include/Poco/Data/DataException.h
  73. 225 0
      ThirdParty/include/Poco/Data/Date.h
  74. 47 0
      ThirdParty/include/Poco/Data/DynamicDateTime.h
  75. 45 0
      ThirdParty/include/Poco/Data/DynamicLOB.h
  76. 869 0
      ThirdParty/include/Poco/Data/Extraction.h
  77. 309 0
      ThirdParty/include/Poco/Data/LOB.h
  78. 150 0
      ThirdParty/include/Poco/Data/LOBStream.h
  79. 113 0
      ThirdParty/include/Poco/Data/Limit.h
  80. 188 0
      ThirdParty/include/Poco/Data/MetaColumn.h
  81. 99 0
      ThirdParty/include/Poco/Data/PooledSessionHolder.h
  82. 97 0
      ThirdParty/include/Poco/Data/PooledSessionImpl.h
  83. 75 0
      ThirdParty/include/Poco/Data/Position.h
  84. 161 0
      ThirdParty/include/Poco/Data/Preparation.h
  85. 104 0
      ThirdParty/include/Poco/Data/Range.h
  86. 653 0
      ThirdParty/include/Poco/Data/RecordSet.h
  87. 312 0
      ThirdParty/include/Poco/Data/Row.h
  88. 276 0
      ThirdParty/include/Poco/Data/RowFilter.h
  89. 231 0
      ThirdParty/include/Poco/Data/RowFormatter.h
  90. 150 0
      ThirdParty/include/Poco/Data/RowIterator.h
  91. 217 0
      ThirdParty/include/Poco/Data/SQLChannel.h
  92. 220 0
      ThirdParty/include/Poco/Data/SQLite/Binder.h
  93. 79 0
      ThirdParty/include/Poco/Data/SQLite/Connector.h
  94. 313 0
      ThirdParty/include/Poco/Data/SQLite/Extractor.h
  95. 195 0
      ThirdParty/include/Poco/Data/SQLite/Notifier.h
  96. 62 0
      ThirdParty/include/Poco/Data/SQLite/SQLite.h
  97. 60 0
      ThirdParty/include/Poco/Data/SQLite/SQLiteException.h
  98. 155 0
      ThirdParty/include/Poco/Data/SQLite/SQLiteStatementImpl.h
  99. 168 0
      ThirdParty/include/Poco/Data/SQLite/SessionImpl.h
  100. 240 0
      ThirdParty/include/Poco/Data/SQLite/Utility.h

+ 366 - 0
ThirdParty/include/Poco/AbstractCache.h

@@ -0,0 +1,366 @@
+//
+// AbstractCache.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AbstractCache
+//
+// Definition of the AbstractCache class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractCache_INCLUDED
+#define Foundation_AbstractCache_INCLUDED
+
+
+#include "Poco/KeyValueArgs.h"
+#include "Poco/ValidArgs.h" 
+#include "Poco/Mutex.h"
+#include "Poco/Exception.h"
+#include "Poco/FIFOEvent.h"
+#include "Poco/EventArgs.h"
+#include "Poco/Delegate.h"
+#include "Poco/SharedPtr.h"
+#include <map>
+#include <set>
+#include <cstddef>
+
+
+namespace Poco {
+
+
+template <class TKey, class TValue, class TStrategy, class TMutex = FastMutex, class TEventMutex = FastMutex> 
+class AbstractCache
+	/// An AbstractCache is the interface of all caches. 
+{
+public:
+	FIFOEvent<const KeyValueArgs<TKey, TValue >, TEventMutex > Add;
+	FIFOEvent<const KeyValueArgs<TKey, TValue >, TEventMutex > Update;
+	FIFOEvent<const TKey, TEventMutex>                         Remove;
+	FIFOEvent<const TKey, TEventMutex>                         Get;
+	FIFOEvent<const EventArgs, TEventMutex>                    Clear;
+
+	typedef std::map<TKey, SharedPtr<TValue > > DataHolder;
+	typedef typename DataHolder::iterator       Iterator;
+	typedef typename DataHolder::const_iterator ConstIterator;
+	typedef std::set<TKey>                      KeySet;
+
+	AbstractCache()
+	{
+		initialize();
+	}
+
+	AbstractCache(const TStrategy& strat): _strategy(strat)
+	{
+		initialize();
+	}
+
+	virtual ~AbstractCache()
+	{
+		try
+		{
+			uninitialize();
+		}
+		catch (...)
+		{
+			poco_unexpected();
+		}
+	}
+
+	void add(const TKey& key, const TValue& val)
+		/// Adds the key value pair to the cache.
+		/// If for the key already an entry exists, it will be overwritten.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doAdd(key, val);
+	}
+
+	void update(const TKey& key, const TValue& val)
+		/// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail!
+		/// If for the key already an entry exists, it will be overwritten.
+		/// The difference to add is that no remove or add events are thrown in this case, 
+		/// just a simply silent update is performed
+		/// If the key doesnot exist the behavior is equal to add, ie. an add event is thrown
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doUpdate(key, val);
+	}
+
+	void add(const TKey& key, SharedPtr<TValue > val)
+		/// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail!
+		/// If for the key already an entry exists, it will be overwritten, ie. first a remove event
+		/// is thrown, then a add event
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doAdd(key, val);
+	}
+
+	void update(const TKey& key, SharedPtr<TValue > val)
+		/// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail!
+		/// If for the key already an entry exists, it will be overwritten.
+		/// The difference to add is that no remove or add events are thrown in this case, 
+		/// just an Update is thrown
+		/// If the key doesnot exist the behavior is equal to add, ie. an add event is thrown
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doUpdate(key, val);
+	}
+
+	void remove(const TKey& key)
+		/// Removes an entry from the cache. If the entry is not found,
+		/// the remove is ignored.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		Iterator it = _data.find(key);
+		doRemove(it);
+	}
+
+	bool has(const TKey& key) const
+		/// Returns true if the cache contains a value for the key.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return doHas(key);
+	}
+
+	SharedPtr<TValue> get(const TKey& key)
+		/// Returns a SharedPtr of the value. The SharedPointer will remain valid
+		/// even when cache replacement removes the element.
+		/// If for the key no value exists, an empty SharedPtr is returned.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return doGet (key);
+	}
+
+	void clear()
+		/// Removes all elements from the cache.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doClear();
+	}
+
+	std::size_t size()
+		/// Returns the number of cached elements
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doReplace();
+		return _data.size();
+	}
+
+	void forceReplace()
+		/// Forces cache replacement. Note that Poco's cache strategy use for efficiency reason no background thread
+		/// which periodically triggers cache replacement. Cache Replacement is only started when the cache is modified
+		/// from outside, i.e. add is called, or when a user tries to access an cache element via get.
+		/// In some cases, i.e. expire based caching where for a long time no access to the cache happens,
+		/// it might be desirable to be able to trigger cache replacement manually.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doReplace();
+	}
+
+	std::set<TKey> getAllKeys()
+		/// Returns a copy of all keys stored in the cache
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		doReplace();
+		ConstIterator it = _data.begin();
+		ConstIterator itEnd = _data.end();
+		std::set<TKey> result;
+		for (; it != itEnd; ++it)
+			result.insert(it->first);
+
+		return result;
+	}
+
+protected:
+	mutable FIFOEvent<ValidArgs<TKey> > IsValid;
+	mutable FIFOEvent<KeySet>           Replace;
+
+	void initialize()
+		/// Sets up event registration.
+	{
+		Add		+= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd);
+		Update	+= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onUpdate);
+		Remove	+= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
+		Get		+= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
+		Clear	+= Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
+		IsValid	+= Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
+		Replace	+= Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
+	}
+
+	void uninitialize()
+		/// Reverts event registration.
+	{
+		Add		-= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd );
+		Update	-= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onUpdate);
+		Remove	-= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
+		Get		-= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
+		Clear	-= Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
+		IsValid	-= Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
+		Replace	-= Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
+	}
+
+	void doAdd(const TKey& key, const TValue& val)
+		/// Adds the key value pair to the cache.
+		/// If for the key already an entry exists, it will be overwritten.
+	{
+		Iterator it = _data.find(key);
+		doRemove(it);
+
+		KeyValueArgs<TKey, TValue> args(key, val);
+		Add.notify(this, args);
+		_data.insert(std::make_pair(key, SharedPtr<TValue>(new TValue(val))));
+		
+		doReplace();
+	}
+
+	void doAdd(const TKey& key, SharedPtr<TValue>& val)
+		/// Adds the key value pair to the cache.
+		/// If for the key already an entry exists, it will be overwritten.
+	{
+		Iterator it = _data.find(key);
+		doRemove(it);
+
+		KeyValueArgs<TKey, TValue> args(key, *val);
+		Add.notify(this, args);
+		_data.insert(std::make_pair(key, val));
+		
+		doReplace();
+	}
+
+	void doUpdate(const TKey& key, const TValue& val)
+		/// Adds the key value pair to the cache.
+		/// If for the key already an entry exists, it will be overwritten.
+	{
+		KeyValueArgs<TKey, TValue> args(key, val);
+		Iterator it = _data.find(key);
+		if (it == _data.end())
+		{
+			Add.notify(this, args);
+			_data.insert(std::make_pair(key, SharedPtr<TValue>(new TValue(val))));
+		}
+		else
+		{
+			Update.notify(this, args);
+			it->second = SharedPtr<TValue>(new TValue(val));
+		}
+		
+		doReplace();
+	}
+
+	void doUpdate(const TKey& key, SharedPtr<TValue>& val)
+		/// Adds the key value pair to the cache.
+		/// If for the key already an entry exists, it will be overwritten.
+	{
+		KeyValueArgs<TKey, TValue> args(key, *val);
+		Iterator it = _data.find(key);
+		if (it == _data.end())
+		{
+			Add.notify(this, args);
+			_data.insert(std::make_pair(key, val));
+		}
+		else
+		{
+			Update.notify(this, args);
+			it->second = val;
+		}
+		
+		doReplace();
+	}
+
+	void doRemove(Iterator it) 
+		/// Removes an entry from the cache. If the entry is not found
+		/// the remove is ignored.
+	{
+		if (it != _data.end())
+		{
+			Remove.notify(this, it->first);
+			_data.erase(it);
+		}
+	}
+
+	bool doHas(const TKey& key) const
+		/// Returns true if the cache contains a value for the key
+	{
+		// ask the strategy if the key is valid
+		ConstIterator it = _data.find(key);
+		bool result = false;
+
+		if (it != _data.end())
+		{
+			ValidArgs<TKey> args(key);
+			IsValid.notify(this, args);
+			result = args.isValid();
+		}
+
+		return result;
+	}
+
+	SharedPtr<TValue> doGet(const TKey& key) 
+		/// Returns a SharedPtr of the cache entry, returns 0 if for
+		/// the key no value was found
+	{
+		Iterator it = _data.find(key);
+		SharedPtr<TValue> result;
+
+		if (it != _data.end())
+		{	
+			// inform all strategies that a read-access to an element happens
+			Get.notify(this, key);
+			// ask all strategies if the key is valid
+			ValidArgs<TKey> args(key);
+			IsValid.notify(this, args);
+
+			if (!args.isValid())
+			{
+				doRemove(it);
+			}
+			else
+			{
+				result = it->second;
+			}
+		}
+
+		return result;
+	}
+
+	void doClear()
+	{
+		static EventArgs _emptyArgs;
+		Clear.notify(this, _emptyArgs);
+		_data.clear();
+	}
+
+	void doReplace()
+	{
+		std::set<TKey> delMe;
+		Replace.notify(this, delMe);
+		// delMe contains the to be removed elements
+		typename std::set<TKey>::const_iterator it    = delMe.begin();
+		typename std::set<TKey>::const_iterator endIt = delMe.end();
+
+		for (; it != endIt; ++it)
+		{
+			Iterator itH = _data.find(*it);
+			doRemove(itH);
+		}
+	}
+
+	TStrategy          _strategy;
+	mutable DataHolder _data;
+	mutable TMutex  _mutex;
+
+private:
+	AbstractCache(const AbstractCache& aCache);
+	AbstractCache& operator = (const AbstractCache& aCache);
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractCache_INCLUDED

+ 110 - 0
ThirdParty/include/Poco/AbstractDelegate.h

@@ -0,0 +1,110 @@
+//
+// AbstractDelegate.h
+//
+// Library: Foundation
+// Package: Events
+// Module:  AbstractDelegate
+//
+// Implementation of the AbstractDelegate template.
+//
+// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractDelegate_INCLUDED
+#define Foundation_AbstractDelegate_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+namespace Poco {
+
+
+template <class TArgs> 
+class AbstractDelegate
+	/// Base class for Delegate and Expire.
+{
+public:
+	AbstractDelegate()
+	{
+	}
+
+	AbstractDelegate(const AbstractDelegate& /*del*/)
+	{
+	}
+
+	virtual ~AbstractDelegate() 
+	{
+	}
+
+	virtual bool notify(const void* sender, TArgs& arguments) = 0;
+		/// Invokes the delegate's callback function.
+		/// Returns true if successful, or false if the delegate
+		/// has been disabled or has expired.
+
+	virtual bool equals(const AbstractDelegate& other) const = 0;
+		/// Compares the AbstractDelegate with the other one for equality.
+
+	virtual AbstractDelegate* clone() const = 0;
+		/// Returns a deep copy of the AbstractDelegate.
+
+	virtual void disable() = 0;
+		/// Disables the delegate, which is done prior to removal.
+		
+	virtual const AbstractDelegate* unwrap() const
+		/// Returns the unwrapped delegate. Must be overridden by decorators
+		/// like Expire.
+	{
+		return this;
+	}
+};
+
+
+template <> 
+class AbstractDelegate<void>
+	/// Base class for Delegate and Expire.
+{
+public:
+	AbstractDelegate()
+	{
+	}
+
+	AbstractDelegate(const AbstractDelegate&)
+	{
+	}
+
+	virtual ~AbstractDelegate() 
+	{
+	}
+
+	virtual bool notify(const void* sender) = 0;
+		/// Invokes the delegate's callback function.
+		/// Returns true if successful, or false if the delegate
+		/// has been disabled or has expired.
+
+	virtual bool equals(const AbstractDelegate& other) const = 0;
+		/// Compares the AbstractDelegate with the other one for equality.
+
+	virtual AbstractDelegate* clone() const = 0;
+		/// Returns a deep copy of the AbstractDelegate.
+
+	virtual void disable() = 0;
+		/// Disables the delegate, which is done prior to removal.
+		
+	virtual const AbstractDelegate* unwrap() const
+		/// Returns the unwrapped delegate. Must be overridden by decorators
+		/// like Expire.
+	{
+		return this;
+	}
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractDelegate_INCLUDED

+ 558 - 0
ThirdParty/include/Poco/AbstractEvent.h

@@ -0,0 +1,558 @@
+//
+// AbstractEvent.h
+//
+// Library: Foundation
+// Package: Events
+// Module:  AbstractEvent
+//
+// Definition of the AbstractEvent class.
+//
+// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractFoundation_INCLUDED
+#define Foundation_AbstractFoundation_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/SingletonHolder.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/ActiveResult.h"
+#include "Poco/ActiveMethod.h"
+#include "Poco/Mutex.h"
+
+
+namespace Poco {
+
+
+template <class TArgs, class TStrategy, class TDelegate, class TMutex = FastMutex>
+class AbstractEvent
+	/// An AbstractEvent is the base class of all events.
+	/// It works similar to the way C# handles notifications (aka events in C#).
+	///
+	/// Events can be used to send information to a set of delegates
+	/// which are registered with the event. The type of the data is specified with
+	/// the template parameter TArgs. The TStrategy parameter must be a subclass
+	/// of NotificationStrategy. The parameter TDelegate can either be a subclass of AbstractDelegate
+	/// or of AbstractPriorityDelegate.
+	///
+	/// Note that AbstractEvent should never be used directly. One ought to use
+	/// one of its subclasses which set the TStrategy and TDelegate template parameters
+	/// to fixed values. For most use-cases the BasicEvent template will be sufficient:
+	///
+	///     #include "Poco/BasicEvent.h"
+	///     #include "Poco/Delegate.h"
+	///
+	/// Note that as of release 1.4.2, the behavior of BasicEvent equals that of FIFOEvent,
+	/// so the FIFOEvent class is no longer necessary and provided for backwards compatibility
+	/// only.
+	///
+	/// BasicEvent works with a standard delegate. They allow one object to register
+	/// one or more delegates with an event. In contrast, a PriorityDelegate comes with an attached priority value
+	/// and allows one object to register for one priority value one or more delegates. Note that PriorityDelegates
+	/// only work with PriorityEvents:
+	///
+	///     #include "Poco/PriorityEvent.h"
+	///     #include "Poco/PriorityDelegate.h"
+	///
+	/// Use events by adding them as public members to the object which is throwing notifications:
+	///
+	///     class MyData
+	///     {
+	///     public:
+	///         Poco::BasicEvent<int> dataChanged;
+	///
+	///         MyData();
+	///         ...
+	///         void setData(int i);
+	///         ...
+	///     private:
+	///         int _data;
+	///     };
+	///
+	/// Firing the event is done either by calling the event's notify() or notifyAsync() method:
+	///
+	///     void MyData::setData(int i)
+	///     {
+	///         this->_data = i;
+	///         dataChanged.notify(this, this->_data);
+	///     }
+	///
+	/// Alternatively, instead of notify(), operator () can be used.
+	///
+	///     void MyData::setData(int i)
+	///     {
+	///         this->_data = i;
+	///         dataChanged(this, this->_data);
+	///     }
+	///
+	/// Note that operator (), notify() and notifyAsync() do not catch exceptions, i.e. in case a
+	/// delegate throws an exception, notifying is immediately aborted and the exception is propagated
+	/// back to the caller.
+	///
+	/// Delegates can register methods at the event. In the case of a BasicEvent
+	/// the Delegate template is used, in case of an PriorityEvent a PriorityDelegate is used.
+	/// Mixing of delegates, e.g. using a PriorityDelegate with a BasicEvent is not allowed and
+	/// can lead to compile-time and/or run-time errors. The standalone delegate() functions
+	/// can be used to construct Delegate objects.
+	///
+	/// Events require the observers to have one of the following method signatures:
+	///
+	///     void onEvent(const void* pSender, TArgs& args);
+	///     void onEvent(TArgs& args);
+	///     static void onEvent(const void* pSender, TArgs& args);
+	///     static void onEvent(void* pSender, TArgs& args);
+	///     static void onEvent(TArgs& args);
+	///
+	/// For performance reasons arguments are always sent by reference. This also allows observers
+	/// to modify the event argument. To prevent that, use <[const TArg]> as template
+	/// parameter. A non-conformant method signature leads to compile errors.
+	///
+	/// Assuming that the observer meets the method signature requirement, it can register
+	/// this method with the += operator:
+	///
+	///     class MyController
+	///     {
+	///     protected:
+	///         MyData _data;
+	///
+	///         void onDataChanged(void* pSender, int& data);
+	///         ...
+	///     };
+	///
+	///     MyController::MyController()
+	///     {
+	///         _data.dataChanged += delegate(this, &MyController::onDataChanged);
+	///     }
+	///
+	/// In some cases it might be desirable to work with automatically expiring registrations. Simply add
+	/// to delegate as 3rd parameter a expireValue (in milliseconds):
+	///
+	///     _data.dataChanged += delegate(this, &MyController::onDataChanged, 1000);
+	///
+	/// This will add a delegate to the event which will automatically be removed in 1000 millisecs.
+	///
+	/// Unregistering happens via the -= operator. Forgetting to unregister a method will lead to
+	/// segmentation faults later, when one tries to send a notify to a no longer existing object.
+	///
+	///     MyController::~MyController()
+	///     {
+	///         _data.dataChanged -= delegate(this, &MyController::onDataChanged);
+	///     }
+	///
+	/// Working with PriorityDelegate's as similar to working with BasicEvent.
+	/// Instead of delegate(), the priorityDelegate() function must be used
+	/// to create the PriorityDelegate.
+{
+public:
+	typedef TDelegate* DelegateHandle;
+	typedef TArgs Args;
+
+	AbstractEvent():
+		_executeAsync(this, &AbstractEvent::executeAsyncImpl),
+		_enabled(true)
+	{
+	}
+
+	AbstractEvent(const TStrategy& strat):
+		_executeAsync(this, &AbstractEvent::executeAsyncImpl),
+		_strategy(strat),
+		_enabled(true)
+	{
+	}
+
+	virtual ~AbstractEvent()
+	{
+	}
+
+	void operator += (const TDelegate& aDelegate)
+		/// Adds a delegate to the event.
+		///
+		/// Exact behavior is determined by the TStrategy.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.add(aDelegate);
+	}
+
+	void operator -= (const TDelegate& aDelegate)
+		/// Removes a delegate from the event.
+		///
+		/// If the delegate is not found, this function does nothing.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.remove(aDelegate);
+	}
+
+	DelegateHandle add(const TDelegate& aDelegate)
+		/// Adds a delegate to the event.
+		///
+		/// Exact behavior is determined by the TStrategy.
+		///
+		/// Returns a DelegateHandle which can be used in call to
+		/// remove() to remove the delegate.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _strategy.add(aDelegate);
+	}
+
+	void remove(DelegateHandle delegateHandle)
+		/// Removes a delegate from the event using a DelegateHandle
+		/// returned by add().
+		///
+		/// If the delegate is not found, this function does nothing.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.remove(delegateHandle);
+	}
+
+	void operator () (const void* pSender, TArgs& args)
+		/// Shortcut for notify(pSender, args);
+	{
+		notify(pSender, args);
+	}
+
+	void operator () (TArgs& args)
+		/// Shortcut for notify(args).
+	{
+		notify(0, args);
+	}
+
+	void notify(const void* pSender, TArgs& args)
+		/// Sends a notification to all registered delegates. The order is
+		/// determined by the TStrategy. This method is blocking. While executing,
+		/// the list of delegates may be modified. These changes don't
+		/// influence the current active notifications but are activated with
+		/// the next notify. If a delegate is removed during a notify(), the
+		/// delegate will no longer be invoked (unless it has already been
+		/// invoked prior to removal). If one of the delegates throws an exception,
+		/// the notify method is immediately aborted and the exception is propagated
+		/// to the caller.
+	{
+		Poco::ScopedLockWithUnlock<TMutex> lock(_mutex);
+
+		if (!_enabled) return;
+
+		// thread-safeness:
+		// copy should be faster and safer than blocking until
+		// execution ends
+		TStrategy strategy(_strategy);
+		lock.unlock();
+		strategy.notify(pSender, args);
+	}
+
+	bool hasDelegates() const {
+		return !empty();
+	}
+
+	ActiveResult<TArgs> notifyAsync(const void* pSender, const TArgs& args)
+		/// Sends a notification to all registered delegates. The order is
+		/// determined by the TStrategy. This method is not blocking and will
+		/// immediately return. The delegates are invoked in a seperate thread.
+		/// Call activeResult.wait() to wait until the notification has ended.
+		/// While executing, other objects can change the delegate list. These changes don't
+		/// influence the current active notifications but are activated with
+		/// the next notify. If a delegate is removed during a notify(), the
+		/// delegate will no longer be invoked (unless it has already been
+		/// invoked prior to removal). If one of the delegates throws an exception,
+		/// the execution is aborted and the exception is propagated to the caller.
+	{
+		NotifyAsyncParams params(pSender, args);
+		{
+			typename TMutex::ScopedLock lock(_mutex);
+
+			// thread-safeness:
+			// copy should be faster and safer than blocking until
+			// execution ends
+			// make a copy of the strategy here to guarantee that
+			// between notifyAsync and the execution of the method no changes can occur
+
+			params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
+			params.enabled  = _enabled;
+		}
+		ActiveResult<TArgs> result = _executeAsync(params);
+		return result;
+	}
+
+	void enable()
+		/// Enables the event.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_enabled = true;
+	}
+
+	void disable()
+		/// Disables the event. notify and notifyAsnyc will be ignored,
+		/// but adding/removing delegates is still allowed.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_enabled = false;
+	}
+
+	bool isEnabled() const
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _enabled;
+	}
+
+	void clear()
+		/// Removes all delegates.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.clear();
+	}
+
+	bool empty() const
+		/// Checks if any delegates are registered at the delegate.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _strategy.empty();
+	}
+
+protected:
+	struct NotifyAsyncParams
+	{
+		SharedPtr<TStrategy> ptrStrat;
+		const void* pSender;
+		TArgs       args;
+		bool        enabled;
+
+		NotifyAsyncParams(const void* pSend, const TArgs& a):ptrStrat(), pSender(pSend), args(a), enabled(true)
+			/// Default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed.
+		{
+		}
+	};
+
+	ActiveMethod<TArgs, NotifyAsyncParams, AbstractEvent> _executeAsync;
+
+	TArgs executeAsyncImpl(const NotifyAsyncParams& par)
+	{
+		if (!par.enabled)
+		{
+			return par.args;
+		}
+
+		NotifyAsyncParams params = par;
+		TArgs retArgs(params.args);
+		params.ptrStrat->notify(params.pSender, retArgs);
+		return retArgs;
+	}
+
+	TStrategy _strategy; /// The strategy used to notify observers.
+	bool      _enabled;  /// Stores if an event is enabled. Notfies on disabled events have no effect
+	                     /// but it is possible to change the observers.
+	mutable TMutex _mutex;
+
+private:
+	AbstractEvent(const AbstractEvent& other);
+	AbstractEvent& operator = (const AbstractEvent& other);
+};
+
+
+template <class TStrategy, class TDelegate, class TMutex>
+class AbstractEvent<void, TStrategy, TDelegate, TMutex>
+{
+public:
+	typedef TDelegate* DelegateHandle;
+
+	AbstractEvent():
+		_executeAsync(this, &AbstractEvent::executeAsyncImpl),
+		_enabled(true)
+	{
+	}
+
+	AbstractEvent(const TStrategy& strat):
+		_executeAsync(this, &AbstractEvent::executeAsyncImpl),
+		_strategy(strat),
+		_enabled(true)
+	{
+	}
+
+	virtual ~AbstractEvent()
+	{
+	}
+
+	void operator += (const TDelegate& aDelegate)
+		/// Adds a delegate to the event.
+		///
+		/// Exact behavior is determined by the TStrategy.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.add(aDelegate);
+	}
+
+	void operator -= (const TDelegate& aDelegate)
+		/// Removes a delegate from the event.
+		///
+		/// If the delegate is not found, this function does nothing.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.remove(aDelegate);
+	}
+
+	DelegateHandle add(const TDelegate& aDelegate)
+		/// Adds a delegate to the event.
+		///
+		/// Exact behavior is determined by the TStrategy.
+		///
+		/// Returns a DelegateHandle which can be used in call to
+		/// remove() to remove the delegate.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _strategy.add(aDelegate);
+	}
+
+	void remove(DelegateHandle delegateHandle)
+		/// Removes a delegate from the event using a DelegateHandle
+		/// returned by add().
+		///
+		/// If the delegate is not found, this function does nothing.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.remove(delegateHandle);
+	}
+
+	void operator () (const void* pSender)
+		/// Shortcut for notify(pSender, args);
+	{
+		notify(pSender);
+	}
+
+	void operator () ()
+		/// Shortcut for notify(args).
+	{
+		notify(0);
+	}
+
+	void notify(const void* pSender)
+		/// Sends a notification to all registered delegates. The order is
+		/// determined by the TStrategy. This method is blocking. While executing,
+		/// the list of delegates may be modified. These changes don't
+		/// influence the current active notifications but are activated with
+		/// the next notify. If a delegate is removed during a notify(), the
+		/// delegate will no longer be invoked (unless it has already been
+		/// invoked prior to removal). If one of the delegates throws an exception,
+		/// the notify method is immediately aborted and the exception is propagated
+		/// to the caller.
+	{
+		Poco::ScopedLockWithUnlock<TMutex> lock(_mutex);
+
+		if (!_enabled) return;
+
+		// thread-safeness:
+		// copy should be faster and safer than blocking until
+		// execution ends
+		TStrategy strategy(_strategy);
+		lock.unlock();
+		strategy.notify(pSender);
+	}
+
+	ActiveResult<void> notifyAsync(const void* pSender)
+		/// Sends a notification to all registered delegates. The order is
+		/// determined by the TStrategy. This method is not blocking and will
+		/// immediately return. The delegates are invoked in a seperate thread.
+		/// Call activeResult.wait() to wait until the notification has ended.
+		/// While executing, other objects can change the delegate list. These changes don't
+		/// influence the current active notifications but are activated with
+		/// the next notify. If a delegate is removed during a notify(), the
+		/// delegate will no longer be invoked (unless it has already been
+		/// invoked prior to removal). If one of the delegates throws an exception,
+		/// the execution is aborted and the exception is propagated to the caller.
+	{
+		NotifyAsyncParams params(pSender);
+		{
+			typename TMutex::ScopedLock lock(_mutex);
+
+			// thread-safeness:
+			// copy should be faster and safer than blocking until
+			// execution ends
+			// make a copy of the strategy here to guarantee that
+			// between notifyAsync and the execution of the method no changes can occur
+
+			params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
+			params.enabled  = _enabled;
+		}
+		ActiveResult<void> result = _executeAsync(params);
+		return result;
+	}
+
+	void enable()
+		/// Enables the event.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_enabled = true;
+	}
+
+	void disable()
+		/// Disables the event. notify and notifyAsnyc will be ignored,
+		/// but adding/removing delegates is still allowed.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_enabled = false;
+	}
+
+	bool isEnabled() const
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _enabled;
+	}
+
+	void clear()
+		/// Removes all delegates.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		_strategy.clear();
+	}
+
+	bool empty() const
+		/// Checks if any delegates are registered at the delegate.
+	{
+		typename TMutex::ScopedLock lock(_mutex);
+		return _strategy.empty();
+	}
+
+protected:
+	struct NotifyAsyncParams
+	{
+		SharedPtr<TStrategy> ptrStrat;
+		const void* pSender;
+		bool        enabled;
+
+		NotifyAsyncParams(const void* pSend):ptrStrat(), pSender(pSend), enabled(true)
+			/// Default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed.
+		{
+		}
+	};
+
+	ActiveMethod<void, NotifyAsyncParams, AbstractEvent> _executeAsync;
+
+	void executeAsyncImpl(const NotifyAsyncParams& par)
+	{
+		if (!par.enabled)
+		{
+			return;
+		}
+
+		NotifyAsyncParams params = par;
+		params.ptrStrat->notify(params.pSender);
+		return;
+	}
+
+	TStrategy _strategy; /// The strategy used to notify observers.
+	bool      _enabled;  /// Stores if an event is enabled. Notfies on disabled events have no effect
+	                     /// but it is possible to change the observers.
+	mutable TMutex _mutex;
+
+private:
+	AbstractEvent(const AbstractEvent& other);
+	AbstractEvent& operator = (const AbstractEvent& other);
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractFoundation_INCLUDED

+ 50 - 0
ThirdParty/include/Poco/AbstractObserver.h

@@ -0,0 +1,50 @@
+//
+// AbstractObserver.h
+//
+// Library: Foundation
+// Package: Notifications
+// Module:  NotificationCenter
+//
+// Definition of the AbstractObserver class.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractObserver_INCLUDED
+#define Foundation_AbstractObserver_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Notification.h"
+
+
+namespace Poco {
+
+
+class Foundation_API AbstractObserver
+	/// The base class for all instantiations of
+	/// the Observer and NObserver template classes.
+{
+public:
+	AbstractObserver();
+	AbstractObserver(const AbstractObserver& observer);
+	virtual ~AbstractObserver();
+	
+	AbstractObserver& operator = (const AbstractObserver& observer);
+
+	virtual void notify(Notification* pNf) const = 0;
+	virtual bool equals(const AbstractObserver& observer) const = 0;
+	virtual bool accepts(Notification* pNf) const = 0;
+	virtual AbstractObserver* clone() const = 0;
+	virtual void disable() = 0;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractObserver_INCLUDED

+ 63 - 0
ThirdParty/include/Poco/AbstractPriorityDelegate.h

@@ -0,0 +1,63 @@
+//
+// AbstractPriorityDelegate.h
+//
+// Library: Foundation
+// Package: Events
+// Module:  AbstractPriorityDelegate
+//
+// Implementation of the AbstractPriorityDelegate template.
+//
+// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractPriorityDelegate_INCLUDED
+#define Foundation_AbstractPriorityDelegate_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/AbstractDelegate.h"
+
+
+namespace Poco {
+
+
+template <class TArgs> 
+class AbstractPriorityDelegate: public AbstractDelegate<TArgs>
+	/// Base class for PriorityDelegate and PriorityExpire.
+	///
+	/// Extends AbstractDelegate with a priority value.
+{
+public:
+	AbstractPriorityDelegate(int prio):
+		_priority(prio)
+	{
+	}
+
+	AbstractPriorityDelegate(const AbstractPriorityDelegate& del):
+		AbstractDelegate<TArgs>(del),
+		_priority(del._priority)
+	{
+	}
+
+	virtual ~AbstractPriorityDelegate() 
+	{
+	}
+
+	int priority() const
+	{
+		return _priority;
+	}
+
+protected:
+	int _priority;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractPriorityDelegate_INCLUDED

+ 77 - 0
ThirdParty/include/Poco/AbstractStrategy.h

@@ -0,0 +1,77 @@
+//
+// AbstractStrategy.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AbstractCache
+//
+// Definition of the AbstractStrategy class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AbstractStrategy_INCLUDED
+#define Foundation_AbstractStrategy_INCLUDED
+
+
+#include "Poco/KeyValueArgs.h"
+#include "Poco/ValidArgs.h"
+#include "Poco/EventArgs.h"
+#include <set>
+
+
+namespace Poco {
+
+
+template <class TKey, class TValue> 
+class AbstractStrategy
+	/// An AbstractStrategy is the interface for all strategies. 
+{
+public:
+	AbstractStrategy()
+	{
+	}
+
+	virtual ~AbstractStrategy()
+	{
+	}
+
+	virtual void onUpdate(const void* pSender, const KeyValueArgs <TKey, TValue>& args)
+		/// Updates an existing entry.
+	{
+		onRemove(pSender,args.key());
+		onAdd(pSender, args);
+	}
+	
+	virtual void onAdd(const void* pSender, const KeyValueArgs <TKey, TValue>& key) = 0;
+		/// Adds the key to the strategy.
+		/// If for the key already an entry exists, an exception will be thrown.
+
+	virtual void onRemove(const void* pSender, const TKey& key) = 0;
+		/// Removes an entry from the strategy. If the entry is not found
+		/// the remove is ignored.
+
+	virtual void onGet(const void* pSender, const TKey& key) = 0;
+		/// Informs the strategy that a read-access happens to an element.
+
+	virtual void onClear(const void* pSender, const EventArgs& args) = 0;
+		/// Removes all elements from the cache.
+
+	virtual void onIsValid(const void* pSender, ValidArgs<TKey>& key) = 0;
+		/// Used to query if a key is still valid (i.e. cached).
+
+	virtual void onReplace(const void* pSender, std::set<TKey>& elemsToRemove) = 0;
+		/// Used by the Strategy to indicate which elements should be removed from
+		/// the cache. Note that onReplace does not change the current list of keys.
+		/// The cache object is reponsible to remove the elements.
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AbstractStrategy_INCLUDED

+ 83 - 0
ThirdParty/include/Poco/AccessExpirationDecorator.h

@@ -0,0 +1,83 @@
+//
+// AccessExpirationDecorator.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AccessExpirationDecorator
+//
+// Implementation of the AccessExpirationDecorator template.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AccessExpirationDecorator_INCLUDED
+#define Foundation_AccessExpirationDecorator_INCLUDED
+
+
+#include "Poco/Timestamp.h"
+#include "Poco/Timespan.h"
+
+
+namespace Poco {
+
+
+template <typename TArgs>
+class AccessExpirationDecorator
+	/// AccessExpirationDecorator adds an expiration method to values so that they can be used
+	/// with the UniqueAccessExpireCache
+{
+public:
+	AccessExpirationDecorator():
+		_value(),
+		_span()
+	{
+	}
+
+	AccessExpirationDecorator(const TArgs& p, const Poco::Timespan::TimeDiff& diffInMs):
+			/// Creates an element that will expire in diff milliseconds
+		_value(p),
+		_span(diffInMs*1000)
+	{
+	}
+
+	AccessExpirationDecorator(const TArgs& p, const Poco::Timespan& timeSpan):
+		/// Creates an element that will expire after the given timeSpan
+		_value(p),
+		_span(timeSpan)
+	{
+	}
+
+
+	~AccessExpirationDecorator()
+	{
+	}
+	
+	const Poco::Timespan& getTimeout() const
+	{
+		return _span;
+	}
+
+	const TArgs& value() const
+	{
+		return _value;
+	}
+
+	TArgs& value()
+	{
+		return _value;
+	}
+
+private:
+	TArgs     _value;
+	Timespan  _span;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AccessExpirationDecorator_INCLUDED

+ 63 - 0
ThirdParty/include/Poco/AccessExpireCache.h

@@ -0,0 +1,63 @@
+//
+// AccessExpireCache.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AccessExpireCache
+//
+// Definition of the AccessExpireCache class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AccessExpireCache_INCLUDED
+#define Foundation_AccessExpireCache_INCLUDED
+
+
+#include "Poco/AbstractCache.h"
+#include "Poco/AccessExpireStrategy.h"
+
+
+namespace Poco {
+
+
+template <
+	class TKey, 
+	class TValue, 
+	class TMutex = FastMutex, 
+	class TEventMutex = FastMutex
+> 
+class AccessExpireCache: public AbstractCache<TKey, TValue, AccessExpireStrategy<TKey, TValue>, TMutex, TEventMutex>
+	/// An AccessExpireCache caches entries for a fixed time period (per default 10 minutes).
+	/// Entries expire when they are not accessed with get() during this time period. Each access resets
+	/// the start time for expiration.
+	/// Be careful when using an AccessExpireCache. A cache is often used
+	/// like cache.has(x) followed by cache.get x). Note that it could happen
+	/// that the "has" call works, then the current execution thread gets descheduled, time passes,
+	/// the entry gets invalid, thus leading to an empty SharedPtr being returned 
+	/// when "get" is invoked.
+{
+public:
+	AccessExpireCache(Timestamp::TimeDiff expire = 600000): 
+		AbstractCache<TKey, TValue, AccessExpireStrategy<TKey, TValue>, TMutex, TEventMutex>(AccessExpireStrategy<TKey, TValue>(expire))
+	{
+	}
+
+	~AccessExpireCache()
+	{
+	}
+
+private:
+	AccessExpireCache(const AccessExpireCache& aCache);
+	AccessExpireCache& operator = (const AccessExpireCache& aCache);
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AccessExpireCache_INCLUDED

+ 62 - 0
ThirdParty/include/Poco/AccessExpireLRUCache.h

@@ -0,0 +1,62 @@
+//
+// AccessExpireLRUCache.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AccessExpireLRUCache
+//
+// Definition of the AccessExpireLRUCache class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AccessExpireLRUCache_INCLUDED
+#define Foundation_AccessExpireLRUCache_INCLUDED
+
+
+#include "Poco/AbstractCache.h"
+#include "Poco/StrategyCollection.h"
+#include "Poco/AccessExpireStrategy.h"
+#include "Poco/LRUStrategy.h"
+
+
+namespace Poco {
+
+
+template < 
+	class TKey,
+	class TValue,
+	class TMutex = FastMutex, 
+	class TEventMutex = FastMutex
+>
+class AccessExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue>, TMutex, TEventMutex>
+	/// An AccessExpireLRUCache combines LRU caching and time based expire caching.
+	/// It cache entries for a fixed time period (per default 10 minutes)
+	/// but also limits the size of the cache (per default: 1024).
+{
+public:
+	AccessExpireLRUCache(long cacheSize = 1024, Timestamp::TimeDiff expire = 600000): 
+		AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue>, TMutex, TEventMutex >(StrategyCollection<TKey, TValue>())
+	{
+		this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
+		this->_strategy.pushBack(new AccessExpireStrategy<TKey, TValue>(expire));
+	}
+
+	~AccessExpireLRUCache()
+	{
+	}
+
+private:
+	AccessExpireLRUCache(const AccessExpireLRUCache& aCache);
+	AccessExpireLRUCache& operator = (const AccessExpireLRUCache& aCache);
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AccessExpireLRUCache_INCLUDED

+ 74 - 0
ThirdParty/include/Poco/AccessExpireStrategy.h

@@ -0,0 +1,74 @@
+//
+// AccessExpireStrategy.h
+//
+// Library: Foundation
+// Package: Cache
+// Module:  AccessExpireStrategy
+//
+// Definition of the AccessExpireStrategy class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AccessExpireStrategy_INCLUDED
+#define Foundation_AccessExpireStrategy_INCLUDED
+
+
+#include "Poco/KeyValueArgs.h"
+#include "Poco/ValidArgs.h"
+#include "Poco/ExpireStrategy.h"
+#include "Poco/Bugcheck.h"
+#include "Poco/Timestamp.h"
+#include "Poco/EventArgs.h"
+#include <set>
+#include <map>
+
+
+namespace Poco {
+
+
+template <
+	class TKey,
+	class TValue
+>
+class AccessExpireStrategy: public ExpireStrategy<TKey, TValue>
+	/// An AccessExpireStrategy implements time and access based expiration of cache entries
+{
+public:
+	AccessExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): ExpireStrategy<TKey, TValue>(expireTimeInMilliSec)
+		/// Create an expire strategy. Note that the smallest allowed caching time is 25ms.
+		/// Anything lower than that is not useful with current operating systems.
+	{
+	}
+
+	~AccessExpireStrategy()
+	{
+	}
+
+	void onGet(const void*, const TKey& key)
+	{
+		// get triggers an update to the expiration time
+		typename ExpireStrategy<TKey, TValue>::Iterator it = this->_keys.find(key);
+		if (it != this->_keys.end())
+		{
+			if (!it->second->first.isElapsed(this->_expireTime)) // don't extend if already expired
+			{
+				this->_keyIndex.erase(it->second);
+				Timestamp now;
+				typename ExpireStrategy<TKey, TValue>::IndexIterator itIdx =
+					this->_keyIndex.insert(typename ExpireStrategy<TKey, TValue>::TimeIndex::value_type(now, key));
+				it->second = itIdx;
+			}
+		}
+	}
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AccessExpireStrategy_INCLUDED

+ 116 - 0
ThirdParty/include/Poco/ActiveDispatcher.h

@@ -0,0 +1,116 @@
+//
+// ActiveDispatcher.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the ActiveDispatcher class.
+//
+// Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_ActiveDispatcher_INCLUDED
+#define Foundation_ActiveDispatcher_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Runnable.h"
+#include "Poco/Thread.h"
+#include "Poco/ActiveStarter.h"
+#include "Poco/ActiveRunnable.h"
+#include "Poco/NotificationQueue.h"
+
+
+namespace Poco {
+
+
+class Foundation_API ActiveDispatcher: protected Runnable
+	/// This class is used to implement an active object
+	/// with strictly serialized method execution.
+	///
+	/// An active object, which is an ordinary object
+	/// containing ActiveMethod members, executes all
+	/// active methods in their own thread. 
+	/// This behavior does not fit the "classic"
+	/// definition of an active object, which serializes
+	/// the execution of active methods (in other words,
+	/// only one active method can be running at any given
+	/// time).
+	///
+	/// Using this class as a base class, the serializing
+	/// behavior for active objects can be implemented.
+	/// 
+	/// The following example shows how this is done:
+	///
+	///     class ActiveObject: public ActiveDispatcher
+	///     {
+	///     public:
+	///         ActiveObject():
+	///             exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
+	///         {
+	///         }
+	///
+	///         ActiveMethod<std::string, std::string, ActiveObject, ActiveStarter<ActiveDispatcher> > exampleActiveMethod;
+	///
+	///     protected:
+	///         std::string exampleActiveMethodImpl(const std::string& arg)
+	///         {
+	///             ...
+	///         }
+	///     };
+	///
+	/// The only things different from the example in
+	/// ActiveMethod is that the ActiveObject in this case
+	/// inherits from ActiveDispatcher, and that the ActiveMethod
+	/// template for exampleActiveMethod has an additional parameter,
+	/// specifying the specialized ActiveStarter for ActiveDispatcher.
+{
+public:
+	ActiveDispatcher();
+		/// Creates the ActiveDispatcher.
+
+	ActiveDispatcher(Thread::Priority prio);
+		/// Creates the ActiveDispatcher and sets
+		/// the priority of its thread.
+
+	virtual ~ActiveDispatcher();
+		/// Destroys the ActiveDispatcher.
+
+	void start(ActiveRunnableBase::Ptr pRunnable);
+		/// Adds the Runnable to the dispatch queue.
+
+	void cancel();
+		/// Cancels all queued methods.
+		
+protected:
+	void run();
+	void stop();
+
+private:
+	Thread            _thread;
+	NotificationQueue _queue;
+};
+
+
+template <>
+class ActiveStarter<ActiveDispatcher>
+	/// A specialization of ActiveStarter
+	/// for ActiveDispatcher.
+{
+public:
+	static void start(ActiveDispatcher* pOwner, ActiveRunnableBase::Ptr pRunnable)
+	{
+		pOwner->start(pRunnable);
+	}
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_ActiveDispatcher_INCLUDED

+ 218 - 0
ThirdParty/include/Poco/ActiveMethod.h

@@ -0,0 +1,218 @@
+//
+// ActiveMethod.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the ActiveMethod class.
+//
+// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_ActiveMethod_INCLUDED
+#define Foundation_ActiveMethod_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/ActiveResult.h"
+#include "Poco/ActiveRunnable.h"
+#include "Poco/ActiveStarter.h"
+#include "Poco/AutoPtr.h"
+
+
+namespace Poco {
+
+
+template <class ResultType, class ArgType, class OwnerType, class StarterType = ActiveStarter<OwnerType> >
+class ActiveMethod
+	/// An active method is a method that, when called, executes
+	/// in its own thread. ActiveMethod's take exactly one
+	/// argument and can return a value. To pass more than one
+	/// argument to the method, use a struct.
+	/// The following example shows how to add an ActiveMethod
+	/// to a class:
+	///
+	///     class ActiveObject
+	///     {
+	///     public:
+	///         ActiveObject():
+	///             exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
+	///         {
+	///         }
+	///
+	///         ActiveMethod<std::string, std::string, ActiveObject> exampleActiveMethod;
+	///
+	///     protected:
+	///         std::string exampleActiveMethodImpl(const std::string& arg)
+	///         {
+	///             ...
+	///         }
+	///     };
+	///
+	/// And following is an example that shows how to invoke an ActiveMethod.
+	///
+	///     ActiveObject myActiveObject;
+	///     ActiveResult<std::string> result = myActiveObject.exampleActiveMethod("foo");
+	///     ...
+	///     result.wait();
+	///     std::cout << result.data() << std::endl;
+	///
+	/// The way an ActiveMethod is started can be changed by passing a StarterType
+	/// template argument with a corresponding class. The default ActiveStarter
+	/// starts the method in its own thread, obtained from a thread pool.
+	///
+	/// For an alternative implementation of StarterType, see ActiveDispatcher.
+	///
+	/// For methods that do not require an argument or a return value, the Void
+	/// class can be used.
+{
+public:
+	typedef ResultType (OwnerType::*Callback)(const ArgType&);
+	typedef ActiveResult<ResultType> ActiveResultType;
+	typedef ActiveRunnable<ResultType, ArgType, OwnerType> ActiveRunnableType;
+
+	ActiveMethod(OwnerType* pOwner, Callback method):
+		_pOwner(pOwner),
+		_method(method)
+		/// Creates an ActiveMethod object.
+	{
+		poco_check_ptr (pOwner);
+	}
+	
+	ActiveResultType operator () (const ArgType& arg)
+		/// Invokes the ActiveMethod.
+	{
+		ActiveResultType result(new ActiveResultHolder<ResultType>());
+		ActiveRunnableBase::Ptr pRunnable(new ActiveRunnableType(_pOwner, _method, arg, result));
+		StarterType::start(_pOwner, pRunnable);
+		return result;
+	}
+		
+	ActiveMethod(const ActiveMethod& other):
+		_pOwner(other._pOwner),
+		_method(other._method)
+	{
+	}
+
+	ActiveMethod& operator = (const ActiveMethod& other)
+	{
+		ActiveMethod tmp(other);
+		swap(tmp);
+		return *this;
+	}
+
+	void swap(ActiveMethod& other)
+	{
+		std::swap(_pOwner, other._pOwner);
+		std::swap(_method, other._method);
+	}
+
+private:
+	ActiveMethod();
+
+	OwnerType* _pOwner;
+	Callback   _method;
+};
+
+
+
+template <class ResultType, class OwnerType, class StarterType>
+class ActiveMethod <ResultType, void, OwnerType, StarterType>
+	/// An active method is a method that, when called, executes
+	/// in its own thread. ActiveMethod's take exactly one
+	/// argument and can return a value. To pass more than one
+	/// argument to the method, use a struct.
+	/// The following example shows how to add an ActiveMethod
+	/// to a class:
+	///
+	///     class ActiveObject
+	///     {
+	///     public:
+	///         ActiveObject():
+	///             exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
+	///         {
+	///         }
+	///
+	///         ActiveMethod<std::string, std::string, ActiveObject> exampleActiveMethod;
+	///
+	///     protected:
+	///         std::string exampleActiveMethodImpl(const std::string& arg)
+	///         {
+	///             ...
+	///         }
+	///     };
+	///
+	/// And following is an example that shows how to invoke an ActiveMethod.
+	///
+	///     ActiveObject myActiveObject;
+	///     ActiveResult<std::string> result = myActiveObject.exampleActiveMethod("foo");
+	///     ...
+	///     result.wait();
+	///     std::cout << result.data() << std::endl;
+	///
+	/// The way an ActiveMethod is started can be changed by passing a StarterType
+	/// template argument with a corresponding class. The default ActiveStarter
+	/// starts the method in its own thread, obtained from a thread pool.
+	///
+	/// For an alternative implementation of StarterType, see ActiveDispatcher.
+	///
+	/// For methods that do not require an argument or a return value, simply use void.
+{
+public:
+	typedef ResultType (OwnerType::*Callback)(void);
+	typedef ActiveResult<ResultType> ActiveResultType;
+	typedef ActiveRunnable<ResultType, void, OwnerType> ActiveRunnableType;
+
+	ActiveMethod(OwnerType* pOwner, Callback method):
+		_pOwner(pOwner),
+		_method(method)
+		/// Creates an ActiveMethod object.
+	{
+		poco_check_ptr (pOwner);
+	}
+	
+	ActiveResultType operator () (void)
+		/// Invokes the ActiveMethod.
+	{
+		ActiveResultType result(new ActiveResultHolder<ResultType>());
+		ActiveRunnableBase::Ptr pRunnable(new ActiveRunnableType(_pOwner, _method, result));
+		StarterType::start(_pOwner, pRunnable);
+		return result;
+	}
+		
+	ActiveMethod(const ActiveMethod& other):
+		_pOwner(other._pOwner),
+		_method(other._method)
+	{
+	}
+
+	ActiveMethod& operator = (const ActiveMethod& other)
+	{
+		ActiveMethod tmp(other);
+		swap(tmp);
+		return *this;
+	}
+
+	void swap(ActiveMethod& other)
+	{
+		std::swap(_pOwner, other._pOwner);
+		std::swap(_method, other._method);
+	}
+
+private:
+	ActiveMethod();
+
+	OwnerType* _pOwner;
+	Callback   _method;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_ActiveMethod_INCLUDED

+ 495 - 0
ThirdParty/include/Poco/ActiveResult.h

@@ -0,0 +1,495 @@
+//
+// ActiveResult.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the ActiveResult class.
+//
+// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_ActiveResult_INCLUDED
+#define Foundation_ActiveResult_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Mutex.h"
+#include "Poco/Event.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/Exception.h"
+#include <algorithm>
+
+
+namespace Poco {
+
+
+template <class ResultType>
+class ActiveResultHolder: public RefCountedObject
+	/// This class holds the result of an asynchronous method
+	/// invocation. It is used to pass the result from the
+	/// execution thread back to the invocation thread. 
+	/// The class uses reference counting for memory management.
+	/// Do not use this class directly, use ActiveResult instead.
+{
+public:
+	ActiveResultHolder():
+		_pData(0),
+		_pExc(0),
+		_event(false)
+		/// Creates an ActiveResultHolder.
+	{
+	}
+		
+	ResultType& data()
+		/// Returns a reference to the actual result.
+	{
+		poco_check_ptr(_pData);
+		return *_pData;
+	}
+	
+	void data(ResultType* pData)
+	{
+		delete _pData;
+		_pData = pData;
+	}
+	
+	void wait()
+		/// Pauses the caller until the result becomes available.
+	{
+		_event.wait();
+	}
+	
+	bool tryWait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Returns true if the result became
+		/// available, false otherwise.
+	{
+		return _event.tryWait(milliseconds);
+	}
+	
+	void wait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Throws a TimeoutException if the
+		/// result did not became available.
+	{
+		_event.wait(milliseconds);
+	}
+	
+	void notify()
+		/// Notifies the invoking thread that the result became available.
+	{
+		_event.set();
+	}
+	
+	bool failed() const
+		/// Returns true if the active method failed (and threw an exception).
+		/// Information about the exception can be obtained by calling error().
+	{
+		return _pExc != 0;
+	}
+	
+	std::string error() const
+		/// If the active method threw an exception, a textual representation
+		/// of the exception is returned. An empty string is returned if the
+		/// active method completed successfully.
+	{
+		if (_pExc)
+			return _pExc->message();
+		else
+			return std::string();
+	}
+	
+	Exception* exception() const
+		/// If the active method threw an exception, a clone of the exception
+		/// object is returned, otherwise null.
+	{
+		return _pExc;
+	}
+	
+	void error(const Exception& exc)
+		/// Sets the exception.
+	{
+		delete _pExc;
+		_pExc = exc.clone();
+	}
+	
+	void error(const std::string& msg)
+		/// Sets the exception.
+	{
+		delete _pExc;
+		_pExc = new UnhandledException(msg);
+	}
+
+protected:
+	~ActiveResultHolder()
+	{
+		delete _pData;
+		delete _pExc;
+	}
+
+private:
+	ResultType* _pData;
+	Exception*  _pExc;
+	Event       _event;
+};
+
+
+
+template <>
+class ActiveResultHolder<void>: public RefCountedObject
+{
+public:
+	ActiveResultHolder():
+		_pExc(0),
+		_event(false)
+		/// Creates an ActiveResultHolder.
+	{
+	}
+	
+	void wait()
+		/// Pauses the caller until the result becomes available.
+	{
+		_event.wait();
+	}
+	
+	bool tryWait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Returns true if the result became
+		/// available, false otherwise.
+	{
+		return _event.tryWait(milliseconds);
+	}
+	
+	void wait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Throws a TimeoutException if the
+		/// result did not became available.
+	{
+		_event.wait(milliseconds);
+	}
+	
+	void notify()
+		/// Notifies the invoking thread that the result became available.
+	{
+		_event.set();
+	}
+	
+	bool failed() const
+		/// Returns true if the active method failed (and threw an exception).
+		/// Information about the exception can be obtained by calling error().
+	{
+		return _pExc != 0;
+	}
+	
+	std::string error() const
+		/// If the active method threw an exception, a textual representation
+		/// of the exception is returned. An empty string is returned if the
+		/// active method completed successfully.
+	{
+		if (_pExc)
+			return _pExc->message();
+		else
+			return std::string();
+	}
+	
+	Exception* exception() const
+		/// If the active method threw an exception, a clone of the exception
+		/// object is returned, otherwise null.
+	{
+		return _pExc;
+	}
+	
+	void error(const Exception& exc)
+		/// Sets the exception.
+	{
+		delete _pExc;
+		_pExc = exc.clone();
+	}
+	
+	void error(const std::string& msg)
+		/// Sets the exception.
+	{
+		delete _pExc;
+		_pExc = new UnhandledException(msg);
+	}
+
+protected:
+	~ActiveResultHolder()
+	{
+		delete _pExc;
+	}
+
+private:
+	Exception*  _pExc;
+	Event       _event;
+};
+
+
+template <class RT>
+class ActiveResult
+	/// This class holds the result of an asynchronous method
+	/// invocation (see class ActiveMethod). It is used to pass the 
+	/// result from the execution thread back to the invocation thread. 
+{
+public:
+	typedef RT ResultType;
+	typedef ActiveResultHolder<ResultType> ActiveResultHolderType;
+
+	ActiveResult(ActiveResultHolderType* pHolder):
+		_pHolder(pHolder)
+		/// Creates the active result. For internal use only.
+	{
+		poco_check_ptr (pHolder);
+	}
+	
+	ActiveResult(const ActiveResult& result)
+		/// Copy constructor.
+	{
+		_pHolder = result._pHolder;
+		_pHolder->duplicate();
+	}
+	
+	~ActiveResult()
+		/// Destroys the result.
+	{
+		_pHolder->release();
+	}
+	
+	ActiveResult& operator = (const ActiveResult& result)
+		/// Assignment operator.
+	{
+		ActiveResult tmp(result);
+		swap(tmp);
+		return *this;
+	}
+	
+	void swap(ActiveResult& result)
+	{
+		using std::swap;
+		swap(_pHolder, result._pHolder);
+	}
+	
+	ResultType& data() const
+		/// Returns a reference to the result data.
+	{
+		return _pHolder->data();
+	}
+	
+	void data(ResultType* pValue)
+	{
+		_pHolder->data(pValue);
+	}
+	
+	void wait()
+		/// Pauses the caller until the result becomes available.
+	{
+		_pHolder->wait();
+	}
+	
+	bool tryWait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Returns true if the result became
+		/// available, false otherwise.
+	{
+		return _pHolder->tryWait(milliseconds);
+	}
+	
+	void wait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Throws a TimeoutException if the
+		/// result did not became available.
+	{
+		_pHolder->wait(milliseconds);
+	}
+	
+	bool available() const
+		/// Returns true if a result is available.
+	{
+		return _pHolder->tryWait(0);
+	}
+	
+	bool failed() const
+		/// Returns true if the active method failed (and threw an exception).
+		/// Information about the exception can be obtained by calling error().
+	{
+		return _pHolder->failed();
+	}
+	
+	std::string error() const
+		/// If the active method threw an exception, a textual representation
+		/// of the exception is returned. An empty string is returned if the
+		/// active method completed successfully.
+	{
+		return _pHolder->error();
+	}
+
+	Exception* exception() const
+		/// If the active method threw an exception, a clone of the exception
+		/// object is returned, otherwise null.
+	{
+		return _pHolder->exception();
+	}
+
+	void notify()
+		/// Notifies the invoking thread that the result became available.
+		/// For internal use only.
+	{
+		_pHolder->notify();
+	}
+	
+	ResultType& data()
+		/// Returns a non-const reference to the result data. For internal
+		/// use only.
+	{
+		return _pHolder->data();
+	}
+	
+	void error(const std::string& msg)
+		/// Sets the failed flag and the exception message.
+	{
+		_pHolder->error(msg);
+	}
+
+	void error(const Exception& exc)
+		/// Sets the failed flag and the exception message.
+	{
+		_pHolder->error(exc);
+	}
+	
+private:
+	ActiveResult();
+
+	ActiveResultHolderType* _pHolder;
+};
+
+
+
+template <>
+class ActiveResult<void>
+	/// This class holds the result of an asynchronous method
+	/// invocation (see class ActiveMethod). It is used to pass the 
+	/// result from the execution thread back to the invocation thread. 
+{
+public:
+	typedef ActiveResultHolder<void> ActiveResultHolderType;
+
+	ActiveResult(ActiveResultHolderType* pHolder):
+		_pHolder(pHolder)
+		/// Creates the active result. For internal use only.
+	{
+		poco_check_ptr (pHolder);
+	}
+	
+	ActiveResult(const ActiveResult& result)
+		/// Copy constructor.
+	{
+		_pHolder = result._pHolder;
+		_pHolder->duplicate();
+	}
+	
+	~ActiveResult()
+		/// Destroys the result.
+	{
+		_pHolder->release();
+	}
+	
+	ActiveResult& operator = (const ActiveResult& result)
+		/// Assignment operator.
+	{
+		ActiveResult tmp(result);
+		swap(tmp);
+		return *this;
+	}
+	
+	void swap(ActiveResult& result)
+	{
+		using std::swap;
+		swap(_pHolder, result._pHolder);
+	}
+	
+	void wait()
+		/// Pauses the caller until the result becomes available.
+	{
+		_pHolder->wait();
+	}
+	
+	bool tryWait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Returns true if the result became
+		/// available, false otherwise.
+	{
+		return _pHolder->tryWait(milliseconds);
+	}
+	
+	void wait(long milliseconds)
+		/// Waits up to the specified interval for the result to
+		/// become available. Throws a TimeoutException if the
+		/// result did not became available.
+	{
+		_pHolder->wait(milliseconds);
+	}
+	
+	bool available() const
+		/// Returns true if a result is available.
+	{
+		return _pHolder->tryWait(0);
+	}
+	
+	bool failed() const
+		/// Returns true if the active method failed (and threw an exception).
+		/// Information about the exception can be obtained by calling error().
+	{
+		return _pHolder->failed();
+	}
+	
+	std::string error() const
+		/// If the active method threw an exception, a textual representation
+		/// of the exception is returned. An empty string is returned if the
+		/// active method completed successfully.
+	{
+		return _pHolder->error();
+	}
+
+	Exception* exception() const
+		/// If the active method threw an exception, a clone of the exception
+		/// object is returned, otherwise null.
+	{
+		return _pHolder->exception();
+	}
+
+	void notify()
+		/// Notifies the invoking thread that the result became available.
+		/// For internal use only.
+	{
+		_pHolder->notify();
+	}
+	
+	void error(const std::string& msg)
+		/// Sets the failed flag and the exception message.
+	{
+		_pHolder->error(msg);
+	}
+
+	void error(const Exception& exc)
+		/// Sets the failed flag and the exception message.
+	{
+		_pHolder->error(exc);
+	}
+	
+private:
+	ActiveResult();
+
+	ActiveResultHolderType* _pHolder;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_ActiveResult_INCLUDED

+ 231 - 0
ThirdParty/include/Poco/ActiveRunnable.h

@@ -0,0 +1,231 @@
+//
+// ActiveRunnable.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the ActiveRunnable class.
+//
+// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_ActiveRunnable_INCLUDED
+#define Foundation_ActiveRunnable_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/ActiveResult.h"
+#include "Poco/Runnable.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include "Poco/Exception.h"
+
+
+namespace Poco {
+
+
+class ActiveRunnableBase: public Runnable, public RefCountedObject
+	/// The base class for all ActiveRunnable instantiations.
+{
+public:
+	typedef AutoPtr<ActiveRunnableBase> Ptr;
+};
+
+
+template <class ResultType, class ArgType, class OwnerType>
+class ActiveRunnable: public ActiveRunnableBase
+	/// This class is used by ActiveMethod.
+	/// See the ActiveMethod class for more information.
+{
+public:
+	typedef ResultType (OwnerType::*Callback)(const ArgType&);
+	typedef ActiveResult<ResultType> ActiveResultType;
+
+	ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
+		_pOwner(pOwner),
+		_method(method),
+		_arg(arg),
+		_result(result)
+	{
+		poco_check_ptr (pOwner);
+	}
+
+	void run()
+	{
+		ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
+		try
+		{
+			_result.data(new ResultType((_pOwner->*_method)(_arg)));
+		}
+		catch (Exception& e)
+		{
+			_result.error(e);
+		}
+		catch (std::exception& e)
+		{
+			_result.error(e.what());
+		}
+		catch (...)
+		{
+			_result.error("unknown exception");
+		}
+		_result.notify();
+	}
+
+private:
+	OwnerType* _pOwner;
+	Callback   _method;
+	ArgType    _arg;
+	ActiveResultType _result;
+};
+
+
+template <class ArgType, class OwnerType>
+class ActiveRunnable<void, ArgType, OwnerType>: public ActiveRunnableBase
+	/// This class is used by ActiveMethod.
+	/// See the ActiveMethod class for more information.
+{
+public:
+	typedef void (OwnerType::*Callback)(const ArgType&);
+	typedef ActiveResult<void> ActiveResultType;
+
+	ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
+		_pOwner(pOwner),
+		_method(method),
+		_arg(arg),
+		_result(result)
+	{
+		poco_check_ptr (pOwner);
+	}
+
+	void run()
+	{
+		ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
+		try
+		{
+			(_pOwner->*_method)(_arg);
+		}
+		catch (Exception& e)
+		{
+			_result.error(e);
+		}
+		catch (std::exception& e)
+		{
+			_result.error(e.what());
+		}
+		catch (...)
+		{
+			_result.error("unknown exception");
+		}
+		_result.notify();
+	}
+
+private:
+	OwnerType* _pOwner;
+	Callback   _method;
+	ArgType    _arg;
+	ActiveResultType _result;
+};
+
+
+template <class ResultType, class OwnerType>
+class ActiveRunnable<ResultType, void, OwnerType>: public ActiveRunnableBase
+	/// This class is used by ActiveMethod.
+	/// See the ActiveMethod class for more information.
+{
+public:
+	typedef ResultType (OwnerType::*Callback)();
+	typedef ActiveResult<ResultType> ActiveResultType;
+
+	ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
+		_pOwner(pOwner),
+		_method(method),
+		_result(result)
+	{
+		poco_check_ptr (pOwner);
+	}
+
+	void run()
+	{
+		ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
+		try
+		{
+			_result.data(new ResultType((_pOwner->*_method)()));
+		}
+		catch (Exception& e)
+		{
+			_result.error(e);
+		}
+		catch (std::exception& e)
+		{
+			_result.error(e.what());
+		}
+		catch (...)
+		{
+			_result.error("unknown exception");
+		}
+		_result.notify();
+	}
+
+private:
+	OwnerType* _pOwner;
+	Callback   _method;
+	ActiveResultType _result;
+};
+
+
+template <class OwnerType>
+class ActiveRunnable<void, void, OwnerType>: public ActiveRunnableBase
+	/// This class is used by ActiveMethod.
+	/// See the ActiveMethod class for more information.
+{
+public:
+	typedef void (OwnerType::*Callback)();
+	typedef ActiveResult<void> ActiveResultType;
+
+	ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
+		_pOwner(pOwner),
+		_method(method),
+		_result(result)
+	{
+		poco_check_ptr (pOwner);
+	}
+
+	void run()
+	{
+		ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
+		try
+		{
+			(_pOwner->*_method)();
+		}
+		catch (Exception& e)
+		{
+			_result.error(e);
+		}
+		catch (std::exception& e)
+		{
+			_result.error(e.what());
+		}
+		catch (...)
+		{
+			_result.error("unknown exception");
+		}
+		_result.notify();
+	}
+
+private:
+	OwnerType* _pOwner;
+	Callback   _method;
+	ActiveResultType _result;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_ActiveRunnable_INCLUDED

+ 48 - 0
ThirdParty/include/Poco/ActiveStarter.h

@@ -0,0 +1,48 @@
+//
+// ActiveStarter.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the ActiveStarter class.
+//
+// Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_ActiveStarter_INCLUDED
+#define Foundation_ActiveStarter_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/ThreadPool.h"
+#include "Poco/ActiveRunnable.h"
+
+
+namespace Poco {
+
+
+template <class OwnerType>
+class ActiveStarter
+	/// The default implementation of the StarterType 
+	/// policy for ActiveMethod. It starts the method
+	/// in its own thread, obtained from the default
+	/// thread pool.
+{
+public:
+	static void start(OwnerType* /*pOwner*/, ActiveRunnableBase::Ptr pRunnable)
+	{
+		ThreadPool::defaultPool().start(*pRunnable);
+		pRunnable->duplicate(); // The runnable will release itself.
+	}
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_ActiveStarter_INCLUDED

+ 208 - 0
ThirdParty/include/Poco/Activity.h

@@ -0,0 +1,208 @@
+//
+// Activity.h
+//
+// Library: Foundation
+// Package: Threading
+// Module:  ActiveObjects
+//
+// Definition of the Activity template class.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Activity_INCLUDED
+#define Foundation_Activity_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/RunnableAdapter.h"
+#include "Poco/ThreadPool.h"
+#include "Poco/Event.h"
+#include "Poco/Mutex.h"
+
+
+namespace Poco {
+
+
+template <class C>
+class Activity: public Runnable
+	/// This template class helps to implement active objects.
+	/// An active object uses threads to decouple method
+	/// execution from method invocation, or to perform tasks
+	/// autonomously, without intervention of a caller.
+	///
+	/// An activity is a (typically longer running) method
+	/// that executes within its own task. Activities can
+	/// be started automatically (upon object construction)
+	/// or manually at a later time. Activities can also
+	/// be stopped at any time. However, to make stopping
+	/// an activity work, the method implementing the
+	/// activity has to check periodically whether it
+	/// has been requested to stop, and if so, return. 
+	/// Activities are stopped before the object they belong to is
+	/// destroyed. Methods implementing activities cannot have arguments
+	/// or return values. 
+	///
+	/// Activity objects are used as follows:
+	///
+	///     class ActiveObject
+	///     {
+	///     public:
+	///         ActiveObject(): 
+	///             _activity(this, &ActiveObject::runActivity)
+	///         {
+	///             ...
+	///         }
+	///   
+	///         ...
+	///  
+	///     protected:
+	///         void runActivity()
+	///         {
+	///             while (!_activity.isStopped())
+	///             {
+	///                 ...
+	///             }
+	///         }
+	///
+	///     private:
+	///         Activity<ActiveObject> _activity;
+	///     };
+{
+public:
+	typedef RunnableAdapter<C> RunnableAdapterType;
+	typedef typename RunnableAdapterType::Callback Callback;
+
+	Activity(C* pOwner, Callback method):
+		_pOwner(pOwner),
+		_runnable(*pOwner, method),
+		_stopped(true),
+		_running(false),
+		_done(false)
+		/// Creates the activity. Call start() to
+		/// start it.
+	{
+		poco_check_ptr (pOwner);
+	}
+	
+	~Activity()
+		/// Stops and destroys the activity.
+	{
+		try
+		{
+			stop();
+			wait();
+		}
+		catch (...)
+		{
+			poco_unexpected();
+		}
+	}
+	
+	void start()
+		/// Starts the activity by acquiring a
+		/// thread for it from the default thread pool.
+	{
+		start(ThreadPool::defaultPool());
+	}
+
+	void start(ThreadPool& pool)
+	{
+		FastMutex::ScopedLock lock(_mutex);
+		
+		if (!_running)
+		{
+			_done.reset();
+			_stopped = false;
+			_running = true;
+			try
+			{
+				pool.start(*this);
+			}
+			catch (...)
+			{
+				_running = false;
+				throw;
+			}
+		}
+	}
+	
+	void stop()
+		/// Requests to stop the activity.
+	{
+		FastMutex::ScopedLock lock(_mutex);
+
+		_stopped = true;
+	}
+	
+	void wait()
+		/// Waits for the activity to complete.
+	{
+		if (_running)
+		{
+			_done.wait();
+		}
+	}
+
+	void wait(long milliseconds)
+		/// Waits the given interval for the activity to complete.
+		/// An TimeoutException is thrown if the activity does not
+		/// complete within the given interval.
+	{
+		if (_running)
+		{
+			_done.wait(milliseconds);
+		}
+	}
+	
+	bool isStopped() const
+		/// Returns true if the activity has been requested to stop.
+	{
+		return _stopped;
+	}
+	
+	bool isRunning() const
+		/// Returns true if the activity is running.
+	{
+		return _running;
+	}
+
+protected:
+	void run()
+	{
+		try
+		{
+			_runnable.run();
+		}
+		catch (...)
+		{
+			_running = false;
+			_done.set();
+			throw;
+		}
+		_running = false;
+		_done.set();
+	}
+	
+private:
+	Activity();
+	Activity(const Activity&);
+	Activity& operator = (const Activity&);
+
+	C*                  _pOwner;
+	RunnableAdapterType _runnable;
+	volatile bool       _stopped;
+	volatile bool       _running;
+	Event               _done;
+	FastMutex           _mutex;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_Activity_INCLUDED

+ 246 - 0
ThirdParty/include/Poco/Alignment.h

@@ -0,0 +1,246 @@
+//
+// Alignment.h
+//
+// Library: Foundation
+// Package: Dynamic
+// Module:  Alignment
+//
+// Definition of the Alignment class.
+//
+// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+// Adapted for POCO from LLVM Compiler Infrastructure code:
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source License
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the AlignOf function that computes alignments for
+// arbitrary types.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef Foundation_AlignOf_INCLUDED
+#define Foundation_AlignOf_INCLUDED
+
+
+#include <cstddef>
+
+
+#ifdef POCO_ENABLE_CPP11
+
+
+	#include <type_traits>
+	#define POCO_HAVE_ALIGNMENT
+
+
+#else
+
+
+	namespace Poco {
+
+
+	template <typename T>
+	struct AlignmentCalcImpl
+	{
+		char x;
+		T t;
+	private:
+		AlignmentCalcImpl() {} // Never instantiate.
+	};
+
+
+	template <typename T>
+	struct AlignOf
+		/// A templated class that contains an enum value representing
+		/// the alignment of the template argument.  For example,
+		/// AlignOf<int>::Alignment represents the alignment of type "int".  The
+		/// alignment calculated is the minimum alignment, and not necessarily
+		/// the "desired" alignment returned by GCC's __alignof__ (for example).  Note
+		/// that because the alignment is an enum value, it can be used as a
+		/// compile-time constant (e.g., for template instantiation).
+	{
+		enum
+		{
+			Alignment = static_cast<unsigned int>(sizeof(AlignmentCalcImpl<T>) - sizeof(T))
+		};
+
+		enum { Alignment_GreaterEqual_2Bytes  = Alignment >= 2  ? 1 : 0 };
+		enum { Alignment_GreaterEqual_4Bytes  = Alignment >= 4  ? 1 : 0 };
+		enum { Alignment_GreaterEqual_8Bytes  = Alignment >= 8  ? 1 : 0 };
+		enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
+	
+		enum { Alignment_LessEqual_2Bytes  = Alignment <= 2  ? 1 : 0 };
+		enum { Alignment_LessEqual_4Bytes  = Alignment <= 4  ? 1 : 0 };
+		enum { Alignment_LessEqual_8Bytes  = Alignment <= 8  ? 1 : 0 };
+		enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
+
+	};
+
+
+	template <typename T>
+	inline unsigned alignOf()
+		/// A templated function that returns the minimum alignment of
+		/// of a type.  This provides no extra functionality beyond the AlignOf
+		/// class besides some cosmetic cleanliness.  Example usage:
+		/// alignOf<int>() returns the alignment of an int.
+	{
+		return AlignOf<T>::Alignment;
+	}
+
+
+	template <std::size_t Alignment> struct AlignedCharArrayImpl;
+		/// Helper for building an aligned character array type.
+		///
+		/// This template is used to explicitly build up a collection of aligned
+		/// character types. We have to build these up using a macro and explicit
+		/// specialization to cope with old versions of MSVC and GCC where only an
+		/// integer literal can be used to specify an alignment constraint. Once built
+		/// up here, we can then begin to indirect between these using normal C++
+		/// template parameters.
+
+
+	// MSVC requires special handling here.
+	#ifndef _MSC_VER
+
+		#ifdef POCO_COMPILER_CLANG
+
+			#if __has_feature(cxx_alignas)
+				#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
+					template <> struct AlignedCharArrayImpl<x> \
+					{ \
+						char aligned alignas(x); \
+					}
+				#define POCO_HAVE_ALIGNMENT
+			#endif
+
+		#elif defined(__GNUC__) || defined(__IBM_ATTRIBUTES)
+
+			#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
+				template <> struct AlignedCharArrayImpl<x> \
+				{ \
+					char aligned __attribute__((aligned(x))); \
+				}
+				#define POCO_HAVE_ALIGNMENT
+
+		#endif
+	
+		#ifdef POCO_HAVE_ALIGNMENT
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
+
+			#undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
+		#endif // POCO_HAVE_ALIGNMENT
+
+	#else // _MSC_VER
+
+		// We provide special variations of this template for the most common
+		// alignments because __declspec(align(...)) doesn't actually work when it is
+		// a member of a by-value function argument in MSVC, even if the alignment
+		// request is something reasonably like 8-byte or 16-byte.
+		template <> struct AlignedCharArrayImpl<1> { char aligned; };
+		template <> struct AlignedCharArrayImpl<2> { short aligned; };
+		template <> struct AlignedCharArrayImpl<4> { int aligned; };
+		template <> struct AlignedCharArrayImpl<8> { double aligned; };
+
+		#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
+			template <> struct AlignedCharArrayImpl<x> { \
+				__declspec(align(x)) char aligned; \
+			}
+
+		POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
+		POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
+		POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
+		POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
+		
+		#if (_MSC_VER > 1600)  // MSVC 2010 complains on alignment  larger than 128
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
+			POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
+		#endif  // _MSC_VER > 1600
+		
+		// Any larger and MSVC complains.
+		#undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
+
+		#define POCO_HAVE_ALIGNMENT
+	#endif // _MSC_VER
+
+	// POCO_HAVE_ALIGNMENT will be defined on the pre-C++11 platforms/compilers where
+	// it can be reliably determined and used. Uncomment the line below to explicitly
+	// disable use of alignment even for those platforms. 
+	// #undef POCO_HAVE_ALIGNMENT
+
+
+	#ifdef POCO_HAVE_ALIGNMENT
+
+		template <typename T1, typename T2 = char, typename T3 = char, typename T4 = char>
+		union AlignedCharArrayUnion
+			/// This union template exposes a suitably aligned and sized character
+			/// array member which can hold elements of any of up to four types.
+			///
+			/// These types may be arrays, structs, or any other types. The goal is to
+			/// produce a union type containing a character array which, when used, forms
+			/// storage suitable to placement new any of these types over. Support for more
+			/// than four types can be added at the cost of more boiler plate.
+		{
+		private:
+			class AlignerImpl
+			{
+				T1 t1;
+				T2 t2;
+				T3 t3;
+				T4 t4;
+		
+				AlignerImpl(); // Never defined or instantiated.
+			};
+	
+			union SizerImpl
+			{
+				char arr1[sizeof(T1)];
+				char arr2[sizeof(T2)];
+				char arr3[sizeof(T3)];
+				char arr4[sizeof(T4)];
+			};
+	
+		public:
+			char buffer[sizeof(SizerImpl)];
+				/// The character array buffer for use by clients.
+				///
+				/// No other member of this union should be referenced. They exist purely to
+				/// constrain the layout of this character array.
+	
+		private:
+			Poco::AlignedCharArrayImpl<AlignOf<AlignerImpl>::Alignment> _nonceMember;
+
+		};
+
+	#endif // POCO_HAVE_ALIGNMENT
+
+	} // namespace Poco
+
+
+#endif // POCO_ENABLE_CPP11
+
+
+#endif // Foundation_AlignOf_INCLUDED

+ 599 - 0
ThirdParty/include/Poco/Any.h

@@ -0,0 +1,599 @@
+//
+// Any.h
+//
+// Library: Foundation
+// Package: Core
+// Module:	Any
+//
+// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
+// Extracted from Boost 1.33.1 libs and adapted for poco: Peter Schojer/AppliedInformatics 2006-02-02
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Any_INCLUDED
+#define Foundation_Any_INCLUDED
+
+
+#include "Poco/Exception.h"
+#include "Poco/MetaProgramming.h"
+#include <algorithm>
+#include <typeinfo>
+#include <cstring>
+
+
+namespace Poco {
+
+
+class Any;
+
+
+namespace Dynamic {
+
+class Var;
+class VarHolder;
+template <class> class VarHolderImpl;
+
+}
+
+#ifndef POCO_NO_SOO
+
+#ifndef POCO_ENABLE_CPP11
+	// C++11 needed for std::aligned_storage
+	#error "Any SOO can only be enabled with C++11 support"
+#endif
+
+template <typename PlaceholderT, unsigned int SizeV = POCO_SMALL_OBJECT_SIZE>
+union Placeholder
+	/// ValueHolder union (used by Poco::Any and Poco::Dynamic::Var for small
+	/// object optimization, when enabled).
+	/// 
+	/// If Holder<Type> fits into POCO_SMALL_OBJECT_SIZE bytes of storage, 
+	/// it will be placement-new-allocated into the local buffer
+	/// (i.e. there will be no heap-allocation). The local buffer size is one byte
+	/// larger - [POCO_SMALL_OBJECT_SIZE + 1], additional byte value indicating
+	/// where the object was allocated (0 => heap, 1 => local).
+{
+public:
+	struct Size
+	{
+		static const unsigned int value = SizeV;
+	};
+
+	Placeholder ()
+	{
+		erase();
+	}
+
+	void erase()
+	{
+		std::memset(holder, 0, sizeof(Placeholder));
+	}
+
+	bool isLocal() const
+	{
+		return holder[SizeV] != 0;
+	}
+
+	void setLocal(bool local) const
+	{
+		holder[SizeV] = local ? 1 : 0;
+	}
+
+	PlaceholderT* content() const
+	{
+		if (isLocal())
+			return reinterpret_cast<PlaceholderT*>(holder);
+		else
+			return pHolder;
+	}
+
+// MSVC71,80 won't extend friendship to nested class (Any::Holder)
+#if !defined(POCO_MSVC_VERSION) || (defined(POCO_MSVC_VERSION) && (POCO_MSVC_VERSION > 80))
+private:
+#endif
+	typedef typename std::aligned_storage<SizeV + 1>::type AlignerType;
+	
+	PlaceholderT* pHolder;
+	mutable char  holder [SizeV + 1];
+	AlignerType   aligner;
+
+	friend class Any;
+	friend class Dynamic::Var;
+	friend class Dynamic::VarHolder;
+	template <class> friend class Dynamic::VarHolderImpl;
+};
+
+
+#else // !POCO_NO_SOO
+
+
+template <typename PlaceholderT>
+union Placeholder
+	/// ValueHolder union (used by Poco::Any and Poco::Dynamic::Var for small
+	/// object optimization, when enabled).
+	/// 
+	/// If Holder<Type> fits into POCO_SMALL_OBJECT_SIZE bytes of storage, 
+	/// it will be placement-new-allocated into the local buffer
+	/// (i.e. there will be no heap-allocation). The local buffer size is one byte
+	/// larger - [POCO_SMALL_OBJECT_SIZE + 1], additional byte value indicating
+	/// where the object was allocated (0 => heap, 1 => local).
+{
+public:
+
+	Placeholder ()
+	{
+	}
+
+	PlaceholderT* content() const
+	{
+		return pHolder;
+	}
+
+// MSVC71,80 won't extend friendship to nested class (Any::Holder)
+#if !defined(POCO_MSVC_VERSION) || (defined(POCO_MSVC_VERSION) && (POCO_MSVC_VERSION > 80))
+private:
+#endif
+	
+	PlaceholderT*         pHolder;
+
+	friend class Any;
+	friend class Dynamic::Var;
+	friend class Dynamic::VarHolder;
+	template <class> friend class Dynamic::VarHolderImpl;
+};
+
+
+#endif // POCO_NO_SOO
+
+
+class Any
+	/// An Any class represents a general type and is capable of storing any type, supporting type-safe extraction
+	/// of the internally stored data.
+	///
+	/// Code taken from the Boost 1.33.1 library. Original copyright by Kevlin Henney. Modified for Poco
+	/// by Applied Informatics.
+	///
+	/// Modified for small object optimization support (optionally supported through conditional compilation)
+	/// by Alex Fabijanic.
+{
+public:
+
+#ifndef POCO_NO_SOO
+
+	Any()
+		/// Creates an empty any type.
+	{
+	}
+
+	template<typename ValueType>
+	Any(const ValueType & value)
+		/// Creates an any which stores the init parameter inside.
+		///
+		/// Example: 
+		///   Any a(13); 
+		///   Any a(string("12345"));
+	{
+		construct(value);
+	}
+
+	Any(const Any& other)
+		/// Copy constructor, works with both empty and initialized Any values.
+	{
+		if ((this != &other) && !other.empty())
+			construct(other);
+	}
+
+	~Any()
+		/// Destructor. If Any is locally held, calls ValueHolder destructor;
+		/// otherwise, deletes the placeholder from the heap.
+	{
+		if (!empty())
+		{
+			if (_valueHolder.isLocal())
+				destruct();
+			else
+				delete content();
+		}
+	}
+
+	Any& swap(Any& other)
+		/// Swaps the content of the two Anys.
+		/// 
+		/// When small object optimizaton is enabled, swap only
+		/// has no-throw guarantee when both (*this and other)
+		/// objects are allocated on the heap.
+	{
+		if (this == &other) return *this;
+
+		if (!_valueHolder.isLocal() && !other._valueHolder.isLocal())
+		{
+			std::swap(_valueHolder.pHolder, other._valueHolder.pHolder);
+		}
+		else
+		{
+			Any tmp(*this);
+			try
+			{
+				if (_valueHolder.isLocal()) destruct();
+				construct(other);
+				other = tmp;
+			}
+			catch (...)
+			{
+				construct(tmp);
+				throw;
+			}
+		}
+
+		return *this;
+	}
+
+	template<typename ValueType>
+	Any& operator = (const ValueType& rhs)
+		/// Assignment operator for all types != Any.
+		///
+		/// Example: 
+		///   Any a = 13; 
+		///   Any a = string("12345");
+	{
+		construct(rhs);
+		return *this;
+	}
+	
+	Any& operator = (const Any& rhs)
+		/// Assignment operator for Any.
+	{
+		if ((this != &rhs) && !rhs.empty())
+			construct(rhs);
+		else if ((this != &rhs) && rhs.empty())
+			_valueHolder.erase();
+
+		return *this;
+	}
+	
+	bool empty() const
+		/// Returns true if the Any is empty.
+	{
+		char buf[POCO_SMALL_OBJECT_SIZE] = { 0 };
+		return 0 == std::memcmp(_valueHolder.holder, buf, POCO_SMALL_OBJECT_SIZE);
+	}
+	
+	const std::type_info & type() const
+		/// Returns the type information of the stored content.
+		/// If the Any is empty typeid(void) is returned.
+		/// It is recommended to always query an Any for its type info before
+		/// trying to extract data via an AnyCast/RefAnyCast.
+	{
+		return empty() ? typeid(void) : content()->type();
+	}
+
+private:
+
+	class ValueHolder
+	{
+	public:
+	
+		virtual ~ValueHolder()
+		{
+		}
+
+		virtual const std::type_info & type() const = 0;
+		virtual void clone(Placeholder<ValueHolder>*) const = 0;
+	};
+
+	template<typename ValueType>
+	class Holder : public ValueHolder
+	{
+	public:
+		Holder(const ValueType & value) : _held(value)
+		{
+		}
+
+		virtual const std::type_info & type() const
+		{
+			return typeid(ValueType);
+		}
+
+		virtual void clone(Placeholder<ValueHolder>* pPlaceholder) const
+		{
+			if ((sizeof(Holder<ValueType>) <= POCO_SMALL_OBJECT_SIZE))
+			{
+				new ((ValueHolder*) pPlaceholder->holder) Holder(_held);
+				pPlaceholder->setLocal(true);
+			}
+			else
+			{
+				pPlaceholder->pHolder = new Holder(_held);
+				pPlaceholder->setLocal(false);
+			}
+		}
+
+		ValueType _held;
+
+	private:
+		Holder & operator = (const Holder &);
+	};
+
+	ValueHolder* content() const
+	{
+		return _valueHolder.content();
+	}
+
+	template<typename ValueType>
+	void construct(const ValueType& value)
+	{
+		if (sizeof(Holder<ValueType>) <= Placeholder<ValueType>::Size::value)
+		{
+			new (reinterpret_cast<ValueHolder*>(_valueHolder.holder)) Holder<ValueType>(value);
+			_valueHolder.setLocal(true);
+		}
+		else
+		{
+			_valueHolder.pHolder = new Holder<ValueType>(value);
+			_valueHolder.setLocal(false);
+		}
+	}
+
+	void construct(const Any& other)
+	{
+		if (!other.empty())
+			other.content()->clone(&_valueHolder);
+		else
+			_valueHolder.erase();
+	}
+	
+	void destruct()
+	{
+		content()->~ValueHolder();
+	}
+
+	Placeholder<ValueHolder> _valueHolder;
+
+
+#else // if POCO_NO_SOO
+
+
+	Any(): _pHolder(0)
+		/// Creates an empty any type.
+	{
+	}
+
+	template <typename ValueType>
+	Any(const ValueType& value):
+		_pHolder(new Holder<ValueType>(value))
+		/// Creates an any which stores the init parameter inside.
+		///
+		/// Example: 
+		///	 Any a(13); 
+		///	 Any a(string("12345"));
+	{
+	}
+
+	Any(const Any& other):
+		_pHolder(other._pHolder ? other._pHolder->clone() : 0)
+		/// Copy constructor, works with both empty and initialized Any values.
+	{
+	}
+
+	~Any()
+	{
+		delete _pHolder;
+	}
+
+	Any& swap(Any& rhs)
+		/// Swaps the content of the two Anys.
+	{
+		std::swap(_pHolder, rhs._pHolder);
+		return *this;
+	}
+
+	template <typename ValueType>
+	Any& operator = (const ValueType& rhs)
+		/// Assignment operator for all types != Any.
+		///
+		/// Example: 
+		///   Any a = 13; 
+		///   Any a = string("12345");
+	{
+		Any(rhs).swap(*this);
+		return *this;
+	}
+
+	Any& operator = (const Any& rhs)
+		/// Assignment operator for Any.
+	{
+		Any(rhs).swap(*this);
+		return *this;
+	}
+
+	bool empty() const
+		/// Returns true if the Any is empty.
+	{
+		return !_pHolder;
+	}
+
+	const std::type_info& type() const
+		/// Returns the type information of the stored content.
+		/// If the Any is empty typeid(void) is returned.
+		/// It is recommended to always query an Any for its type info before
+		/// trying to extract data via an AnyCast/RefAnyCast.
+	{
+		return _pHolder ? _pHolder->type() : typeid(void);
+	}
+
+private:
+	class ValueHolder
+	{
+	public:
+		virtual ~ValueHolder()
+		{
+		}
+
+		virtual const std::type_info& type() const = 0;
+		virtual ValueHolder* clone() const = 0;
+	};
+
+	template <typename ValueType>
+	class Holder: public ValueHolder
+	{
+	public: 
+		Holder(const ValueType& value):
+			_held(value)
+		{
+		}
+
+		virtual const std::type_info& type() const
+		{
+			return typeid(ValueType);
+		}
+
+		virtual ValueHolder* clone() const
+		{
+			return new Holder(_held);
+		}
+
+		ValueType _held;
+
+	private:
+		Holder & operator=(const Holder &);
+	};
+
+	ValueHolder* content() const
+	{
+		return _pHolder;
+	}
+
+private:
+	ValueHolder* _pHolder;
+
+#endif // POCO_NO_SOO
+
+	template <typename ValueType>
+	friend ValueType* AnyCast(Any*);
+
+	template <typename ValueType>
+	friend ValueType* UnsafeAnyCast(Any*);
+
+};
+
+
+template <typename ValueType>
+ValueType* AnyCast(Any* operand)
+	/// AnyCast operator used to extract the ValueType from an Any*. Will return a pointer
+	/// to the stored value. 
+	///
+	/// Example Usage: 
+	///	 MyType* pTmp = AnyCast<MyType*>(pAny).
+	/// Will return NULL if the cast fails, i.e. types don't match.
+{
+	return operand && operand->type() == typeid(ValueType)
+				? &static_cast<Any::Holder<ValueType>*>(operand->content())->_held
+				: 0;
+}
+
+
+template <typename ValueType>
+const ValueType* AnyCast(const Any* operand)
+	/// AnyCast operator used to extract a const ValueType pointer from an const Any*. Will return a const pointer
+	/// to the stored value. 
+	///
+	/// Example Usage:
+	///	 const MyType* pTmp = AnyCast<MyType*>(pAny).
+	/// Will return NULL if the cast fails, i.e. types don't match.
+{
+	return AnyCast<ValueType>(const_cast<Any*>(operand));
+}
+
+
+template <typename ValueType>
+ValueType AnyCast(Any& operand)
+	/// AnyCast operator used to extract a copy of the ValueType from an Any&.
+	///
+	/// Example Usage: 
+	///	 MyType tmp = AnyCast<MyType>(anAny).
+	/// Will throw a BadCastException if the cast fails.
+	/// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ...
+	/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
+	/// these cases.
+{
+	typedef typename TypeWrapper<ValueType>::TYPE NonRef;
+
+	NonRef* result = AnyCast<NonRef>(&operand);
+	if (!result) throw BadCastException("Failed to convert between Any types");
+	return *result;
+}
+
+
+template <typename ValueType>
+ValueType AnyCast(const Any& operand)
+	/// AnyCast operator used to extract a copy of the ValueType from an const Any&.
+	///
+	/// Example Usage: 
+	///	 MyType tmp = AnyCast<MyType>(anAny).
+	/// Will throw a BadCastException if the cast fails.
+	/// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& = ...
+	/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
+	/// these cases.
+{
+	typedef typename TypeWrapper<ValueType>::TYPE NonRef;
+
+	return AnyCast<NonRef&>(const_cast<Any&>(operand));
+}
+
+
+template <typename ValueType>
+const ValueType& RefAnyCast(const Any & operand)
+	/// AnyCast operator used to return a const reference to the internal data. 
+	///
+	/// Example Usage: 
+	///	 const MyType& tmp = RefAnyCast<MyType>(anAny);
+{
+	ValueType* result = AnyCast<ValueType>(const_cast<Any*>(&operand));
+	if (!result) throw BadCastException("RefAnyCast: Failed to convert between const Any types");
+	return *result;
+}
+
+
+template <typename ValueType>
+ValueType& RefAnyCast(Any& operand)
+	/// AnyCast operator used to return a reference to the internal data.
+	///
+	/// Example Usage: 
+	///	 MyType& tmp = RefAnyCast<MyType>(anAny);
+{
+	ValueType* result = AnyCast<ValueType>(&operand);
+	if (!result) throw BadCastException("RefAnyCast: Failed to convert between Any types");
+	return *result;
+}
+
+
+template <typename ValueType>
+ValueType* UnsafeAnyCast(Any* operand)
+	/// The "unsafe" versions of AnyCast are not part of the
+	/// public interface and may be removed at any time. They are
+	/// required where we know what type is stored in the any and can't
+	/// use typeid() comparison, e.g., when our types may travel across
+	/// different shared libraries.
+{
+	return &static_cast<Any::Holder<ValueType>*>(operand->content())->_held;
+}
+
+
+template <typename ValueType>
+const ValueType* UnsafeAnyCast(const Any* operand)
+	/// The "unsafe" versions of AnyCast are not part of the
+	/// public interface and may be removed at any time. They are
+	/// required where we know what type is stored in the any and can't
+	/// use typeid() comparison, e.g., when our types may travel across
+	/// different shared libraries.
+{
+	return AnyCast<ValueType>(const_cast<Any*>(operand));
+}
+
+
+} // namespace Poco
+
+
+#endif

+ 220 - 0
ThirdParty/include/Poco/Ascii.h

@@ -0,0 +1,220 @@
+//
+// Ascii.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  Ascii
+//
+// Definition of the Ascii class.
+//
+// Copyright (c) 2010, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Ascii_INCLUDED
+#define Foundation_Ascii_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+namespace Poco {
+
+
+class Foundation_API Ascii
+	/// This class contains enumerations and static
+	/// utility functions for dealing with ASCII characters
+	/// and their properties.
+	///
+	/// The classification functions will also work if
+	/// non-ASCII character codes are passed to them,
+	/// but classification will only check for
+	/// ASCII characters.
+	///
+	/// This allows the classification methods to be used
+	/// on the single bytes of a UTF-8 string, without
+	/// causing assertions or inconsistent results (depending
+	/// upon the current locale) on bytes outside the ASCII range,
+	/// as may be produced by Ascii::isSpace(), etc.
+{
+public:
+	enum CharacterProperties
+		/// ASCII character properties.
+	{
+		ACP_CONTROL  = 0x0001,
+		ACP_SPACE    = 0x0002,
+		ACP_PUNCT    = 0x0004,
+		ACP_DIGIT    = 0x0008,
+		ACP_HEXDIGIT = 0x0010,
+		ACP_ALPHA    = 0x0020,
+		ACP_LOWER    = 0x0040,
+		ACP_UPPER    = 0x0080,
+		ACP_GRAPH    = 0x0100,
+		ACP_PRINT    = 0x0200
+	};
+	
+	static int properties(int ch);
+		/// Return the ASCII character properties for the
+		/// character with the given ASCII value.
+		///
+		/// If the character is outside the ASCII range
+		/// (0 .. 127), 0 is returned.
+
+	static bool hasSomeProperties(int ch, int properties);
+		/// Returns true if the given character is
+		/// within the ASCII range and has at least one of 
+		/// the given properties.
+
+	static bool hasProperties(int ch, int properties);
+		/// Returns true if the given character is
+		/// within the ASCII range and has all of 
+		/// the given properties.
+
+	static bool isAscii(int ch);
+		/// Returns true iff the given character code is within
+		/// the ASCII range (0 .. 127).
+		
+	static bool isSpace(int ch);
+		/// Returns true iff the given character is a whitespace.
+		
+	static bool isDigit(int ch);
+		/// Returns true iff the given character is a digit.
+
+	static bool isHexDigit(int ch);
+		/// Returns true iff the given character is a hexadecimal digit.
+		
+	static bool isPunct(int ch);
+		/// Returns true iff the given character is a punctuation character.
+		
+	static bool isAlpha(int ch);
+		/// Returns true iff the given character is an alphabetic character.	
+
+	static bool isAlphaNumeric(int ch);
+		/// Returns true iff the given character is an alphabetic character.	
+		
+	static bool isLower(int ch);
+		/// Returns true iff the given character is a lowercase alphabetic
+		/// character.
+		
+	static bool isUpper(int ch);
+		/// Returns true iff the given character is an uppercase alphabetic
+		/// character.
+		
+	static int toLower(int ch);
+		/// If the given character is an uppercase character,
+		/// return its lowercase counterpart, otherwise return
+		/// the character.
+
+	static int toUpper(int ch);
+		/// If the given character is a lowercase character,
+		/// return its uppercase counterpart, otherwise return
+		/// the character.
+		
+private:
+	static const int CHARACTER_PROPERTIES[128];
+};
+
+
+//
+// inlines
+//
+inline int Ascii::properties(int ch)
+{
+	if (isAscii(ch)) 
+		return CHARACTER_PROPERTIES[ch];
+	else
+		return 0;
+}
+
+
+inline bool Ascii::isAscii(int ch)
+{
+	return (static_cast<UInt32>(ch) & 0xFFFFFF80) == 0;
+}
+
+
+inline bool Ascii::hasProperties(int ch, int props)
+{
+	return (properties(ch) & props) == props;
+}
+
+
+inline bool Ascii::hasSomeProperties(int ch, int props)
+{
+	return (properties(ch) & props) != 0;
+}
+
+
+inline bool Ascii::isSpace(int ch)
+{
+	return hasProperties(ch, ACP_SPACE);
+}
+
+
+inline bool Ascii::isDigit(int ch)
+{
+	return hasProperties(ch, ACP_DIGIT);
+}
+
+
+inline bool Ascii::isHexDigit(int ch)
+{
+	return hasProperties(ch, ACP_HEXDIGIT);
+}
+
+
+inline bool Ascii::isPunct(int ch)
+{
+	return hasProperties(ch, ACP_PUNCT);
+}
+
+
+inline bool Ascii::isAlpha(int ch)
+{
+	return hasProperties(ch, ACP_ALPHA);
+}
+
+
+inline bool Ascii::isAlphaNumeric(int ch)
+{
+	return hasSomeProperties(ch, ACP_ALPHA | ACP_DIGIT);
+}
+
+
+inline bool Ascii::isLower(int ch)
+{
+	return hasProperties(ch, ACP_LOWER);
+}
+
+
+inline bool Ascii::isUpper(int ch)
+{
+	return hasProperties(ch, ACP_UPPER);
+}
+
+
+inline int Ascii::toLower(int ch)
+{
+	if (isUpper(ch))
+		return ch + 32;
+	else
+		return ch;
+}
+
+
+inline int Ascii::toUpper(int ch)
+{
+	if (isLower(ch))
+		return ch - 32;
+	else
+		return ch;
+}
+
+
+} // namespace Poco
+
+
+#endif // Foundation_Ascii_INCLUDED

+ 100 - 0
ThirdParty/include/Poco/AsyncChannel.h

@@ -0,0 +1,100 @@
+//
+// AsyncChannel.h
+//
+// Library: Foundation
+// Package: Logging
+// Module:  AsyncChannel
+//
+// Definition of the AsyncChannel class.
+//
+// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AsyncChannel_INCLUDED
+#define Foundation_AsyncChannel_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Channel.h"
+#include "Poco/Thread.h"
+#include "Poco/Mutex.h"
+#include "Poco/Runnable.h"
+#include "Poco/NotificationQueue.h"
+
+
+namespace Poco {
+
+
+class Foundation_API AsyncChannel: public Channel, public Runnable
+	/// A channel uses a separate thread for logging.
+	///
+	/// Using this channel can help to improve the performance of
+	/// applications that produce huge amounts of log messages or
+	/// that write log messages to multiple channels simultaneously.
+	///
+	/// All log messages are put into a queue and this queue is
+	/// then processed by a separate thread.
+{
+public:
+	AsyncChannel(Channel* pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
+		/// Creates the AsyncChannel and connects it to
+		/// the given channel.
+
+	void setChannel(Channel* pChannel);
+		/// Connects the AsyncChannel to the given target channel.
+		/// All messages will be forwarded to this channel.
+		
+	Channel* getChannel() const;
+		/// Returns the target channel.
+
+	void open();
+		/// Opens the channel and creates the 
+		/// background logging thread.
+		
+	void close();
+		/// Closes the channel and stops the background
+		/// logging thread.
+
+	void log(const Message& msg);
+		/// Queues the message for processing by the
+		/// background thread.
+
+	void setProperty(const std::string& name, const std::string& value);
+		/// Sets or changes a configuration property.
+		///
+		/// The "channel" property allows setting the target 
+		/// channel via the LoggingRegistry.
+		/// The "channel" property is set-only.
+		///
+		/// The "priority" property allows setting the thread
+		/// priority. The following values are supported:
+		///    * lowest
+		///    * low
+		///    * normal (default)
+		///    * high
+		///    * highest
+		///
+		/// The "priority" property is set-only.
+
+protected:
+	~AsyncChannel();
+	void run();
+	void setPriority(const std::string& value);
+		
+private:
+	Channel*  _pChannel;
+	Thread    _thread;
+	FastMutex _threadMutex;
+	FastMutex _channelMutex;
+	NotificationQueue _queue;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AsyncChannel_INCLUDED

+ 417 - 0
ThirdParty/include/Poco/AtomicCounter.h

@@ -0,0 +1,417 @@
+//
+// AtomicCounter.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  AtomicCounter
+//
+// Definition of the AtomicCounter class.
+//
+// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AtomicCounter_INCLUDED
+#define Foundation_AtomicCounter_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#if POCO_OS == POCO_OS_WINDOWS_NT
+	#include "Poco/UnWindows.h"
+#elif POCO_OS == POCO_OS_MAC_OS_X
+	#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 || __TV_OS_VERSION_MAX_ALLOWED >= 100000 || __WATCH_OS_VERSION_MAX_ALLOWED >= 30000
+		#if __cplusplus >= 201103L
+			#ifndef POCO_HAVE_STD_ATOMICS
+				#define POCO_HAVE_STD_ATOMICS
+			#endif
+		#else
+			#include <libkern/OSAtomic.h>
+		#endif
+	#else
+		#include <libkern/OSAtomic.h>
+	#endif
+#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) || __GNUC__ > 4) && (defined(__x86_64__) || defined(__i386__))
+	#if !defined(POCO_HAVE_GCC_ATOMICS) && !defined(POCO_NO_GCC_ATOMICS)
+		#define POCO_HAVE_GCC_ATOMICS
+	#endif
+#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) || __GNUC__ > 4)
+	#if !defined(POCO_HAVE_GCC_ATOMICS) && !defined(POCO_NO_GCC_ATOMICS)
+		#define POCO_HAVE_GCC_ATOMICS
+	#endif
+#endif // POCO_OS
+#include "Poco/Mutex.h"
+#ifdef POCO_HAVE_STD_ATOMICS
+#include <atomic>
+#endif
+
+
+namespace Poco {
+
+
+class Foundation_API AtomicCounter
+	/// This class implements a simple counter, which
+	/// provides atomic operations that are safe to
+	/// use in a multithreaded environment.
+	///
+	/// Typical usage of AtomicCounter is for implementing
+	/// reference counting and similar things.
+	///
+	/// On some platforms, the implementation of AtomicCounter
+	/// is based on atomic primitives specific to the platform
+	/// (such as InterlockedIncrement, etc. on Windows), and
+	/// thus very efficient. On platforms that do not support
+	/// atomic primitives, operations are guarded by a FastMutex.
+	///
+	/// The following platforms currently have atomic
+	/// primitives:
+	///   - Windows
+	///   - Mac OS X
+	///   - GCC 4.1+ (Intel platforms only)
+{
+public:
+	typedef int ValueType; /// The underlying integer type.
+	
+	AtomicCounter();
+		/// Creates a new AtomicCounter and initializes it to zero.
+		
+	explicit AtomicCounter(ValueType initialValue);
+		/// Creates a new AtomicCounter and initializes it with
+		/// the given value.
+	
+	AtomicCounter(const AtomicCounter& counter);
+		/// Creates the counter by copying another one.
+	
+	~AtomicCounter();
+		/// Destroys the AtomicCounter.
+
+	AtomicCounter& operator = (const AtomicCounter& counter);
+		/// Assigns the value of another AtomicCounter.
+		
+	AtomicCounter& operator = (ValueType value);
+		/// Assigns a value to the counter.
+
+	operator ValueType () const;
+		/// Returns the value of the counter.
+		
+	ValueType value() const;
+		/// Returns the value of the counter.
+		
+	ValueType operator ++ (); // prefix
+		/// Increments the counter and returns the result.
+		
+	ValueType operator ++ (int); // postfix
+		/// Increments the counter and returns the previous value.
+		
+	ValueType operator -- (); // prefix
+		/// Decrements the counter and returns the result.
+		
+	ValueType operator -- (int); // postfix
+		/// Decrements the counter and returns the previous value.
+		
+	bool operator ! () const;
+		/// Returns true if the counter is zero, false otherwise.
+
+private:
+#if defined(POCO_HAVE_STD_ATOMICS)
+	typedef std::atomic<int> ImplType;
+#elif POCO_OS == POCO_OS_WINDOWS_NT
+	typedef volatile LONG ImplType;
+#elif POCO_OS == POCO_OS_MAC_OS_X
+	typedef int32_t ImplType;
+#elif defined(POCO_HAVE_GCC_ATOMICS)
+	typedef int ImplType;
+#else // generic implementation based on FastMutex
+	struct ImplType
+	{
+		mutable FastMutex mutex;
+		volatile int      value;
+	};
+#endif // POCO_OS
+
+	ImplType _counter;
+};
+
+
+//
+// inlines
+//
+
+
+#if defined(POCO_HAVE_STD_ATOMICS)
+//
+// C++11 atomics
+//
+inline AtomicCounter::operator AtomicCounter::ValueType () const
+{
+	return _counter.load();
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::value() const
+{
+	return _counter.load();
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
+{
+	return ++_counter;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
+{
+	return _counter++;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
+{
+	return --_counter;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
+{
+	return _counter--;
+}
+
+	
+inline bool AtomicCounter::operator ! () const
+{
+	return _counter.load() == 0;
+}
+
+
+#elif POCO_OS == POCO_OS_WINDOWS_NT
+//
+// Windows
+//
+inline AtomicCounter::operator AtomicCounter::ValueType () const
+{
+	return _counter;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::value() const
+{
+	return _counter;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
+{
+	return InterlockedIncrement(&_counter);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
+{
+	ValueType result = InterlockedIncrement(&_counter);
+	return --result;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
+{
+	return InterlockedDecrement(&_counter);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
+{
+	ValueType result = InterlockedDecrement(&_counter);
+	return ++result;
+}
+
+	
+inline bool AtomicCounter::operator ! () const
+{
+	return _counter == 0;
+}
+
+
+#elif POCO_OS == POCO_OS_MAC_OS_X
+//
+// Mac OS X
+//
+inline AtomicCounter::operator AtomicCounter::ValueType () const
+{
+	return _counter;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::value() const
+{
+	return _counter;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
+{
+	return OSAtomicIncrement32(&_counter);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
+{
+	ValueType result = OSAtomicIncrement32(&_counter);
+	return --result;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
+{
+	return OSAtomicDecrement32(&_counter);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
+{
+	ValueType result = OSAtomicDecrement32(&_counter);
+	return ++result;
+}
+
+	
+inline bool AtomicCounter::operator ! () const
+{
+	return _counter == 0;
+}
+
+#elif defined(POCO_HAVE_GCC_ATOMICS)
+//
+// GCC 4.1+ atomic builtins.
+//
+inline AtomicCounter::operator AtomicCounter::ValueType () const
+{
+	return _counter;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::value() const
+{
+	return _counter;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
+{
+	return __sync_add_and_fetch(&_counter, 1);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
+{
+	return __sync_fetch_and_add(&_counter, 1);
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
+{
+	return __sync_sub_and_fetch(&_counter, 1);
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
+{
+	return __sync_fetch_and_sub(&_counter, 1);
+}
+
+	
+inline bool AtomicCounter::operator ! () const
+{
+	return _counter == 0;
+}
+
+
+#else
+//
+// Generic implementation based on FastMutex
+//
+inline AtomicCounter::operator AtomicCounter::ValueType () const
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = _counter.value;
+	}
+	return result;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::value() const
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = _counter.value;
+	}
+	return result;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = ++_counter.value;
+	}
+	return result;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = _counter.value++;
+	}
+	return result;
+}
+
+
+inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = --_counter.value;
+	}
+	return result;
+}
+
+	
+inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
+{
+	ValueType result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = _counter.value--;
+	}
+	return result;
+}
+
+	
+inline bool AtomicCounter::operator ! () const
+{
+	bool result;
+	{
+		FastMutex::ScopedLock lock(_counter.mutex);
+		result = _counter.value == 0;
+	}
+	return result;
+}
+
+
+#endif // POCO_OS
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AtomicCounter_INCLUDED

+ 386 - 0
ThirdParty/include/Poco/AutoPtr.h

@@ -0,0 +1,386 @@
+//
+// AutoPtr.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  AutoPtr
+//
+// Definition of the AutoPtr template class.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AutoPtr_INCLUDED
+#define Foundation_AutoPtr_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Exception.h"
+#include <algorithm>
+
+
+namespace Poco {
+
+
+template <class C>
+class AutoPtr
+	/// AutoPtr is a "smart" pointer for classes implementing
+	/// reference counting based garbage collection.
+	/// To be usable with the AutoPtr template, a class must
+	/// implement the following behaviour:
+	/// A class must maintain a reference count.
+	/// The constructors of the object initialize the reference
+	/// count to one.
+	/// The class must implement a public duplicate() method:
+	///     void duplicate();
+	/// that increments the reference count by one.
+	/// The class must implement a public release() method:
+	///     void release()
+	/// that decrements the reference count by one, and,
+	/// if the reference count reaches zero, deletes the
+	/// object.
+	///
+	/// AutoPtr works in the following way:
+	/// If an AutoPtr is assigned an ordinary pointer to
+	/// an object (via the constructor or the assignment operator),
+	/// it takes ownership of the object and the object's reference 
+	/// count remains unchanged.
+	/// If the AutoPtr is assigned another AutoPtr, the
+	/// object's reference count is incremented by one by
+	/// calling duplicate() on its object.
+	/// The destructor of AutoPtr calls release() on its
+	/// object.
+	/// AutoPtr supports dereferencing with both the ->
+	/// and the * operator. An attempt to dereference a null
+	/// AutoPtr results in a NullPointerException being thrown.
+	/// AutoPtr also implements all relational operators.
+	/// Note that AutoPtr allows casting of its encapsulated data types.
+{
+public:
+	AutoPtr(): _ptr(0)
+	{
+	}
+
+	AutoPtr(C* ptr): _ptr(ptr)
+	{
+	}
+
+	AutoPtr(C* ptr, bool shared): _ptr(ptr)
+	{
+		if (shared && _ptr) _ptr->duplicate();
+	}
+
+	AutoPtr(const AutoPtr& ptr): _ptr(ptr._ptr)
+	{
+		if (_ptr) _ptr->duplicate();
+	}
+
+	template <class Other> 
+	AutoPtr(const AutoPtr<Other>& ptr): _ptr(const_cast<Other*>(ptr.get()))
+	{
+		if (_ptr) _ptr->duplicate();
+	}
+
+	~AutoPtr()
+	{
+		if (_ptr) _ptr->release();
+	}
+	
+	AutoPtr& assign(C* ptr)
+	{
+		if (_ptr != ptr)
+		{
+			if (_ptr) _ptr->release();
+			_ptr = ptr;
+		}
+		return *this;
+	}
+
+	AutoPtr& assign(C* ptr, bool shared)
+	{
+		if (_ptr != ptr)
+		{
+			if (_ptr) _ptr->release();
+			_ptr = ptr;
+			if (shared && _ptr) _ptr->duplicate();
+		}
+		return *this;
+	}
+	
+	AutoPtr& assign(const AutoPtr& ptr)
+	{
+		if (&ptr != this)
+		{
+			if (_ptr) _ptr->release();
+			_ptr = ptr._ptr;
+			if (_ptr) _ptr->duplicate();
+		}
+		return *this;
+	}
+	
+	template <class Other> 
+	AutoPtr& assign(const AutoPtr<Other>& ptr)
+	{
+		if (ptr.get() != _ptr)
+		{
+			if (_ptr) _ptr->release();
+			_ptr = const_cast<Other*>(ptr.get());
+			if (_ptr) _ptr->duplicate();
+		}
+		return *this;
+	}
+
+	void reset()
+	{
+		if (_ptr)
+		{
+			_ptr->release();
+			_ptr = 0;
+		}
+	}
+
+	void reset(C* ptr)
+	{
+		assign(ptr);
+	}
+
+	void reset(C* ptr, bool shared)
+	{
+		assign(ptr, shared);
+	}
+
+	void reset(const AutoPtr& ptr)
+	{
+		assign(ptr);
+	}
+
+	template <class Other>
+	void reset(const AutoPtr<Other>& ptr)
+	{
+		assign<Other>(ptr);
+	}
+
+	AutoPtr& operator = (C* ptr)
+	{
+		return assign(ptr);
+	}
+
+	AutoPtr& operator = (const AutoPtr& ptr)
+	{
+		return assign(ptr);
+	}
+	
+	template <class Other> 
+	AutoPtr& operator = (const AutoPtr<Other>& ptr)
+	{
+		return assign<Other>(ptr);
+	}
+
+	void swap(AutoPtr& ptr)
+	{
+		std::swap(_ptr, ptr._ptr);
+	}
+	
+	template <class Other> 
+	AutoPtr<Other> cast() const
+		/// Casts the AutoPtr via a dynamic cast to the given type.
+		/// Returns an AutoPtr containing NULL if the cast fails.
+		/// Example: (assume class Sub: public Super)
+		///    AutoPtr<Super> super(new Sub());
+		///    AutoPtr<Sub> sub = super.cast<Sub>();
+		///    poco_assert (sub.get());
+	{
+		Other* pOther = dynamic_cast<Other*>(_ptr);
+		return AutoPtr<Other>(pOther, true);
+	}
+
+	template <class Other> 
+	AutoPtr<Other> unsafeCast() const
+		/// Casts the AutoPtr via a static cast to the given type.
+		/// Example: (assume class Sub: public Super)
+		///    AutoPtr<Super> super(new Sub());
+		///    AutoPtr<Sub> sub = super.unsafeCast<Sub>();
+		///    poco_assert (sub.get());
+	{
+		Other* pOther = static_cast<Other*>(_ptr);
+		return AutoPtr<Other>(pOther, true);
+	}
+
+	C* operator -> ()
+	{
+		if (_ptr)
+			return _ptr;
+		else
+			throw NullPointerException();
+	}
+
+	const C* operator -> () const
+	{
+		if (_ptr)
+			return _ptr;
+		else
+			throw NullPointerException();
+	}
+
+	C& operator * ()
+	{
+		if (_ptr)
+			return *_ptr;
+		else
+			throw NullPointerException();
+	}
+
+	const C& operator * () const
+	{
+		if (_ptr)
+			return *_ptr;
+		else
+			throw NullPointerException();
+	}
+
+	C* get()
+	{
+		return _ptr;
+	}
+
+	const C* get() const
+	{
+		return _ptr;
+	}
+
+	operator C* ()
+	{
+		return _ptr;
+	}
+	
+	operator const C* () const
+	{
+		return _ptr;
+	}
+	
+	bool operator ! () const
+	{
+		return _ptr == 0;
+	}
+
+	bool isNull() const
+	{
+		return _ptr == 0;
+	}
+	
+	C* duplicate()
+	{
+		if (_ptr) _ptr->duplicate();
+		return _ptr;
+	}
+
+	bool operator == (const AutoPtr& ptr) const
+	{
+		return _ptr == ptr._ptr;
+	}
+
+	bool operator == (const C* ptr) const
+	{
+		return _ptr == ptr;
+	}
+
+	bool operator == (C* ptr) const
+	{
+		return _ptr == ptr;
+	}
+
+	bool operator != (const AutoPtr& ptr) const
+	{
+		return _ptr != ptr._ptr;
+	}
+
+	bool operator != (const C* ptr) const
+	{
+		return _ptr != ptr;
+	}
+
+	bool operator != (C* ptr) const
+	{
+		return _ptr != ptr;
+	}
+
+	bool operator < (const AutoPtr& ptr) const
+	{
+		return _ptr < ptr._ptr;
+	}
+
+	bool operator < (const C* ptr) const
+	{
+		return _ptr < ptr;
+	}
+
+	bool operator < (C* ptr) const
+	{
+		return _ptr < ptr;
+	}
+
+	bool operator <= (const AutoPtr& ptr) const
+	{
+		return _ptr <= ptr._ptr;
+	}
+
+	bool operator <= (const C* ptr) const
+	{
+		return _ptr <= ptr;
+	}
+
+	bool operator <= (C* ptr) const
+	{
+		return _ptr <= ptr;
+	}
+
+	bool operator > (const AutoPtr& ptr) const
+	{
+		return _ptr > ptr._ptr;
+	}
+
+	bool operator > (const C* ptr) const
+	{
+		return _ptr > ptr;
+	}
+
+	bool operator > (C* ptr) const
+	{
+		return _ptr > ptr;
+	}
+
+	bool operator >= (const AutoPtr& ptr) const
+	{
+		return _ptr >= ptr._ptr;
+	}
+
+	bool operator >= (const C* ptr) const
+	{
+		return _ptr >= ptr;
+	}
+
+	bool operator >= (C* ptr) const
+	{
+		return _ptr >= ptr;
+	}
+
+private:
+	C* _ptr;
+};
+
+
+template <class C>
+inline void swap(AutoPtr<C>& p1, AutoPtr<C>& p2)
+{
+	p1.swap(p2);
+}
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AutoPtr_INCLUDED

+ 86 - 0
ThirdParty/include/Poco/AutoReleasePool.h

@@ -0,0 +1,86 @@
+//
+// AutoReleasePool.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  AutoReleasePool
+//
+// Definition of the AutoReleasePool class.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_AutoReleasePool_INCLUDED
+#define Foundation_AutoReleasePool_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include <list>
+
+
+namespace Poco {
+
+
+template <class C>
+class AutoReleasePool
+	/// An AutoReleasePool implements simple garbage collection for 
+	/// reference-counted objects.
+	/// It temporarily takes ownwership of reference-counted objects that 
+	/// nobody else wants to take ownership of and releases them 
+	/// at a later, appropriate point in time.
+	///
+	/// Note: The correct way to add an object hold by an AutoPtr<> to
+	/// an AutoReleasePool is by invoking the AutoPtr's duplicate()
+	/// method. Example:
+	///    AutoReleasePool<C> arp;
+	///    AutoPtr<C> ptr = new C;
+	///    ...
+	///    arp.add(ptr.duplicate());
+{
+public:
+	AutoReleasePool()
+		/// Creates the AutoReleasePool.
+	{
+	}
+	
+	~AutoReleasePool()
+		/// Destroys the AutoReleasePool and releases
+		/// all objects it currently holds.
+	{
+		release();
+	}
+	
+	void add(C* pObject)
+		/// Adds the given object to the AutoReleasePool.
+		/// The object's reference count is not modified
+	{
+		if (pObject)
+			_list.push_back(pObject);
+	}
+	
+	void release()
+		/// Releases all objects the AutoReleasePool currently holds
+		/// by calling each object's release() method.
+	{
+		while (!_list.empty())
+		{
+			_list.front()->release();
+			_list.pop_front();
+		}
+	}
+	
+private:
+	typedef std::list<C*> ObjectList;
+	
+	ObjectList _list;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_AutoReleasePool_INCLUDED

+ 60 - 0
ThirdParty/include/Poco/BasicEvent.h

@@ -0,0 +1,60 @@
+//
+// BasicEvent.h
+//
+// Library: Foundation
+// Package: Events
+// Module:  BasicEvent
+//
+// Implementation of the BasicEvent template.
+//
+// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_BasicEvent_INCLUDED
+#define Foundation_BasicEvent_INCLUDED
+
+
+#include "Poco/AbstractEvent.h"
+#include "Poco/DefaultStrategy.h"
+#include "Poco/AbstractDelegate.h"
+#include "Poco/Mutex.h"
+
+
+namespace Poco {
+
+
+template <class TArgs, class TMutex = FastMutex> 
+class BasicEvent: public AbstractEvent < 
+	TArgs, DefaultStrategy<TArgs, AbstractDelegate<TArgs> >,
+	AbstractDelegate<TArgs>,
+	TMutex
+>
+	/// A BasicEvent uses the DefaultStrategy which 
+	/// invokes delegates in the order they have been registered.
+	///
+	/// Please see the AbstractEvent class template documentation
+	/// for more information.
+{
+public:
+	BasicEvent()
+	{
+	}
+
+	~BasicEvent()
+	{
+	}
+
+private:
+	BasicEvent(const BasicEvent& e);
+	BasicEvent& operator = (const BasicEvent& e);
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_BasicEvent_INCLUDED

+ 329 - 0
ThirdParty/include/Poco/Buffer.h

@@ -0,0 +1,329 @@
+//
+// Buffer.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  Buffer
+//
+// Definition of the Buffer class.
+//
+// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Buffer_INCLUDED
+#define Foundation_Buffer_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/Exception.h"
+#include <cstring>
+#include <cstddef>
+
+
+namespace Poco {
+
+
+template <class T>
+class Buffer
+	/// A buffer class that allocates a buffer of a given type and size 
+	/// in the constructor and deallocates the buffer in the destructor.
+	///
+	/// This class is useful everywhere where a temporary buffer
+	/// is needed.
+{
+public:
+	Buffer(std::size_t capacity):
+		_capacity(capacity),
+		_used(capacity),
+		_ptr(0),
+		_ownMem(true)
+		/// Creates and allocates the Buffer.
+	{
+		if (capacity > 0)
+		{
+			_ptr = new T[capacity];
+		}
+	}
+
+	Buffer(T* pMem, std::size_t length):
+		_capacity(length),
+		_used(length),
+		_ptr(pMem),
+		_ownMem(false)
+		/// Creates the Buffer. Length argument specifies the length
+		/// of the supplied memory pointed to by pMem in the number
+		/// of elements of type T. Supplied pointer is considered
+		/// blank and not owned by Buffer, so in this case Buffer 
+		/// only acts as a wrapper around externally supplied 
+		/// (and lifetime-managed) memory.
+	{
+	}
+
+	Buffer(const T* pMem, std::size_t length):
+		_capacity(length),
+		_used(length),
+		_ptr(0),
+		_ownMem(true)
+		/// Creates and allocates the Buffer; copies the contents of
+		/// the supplied memory into the buffer. Length argument specifies
+		/// the length of the supplied memory pointed to by pMem in the
+		/// number of elements of type T.
+	{
+		if (_capacity > 0)
+		{
+			_ptr = new T[_capacity];
+			std::memcpy(_ptr, pMem, _used * sizeof(T));
+		}
+	}
+
+	Buffer(const Buffer& other):
+		/// Copy constructor.
+		_capacity(other._used),
+		_used(other._used),
+		_ptr(0),
+		_ownMem(true)
+	{
+		if (_used)
+		{
+			_ptr = new T[_used];
+			std::memcpy(_ptr, other._ptr, _used * sizeof(T));
+		}
+	}
+
+	Buffer& operator = (const Buffer& other)
+		/// Assignment operator.
+	{
+		if (this != &other)
+		{
+			Buffer tmp(other);
+			swap(tmp);
+		}
+
+		return *this;
+	}
+
+	~Buffer()
+		/// Destroys the Buffer.
+	{
+		if (_ownMem) delete [] _ptr;
+	}
+	
+	void resize(std::size_t newCapacity, bool preserveContent = true)
+		/// Resizes the buffer capacity and size. If preserveContent is true,
+		/// the content of the old buffer is copied over to the
+		/// new buffer. The new capacity can be larger or smaller than
+		/// the current one; if it is smaller, capacity will remain intact.
+		/// Size will always be set to the new capacity.
+		///  
+		/// Buffers only wrapping externally owned storage can not be 
+		/// resized. If resize is attempted on those, IllegalAccessException
+		/// is thrown.
+	{
+		if (!_ownMem) throw Poco::InvalidAccessException("Cannot resize buffer which does not own its storage.");
+
+		if (newCapacity > _capacity)
+		{
+			T* ptr = new T[newCapacity];
+			if (preserveContent)
+			{
+				std::memcpy(ptr, _ptr, _used * sizeof(T));
+			}
+			delete [] _ptr;
+			_ptr = ptr;
+			_capacity = newCapacity;
+		}
+		
+		_used = newCapacity;
+	}
+	
+	void setCapacity(std::size_t newCapacity, bool preserveContent = true)
+		/// Sets the buffer capacity. If preserveContent is true,
+		/// the content of the old buffer is copied over to the
+		/// new buffer. The new capacity can be larger or smaller than
+		/// the current one; size will be set to the new capacity only if 
+		/// new capacity is smaller than the current size, otherwise it will
+		/// remain intact.
+		/// 
+		/// Buffers only wrapping externally owned storage can not be 
+		/// resized. If resize is attempted on those, IllegalAccessException
+		/// is thrown.
+	{
+		if (!_ownMem) throw Poco::InvalidAccessException("Cannot resize buffer which does not own its storage.");
+
+		if (newCapacity != _capacity)
+		{
+			T* ptr = 0;
+			if (newCapacity > 0)
+			{
+				ptr = new T[newCapacity];
+				if (preserveContent)
+				{
+					std::size_t newSz = _used < newCapacity ? _used : newCapacity;
+					std::memcpy(ptr, _ptr, newSz * sizeof(T));
+				}
+			}
+			delete [] _ptr;
+			_ptr = ptr;
+			_capacity = newCapacity;
+
+			if (newCapacity < _used) _used = newCapacity;
+		}
+	}
+
+	void assign(const T* buf, std::size_t sz)
+		/// Assigns the argument buffer to this buffer.
+		/// If necessary, resizes the buffer.
+	{
+		if (0 == sz) return;
+		if (sz > _capacity) resize(sz, false);
+		std::memcpy(_ptr, buf, sz * sizeof(T));
+		_used = sz;
+	}
+
+	void append(const T* buf, std::size_t sz)
+		/// Resizes this buffer and appends the argument buffer.
+	{
+		if (0 == sz) return;
+		resize(_used + sz, true);
+		std::memcpy(_ptr + _used - sz, buf, sz * sizeof(T));
+	}
+
+	void append(T val)
+		/// Resizes this buffer by one element and appends the argument value.
+	{
+		resize(_used + 1, true);
+		_ptr[_used - 1] = val;
+	}
+
+	void append(const Buffer& buf)
+		/// Resizes this buffer and appends the argument buffer.
+	{
+		append(buf.begin(), buf.size());
+	}
+
+	std::size_t capacity() const
+		/// Returns the allocated memory size in elements.
+	{
+		return _capacity;
+	}
+
+	std::size_t capacityBytes() const
+		/// Returns the allocated memory size in bytes.
+	{
+		return _capacity * sizeof(T);
+	}
+
+	void swap(Buffer& other)
+	/// Swaps the buffer with another one.
+	{
+		using std::swap;
+
+		swap(_ptr, other._ptr);
+		swap(_capacity, other._capacity);
+		swap(_used, other._used);
+	}
+
+	bool operator == (const Buffer& other) const
+		/// Compare operator.
+	{
+		if (this != &other)
+		{
+			if (_used == other._used)
+			{
+				if (std::memcmp(_ptr, other._ptr, _used * sizeof(T)) == 0)
+				{
+					return true;
+				}
+			}
+			return false;
+		}
+
+		return true;
+	}
+
+	bool operator != (const Buffer& other) const
+		/// Compare operator.
+	{
+		return !(*this == other);
+	}
+
+	void clear()
+		/// Sets the contents of the buffer to zero.
+	{
+		std::memset(_ptr, 0, _used * sizeof(T));
+	}
+
+	std::size_t size() const
+		/// Returns the used size of the buffer in elements.
+	{
+		return _used;
+	}
+
+	std::size_t sizeBytes() const
+		/// Returns the used size of the buffer in bytes.
+	{
+		return _used * sizeof(T);
+	}
+	
+	T* begin()
+		/// Returns a pointer to the beginning of the buffer.
+	{
+		return _ptr;
+	}
+	
+	const T* begin() const
+		/// Returns a pointer to the beginning of the buffer.
+	{
+		return _ptr;
+	}
+
+	T* end()
+		/// Returns a pointer to end of the buffer.
+	{
+		return _ptr + _used;
+	}
+	
+	const T* end() const
+		/// Returns a pointer to the end of the buffer.
+	{
+		return _ptr + _used;
+	}
+	
+	bool empty() const
+		/// Return true if buffer is empty.
+	{
+		return 0 == _used;
+	}
+
+	T& operator [] (std::size_t index)
+	{
+		poco_assert (index < _used);
+		
+		return _ptr[index];
+	}
+
+	const T& operator [] (std::size_t index) const
+	{
+		poco_assert (index < _used);
+		
+		return _ptr[index];
+	}
+
+private:
+	Buffer();
+
+	std::size_t _capacity;
+	std::size_t _used;
+	T*          _ptr;
+	bool        _ownMem;
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_Buffer_INCLUDED

+ 52 - 0
ThirdParty/include/Poco/BufferAllocator.h

@@ -0,0 +1,52 @@
+//
+// BufferAllocator.h
+//
+// Library: Foundation
+// Package: Streams
+// Module:  BufferAllocator
+//
+// Definition of the BufferAllocator class.
+//
+// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_BufferAllocator_INCLUDED
+#define Foundation_BufferAllocator_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include <ios>
+#include <cstddef>
+
+
+namespace Poco {
+
+
+template <typename ch>
+class BufferAllocator
+	/// The BufferAllocator used if no specific
+	/// BufferAllocator has been specified.
+{
+public:
+	typedef ch char_type;
+
+	static char_type* allocate(std::streamsize size)
+	{
+		return new char_type[static_cast<std::size_t>(size)];
+	}
+	
+	static void deallocate(char_type* ptr, std::streamsize /*size*/) throw()
+	{
+		delete [] ptr;
+	}
+};
+
+
+} // namespace Poco
+
+
+#endif // Foundation_BufferAllocator_INCLUDED

+ 181 - 0
ThirdParty/include/Poco/BufferedBidirectionalStreamBuf.h

@@ -0,0 +1,181 @@
+//
+// BufferedBidirectionalStreamBuf.h
+//
+// Library: Foundation
+// Package: Streams
+// Module:  StreamBuf
+//
+// Definition of template BasicBufferedBidirectionalStreamBuf and class BufferedBidirectionalStreamBuf.
+//
+// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_BufferedBidirectionalStreamBuf_INCLUDED
+#define Foundation_BufferedBidirectionalStreamBuf_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/BufferAllocator.h"
+#include "Poco/StreamUtil.h"
+#include <streambuf>
+#include <iosfwd>
+#include <ios>
+
+
+namespace Poco {
+
+
+template <typename ch, typename tr, typename ba = BufferAllocator<ch> > 
+class BasicBufferedBidirectionalStreamBuf: public std::basic_streambuf<ch, tr>
+	/// This is an implementation of a buffered bidirectional 
+	/// streambuf that greatly simplifies the implementation of
+	/// custom streambufs of various kinds.
+	/// Derived classes only have to override the methods
+	/// readFromDevice() or writeToDevice().
+	///
+	/// In contrast to BasicBufferedStreambuf, this class supports
+	/// simultaneous read and write access, so in addition to
+	/// istream and ostream this streambuf can also be used
+	/// for implementing an iostream.
+{
+protected:
+	typedef std::basic_streambuf<ch, tr> Base;
+	typedef std::basic_ios<ch, tr> IOS;
+	typedef ch char_type;
+	typedef tr char_traits;
+	typedef ba Allocator;
+	typedef typename Base::int_type int_type;
+	typedef typename Base::pos_type pos_type;
+	typedef typename Base::off_type off_type;
+	typedef typename IOS::openmode openmode;
+
+public:
+	BasicBufferedBidirectionalStreamBuf(std::streamsize bufferSize, openmode mode):
+		_bufsize(bufferSize),
+		_pReadBuffer(Allocator::allocate(_bufsize)),
+		_pWriteBuffer(Allocator::allocate(_bufsize)),
+		_mode(mode)
+	{
+		resetBuffers();
+	}
+
+	~BasicBufferedBidirectionalStreamBuf()
+	{
+		Allocator::deallocate(_pReadBuffer, _bufsize);
+		Allocator::deallocate(_pWriteBuffer, _bufsize);
+	}
+	
+	virtual int_type overflow(int_type c)
+	{
+		if (!(_mode & IOS::out)) return char_traits::eof();
+
+		if (flushBuffer() == std::streamsize(-1)) return char_traits::eof();
+		if (c != char_traits::eof()) 
+		{
+			*this->pptr() = char_traits::to_char_type(c);
+			this->pbump(1);
+		}
+
+		return c;
+	}
+
+	virtual int_type underflow()
+	{
+		if (!(_mode & IOS::in)) return char_traits::eof();
+
+		if (this->gptr() && (this->gptr() < this->egptr()))
+			return char_traits::to_int_type(*this->gptr());
+
+		int putback = int(this->gptr() - this->eback());
+		if (putback > 4) putback = 4;
+
+		char_traits::move(_pReadBuffer + (4 - putback), this->gptr() - putback, putback);
+
+		int n = readFromDevice(_pReadBuffer + 4, _bufsize - 4);
+		if (n <= 0) return char_traits::eof();
+
+		this->setg(_pReadBuffer + (4 - putback), _pReadBuffer + 4, _pReadBuffer + 4 + n);
+
+		// return next character
+		return char_traits::to_int_type(*this->gptr());    
+	}
+
+	virtual int sync()
+	{
+		if (this->pptr() && this->pptr() > this->pbase()) 
+		{
+			if (flushBuffer() == -1) return -1;
+		}
+		return 0;
+	}
+
+protected:
+	void setMode(openmode mode)
+	{
+		_mode = mode;
+	}
+
+	openmode getMode() const
+	{
+		return _mode;
+	}
+	
+	void resetBuffers()
+	{
+		this->setg(_pReadBuffer + 4, _pReadBuffer + 4, _pReadBuffer + 4);
+		this->setp(_pWriteBuffer, _pWriteBuffer + _bufsize);
+	}
+
+private:
+	virtual int readFromDevice(char_type* /*buffer*/, std::streamsize /*length*/)
+	{
+		return 0;
+	}
+
+	virtual int writeToDevice(const char_type* /*buffer*/, std::streamsize /*length*/)
+	{
+		return 0;
+	}
+
+	int flushBuffer()
+	{
+		int n = int(this->pptr() - this->pbase());
+		if (writeToDevice(this->pbase(), n) == n) 
+		{
+			this->pbump(-n);
+			return n;
+		}
+		return -1;
+	}
+
+	std::streamsize _bufsize;
+	char_type*      _pReadBuffer;
+	char_type*      _pWriteBuffer;
+	openmode        _mode;
+
+	BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&);
+	BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&);
+};
+
+
+//
+// We provide an instantiation for char.
+//
+// Visual C++ needs a workaround - explicitly importing the template
+// instantiation - to avoid duplicate symbols due to multiple
+// instantiations in different libraries.
+//
+#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS) 
+template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> >;
+#endif
+typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> > BufferedBidirectionalStreamBuf;
+
+
+} // namespace Poco
+
+
+#endif // Foundation_BufferedBidirectionalStreamBuf_INCLUDED

+ 173 - 0
ThirdParty/include/Poco/BufferedStreamBuf.h

@@ -0,0 +1,173 @@
+//
+// BufferedStreamBuf.h
+//
+// Library: Foundation
+// Package: Streams
+// Module:  StreamBuf
+//
+// Definition of template BasicBufferedStreamBuf and class BufferedStreamBuf.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_BufferedStreamBuf_INCLUDED
+#define Foundation_BufferedStreamBuf_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/BufferAllocator.h"
+#include "Poco/StreamUtil.h"
+#include <streambuf>
+#include <iosfwd>
+#include <ios>
+
+
+namespace Poco {
+
+
+template <typename ch, typename tr, typename ba = BufferAllocator<ch> > 
+class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
+	/// This is an implementation of a buffered streambuf
+	/// that greatly simplifies the implementation of
+	/// custom streambufs of various kinds.
+	/// Derived classes only have to override the methods
+	/// readFromDevice() or writeToDevice().
+	///
+	/// This streambuf only supports unidirectional streams.
+	/// In other words, the BasicBufferedStreamBuf can be
+	/// used for the implementation of an istream or an
+	/// ostream, but not for an iostream.
+{
+protected:
+	typedef std::basic_streambuf<ch, tr> Base;
+	typedef std::basic_ios<ch, tr> IOS;
+	typedef ch char_type;
+	typedef tr char_traits;
+	typedef ba Allocator;
+	typedef typename Base::int_type int_type;
+	typedef typename Base::pos_type pos_type;
+	typedef typename Base::off_type off_type;
+	typedef typename IOS::openmode openmode;
+
+public:
+	BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode):
+		_bufsize(bufferSize),
+		_pBuffer(Allocator::allocate(_bufsize)),
+		_mode(mode)
+	{
+		this->setg(_pBuffer + 4, _pBuffer + 4, _pBuffer + 4);
+		this->setp(_pBuffer, _pBuffer + _bufsize);
+	}
+
+	~BasicBufferedStreamBuf()
+	{
+		Allocator::deallocate(_pBuffer, _bufsize);
+	}
+
+	virtual int_type overflow(int_type c)
+	{
+		if (!(_mode & IOS::out)) return char_traits::eof();
+
+		if (flushBuffer() == std::streamsize(-1)) return char_traits::eof();
+		if (c != char_traits::eof()) 
+		{
+			*this->pptr() = char_traits::to_char_type(c);
+			this->pbump(1);
+		}
+
+		return c;
+	}
+
+	virtual int_type underflow()
+	{
+		if (!(_mode & IOS::in)) return char_traits::eof();
+
+		if (this->gptr() && (this->gptr() < this->egptr()))
+			return char_traits::to_int_type(*this->gptr());
+
+		int putback = int(this->gptr() - this->eback());
+		if (putback > 4) putback = 4;
+
+		char_traits::move(_pBuffer + (4 - putback), this->gptr() - putback, putback);
+
+		int n = readFromDevice(_pBuffer + 4, _bufsize - 4);
+		if (n <= 0) return char_traits::eof();
+
+		this->setg(_pBuffer + (4 - putback), _pBuffer + 4, _pBuffer + 4 + n);
+
+		// return next character
+		return char_traits::to_int_type(*this->gptr());    
+	}
+
+	virtual int sync()
+	{
+		if (this->pptr() && this->pptr() > this->pbase()) 
+		{
+			if (flushBuffer() == -1) return -1;
+		}
+		return 0;
+	}
+
+protected:
+	void setMode(openmode mode)
+	{
+		_mode = mode;
+	}
+	
+	openmode getMode() const
+	{
+		return _mode;
+	}
+
+private:
+	virtual int readFromDevice(char_type* /*buffer*/, std::streamsize /*length*/)
+	{
+		return 0;
+	}
+
+	virtual int writeToDevice(const char_type* /*buffer*/, std::streamsize /*length*/)
+	{
+		return 0;
+	}
+
+	int flushBuffer()
+	{
+		int n = int(this->pptr() - this->pbase());
+		if (writeToDevice(this->pbase(), n) == n) 
+		{
+			this->pbump(-n);
+			return n;
+		}
+		return -1;
+	}
+
+	std::streamsize _bufsize;
+	char_type*      _pBuffer;
+	openmode        _mode;
+
+	BasicBufferedStreamBuf(const BasicBufferedStreamBuf&);
+	BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
+};
+
+
+//
+// We provide an instantiation for char.
+//
+// Visual C++ needs a workaround - explicitly importing the template
+// instantiation - to avoid duplicate symbols due to multiple
+// instantiations in different libraries.
+//
+#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
+template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char> >;
+#endif
+typedef BasicBufferedStreamBuf<char, std::char_traits<char> > BufferedStreamBuf;
+
+
+} // namespace Poco
+
+
+#endif // Foundation_BufferedStreamBuf_INCLUDED

+ 206 - 0
ThirdParty/include/Poco/Bugcheck.h

@@ -0,0 +1,206 @@
+//
+// Bugcheck.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  Bugcheck
+//
+// Definition of the Bugcheck class and the self-testing macros.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Bugcheck_INCLUDED
+#define Foundation_Bugcheck_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include <string>
+#include <cstdlib>
+#if defined(_DEBUG)
+#	include <iostream>
+#endif
+
+
+namespace Poco {
+
+
+class Foundation_API Bugcheck
+	/// This class provides some static methods that are
+	/// used by the
+	/// poco_assert_dbg(), poco_assert(), poco_check_ptr(), 
+	/// poco_bugcheck() and poco_unexpected() macros. 
+	/// You should not invoke these methods
+	/// directly. Use the macros instead, as they
+	/// automatically provide useful context information.
+{
+public:
+	static void assertion(const char* cond, const char* file, int line, const char* text = 0);
+		/// An assertion failed. Break into the debugger, if
+		/// possible, then throw an AssertionViolationException.
+
+	static void nullPointer(const char* ptr, const char* file, int line);
+		/// An null pointer was encountered. Break into the debugger, if
+		/// possible, then throw an NullPointerException.
+
+	static void bugcheck(const char* file, int line);
+		/// An internal error was encountered. Break into the debugger, if
+		/// possible, then throw an BugcheckException.
+
+	static void bugcheck(const char* msg, const char* file, int line);
+		/// An internal error was encountered. Break into the debugger, if
+		/// possible, then throw an BugcheckException.
+
+	static void unexpected(const char* file, int line);
+		/// An exception was caught in a destructor. Break into debugger,
+		/// if possible and report exception. Must only be called from
+		/// within a catch () block as it rethrows the exception to
+		/// determine its class.
+
+	static void debugger(const char* file, int line);
+		/// An internal error was encountered. Break into the debugger, if
+		/// possible.
+
+	static void debugger(const char* msg, const char* file, int line);
+		/// An internal error was encountered. Break into the debugger, if
+		/// possible.
+
+protected:
+	static std::string what(const char* msg, const char* file, int line, const char* text = 0);
+};
+
+
+} // namespace Poco
+
+
+//
+// useful macros (these automatically supply line number and file name)
+//
+#if defined(__KLOCWORK__) || defined(__clang_analyzer__)
+
+
+// Short-circuit these macros when under static analysis.
+// Ideally, static analysis tools should understand and reason correctly about
+// noreturn methods such as Bugcheck::bugcheck(). In practice, they don't.
+// Help them by turning these macros into std::abort() as described here:
+// https://developer.klocwork.com/documentation/en/insight/10-1/tuning-cc-analysis#Usingthe__KLOCWORK__macro
+
+#include <cstdlib> // for abort
+#define poco_assert_dbg(cond)           do { if (!(cond)) std::abort(); } while (0)
+#define poco_assert_msg_dbg(cond, text) do { if (!(cond)) std::abort(); } while (0)
+#define poco_assert(cond)               do { if (!(cond)) std::abort(); } while (0)
+#define poco_assert_msg(cond, text)     do { if (!(cond)) std::abort(); } while (0)
+#define poco_check_ptr(ptr)             do { if (!(ptr)) std::abort(); } while (0)
+#define poco_bugcheck()                 do { std::abort(); } while (0)
+#define poco_bugcheck_msg(msg)          do { std::abort(); } while (0)
+
+
+#else // defined(__KLOCWORK__) || defined(__clang_analyzer__)
+
+
+#if defined(_DEBUG)
+	#define poco_assert_dbg(cond) \
+		if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
+
+	#define poco_assert_msg_dbg(cond, text) \
+		if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0
+#else
+	#define poco_assert_msg_dbg(cond, text)
+	#define poco_assert_dbg(cond)
+#endif
+
+
+#define poco_assert(cond) \
+	if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
+
+
+#define poco_assert_msg(cond, text) \
+	if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0
+
+
+#define poco_check_ptr(ptr) \
+	if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0
+
+
+#define poco_bugcheck() \
+	Poco::Bugcheck::bugcheck(__FILE__, __LINE__)
+
+
+#define poco_bugcheck_msg(msg) \
+	Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
+
+
+#endif // defined(__KLOCWORK__) || defined(__clang_analyzer__)
+
+
+#define poco_unexpected() \
+	Poco::Bugcheck::unexpected(__FILE__, __LINE__);
+
+
+#define poco_debugger() \
+	Poco::Bugcheck::debugger(__FILE__, __LINE__)
+
+
+#define poco_debugger_msg(msg) \
+	Poco::Bugcheck::debugger(msg, __FILE__, __LINE__)
+
+
+#if defined(_DEBUG)
+#	define poco_stdout_dbg(outstr) \
+	std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
+#else
+#	define poco_stdout_dbg(outstr)
+#endif
+
+
+#if defined(_DEBUG)
+#	define poco_stderr_dbg(outstr) \
+		std::cerr << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
+#else
+#	define poco_stderr_dbg(outstr)
+#endif
+
+
+//
+// poco_static_assert
+//
+// The following was ported from <boost/static_assert.hpp>
+//
+
+
+template <bool x>
+struct POCO_STATIC_ASSERTION_FAILURE;
+
+
+template <>
+struct POCO_STATIC_ASSERTION_FAILURE<true>
+{
+	enum
+	{
+		value = 1
+	};
+};
+
+
+template <int x> 
+struct poco_static_assert_test
+{
+};
+
+
+#if defined(__GNUC__) && (__GNUC__ == 3) && ((__GNUC_MINOR__ == 3) || (__GNUC_MINOR__ == 4))
+#define poco_static_assert(B) \
+	typedef char POCO_JOIN(poco_static_assert_typedef_, __LINE__) \
+        [POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>::value]
+#else
+#define poco_static_assert(B) \
+	typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>)> \
+		POCO_JOIN(poco_static_assert_typedef_, __LINE__) POCO_UNUSED
+#endif
+
+
+#endif // Foundation_Bugcheck_INCLUDED

+ 108 - 0
ThirdParty/include/Poco/Checksum.h

@@ -0,0 +1,108 @@
+//
+// Checksum.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  Checksum
+//
+// Definition of the Checksum class.
+//
+// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Checksum_INCLUDED
+#define Foundation_Checksum_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+namespace Poco {
+
+
+class Foundation_API Checksum
+	/// This class calculates CRC-32 or Adler-32 checksums
+	/// for arbitrary data.
+	///
+	/// A cyclic redundancy check (CRC) is a type of hash function, which is used to produce a 
+	/// small, fixed-size checksum of a larger block of data, such as a packet of network 
+	/// traffic or a computer file. CRC-32 is one of the most commonly used CRC algorithms.
+	///
+	/// Adler-32 is a checksum algorithm which was invented by Mark Adler. 
+	/// It is almost as reliable as a 32-bit cyclic redundancy check for protecting against 
+	/// accidental modification of data, such as distortions occurring during a transmission, 
+	/// but is significantly faster to calculate in software.
+	
+{
+public:
+	enum Type
+	{
+		TYPE_ADLER32 = 0,
+		TYPE_CRC32
+	};
+
+	Checksum();
+		/// Creates a CRC-32 checksum initialized to 0.
+
+	Checksum(Type t);
+		/// Creates the Checksum, using the given type.
+
+	~Checksum();
+		/// Destroys the Checksum.
+
+	void update(const char* data, unsigned length);
+		/// Updates the checksum with the given data.
+
+	void update(const std::string& data);
+		/// Updates the checksum with the given data.
+
+	void update(char data);
+		/// Updates the checksum with the given data.
+
+	Poco::UInt32 checksum() const;
+		/// Returns the calculated checksum.
+
+	Type type() const;
+		/// Which type of checksum are we calulcating
+
+private:
+	Type         _type;
+	Poco::UInt32 _value;
+};
+
+
+//
+// inlines
+//
+inline void Checksum::update(const std::string& data)
+{
+	update(data.c_str(), static_cast<unsigned int>(data.size()));
+}
+
+
+inline void Checksum::update(char c)
+{
+	update(&c, 1);
+}
+
+
+inline Poco::UInt32 Checksum::checksum() const
+{
+	return _value;
+}
+
+
+inline Checksum::Type Checksum::type() const
+{
+	return _type;
+}
+
+
+} // namespace Poco
+
+
+#endif // Foundation_Checksum_INCLUDED

+ 207 - 0
ThirdParty/include/Poco/Config.h

@@ -0,0 +1,207 @@
+//
+// Config.h
+//
+// Library: Foundation
+// Package: Core
+// Module:  Foundation
+//
+// Feature configuration for the POCO libraries.
+//
+// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Foundation_Config_INCLUDED
+#define Foundation_Config_INCLUDED
+
+
+// Define to enable Windows Unicode (UTF-8) support
+// NOTE: As of POCO C++ Libraries release 1.6.0, compiling POCO
+// without POCO_WIN32_UTF8 defined on Windows is deprecated.
+#define POCO_WIN32_UTF8
+
+
+// Define to enable C++11 support
+// #define POCO_ENABLE_CPP11
+
+
+// Define to disable implicit linking
+// #define POCO_NO_AUTOMATIC_LIBS
+
+
+// Define to disable automatic initialization
+// Defining this will disable ALL automatic
+// initialization framework-wide (e.g. Net
+// on Windows, all Data back-ends, etc).
+//
+// #define POCO_NO_AUTOMATIC_LIB_INIT
+
+
+// Define to disable FPEnvironment support
+// #define POCO_NO_FPENVIRONMENT
+
+
+// Define if std::wstring is not available
+// #define POCO_NO_WSTRING
+
+
+// Define to disable shared memory
+// #define POCO_NO_SHAREDMEMORY
+
+
+// Define if no <locale> header is available (such as on WinCE)
+// #define POCO_NO_LOCALE
+
+
+// Define to desired default thread stack size
+// Zero means OS default
+#ifndef POCO_THREAD_STACK_SIZE
+	#define POCO_THREAD_STACK_SIZE 0
+#endif
+
+
+// Define to override system-provided
+// minimum thread priority value on POSIX
+// platforms (returned by Poco::Thread::getMinOSPriority()).
+// #define POCO_THREAD_PRIORITY_MIN 0
+
+
+// Define to override system-provided
+// maximum thread priority value on POSIX
+// platforms (returned by Poco::Thread::getMaxOSPriority()).
+// #define POCO_THREAD_PRIORITY_MAX 31
+
+
+// Define to disable small object optimization. If not
+// defined, Any and Dynamic::Var (and similar optimization
+// candidates) will be auto-allocated on the stack in
+// cases when value holder fits into POCO_SMALL_OBJECT_SIZE
+// (see below).
+//
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+// !!! NOTE: Any/Dynamic::Var SOO will NOT work reliably   !!!
+// !!! without C++11 (std::aligned_storage in particular). !!!
+// !!! Only comment this out if your compiler has support  !!!
+// !!! for std::aligned_storage.                           !!!
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//
+#ifndef POCO_ENABLE_SOO
+#define POCO_NO_SOO
+#endif
+
+
+// Small object size in bytes. When assigned to Any or Var,
+// objects larger than this value will be alocated on the heap,
+// while those smaller will be placement new-ed into an
+// internal buffer.
+#if !defined(POCO_SMALL_OBJECT_SIZE) && !defined(POCO_NO_SOO)
+	#define POCO_SMALL_OBJECT_SIZE 32
+#endif
+
+
+// Define to disable compilation of DirectoryWatcher
+// on platforms with no inotify.
+// #define POCO_NO_INOTIFY
+
+
+// Following are options to remove certain features
+// to reduce library/executable size for smaller
+// embedded platforms. By enabling these options,
+// the size of a statically executable can be
+// reduced by a few 100 Kbytes.
+
+
+// No automatic registration of FileChannel in
+// LoggingFactory - avoids FileChannel and friends
+// being linked to executable.
+// #define POCO_NO_FILECHANNEL
+
+
+// No automatic registration of SplitterChannel in
+// LoggingFactory - avoids SplitterChannel being
+// linked to executable.
+// #define POCO_NO_SPLITTERCHANNEL
+
+
+// No automatic registration of SyslogChannel in
+// LoggingFactory - avoids SyslogChannel being
+// linked to executable on Unix/Linux systems.
+// #define POCO_NO_SYSLOGCHANNEL
+
+
+// Define to enable MSVC secure warnings
+// #define POCO_MSVC_SECURE_WARNINGS
+
+
+// No support for INI file configurations in
+// Poco::Util::Application.
+// #define POCO_UTIL_NO_INIFILECONFIGURATION
+
+
+// No support for JSON configuration in
+// Poco::Util::Application. Avoids linking of JSON
+// library and saves a few 100 Kbytes.
+// #define POCO_UTIL_NO_JSONCONFIGURATION
+
+
+// No support for XML configuration in
+// Poco::Util::Application. Avoids linking of XML
+// library and saves a few 100 Kbytes.
+// #define POCO_UTIL_NO_XMLCONFIGURATION
+
+
+// No IPv6 support
+// Define to disable IPv6
+// #define POCO_NET_NO_IPv6
+
+
+// Windows CE has no locale support
+#if defined(_WIN32_WCE)
+	#define POCO_NO_LOCALE
+#endif
+
+
+// Enable the poco_debug_* and poco_trace_* macros
+// even if the _DEBUG variable is not set.
+// This allows the use of these macros in a release version.
+// #define POCO_LOG_DEBUG
+
+
+// OpenSSL on Windows
+//
+// Poco has its own OpenSSL build system.
+// See <https://github.com/pocoproject/openssl/blob/master/README.md>
+// for details.
+//
+// These options are Windows only.
+//
+// To disable the use of Poco-provided OpenSSL binaries,
+// define POCO_EXTERNAL_OPENSSL.
+//
+// Possible values:
+//   POCO_EXTERNAL_OPENSSL_SLPRO:
+//     Automatically link OpenSSL libraries from OpenSSL Windows installer provided
+//     by Shining Light Productions <http://slproweb.com/products/Win32OpenSSL.html>
+//     The (global) library search path must be set accordingly.
+//   POCO_EXTERNAL_OPENSSL_DEFAULT:
+//     Automatically link OpenSSL libraries from standard OpenSSL Windows build.
+//     The (global) library search path must be set accordingly.
+//   empty or other value:
+//     Do not link any OpenSSL libraries automatically. You will have to edit the
+//     Visual C++ project files for Crypto and NetSSL_OpenSSL.
+// #define POCO_EXTERNAL_OPENSSL POCO_EXTERNAL_OPENSSL_SLPRO
+
+
+// Define to prevent changing the suffix for shared libraries
+// to "d.so", "d.dll", etc. for _DEBUG builds in Poco::SharedLibrary.
+// #define POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX
+
+
+// Disarm POCO_DEPRECATED macro.
+// #define POCO_NO_DEPRECATED
+
+
+#endif // Foundation_Config_INCLUDED

+ 138 - 0
ThirdParty/include/Poco/Crypto/Cipher.h

@@ -0,0 +1,138 @@
+//
+// Cipher.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  Cipher
+//
+// Definition of the Cipher class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_Cipher_INCLUDED
+#define Crypto_Cipher_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <istream>
+#include <ostream>
+#include <vector>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class CryptoTransform;
+
+
+class Crypto_API Cipher: public Poco::RefCountedObject
+	/// Represents the abstract base class from which all implementations of
+	/// symmetric/asymmetric encryption algorithms must inherit.  Use the CipherFactory
+	/// class to obtain an instance of this class:
+	///
+	///     CipherFactory& factory = CipherFactory::defaultFactory();
+	///     // Creates a 256-bit AES cipher
+	///     Cipher* pCipher = factory.createCipher(CipherKey("aes-256"));
+	///     Cipher* pRSACipher = factory.createCipher(RSAKey(RSAKey::KL_1024, RSAKey::EXP_SMALL));
+	///
+	/// Check the different Key constructors on how to initialize/create
+	/// a key. The above example auto-generates random keys.
+	///
+	/// Note that you won't be able to decrypt data encrypted with a random key
+	/// once the Cipher is destroyed unless you persist the generated key and IV.
+	/// An example usage for random keys is to encrypt data saved in a temporary
+	/// file.
+	///
+	/// Once your key is set up, you can use the Cipher object to encrypt or
+	/// decrypt strings or, in conjunction with a CryptoInputStream or a
+	/// CryptoOutputStream, to encrypt streams of data.
+	///
+	/// Since encrypted strings will contain arbitrary binary data that will cause
+	/// problems in applications that are not binary-safe (eg., when sending
+	/// encrypted data in e-mails), the encryptString() and decryptString() can
+	/// encode (or decode, respectively) encrypted data using a "transport encoding".
+	/// Supported encodings are Base64 and BinHex.
+	///
+	/// The following example encrypts and decrypts a string utilizing Base64
+	/// encoding:
+	///
+	///     std::string plainText = "This is my secret information";
+	///     std::string encrypted = pCipher->encryptString(plainText, Cipher::ENC_BASE64);
+	///     std::string decrypted = pCipher->decryptString(encrypted, Cipher::ENC_BASE64);
+	///
+	/// In order to encrypt a stream of data (eg. to encrypt files), you can use
+	/// a CryptoStream:
+	///
+	///     // Create an output stream that will encrypt all data going through it
+	///     // and write pass it to the underlying file stream.
+	///     Poco::FileOutputStream sink("encrypted.dat");
+	///     CryptoOutputStream encryptor(sink, pCipher->createEncryptor());
+	///     
+	///     Poco::FileInputStream source("source.txt");
+	///     Poco::StreamCopier::copyStream(source, encryptor);
+	///     
+	///     // Always close output streams to flush all internal buffers
+	///     encryptor.close();
+	///     sink.close();
+{
+public:
+	typedef Poco::AutoPtr<Cipher> Ptr;
+	typedef std::vector<unsigned char> ByteVec;
+
+	enum Encoding
+		/// Transport encoding to use for encryptString() and decryptString().
+	{
+		ENC_NONE         = 0x00, /// Plain binary output
+		ENC_BASE64       = 0x01, /// Base64-encoded output
+		ENC_BINHEX       = 0x02, /// BinHex-encoded output
+		ENC_BASE64_NO_LF = 0x81, /// Base64-encoded output, no linefeeds
+		ENC_BINHEX_NO_LF = 0x82  /// BinHex-encoded output, no linefeeds
+		
+	};
+
+	virtual ~Cipher();
+		/// Destroys the Cipher.
+
+	virtual const std::string& name() const = 0;
+		/// Returns the name of the Cipher.
+
+	virtual CryptoTransform* createEncryptor() = 0;
+		/// Creates an encryptor object to be used with a CryptoStream.
+
+	virtual CryptoTransform* createDecryptor() = 0;
+		/// Creates a decryptor object to be used with a CryptoStream.
+
+	virtual std::string encryptString(const std::string& str, Encoding encoding = ENC_NONE);
+		/// Directly encrypt a string and encode it using the given encoding.
+
+	virtual std::string decryptString(const std::string& str, Encoding encoding = ENC_NONE);
+		/// Directly decrypt a string that is encoded with the given encoding.
+
+	virtual void encrypt(std::istream& source, std::ostream& sink, Encoding encoding = ENC_NONE);
+		/// Directly encrypts an input stream and encodes it using the given encoding.
+
+	virtual void decrypt(std::istream& source, std::ostream& sink, Encoding encoding = ENC_NONE);
+		/// Directly decrypt an input stream that is encoded with the given encoding.
+
+protected:
+	Cipher();
+		/// Creates a new Cipher object.
+
+private:
+	Cipher(const Cipher&);
+	Cipher& operator = (const Cipher&);
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_Cipher_INCLUDED

+ 75 - 0
ThirdParty/include/Poco/Crypto/CipherFactory.h

@@ -0,0 +1,75 @@
+//
+// CipherFactory.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CipherFactory
+//
+// Definition of the CipherFactory class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CipherFactory_INCLUDED
+#define Crypto_CipherFactory_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Cipher;
+class CipherKey;
+class RSAKey;
+
+
+class Crypto_API CipherFactory
+	/// A factory for Cipher objects. See the Cipher class for examples on how to
+	/// use the CipherFactory.
+{
+public:
+	CipherFactory();
+		/// Creates a new CipherFactory object.
+
+	virtual ~CipherFactory();
+		/// Destroys the CipherFactory.
+
+	Cipher* createCipher(const CipherKey& key);
+		/// Creates a Cipher object for the given Cipher name. Valid cipher 
+		/// names depend on the OpenSSL version the library is linked with;  
+		/// see the output of
+		///
+		///     openssl enc --help
+		///
+		/// for a list of supported block and stream ciphers.
+		///
+		/// Common examples are:
+		///
+		///   * AES: "aes-128", "aes-256"
+		///   * DES: "des", "des3"
+		///   * Blowfish: "bf"
+
+	Cipher* createCipher(const RSAKey& key, RSAPaddingMode paddingMode = RSA_PADDING_PKCS1);
+		/// Creates a RSACipher using the given RSA key and padding mode
+		/// for public key encryption/private key decryption.
+	
+	static CipherFactory& defaultFactory();
+		/// Returns the default CipherFactory.
+
+private:
+	CipherFactory(const CipherFactory&);
+	CipherFactory& operator = (const CipherFactory&);
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CipherFactory_INCLUDED

+ 69 - 0
ThirdParty/include/Poco/Crypto/CipherImpl.h

@@ -0,0 +1,69 @@
+//
+// CipherImpl.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CipherImpl
+//
+// Definition of the CipherImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CipherImpl_INCLUDED
+#define Crypto_CipherImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/Cipher.h"
+#include "Poco/Crypto/CipherKey.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include <openssl/evp.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class CipherImpl: public Cipher
+	/// An implementation of the Cipher class for OpenSSL's crypto library.
+{
+public:
+	CipherImpl(const CipherKey& key);
+		/// Creates a new CipherImpl object for the given CipherKey.
+
+	virtual ~CipherImpl();
+		/// Destroys the CipherImpl.
+
+	const std::string& name() const;
+		/// Returns the name of the cipher.
+
+	CryptoTransform* createEncryptor();
+		/// Creates an encryptor object.
+
+	CryptoTransform* createDecryptor();
+		/// Creates a decryptor object.
+
+private:
+	CipherKey _key;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// Inlines
+//
+inline const std::string& CipherImpl::name() const
+{
+	return _key.name();
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CipherImpl_INCLUDED

+ 201 - 0
ThirdParty/include/Poco/Crypto/CipherKey.h

@@ -0,0 +1,201 @@
+//
+// CipherKey.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CipherKey
+//
+// Definition of the CipherKey class.
+//
+// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CipherKey_INCLUDED
+#define Crypto_CipherKey_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/CipherKeyImpl.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API CipherKey
+	/// CipherKey stores the key information for decryption/encryption of data.
+	/// To create a random key, using the following code:
+	///
+	///     CipherKey key("aes-256");
+	///
+	/// Note that you won't be able to decrypt data encrypted with a random key
+	/// once the Cipher is destroyed unless you persist the generated key and IV.
+	/// An example usage for random keys is to encrypt data saved in a temporary
+	/// file.
+	///
+	/// To create a key using a human-readable password
+	/// string, use the following code. We create a AES Cipher and 
+	/// use a salt value to make the key more robust:
+	///
+	///     std::string password = "secret";
+	///     std::string salt("asdff8723lasdf(**923412");
+	///     CipherKey key("aes-256", password, salt);
+	///
+	/// You may also control the digest and the number of iterations used to generate the key
+	/// by specifying the specific values. Here we create a key with the same data as before,
+	/// except that we use 100 iterations instead of DEFAULT_ITERATION_COUNT, and sha1 instead of
+	/// the default md5:
+	///
+	///     std::string password = "secret";
+	///     std::string salt("asdff8723lasdf(**923412");
+	///     std::string digest ("sha1");
+	///     CipherKey key("aes-256", password, salt, 100, digest);
+	///
+{
+public:
+	typedef CipherKeyImpl::Mode Mode;
+	typedef CipherKeyImpl::ByteVec ByteVec;
+
+	enum
+	{
+		DEFAULT_ITERATION_COUNT = 2000
+			/// Default iteration count to use with
+			/// generateKey(). RSA security recommends
+			/// an iteration count of at least 1000.
+	};
+
+	CipherKey(const std::string& name, 
+		const std::string& passphrase, 
+		const std::string& salt = "",
+		int iterationCount = DEFAULT_ITERATION_COUNT,
+		const std::string& digest = "md5");
+		/// Creates a new CipherKeyImpl object using the given
+		/// cipher name, passphrase, salt value, iteration count and digest.
+
+	CipherKey(const std::string& name, 
+		const ByteVec& key, 
+		const ByteVec& iv);
+		/// Creates a new CipherKeyImpl object using the given cipher
+		/// name, key and initialization vector (IV).
+		///
+		/// The size of the IV must match the cipher's expected
+		/// IV size (see ivSize()), except for GCM mode, which allows
+		/// a custom IV size.
+
+	CipherKey(const std::string& name);
+		/// Creates a new CipherKeyImpl object. Autoinitializes key and 
+		/// initialization vector.
+
+	~CipherKey();
+		/// Destroys the CipherKeyImpl.
+
+	const std::string& name() const;
+		/// Returns the name of the Cipher.
+
+	int keySize() const;
+		/// Returns the key size of the Cipher.
+
+	int blockSize() const;
+		/// Returns the block size of the Cipher.
+
+	int ivSize() const;
+		/// Returns the IV size of the Cipher.
+
+	Mode mode() const;
+		/// Returns the Cipher's mode of operation.
+	
+	const ByteVec& getKey() const;
+		/// Returns the key for the Cipher.
+
+	void setKey(const ByteVec& key);
+		/// Sets the key for the Cipher.
+
+	const ByteVec& getIV() const;
+		/// Returns the initialization vector (IV) for the Cipher.
+
+	void setIV(const ByteVec& iv);
+		/// Sets the initialization vector (IV) for the Cipher.
+		///
+		/// The size of the vector must match the cipher's expected
+		/// IV size (see ivSize()), except for GCM mode, which allows
+		/// a custom IV size.
+
+	CipherKeyImpl::Ptr impl();
+		/// Returns the impl object
+
+private:
+	CipherKeyImpl::Ptr _pImpl;
+};
+
+
+//
+// inlines
+//
+inline const std::string& CipherKey::name() const
+{
+	return _pImpl->name();
+}
+
+
+inline int CipherKey::keySize() const
+{
+	return _pImpl->keySize();
+}
+
+
+inline int CipherKey::blockSize() const
+{
+	return _pImpl->blockSize();
+}
+
+
+inline int CipherKey::ivSize() const
+{
+	return _pImpl->ivSize();
+}
+
+
+inline CipherKey::Mode CipherKey::mode() const
+{
+	return _pImpl->mode();
+}
+
+
+inline const CipherKey::ByteVec& CipherKey::getKey() const
+{
+	return _pImpl->getKey();
+}
+
+
+inline void CipherKey::setKey(const CipherKey::ByteVec& key)
+{
+	_pImpl->setKey(key);
+}
+
+
+inline const CipherKey::ByteVec& CipherKey::getIV() const
+{
+	return _pImpl->getIV();
+}
+
+
+inline void CipherKey::setIV(const CipherKey::ByteVec& iv)
+{
+	_pImpl->setIV(iv);
+}
+
+
+inline CipherKeyImpl::Ptr CipherKey::impl()
+{
+	return _pImpl;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CipherKey_INCLUDED

+ 168 - 0
ThirdParty/include/Poco/Crypto/CipherKeyImpl.h

@@ -0,0 +1,168 @@
+//
+// CipherKeyImpl.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CipherKeyImpl
+//
+// Definition of the CipherKeyImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CipherKeyImpl_INCLUDED
+#define Crypto_CipherKeyImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <vector>
+
+
+struct evp_cipher_st;
+typedef struct evp_cipher_st EVP_CIPHER;
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class CipherKeyImpl: public RefCountedObject
+	/// An implementation of the CipherKey class for OpenSSL's crypto library.
+{
+public:
+	typedef std::vector<unsigned char> ByteVec;
+	typedef Poco::AutoPtr<CipherKeyImpl> Ptr;
+
+	enum Mode
+		/// Cipher mode of operation. This mode determines how multiple blocks
+		/// are connected; this is essential to improve security.
+	{
+		MODE_STREAM_CIPHER,	/// Stream cipher
+		MODE_ECB,			/// Electronic codebook (plain concatenation)
+		MODE_CBC,			/// Cipher block chaining (default)
+		MODE_CFB,			/// Cipher feedback
+		MODE_OFB,			/// Output feedback
+		MODE_CTR,           /// Counter mode
+		MODE_GCM,           /// Galois/Counter mode
+		MODE_CCM            /// Counter with CBC-MAC
+	};
+
+	CipherKeyImpl(const std::string& name,
+		const std::string& passphrase,
+		const std::string& salt,
+		int iterationCount,
+		const std::string& digest);
+		/// Creates a new CipherKeyImpl object, using
+		/// the given cipher name, passphrase, salt value
+		/// and iteration count.
+
+	CipherKeyImpl(const std::string& name,
+		const ByteVec& key,
+		const ByteVec& iv);
+		/// Creates a new CipherKeyImpl object, using the
+		/// given cipher name, key and initialization vector.
+
+	CipherKeyImpl(const std::string& name);
+		/// Creates a new CipherKeyImpl object. Autoinitializes key
+		/// and initialization vector.
+
+	virtual ~CipherKeyImpl();
+		/// Destroys the CipherKeyImpl.
+
+	const std::string& name() const;
+		/// Returns the name of the Cipher.
+
+	int keySize() const;
+		/// Returns the key size of the Cipher.
+
+	int blockSize() const;
+		/// Returns the block size of the Cipher.
+
+	int ivSize() const;
+		/// Returns the IV size of the Cipher.
+
+	Mode mode() const;
+		/// Returns the Cipher's mode of operation.
+
+	const ByteVec& getKey() const;
+		/// Returns the key for the Cipher.
+
+	void setKey(const ByteVec& key);
+		/// Sets the key for the Cipher.
+
+	const ByteVec& getIV() const;
+		/// Returns the initialization vector (IV) for the Cipher.
+
+	void setIV(const ByteVec& iv);
+		/// Sets the initialization vector (IV) for the Cipher.
+
+	const EVP_CIPHER* cipher();
+		/// Returns the cipher object
+
+private:
+	void generateKey(const std::string& passphrase,
+		const std::string& salt,
+		int iterationCount);
+	 	/// Generates key and IV from a password and optional salt string.
+
+	void generateKey();
+		/// Generates key and IV from random data.
+
+	void getRandomBytes(ByteVec& vec, std::size_t count);
+		/// Stores random bytes in vec.
+
+private:
+	const EVP_CIPHER*  _pCipher;
+	const EVP_MD*      _pDigest;
+	std::string	       _name;
+	ByteVec		       _key;
+	ByteVec		       _iv;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// Inlines
+//
+inline const std::string& CipherKeyImpl::name() const
+{
+	return _name;
+}
+
+
+inline const CipherKeyImpl::ByteVec& CipherKeyImpl::getKey() const
+{
+	return _key;
+}
+
+
+inline void CipherKeyImpl::setKey(const ByteVec& key)
+{
+	poco_assert(key.size() == static_cast<ByteVec::size_type>(keySize()));
+	_key = key;
+}
+
+
+inline const CipherKeyImpl::ByteVec& CipherKeyImpl::getIV() const
+{
+	return _iv;
+}
+
+
+inline const EVP_CIPHER* CipherKeyImpl::cipher()
+{
+	return _pCipher;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CipherKeyImpl_INCLUDED

+ 195 - 0
ThirdParty/include/Poco/Crypto/Crypto.h

@@ -0,0 +1,195 @@
+//
+// Crypto.h
+//
+// Library: Crypto
+// Package: CryptoCore
+// Module:  Crypto
+//
+// Basic definitions for the Poco Crypto library.
+// This file must be the first file included by every other Crypto
+// header file.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_Crypto_INCLUDED
+#define Crypto_Crypto_INCLUDED
+
+
+#define POCO_EXTERNAL_OPENSSL_DEFAULT 1
+#define POCO_EXTERNAL_OPENSSL_SLPRO 2
+
+
+#include "Poco/Foundation.h"
+#include <openssl/opensslv.h>
+
+
+#ifndef OPENSSL_VERSION_PREREQ
+	#if defined(OPENSSL_VERSION_MAJOR) && defined(OPENSSL_VERSION_MINOR)
+		#define OPENSSL_VERSION_PREREQ(maj, min) \
+			((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
+	#else
+		#define OPENSSL_VERSION_PREREQ(maj, min) \
+			(OPENSSL_VERSION_NUMBER >= (((maj) << 28) | ((min) << 20)))
+	#endif
+#endif
+
+
+enum RSAPaddingMode
+	/// The padding mode used for RSA public key encryption.
+{
+	RSA_PADDING_PKCS1,
+		/// PKCS #1 v1.5 padding. This currently is the most widely used mode. 
+		
+	RSA_PADDING_PKCS1_OAEP,
+		/// EME-OAEP as defined in PKCS #1 v2.0 with SHA-1, MGF1 and an empty 
+		/// encoding parameter. This mode is recommended for all new applications.
+		
+	RSA_PADDING_SSLV23,
+		/// PKCS #1 v1.5 padding with an SSL-specific modification that denotes 
+		/// that the server is SSL3 capable. 
+		
+	RSA_PADDING_NONE
+		/// Raw RSA encryption. This mode should only be used to implement cryptographically 
+		/// sound padding modes in the application code. Encrypting user data directly with RSA 
+		/// is insecure. 
+};
+
+
+//
+// The following block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the Crypto_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// Crypto_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+//
+#if defined(_WIN32)
+	#if defined(POCO_DLL)
+		#if defined(Crypto_EXPORTS)
+			#define Crypto_API __declspec(dllexport)
+		#else
+			#define Crypto_API __declspec(dllimport)
+		#endif
+	#endif
+#endif
+
+
+#if !defined(Crypto_API)
+	#if !defined(POCO_NO_GCC_API_ATTRIBUTE) && defined (__GNUC__) && (__GNUC__ >= 4)
+		#define Crypto_API __attribute__ ((visibility ("default")))
+	#else
+		#define Crypto_API
+	#endif
+#endif
+
+
+//
+// Automatically link Crypto and OpenSSL libraries.
+//
+#if defined(_MSC_VER)
+	#if !defined(POCO_NO_AUTOMATIC_LIBS)
+		#if defined(POCO_INTERNAL_OPENSSL_MSVC_VER)
+			#if defined(POCO_EXTERNAL_OPENSSL)
+				#pragma message("External OpenSSL defined but internal headers used - possible mismatch!")
+			#endif // POCO_EXTERNAL_OPENSSL
+			#if !defined(_DEBUG)
+				#define POCO_DEBUG_SUFFIX ""
+				#if !defined (_DLL)
+					#define POCO_STATIC_SUFFIX "mt"
+				#else // _DLL
+					#define POCO_STATIC_SUFFIX ""
+				#endif
+			#else // _DEBUG
+				#define POCO_DEBUG_SUFFIX "d"
+				#if !defined (_DLL)
+					#define POCO_STATIC_SUFFIX "mt"
+				#else // _DLL
+					#define POCO_STATIC_SUFFIX ""
+				#endif
+			#endif
+			#pragma comment(lib, "libcrypto" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
+			#pragma comment(lib, "libssl" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
+			#if !defined(_WIN64) && !defined (_DLL) && \
+						(POCO_INTERNAL_OPENSSL_MSVC_VER == 120) && \
+						(POCO_MSVC_VERSION < POCO_INTERNAL_OPENSSL_MSVC_VER)
+				#pragma comment(lib, "libPreVS2013CRT" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
+			#endif
+			#if !defined (_DLL) && (POCO_MSVS_VERSION >= 2015)
+				#pragma comment(lib, "legacy_stdio_definitions.lib")
+				#pragma comment(lib, "legacy_stdio_wide_specifiers.lib")
+			#endif
+		#elif defined(POCO_EXTERNAL_OPENSSL)
+			#if POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_SLPRO
+				#if defined(POCO_DLL)
+					#if OPENSSL_VERSION_PREREQ(1,1)
+						#pragma comment(lib, "libcrypto.lib")
+						#pragma comment(lib, "libssl.lib")
+					#else
+						#pragma comment(lib, "libeay32.lib")
+						#pragma comment(lib, "ssleay32.lib")
+					#endif
+			  	#else
+					#if OPENSSL_VERSION_PREREQ(1,1)
+						#if defined(_WIN64)
+							#pragma comment(lib, "libcrypto64" POCO_LIB_SUFFIX)
+							#pragma comment(lib, "libssl64" POCO_LIB_SUFFIX)
+						#else
+							#pragma comment(lib, "libcrypto32" POCO_LIB_SUFFIX)
+							#pragma comment(lib, "libssl32" POCO_LIB_SUFFIX)
+						#endif
+					#else
+						#pragma comment(lib, "libeay32" POCO_LIB_SUFFIX)
+						#pragma comment(lib, "ssleay32" POCO_LIB_SUFFIX)
+					#endif
+				#endif
+			#elif POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_DEFAULT
+				#if OPENSSL_VERSION_PREREQ(1,1)
+					#pragma comment(lib, "libcrypto.lib")
+					#pragma comment(lib, "libssl.lib")
+				#else
+					#pragma comment(lib, "libeay32.lib")
+					#pragma comment(lib, "ssleay32.lib")
+				#endif
+			#endif
+		#endif // POCO_INTERNAL_OPENSSL_MSVC_VER
+		#if !defined(Crypto_EXPORTS)
+			#pragma comment(lib, "PocoCrypto" POCO_LIB_SUFFIX)
+		#endif
+	#endif // POCO_NO_AUTOMATIC_LIBS
+#endif
+
+
+namespace Poco {
+namespace Crypto {
+
+
+void Crypto_API initializeCrypto();
+	/// Initialize the Crypto library, as well as the underlying OpenSSL
+	/// libraries, by calling OpenSSLInitializer::initialize().
+	///
+	/// Should be called before using any class from the Crypto library.
+	/// The Crypto library will be initialized automatically, through
+	/// OpenSSLInitializer instances held by various Crypto classes
+	/// (Cipher, CipherKey, RSAKey, X509Certificate).
+	/// However, it is recommended to call initializeCrypto()
+	/// in any case at application startup.
+	///
+	/// Can be called multiple times; however, for every call to
+	/// initializeCrypto(), a matching call to uninitializeCrypto()
+	/// must be performed.
+
+
+void Crypto_API uninitializeCrypto();
+	/// Uninitializes the Crypto library by calling
+	/// OpenSSLInitializer::uninitialize().
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_Crypto_INCLUDED

+ 56 - 0
ThirdParty/include/Poco/Crypto/CryptoException.h

@@ -0,0 +1,56 @@
+//
+// CryptoException.h
+//
+//
+// Library: Crypto
+// Package: Crypto
+// Module:  CryptoException
+//
+// Definition of the CryptoException class.
+//
+// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CryptoException_INCLUDED
+#define Crypto_CryptoException_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Exception.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+POCO_DECLARE_EXCEPTION(Crypto_API, CryptoException, Poco::Exception)
+
+
+class Crypto_API OpenSSLException : public CryptoException
+{
+public:
+	OpenSSLException(int code = 0);
+	OpenSSLException(const std::string& msg, int code = 0);
+	OpenSSLException(const std::string& msg, const std::string& arg, int code = 0);
+	OpenSSLException(const std::string& msg, const Poco::Exception& exc, int code = 0);
+	OpenSSLException(const OpenSSLException& exc);
+	~OpenSSLException() throw();
+	OpenSSLException& operator = (const OpenSSLException& exc);
+	const char* name() const throw();
+	const char* className() const throw();
+	Poco::Exception* clone() const;
+	void rethrow() const;
+
+private:
+	void setExtMessage();
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CryptoException_INCLUDED

+ 192 - 0
ThirdParty/include/Poco/Crypto/CryptoStream.h

@@ -0,0 +1,192 @@
+//
+// CryptoStream.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CryptoStream
+//
+// Definition of the CryptoStreamBuf, CryptoInputStream and CryptoOutputStream
+// classes.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CryptoStream_INCLUDED
+#define Crypto_CryptoStream_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/BufferedStreamBuf.h"
+#include "Poco/Buffer.h"
+#include <iostream>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class CryptoTransform;
+class Cipher;
+
+
+class Crypto_API CryptoStreamBuf: public Poco::BufferedStreamBuf
+	/// This stream buffer performs cryptographic transformation on the data
+	/// going through it.
+{
+public:
+	CryptoStreamBuf(std::istream& istr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+	CryptoStreamBuf(std::ostream& ostr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+
+	virtual ~CryptoStreamBuf();
+
+	void close();
+		/// Flushes all buffers and finishes the encryption.
+
+protected:
+	int readFromDevice(char* buffer, std::streamsize length);
+	int writeToDevice(const char* buffer, std::streamsize length);
+
+private:
+	CryptoTransform* _pTransform;
+	std::istream*	 _pIstr;
+	std::ostream*	 _pOstr;
+	bool			 _eof;
+
+	Poco::Buffer<unsigned char> _buffer;
+
+	CryptoStreamBuf(const CryptoStreamBuf&);
+	CryptoStreamBuf& operator = (const CryptoStreamBuf&);
+};
+
+
+class Crypto_API CryptoIOS: public virtual std::ios
+	/// The base class for CryptoInputStream and CryptoOutputStream.
+	///
+	/// This class is needed to ensure correct initialization order of the
+	/// stream buffer and base classes.
+{
+public:
+	CryptoIOS(std::istream& istr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+	CryptoIOS(std::ostream& ostr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+	~CryptoIOS();
+	CryptoStreamBuf* rdbuf();
+
+protected:
+	CryptoStreamBuf _buf;
+};
+
+
+class Crypto_API CryptoInputStream: public CryptoIOS, public std::istream
+	/// This stream transforms all data passing through it using the given
+	/// CryptoTransform.
+	///
+	/// Use a CryptoTransform object provided by Cipher::createEncrytor() or
+	/// Cipher::createDecryptor() to create an encrypting or decrypting stream,
+	/// respectively.
+{
+public:
+	CryptoInputStream(std::istream& istr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+		/// Create a new CryptoInputStream object. The CryptoInputStream takes the
+		/// ownership of the given CryptoTransform object.
+
+	CryptoInputStream(std::istream& istr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new encrypting CryptoInputStream object using the given cipher.
+
+	~CryptoInputStream();
+		/// Destroys the CryptoInputStream.
+};
+
+
+class Crypto_API CryptoOutputStream: public CryptoIOS, public std::ostream
+	/// This stream transforms all data passing through it using the given
+	/// CryptoTransform.
+	///
+	/// Use a CryptoTransform object provided by Cipher::createEncrytor() or
+	/// Cipher::createDecryptor() to create an encrypting or decrypting stream,
+	/// respectively.
+	///
+	/// After all data has been passed through the stream, close() must be called
+	/// to ensure completion of cryptographic transformation.
+{
+public:
+	CryptoOutputStream(std::ostream& ostr, CryptoTransform* pTransform, std::streamsize bufferSize = 8192);
+		/// Create a new CryptoOutputStream object. The CryptoOutputStream takes the
+		/// ownership of the given CryptoTransform object.
+
+	CryptoOutputStream(std::ostream& ostr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new decrypting CryptoOutputStream object using the given cipher.
+
+	~CryptoOutputStream();
+		/// Destroys the CryptoOutputStream.
+
+	void close();
+		/// Flushes all buffers and finishes the encryption.
+};
+
+
+class Crypto_API DecryptingInputStream: public CryptoIOS, public std::istream
+	/// This stream decrypts all data passing through it using the given
+	/// Cipher.
+{
+public:
+	DecryptingInputStream(std::istream& istr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new DecryptingInputStream object using the given cipher.
+
+	~DecryptingInputStream();
+		/// Destroys the DecryptingInputStream.
+};
+
+
+class Crypto_API DecryptingOutputStream: public CryptoIOS, public std::ostream
+	/// This stream decrypts all data passing through it using the given
+	/// Cipher.
+{
+public:
+	DecryptingOutputStream(std::ostream& ostr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new DecryptingOutputStream object using the given cipher.
+
+	~DecryptingOutputStream();
+		/// Destroys the DecryptingOutputStream.
+
+	void close();
+		/// Flushes all buffers and finishes the decryption.
+};
+
+
+class Crypto_API EncryptingInputStream: public CryptoIOS, public std::istream
+	/// This stream encrypts all data passing through it using the given
+	/// Cipher.
+{
+public:
+	EncryptingInputStream(std::istream& istr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new EncryptingInputStream object using the given cipher.
+
+	~EncryptingInputStream();
+		/// Destroys the EncryptingInputStream.
+};
+
+
+class Crypto_API EncryptingOutputStream: public CryptoIOS, public std::ostream
+	/// This stream encrypts all data passing through it using the given
+	/// Cipher.
+{
+public:
+	EncryptingOutputStream(std::ostream& ostr, Cipher& cipher, std::streamsize bufferSize = 8192);
+		/// Create a new EncryptingOutputStream object using the given cipher.
+
+	~EncryptingOutputStream();
+		/// Destroys the EncryptingOutputStream.
+
+	void close();
+		/// Flushes all buffers and finishes the encryption.
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CryptoStream_INCLUDED

+ 87 - 0
ThirdParty/include/Poco/Crypto/CryptoTransform.h

@@ -0,0 +1,87 @@
+//
+// CryptoTransform.h
+//
+// Library: Crypto
+// Package: Cipher
+// Module:  CryptoTransform
+//
+// Definition of the CryptoTransform class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_CryptoTransform_INCLUDED
+#define Crypto_CryptoTransform_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include <ios>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API CryptoTransform
+	/// This interface represents the basic operations for cryptographic
+	/// transformations to be used with a CryptoInputStream or a
+	/// CryptoOutputStream.
+	///
+	/// Implementations of this class are returned by the Cipher class to
+	/// perform encryption or decryption of data.
+{
+public:
+	CryptoTransform();
+		/// Creates a new CryptoTransform object.
+
+	virtual ~CryptoTransform();
+		/// Destroys the CryptoTransform.
+
+	virtual std::size_t blockSize() const = 0;
+		/// Returns the block size for this CryptoTransform.
+
+	virtual int setPadding(int padding);
+		/// Enables or disables padding. By default encryption operations are padded using standard block
+		/// padding and the padding is checked and removed when decrypting. If the padding parameter is zero then
+		/// no padding is performed, the total amount of data encrypted or decrypted must then be a multiple of
+		/// the block size or an error will occur.
+
+	virtual std::string getTag(std::size_t tagSize = 16) = 0;
+		/// Returns the GCM tag after encrypting using GCM mode.
+		///
+		/// Must be called after finalize().
+
+	virtual void setTag(const std::string& tag) = 0;
+		/// Sets the GCM tag for authenticated decryption using GCM mode.
+		///
+		/// Must be set before finalize() is called, otherwise
+		/// decryption will fail.
+
+	virtual std::streamsize transform(
+		const unsigned char* input,
+		std::streamsize		 inputLength,
+		unsigned char*		 output,
+		std::streamsize		 outputLength) = 0;
+		/// Transforms a chunk of data. The inputLength is arbitrary and does not
+		/// need to be a multiple of the block size. The output buffer has a maximum
+		/// capacity of the given outputLength that must be at least
+		///   inputLength + blockSize() - 1
+		/// Returns the number of bytes written to the output buffer.
+
+	virtual std::streamsize finalize(unsigned char* output, std::streamsize length) = 0;
+		/// Finalizes the transformation. The output buffer must contain enough
+		/// space for at least two blocks, ie.
+		///   length >= 2*blockSize()
+		/// must be true.  Returns the number of bytes written to the output
+		/// buffer.
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_CryptoTransform_INCLUDED

+ 80 - 0
ThirdParty/include/Poco/Crypto/DigestEngine.h

@@ -0,0 +1,80 @@
+//
+// DigestEngine.h
+//
+// Library: Crypto
+// Package: Digest
+// Module:  DigestEngine
+//
+// Definition of the DigestEngine class.
+//
+// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_DigestEngine_INCLUDED
+#define Crypto_DigestEngine_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/DigestEngine.h"
+#include <openssl/evp.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API DigestEngine: public Poco::DigestEngine
+	/// This class implements a Poco::DigestEngine for all
+	/// digest algorithms supported by OpenSSL.
+{
+public:
+	DigestEngine(const std::string& name);
+		/// Creates a DigestEngine using the digest with the given name
+		/// (e.g., "MD5", "SHA1", "SHA256", "SHA512", etc.).
+		/// See the OpenSSL documentation for a list of supported digest algorithms.
+		///
+		/// Throws a Poco::NotFoundException if no algorithm with the given name exists.
+		
+	~DigestEngine();
+		/// Destroys the DigestEngine.
+	
+	const std::string& algorithm() const;
+		/// Returns the name of the digest algorithm.
+	
+	int nid() const;
+		/// Returns the NID (OpenSSL object identifier) of the digest algorithm.
+
+	// DigestEngine
+	std::size_t digestLength() const;
+	void reset();
+	const Poco::DigestEngine::Digest& digest();
+
+protected:
+	void updateImpl(const void* data, std::size_t length);
+	
+private:
+	std::string _name;
+	EVP_MD_CTX* _pContext;
+	Poco::DigestEngine::Digest _digest;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// inlines
+//
+inline const std::string& DigestEngine::algorithm() const
+{
+	return _name;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_DigestEngine_INCLUDED

+ 101 - 0
ThirdParty/include/Poco/Crypto/ECDSADigestEngine.h

@@ -0,0 +1,101 @@
+//
+// ECDSADigestEngine.h
+//
+//
+// Library: Crypto
+// Package: ECDSA
+// Module:  ECDSADigestEngine
+//
+// Definition of the ECDSADigestEngine class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_ECDSADigestEngine_INCLUDED
+#define Crypto_ECDSADigestEngine_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/ECKey.h"
+#include "Poco/DigestEngine.h"
+#include "Poco/Crypto/DigestEngine.h"
+#include <istream>
+#include <ostream>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API ECDSADigestEngine: public Poco::DigestEngine
+	/// This class implements a Poco::DigestEngine that can be
+	/// used to compute a secure digital signature.
+	///
+	/// First another Poco::Crypto::DigestEngine is created and
+	/// used to compute a cryptographic hash of the data to be
+	/// signed. Then, the hash value is encrypted, using
+	/// the ECDSA private key.
+	///
+	/// To verify a signature, pass it to the verify() 
+	/// member function. It will decrypt the signature
+	/// using the ECDSA public key and compare the resulting
+	/// hash with the actual hash of the data.
+{
+public:
+
+	ECDSADigestEngine(const ECKey& key, const std::string &name);
+		/// Creates the ECDSADigestEngine with the given ECDSA key,
+		/// using the hash algorithm with the given name
+		/// (e.g., "SHA1", "SHA256", "SHA512", etc.).
+		/// See the OpenSSL documentation for a list of supported digest algorithms.
+		///
+		/// Throws a Poco::NotFoundException if no algorithm with the given name exists.
+
+	~ECDSADigestEngine();
+		/// Destroys the ECDSADigestEngine.
+
+	std::size_t digestLength() const;
+		/// Returns the length of the digest in bytes.
+
+	void reset();
+		/// Resets the engine so that a new
+		/// digest can be computed.
+		
+	const DigestEngine::Digest& digest();
+		/// Finishes the computation of the digest 
+		/// (the first time it's called) and
+		/// returns the message digest. 
+		///
+		/// Can be called multiple times.
+
+	const DigestEngine::Digest& signature();
+		/// Signs the digest using the ECDSADSA algorithm
+		/// and the private key (the first time it's
+		/// called) and returns the result.
+		///
+		/// Can be called multiple times.
+
+	bool verify(const DigestEngine::Digest& signature);
+		/// Verifies the data against the signature.
+		///
+		/// Returns true if the signature can be verified, false otherwise.
+
+protected:
+	void updateImpl(const void* data, std::size_t length);
+
+private:
+	ECKey _key;
+	Poco::Crypto::DigestEngine _engine;
+	Poco::DigestEngine::Digest _digest;
+	Poco::DigestEngine::Digest _signature;
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_ECDSADigestEngine_INCLUDED

+ 136 - 0
ThirdParty/include/Poco/Crypto/ECKey.h

@@ -0,0 +1,136 @@
+//
+// ECKey.h
+//
+//
+// Library: Crypto
+// Package: EC
+// Module:  ECKey
+//
+// Definition of the ECKey class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_ECKey_INCLUDED
+#define Crypto_ECKey_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/KeyPair.h"
+#include "Poco/Crypto/ECKeyImpl.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class X509Certificate;
+class PKCS12Container;
+
+
+class Crypto_API ECKey : public KeyPair
+	/// This class stores an EC key pair, consisting
+	/// of private and public key. Storage of the private
+	/// key is optional.
+	///
+	/// If a private key is available, the ECKey can be
+	/// used for decrypting data (encrypted with the public key)
+	/// or computing secure digital signatures.
+{
+public:
+	ECKey(const EVPPKey& key);
+		/// Constructs ECKeyImpl by extracting the EC key.
+
+	ECKey(const X509Certificate& cert);
+		/// Extracts the EC public key from the given certificate.
+
+	ECKey(const PKCS12Container& cert);
+		/// Extracts the EC private key from the given certificate.
+
+	ECKey(const std::string& eccGroup);
+		/// Creates the ECKey. Creates a new public/private keypair using the given parameters.
+		/// Can be used to sign data and verify signatures.
+
+	ECKey(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase = "");
+		/// Creates the ECKey, by reading public and private key from the given files and
+		/// using the given passphrase for the private key.
+		///
+		/// Cannot be used for signing or decryption unless a private key is available.
+		///
+		/// If a private key is specified, you don't need to specify a public key file.
+		/// OpenSSL will auto-create the public key from the private key.
+
+	ECKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "");
+		/// Creates the ECKey, by reading public and private key from the given streams and
+		/// using the given passphrase for the private key.
+		///
+		/// Cannot be used for signing or decryption unless a private key is available.
+		///
+		/// If a private key is specified, you don't need to specify a public key file.
+		/// OpenSSL will auto-create the public key from the private key.
+
+	~ECKey();
+		/// Destroys the ECKey.
+
+	ECKeyImpl::Ptr impl() const;
+		/// Returns the impl object.
+
+	static std::string getCurveName(int nid = -1);
+		/// Returns elliptical curve name corresponding to
+		/// the given nid; if nid is not found, returns
+		/// empty string.
+		///
+		/// If nid is -1, returns first curve name.
+		///
+		/// If no curves are found, returns empty string;
+
+	static int getCurveNID(std::string& name);
+		/// Returns the NID of the specified curve.
+		///
+		/// If name is empty, returns the first curve NID
+		/// and updates the name accordingly.
+
+	static bool hasCurve(const std::string& name);
+		/// Returns true if the named curve is found,
+		/// false otherwise.
+
+private:
+	ECKeyImpl::Ptr _pImpl;
+};
+
+
+//
+// inlines
+//
+inline ECKeyImpl::Ptr ECKey::impl() const
+{
+	return _pImpl;
+}
+
+
+inline std::string ECKey::getCurveName(int nid)
+{
+	return ECKeyImpl::getCurveName(nid);
+}
+
+
+inline int ECKey::getCurveNID(std::string& name)
+{
+	return ECKeyImpl::getCurveNID(name);
+}
+
+
+inline bool ECKey::hasCurve(const std::string& name)
+{
+	return ECKeyImpl::hasCurve(name);
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_ECKey_INCLUDED

+ 174 - 0
ThirdParty/include/Poco/Crypto/ECKeyImpl.h

@@ -0,0 +1,174 @@
+//
+// ECKeyImpl.h
+//
+//
+// Library: Crypto
+// Package: EC
+// Module:  ECKeyImpl
+//
+// Definition of the ECKeyImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_ECKeyImplImpl_INCLUDED
+#define Crypto_ECKeyImplImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/EVPPKey.h"
+#include "Poco/Crypto/KeyPairImpl.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <istream>
+#include <ostream>
+#include <vector>
+#include <openssl/objects.h>
+#include <openssl/ec.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class X509Certificate;
+class PKCS12Container;
+
+
+class ECKeyImpl: public KeyPairImpl
+	/// Elliptic Curve key clas implementation.
+{
+public:
+	typedef Poco::AutoPtr<ECKeyImpl> Ptr;
+	typedef std::vector<unsigned char> ByteVec;
+
+	ECKeyImpl(const EVPPKey& key);
+		/// Constructs ECKeyImpl by extracting the EC key.
+
+	ECKeyImpl(const X509Certificate& cert);
+		/// Constructs ECKeyImpl by extracting the EC public key from the given certificate.
+
+	ECKeyImpl(const PKCS12Container& cert);
+		/// Constructs ECKeyImpl by extracting the EC private key from the given certificate.
+
+	ECKeyImpl(int eccGroup);
+		/// Creates the ECKey of the specified group. Creates a new public/private keypair using the given parameters.
+		/// Can be used to sign data and verify signatures.
+
+	ECKeyImpl(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase);
+		/// Creates the ECKey, by reading public and private key from the given files and
+		/// using the given passphrase for the private key. Can only by used for signing if 
+		/// a private key is available. 
+
+	ECKeyImpl(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, const std::string& privateKeyPassphrase);
+		/// Creates the ECKey. Can only by used for signing if pPrivKey
+		/// is not null. If a private key file is specified, you don't need to
+		/// specify a public key file. OpenSSL will auto-create it from the private key.
+
+	~ECKeyImpl();
+		/// Destroys the ECKeyImpl.
+
+	EC_KEY* getECKey();
+		/// Returns the OpenSSL EC key.
+
+	const EC_KEY* getECKey() const;
+		/// Returns the OpenSSL EC key.
+
+	int size() const;
+		/// Returns the EC key length in bits.
+
+	int groupId() const;
+		/// Returns the EC key group integer Id.
+
+	std::string groupName() const;
+		/// Returns the EC key group name.
+
+	void save(const std::string& publicKeyFile,
+		const std::string& privateKeyFile = "",
+		const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and private keys to the given files. 
+		///
+		/// If an empty filename is specified, the corresponding key
+		/// is not exported.
+
+	void save(std::ostream* pPublicKeyStream,
+		std::ostream* pPrivateKeyStream = 0,
+		const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and private key to the given streams.
+		///
+		/// If a null pointer is passed for a stream, the corresponding
+		/// key is not exported.
+
+	static std::string getCurveName(int nid = -1);
+		/// Returns elliptical curve name corresponding to
+		/// the given nid; if nid is not found, returns
+		/// empty string.
+		///
+		/// If nid is -1, returns first curve name.
+		///
+		/// If no curves are found, returns empty string;
+
+	static int getCurveNID(std::string& name);
+		/// Returns the NID of the specified curve.
+		///
+		/// If name is empty, returns the first curve NID
+		/// and updates the name accordingly.
+
+	static bool hasCurve(const std::string& name);
+		/// Returns true if the named curve is found,
+		/// false otherwise.
+
+private:
+	void checkEC(const std::string& method, const std::string& func) const;
+	void freeEC();
+
+	EC_KEY* _pEC;
+};
+
+
+//
+// inlines
+//
+inline EC_KEY* ECKeyImpl::getECKey()
+{
+	return _pEC;
+}
+
+
+inline const EC_KEY* ECKeyImpl::getECKey() const
+{
+	return _pEC;
+}
+
+
+inline std::string ECKeyImpl::groupName() const
+{
+	return OBJ_nid2sn(groupId());
+}
+
+
+inline void ECKeyImpl::save(const std::string& publicKeyFile,
+	const std::string& privateKeyFile,
+	const std::string& privateKeyPassphrase) const
+{
+	EVPPKey(_pEC).save(publicKeyFile, privateKeyFile, privateKeyPassphrase);
+}
+
+
+inline void ECKeyImpl::save(std::ostream* pPublicKeyStream,
+	std::ostream* pPrivateKeyStream,
+	const std::string& privateKeyPassphrase) const
+{
+	EVPPKey(_pEC).save(pPublicKeyStream, pPrivateKeyStream, privateKeyPassphrase);
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_ECKeyImplImpl_INCLUDED

+ 354 - 0
ThirdParty/include/Poco/Crypto/EVPPKey.h

@@ -0,0 +1,354 @@
+//
+// EVPPKey.h
+//
+//
+// Library: Crypto
+// Package: CryptoCore
+// Module:  EVPPKey
+//
+// Definition of the EVPPKey class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_EVPPKeyImpl_INCLUDED
+#define Crypto_EVPPKeyImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/CryptoException.h"
+#include "Poco/StreamCopier.h"
+#include <openssl/ec.h>
+#include <openssl/rsa.h>
+#include <openssl/evp.h>
+#include <openssl/pem.h>
+#include <sstream>
+#include <typeinfo>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class ECKey;
+class RSAKey;
+
+
+class Crypto_API EVPPKey
+	/// Utility class for conversion of native keys to EVP.
+	/// Currently, only RSA and EC keys are supported.
+{
+public:
+	explicit EVPPKey(const std::string& ecCurveName);
+		/// Constructs EVPPKey from ECC curve name.
+		///
+		/// Only EC keys can be wrapped by an EVPPKey
+		/// created using this constructor.
+
+	explicit EVPPKey(const char* ecCurveName);
+		/// Constructs EVPPKey from ECC curve name.
+		///
+		/// Only EC keys can be wrapped by an EVPPKey
+		/// created using this constructor.
+
+	explicit EVPPKey(EVP_PKEY* pEVPPKey);
+		/// Constructs EVPPKey from EVP_PKEY pointer.
+		/// The content behind the supplied pointer is internally duplicated.
+
+	template<typename K>
+	explicit EVPPKey(K* pKey): _pEVPPKey(EVP_PKEY_new())
+		/// Constructs EVPPKey from a "native" OpenSSL (RSA or EC_KEY),
+		/// or a Poco wrapper (RSAKey, ECKey) key pointer.
+	{
+		if (!_pEVPPKey) throw OpenSSLException();
+		setKey(pKey);
+	}
+
+	EVPPKey(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase = "");
+		/// Creates the EVPPKey, by reading public and private key from the given files and
+		/// using the given passphrase for the private key. Can only by used for signing if
+		/// a private key is available.
+
+	EVPPKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, const std::string& privateKeyPassphrase = "");
+		/// Creates the EVPPKey. Can only by used for signing if pPrivKey
+		/// is not null. If a private key file is specified, you don't need to
+		/// specify a public key file. OpenSSL will auto-create it from the private key.
+
+	EVPPKey(const EVPPKey& other);
+		/// Copy constructor.
+
+	EVPPKey& operator=(const EVPPKey& other);
+		/// Assignment operator.
+
+#ifdef POCO_ENABLE_CPP11
+
+	EVPPKey(EVPPKey&& other);
+		/// Move constructor.
+
+	EVPPKey& operator=(EVPPKey&& other);
+		/// Assignment move operator.
+
+#endif // POCO_ENABLE_CPP11
+
+	~EVPPKey();
+		/// Destroys the EVPPKey.
+
+	bool operator == (const EVPPKey& other) const;
+		/// Comparison operator.
+		/// Returns true if public key components and parameters
+		/// of the other key are equal to this key.
+		///
+		/// Works as expected when one key contains only public key,
+		/// while the other one contains private (thus also public) key.
+
+	bool operator != (const EVPPKey& other) const;
+		/// Comparison operator.
+		/// Returns true if public key components and parameters
+		/// of the other key are different from this key.
+		///
+		/// Works as expected when one key contains only public key,
+		/// while the other one contains private (thus also public) key.
+
+	void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and/or private keys to the given files.
+		///
+		/// If an empty filename is specified, the corresponding key
+		/// is not exported.
+
+	void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and/or private key to the given streams.
+		///
+		/// If a null pointer is passed for a stream, the corresponding
+		/// key is not exported.
+
+	int type() const;
+		/// Retuns the EVPPKey type NID.
+
+	bool isSupported(int type) const;
+		/// Returns true if OpenSSL type is supported
+
+	operator const EVP_PKEY*() const;
+		/// Returns const pointer to the OpenSSL EVP_PKEY structure.
+
+	operator EVP_PKEY*();
+		/// Returns pointer to the OpenSSL EVP_PKEY structure.
+
+	static EVP_PKEY* duplicate(const EVP_PKEY* pFromKey, EVP_PKEY** pToKey);
+		/// Duplicates pFromKey into *pToKey and returns
+		// the pointer to duplicated EVP_PKEY.
+
+private:
+	EVPPKey();
+
+	static int type(const EVP_PKEY* pEVPPKey);
+	void newECKey(const char* group);
+	void duplicate(EVP_PKEY* pEVPPKey);
+
+	void setKey(ECKey* pKey);
+	void setKey(RSAKey* pKey);
+	void setKey(EC_KEY* pKey);
+	void setKey(RSA* pKey);
+	static int passCB(char* buf, int size, int, void* pass);
+
+	typedef EVP_PKEY* (*PEM_read_FILE_Key_fn)(FILE*, EVP_PKEY**, pem_password_cb*, void*);
+	typedef EVP_PKEY* (*PEM_read_BIO_Key_fn)(BIO*, EVP_PKEY**, pem_password_cb*, void*);
+	typedef void* (*EVP_PKEY_get_Key_fn)(EVP_PKEY*);
+
+	// The following load*() functions are used by both native and EVP_PKEY type key
+	// loading from BIO/FILE.
+	// When used for EVP key loading, getFunc is null (ie. native key is not extracted
+	// from the loaded EVP_PKEY).
+	template <typename K, typename F>
+	static bool loadKey(K** ppKey,
+		PEM_read_FILE_Key_fn readFunc,
+		F getFunc,
+		const std::string& keyFile,
+		const std::string& pass = "")
+	{
+		poco_assert_dbg (((typeid(K*) == typeid(RSA*) || typeid(K*) == typeid(EC_KEY*)) && getFunc) ||
+						((typeid(K*) == typeid(EVP_PKEY*)) && !getFunc));
+		poco_check_ptr (ppKey);
+		poco_assert_dbg (!*ppKey);
+
+		FILE* pFile = 0;
+		if (!keyFile.empty())
+		{
+			if (!getFunc) *ppKey = (K*)EVP_PKEY_new();
+			EVP_PKEY* pKey = getFunc ? EVP_PKEY_new() : (EVP_PKEY*)*ppKey;
+			if (pKey)
+			{
+				pFile = fopen(keyFile.c_str(), "r");
+				if (pFile)
+				{
+					pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB;
+					void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str();
+					if (readFunc(pFile, &pKey, pCB, pPassword))
+					{
+						fclose(pFile); pFile = 0;
+						if(getFunc)
+						{
+							*ppKey = (K*)getFunc(pKey);
+							EVP_PKEY_free(pKey);
+						}
+						else
+						{
+							poco_assert_dbg (typeid(K*) == typeid(EVP_PKEY*));
+							*ppKey = (K*)pKey;
+						}
+						if(!*ppKey) goto error;
+						return true;
+					}
+					goto error;
+				}
+				else
+				{
+					if (getFunc) EVP_PKEY_free(pKey);
+					throw IOException("ECKeyImpl, cannot open file", keyFile);
+				}
+			}
+			else goto error;
+		}
+		return false;
+
+	error:
+		if (pFile) fclose(pFile);
+		throw OpenSSLException("EVPKey::loadKey(string)");
+	}
+
+	template <typename K, typename F>
+	static bool loadKey(K** ppKey,
+		PEM_read_BIO_Key_fn readFunc,
+		F getFunc,
+		std::istream* pIstr,
+		const std::string& pass = "")
+	{
+		poco_assert_dbg (((typeid(K*) == typeid(RSA*) || typeid(K*) == typeid(EC_KEY*)) && getFunc) ||
+						((typeid(K*) == typeid(EVP_PKEY*)) && !getFunc));
+		poco_check_ptr(ppKey);
+		poco_assert_dbg(!*ppKey);
+
+		BIO* pBIO = 0;
+		if (pIstr)
+		{
+			std::ostringstream ostr;
+			Poco::StreamCopier::copyStream(*pIstr, ostr);
+			std::string key = ostr.str();
+			pBIO = BIO_new_mem_buf(const_cast<char*>(key.data()), static_cast<int>(key.size()));
+			if (pBIO)
+			{
+				if (!getFunc) *ppKey = (K*)EVP_PKEY_new();
+				EVP_PKEY* pKey = getFunc ? EVP_PKEY_new() : (EVP_PKEY*)*ppKey;
+				if (pKey)
+				{
+					pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB;
+					void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str();
+					if (readFunc(pBIO, &pKey, pCB, pPassword))
+					{
+						BIO_free(pBIO); pBIO = 0;
+						if (getFunc)
+						{
+							*ppKey = (K*)getFunc(pKey);
+							EVP_PKEY_free(pKey);
+						}
+						else
+						{
+							poco_assert_dbg (typeid(K*) == typeid(EVP_PKEY*));
+							*ppKey = (K*)pKey;
+						}
+						if (!*ppKey) goto error;
+						return true;
+					}
+					if (getFunc) EVP_PKEY_free(pKey);
+					goto error;
+				}
+				else goto error;
+			}
+			else goto error;
+		}
+		return false;
+
+	error:
+		if (pBIO) BIO_free(pBIO);
+		throw OpenSSLException("EVPKey::loadKey(stream)");
+	}
+
+	EVP_PKEY* _pEVPPKey;
+
+	friend class ECKeyImpl;
+	friend class RSAKeyImpl;
+};
+
+
+//
+// inlines
+//
+
+
+inline bool EVPPKey::operator == (const EVPPKey& other) const
+{
+	poco_check_ptr (other._pEVPPKey);
+	poco_check_ptr (_pEVPPKey);
+	return (1 == EVP_PKEY_cmp(_pEVPPKey, other._pEVPPKey));
+}
+
+
+inline bool EVPPKey::operator != (const EVPPKey& other) const
+{
+	return !(other == *this);
+}
+
+
+inline int EVPPKey::type(const EVP_PKEY* pEVPPKey)
+{
+	if (!pEVPPKey) return NID_undef;
+
+	return EVP_PKEY_type(EVP_PKEY_id(pEVPPKey));
+}
+
+
+inline int EVPPKey::type() const
+{
+	return type(_pEVPPKey);
+}
+
+
+inline bool EVPPKey::isSupported(int type) const
+{
+	return type == EVP_PKEY_EC || type == EVP_PKEY_RSA;
+}
+
+
+inline EVPPKey::operator const EVP_PKEY*() const
+{
+	return _pEVPPKey;
+}
+
+
+inline EVPPKey::operator EVP_PKEY*()
+{
+	return _pEVPPKey;
+}
+
+
+inline void EVPPKey::setKey(EC_KEY* pKey)
+{
+	if (!EVP_PKEY_set1_EC_KEY(_pEVPPKey, pKey))
+		throw OpenSSLException();
+}
+
+
+inline void EVPPKey::setKey(RSA* pKey)
+{
+	if (!EVP_PKEY_set1_RSA(_pEVPPKey, pKey))
+		throw OpenSSLException();
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_EVPPKeyImpl_INCLUDED

+ 133 - 0
ThirdParty/include/Poco/Crypto/KeyPair.h

@@ -0,0 +1,133 @@
+//
+// KeyPair.h
+//
+//
+// Library: Crypto
+// Package: CryptoCore
+// Module:  KeyPair
+//
+// Definition of the KeyPair class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_KeyPair_INCLUDED
+#define Crypto_KeyPair_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/KeyPairImpl.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class X509Certificate;
+
+
+class Crypto_API KeyPair
+	/// This is a parent class for classes storing a key pair, consisting
+	/// of private and public key. Storage of the private key is optional.
+	///
+	/// If a private key is available, the KeyPair can be
+	/// used for decrypting data (encrypted with the public key)
+	/// or computing secure digital signatures.
+{
+public:
+	enum Type
+	{
+		KT_RSA = KeyPairImpl::KT_RSA_IMPL,
+		KT_EC = KeyPairImpl::KT_EC_IMPL
+	};
+
+	explicit KeyPair(KeyPairImpl::Ptr pKeyPairImpl = 0);
+		/// Extracts the RSA public key from the given certificate.
+
+	virtual ~KeyPair();
+		/// Destroys the KeyPair.
+
+	virtual int size() const;
+		/// Returns the RSA modulus size.
+
+	virtual void save(const std::string& publicKeyPairFile,
+		const std::string& privateKeyPairFile = "",
+		const std::string& privateKeyPairPassphrase = "") const;
+		/// Exports the public and private keys to the given files. 
+		///
+		/// If an empty filename is specified, the corresponding key
+		/// is not exported.
+
+	virtual void save(std::ostream* pPublicKeyPairStream,
+		std::ostream* pPrivateKeyPairStream = 0,
+		const std::string& privateKeyPairPassphrase = "") const;
+		/// Exports the public and private key to the given streams.
+		///
+		/// If a null pointer is passed for a stream, the corresponding
+		/// key is not exported.
+
+	KeyPairImpl::Ptr impl() const;
+		/// Returns the impl object.
+
+	const std::string& name() const;
+		/// Returns key pair name
+
+	Type type() const;
+		/// Returns key pair type
+	
+private:
+	KeyPairImpl::Ptr _pImpl;
+};
+
+
+//
+// inlines
+//
+
+inline int KeyPair::size() const
+{
+	return _pImpl->size();
+}
+
+
+inline void KeyPair::save(const std::string& publicKeyFile,
+	const std::string& privateKeyFile,
+	const std::string& privateKeyPassphrase) const
+{
+	_pImpl->save(publicKeyFile, privateKeyFile, privateKeyPassphrase);
+}
+
+
+inline void KeyPair::save(std::ostream* pPublicKeyStream,
+	std::ostream* pPrivateKeyStream,
+	const std::string& privateKeyPassphrase) const
+{
+	_pImpl->save(pPublicKeyStream, pPrivateKeyStream, privateKeyPassphrase);
+}
+
+
+inline const std::string& KeyPair::name() const
+{
+	return _pImpl->name();
+}
+
+inline KeyPairImpl::Ptr KeyPair::impl() const
+{
+	return _pImpl;
+}
+
+
+inline KeyPair::Type KeyPair::type() const
+{
+	return (KeyPair::Type)impl()->type();
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_KeyPair_INCLUDED

+ 107 - 0
ThirdParty/include/Poco/Crypto/KeyPairImpl.h

@@ -0,0 +1,107 @@
+//
+// KeyPairImpl.h
+//
+//
+// Library: Crypto
+// Package: CryptoCore
+// Module:  KeyPairImpl
+//
+// Definition of the KeyPairImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_KeyPairImplImpl_INCLUDED
+#define Crypto_KeyPairImplImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <string>
+#include <vector>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class KeyPairImpl: public Poco::RefCountedObject
+	/// Class KeyPairImpl
+{
+public:
+	enum Type
+	{
+		KT_RSA_IMPL = 0,
+		KT_EC_IMPL
+	};
+
+	typedef Poco::AutoPtr<KeyPairImpl> Ptr;
+	typedef std::vector<unsigned char> ByteVec;
+
+	KeyPairImpl(const std::string& name, Type type);
+		/// Create KeyPairImpl with specified type and name.
+
+	virtual ~KeyPairImpl();
+		/// Destroys the KeyPairImpl.
+
+	virtual int size() const = 0;
+		/// Returns the key size.
+
+	virtual void save(const std::string& publicKeyFile,
+		const std::string& privateKeyFile = "",
+		const std::string& privateKeyPassphrase = "") const = 0;
+		/// Exports the public and private keys to the given files. 
+		///
+		/// If an empty filename is specified, the corresponding key
+		/// is not exported.
+
+	virtual void save(std::ostream* pPublicKeyStream,
+		std::ostream* pPrivateKeyStream = 0,
+		const std::string& privateKeyPassphrase = "") const = 0;
+		/// Exports the public and private key to the given streams.
+		///
+		/// If a null pointer is passed for a stream, the corresponding
+		/// key is not exported.
+
+	const std::string& name() const;
+		/// Returns key pair name
+
+	Type type() const;
+		/// Returns key pair type
+
+private:
+	KeyPairImpl();
+
+	std::string _name;
+	Type        _type;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// inlines
+//
+
+
+inline const std::string& KeyPairImpl::name() const
+{
+	return _name;
+}
+
+
+inline KeyPairImpl::Type KeyPairImpl::type() const
+{
+	return _type;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_KeyPairImplImpl_INCLUDED

+ 115 - 0
ThirdParty/include/Poco/Crypto/OpenSSLInitializer.h

@@ -0,0 +1,115 @@
+//
+// OpenSSLInitializer.h
+//
+// Library: Crypto
+// Package: CryptoCore
+// Module:  OpenSSLInitializer
+//
+// Definition of the OpenSSLInitializer class.
+//
+// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_OpenSSLInitializer_INCLUDED
+#define Crypto_OpenSSLInitializer_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Mutex.h"
+#include "Poco/AtomicCounter.h"
+#include <openssl/crypto.h>
+
+#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_NUMBER < 0x010001000L
+#include <openssl/fips.h>
+#endif
+
+
+extern "C"
+{
+	struct CRYPTO_dynlock_value
+	{
+		Poco::FastMutex _mutex;
+	};
+}
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API OpenSSLInitializer
+	/// Initalizes the OpenSSL library.
+	///
+	/// The class ensures the earliest initialization and the
+	/// latest shutdown of the OpenSSL library.
+{
+public:
+	OpenSSLInitializer();
+		/// Automatically initialize OpenSSL on startup.
+		
+	~OpenSSLInitializer();
+		/// Automatically shut down OpenSSL on exit.
+	
+	static void initialize();
+		/// Initializes the OpenSSL machinery.
+
+	static void uninitialize();
+		/// Shuts down the OpenSSL machinery.
+
+	static bool isFIPSEnabled();
+		// Returns true if FIPS mode is enabled, false otherwise.
+
+	static void enableFIPSMode(bool enabled);
+		// Enable or disable FIPS mode. If FIPS is not available, this method doesn't do anything.
+
+protected:
+	enum
+	{
+		SEEDSIZE = 256
+	};
+	
+	// OpenSSL multithreading support
+	static void lock(int mode, int n, const char* file, int line);
+	static unsigned long id();
+	static struct CRYPTO_dynlock_value* dynlockCreate(const char* file, int line);
+	static void dynlock(int mode, struct CRYPTO_dynlock_value* lock, const char* file, int line);
+	static void dynlockDestroy(struct CRYPTO_dynlock_value* lock, const char* file, int line);
+
+private:
+	static Poco::FastMutex* _mutexes;
+	static Poco::AtomicCounter _rc;
+};
+
+
+//
+// inlines
+//
+inline bool OpenSSLInitializer::isFIPSEnabled()
+{
+#ifdef OPENSSL_FIPS
+	return FIPS_mode() ? true : false;
+#else
+	return false;
+#endif
+}
+
+#ifdef OPENSSL_FIPS
+inline void OpenSSLInitializer::enableFIPSMode(bool enabled)
+{
+	FIPS_mode_set(enabled);
+}
+#else
+inline void OpenSSLInitializer::enableFIPSMode(bool /*enabled*/)
+{
+}
+#endif
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_OpenSSLInitializer_INCLUDED

+ 159 - 0
ThirdParty/include/Poco/Crypto/PKCS12Container.h

@@ -0,0 +1,159 @@
+//
+// PKCS12Container.h
+//
+// Library: Crypto
+// Package: Certificate
+// Module:  PKCS12Container
+//
+// Definition of the PKCS12Container class.
+//
+// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_PKCS12Container_INCLUDED
+#define Crypto_PKCS12Container_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/Crypto/X509Certificate.h"
+#include "Poco/Crypto/EVPPKey.h"
+#include "Poco/Path.h"
+#include <memory>
+#include <istream>
+#include <openssl/pkcs12.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API PKCS12Container
+	/// This class implements PKCS#12 container functionality.
+{
+public:
+	typedef X509Certificate::List CAList;
+	typedef std::vector<std::string> CANameList;
+
+	explicit PKCS12Container(std::istream& istr, const std::string& password = "");
+		/// Creates the PKCS12Container object from a stream.
+
+	explicit PKCS12Container(const std::string& path, const std::string& password = "");
+		/// Creates the PKCS12Container object from a file.
+
+	PKCS12Container(const PKCS12Container& cont);
+		/// Copy constructor.
+
+	PKCS12Container& operator = (const PKCS12Container& cont);
+		/// Assignment operator.
+
+#ifdef POCO_ENABLE_CPP11
+
+	PKCS12Container(PKCS12Container&& cont);
+		/// Move constructor.
+
+	PKCS12Container& operator = (PKCS12Container&& cont);
+		/// Move assignment operator.
+
+#endif // POCO_ENABLE_CPP11
+
+	~PKCS12Container();
+		/// Destroys the PKCS12Container.
+
+	bool hasKey() const;
+		/// Returns true if container contains the key.
+
+	EVPPKey getKey() const;
+		/// Return key as openssl EVP_PKEY wrapper object.
+
+	bool hasX509Certificate() const;
+		/// Returns true if container has X509 certificate.
+
+	const X509Certificate& getX509Certificate() const;
+		/// Returns the X509 certificate.
+		/// Throws NotFoundException if there is no certificate.
+
+	const CAList& getCACerts() const;
+		/// Returns the list of CA certificates in this container.
+
+	const std::string& getFriendlyName() const;
+		/// Returns the friendly name of the certificate bag.
+
+	const CANameList& getFriendlyNamesCA() const;
+		/// Returns a list of CA certificates friendly names.
+
+private:
+	void load(PKCS12* pPKCS12, const std::string& password = "");
+	std::string extractFriendlyName(X509* pCert);
+
+#ifdef POCO_ENABLE_CPP11
+	typedef std::unique_ptr<X509Certificate> CertPtr;
+#else
+	typedef std::auto_ptr<X509Certificate> CertPtr;
+#endif // #ifdef POCO_ENABLE_CPP11
+
+	OpenSSLInitializer _openSSLInitializer;
+	EVP_PKEY*          _pKey;
+	CertPtr            _pX509Cert;
+	CAList             _caCertList;
+	CANameList         _caCertNames;
+	std::string        _pkcsFriendlyName;
+};
+
+
+//
+// inlines
+//
+
+inline bool PKCS12Container::hasX509Certificate() const
+{
+	return _pX509Cert.get() != 0;
+}
+
+
+inline const X509Certificate& PKCS12Container::getX509Certificate() const
+{
+	if (!hasX509Certificate())
+		throw NotFoundException("PKCS12Container X509 certificate");
+	return *_pX509Cert;
+}
+
+
+inline const std::string& PKCS12Container::getFriendlyName() const
+{
+	return _pkcsFriendlyName;
+}
+
+
+inline const PKCS12Container::CAList& PKCS12Container::getCACerts() const
+{
+	return _caCertList;
+}
+
+
+inline const PKCS12Container::CANameList& PKCS12Container::getFriendlyNamesCA() const
+{
+	return _caCertNames;
+}
+
+
+inline bool PKCS12Container::hasKey() const
+{
+	return _pKey != 0;
+}
+
+
+inline EVPPKey PKCS12Container::getKey() const
+{
+	return EVPPKey(_pKey);
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_PKCS12Container_INCLUDED

+ 77 - 0
ThirdParty/include/Poco/Crypto/RSACipherImpl.h

@@ -0,0 +1,77 @@
+//
+// RSACipherImpl.h
+//
+// Library: Crypto
+// Package: RSA
+// Module:  RSACipherImpl
+//
+// Definition of the RSACipherImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_RSACipherImpl_INCLUDED
+#define Crypto_RSACipherImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/Cipher.h"
+#include "Poco/Crypto/RSAKey.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include <openssl/evp.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class RSACipherImpl: public Cipher
+	/// An implementation of the Cipher class for 
+	/// asymmetric (public-private key) encryption
+	/// based on the the RSA algorithm in OpenSSL's 
+	/// crypto library.
+	///
+	/// Encryption is using the public key, decryption
+	/// requires the private key.
+{
+public:
+	RSACipherImpl(const RSAKey& key, RSAPaddingMode paddingMode);
+		/// Creates a new RSACipherImpl object for the given RSAKey
+		/// and using the given padding mode.
+
+	virtual ~RSACipherImpl();
+		/// Destroys the RSACipherImpl.
+
+	const std::string& name() const;
+		/// Returns the name of the Cipher.
+	
+	CryptoTransform* createEncryptor();
+		/// Creates an encryptor object.
+
+	CryptoTransform* createDecryptor();
+		/// Creates a decryptor object.
+
+private:
+	RSAKey _key;
+	RSAPaddingMode _paddingMode;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// Inlines
+//
+inline const std::string& RSACipherImpl::name() const
+{
+	return _key.name();
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_RSACipherImpl_INCLUDED

+ 111 - 0
ThirdParty/include/Poco/Crypto/RSADigestEngine.h

@@ -0,0 +1,111 @@
+//
+// RSADigestEngine.h
+//
+// Library: Crypto
+// Package: RSA
+// Module:  RSADigestEngine
+//
+// Definition of the RSADigestEngine class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_RSADigestEngine_INCLUDED
+#define Crypto_RSADigestEngine_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/RSAKey.h"
+#include "Poco/DigestEngine.h"
+#include "Poco/Crypto/DigestEngine.h"
+#include <istream>
+#include <ostream>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API RSADigestEngine: public Poco::DigestEngine
+	/// This class implements a Poco::DigestEngine that can be
+	/// used to compute a secure digital signature.
+	///
+	/// First another Poco::Crypto::DigestEngine is created and
+	/// used to compute a cryptographic hash of the data to be
+	/// signed. Then, the hash value is encrypted, using
+	/// the RSA private key.
+	///
+	/// To verify a signature, pass it to the verify() 
+	/// member function. It will decrypt the signature
+	/// using the RSA public key and compare the resulting
+	/// hash with the actual hash of the data.
+{
+public:
+	enum DigestType
+	{
+		DIGEST_MD5,
+		DIGEST_SHA1
+	};
+	
+	//@ deprecated
+	RSADigestEngine(const RSAKey& key, DigestType digestType = DIGEST_SHA1);
+		/// Creates the RSADigestEngine with the given RSA key,
+		/// using the MD5 or SHA-1 hash algorithm.
+		/// Kept for backward compatibility
+
+	RSADigestEngine(const RSAKey& key, const std::string &name);
+		/// Creates the RSADigestEngine with the given RSA key,
+		/// using the hash algorithm with the given name
+		/// (e.g., "MD5", "SHA1", "SHA256", "SHA512", etc.).
+		/// See the OpenSSL documentation for a list of supported digest algorithms.
+		///
+		/// Throws a Poco::NotFoundException if no algorithm with the given name exists.
+
+	~RSADigestEngine();
+		/// Destroys the RSADigestEngine.
+
+	std::size_t digestLength() const;
+		/// Returns the length of the digest in bytes.
+
+	void reset();
+		/// Resets the engine so that a new
+		/// digest can be computed.
+		
+	const DigestEngine::Digest& digest();
+		/// Finishes the computation of the digest 
+		/// (the first time it's called) and
+		/// returns the message digest. 
+		///
+		/// Can be called multiple times.
+
+	const DigestEngine::Digest& signature();
+		/// Signs the digest using the RSA algorithm
+		/// and the private key (the first time it's
+		/// called) and returns the result.
+		///
+		/// Can be called multiple times.
+
+	bool verify(const DigestEngine::Digest& signature);
+		/// Verifies the data against the signature.
+		///
+		/// Returns true if the signature can be verified, false otherwise.
+
+protected:
+	void updateImpl(const void* data, std::size_t length);
+
+private:
+	RSAKey _key;
+	Poco::Crypto::DigestEngine _engine;
+	Poco::DigestEngine::Digest _digest;
+	Poco::DigestEngine::Digest _signature;
+};
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_RSADigestEngine_INCLUDED

+ 125 - 0
ThirdParty/include/Poco/Crypto/RSAKey.h

@@ -0,0 +1,125 @@
+//
+// RSAKey.h
+//
+// Library: Crypto
+// Package: RSA
+// Module:  RSAKey
+//
+// Definition of the RSAKey class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_RSAKey_INCLUDED
+#define Crypto_RSAKey_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/KeyPair.h"
+#include "Poco/Crypto/RSAKeyImpl.h"
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class X509Certificate;
+class PKCS12Container;
+
+
+class Crypto_API RSAKey : public KeyPair
+	/// This class stores an RSA key pair, consisting
+	/// of private and public key. Storage of the private
+	/// key is optional.
+	///
+	/// If a private key is available, the RSAKey can be
+	/// used for decrypting data (encrypted with the public key)
+	/// or computing secure digital signatures.
+{
+public:
+	enum KeyLength
+	{
+		KL_512  = 512,
+		KL_1024 = 1024,
+		KL_2048 = 2048,
+		KL_4096 = 4096
+	};
+
+	enum Exponent
+	{
+		EXP_SMALL = 0,
+		EXP_LARGE
+	};
+
+	RSAKey(const EVPPKey& key);
+		/// Constructs ECKeyImpl by extracting the EC key.
+
+	RSAKey(const X509Certificate& cert);
+		/// Extracts the RSA public key from the given certificate.
+
+	RSAKey(const PKCS12Container& cert);
+		/// Extracts the RSA private key from the given certificate.
+
+	RSAKey(KeyLength keyLength, Exponent exp);
+		/// Creates the RSAKey. Creates a new public/private keypair using the given parameters.
+		/// Can be used to sign data and verify signatures.
+
+	RSAKey(const std::string& publicKeyFile,
+		const std::string& privateKeyFile = "",
+		const std::string& privateKeyPassphrase = "");
+		/// Creates the RSAKey, by reading public and private key from the given files and
+		/// using the given passphrase for the private key.
+		///
+		/// Cannot be used for signing or decryption unless a private key is available.
+		///
+		/// If a private key is specified, you don't need to specify a public key file.
+		/// OpenSSL will auto-create the public key from the private key.
+
+	RSAKey(std::istream* pPublicKeyStream,
+		std::istream* pPrivateKeyStream = 0,
+		const std::string& privateKeyPassphrase = "");
+		/// Creates the RSAKey, by reading public and private key from the given streams and
+		/// using the given passphrase for the private key.
+		///
+		/// Cannot be used for signing or decryption unless a private key is available.
+		///
+		/// If a private key is specified, you don't need to specify a public key file.
+		/// OpenSSL will auto-create the public key from the private key.
+
+	~RSAKey();
+		/// Destroys the RSAKey.
+
+	RSAKeyImpl::ByteVec modulus() const;
+		/// Returns the RSA modulus.
+
+	RSAKeyImpl::ByteVec encryptionExponent() const;
+		/// Returns the RSA encryption exponent.
+
+	RSAKeyImpl::ByteVec decryptionExponent() const;
+		/// Returns the RSA decryption exponent.
+
+	RSAKeyImpl::Ptr impl() const;
+		/// Returns the impl object.
+	
+private:
+	RSAKeyImpl::Ptr _pImpl;
+};
+
+
+//
+// inlines
+//
+inline RSAKeyImpl::Ptr RSAKey::impl() const
+{
+	return _pImpl;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_RSAKey_INCLUDED

+ 141 - 0
ThirdParty/include/Poco/Crypto/RSAKeyImpl.h

@@ -0,0 +1,141 @@
+//
+// RSAKeyImpl.h
+//
+// Library: Crypto
+// Package: RSA
+// Module:  RSAKeyImpl
+//
+// Definition of the RSAKeyImpl class.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_RSAKeyImplImpl_INCLUDED
+#define Crypto_RSAKeyImplImpl_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/EVPPKey.h"
+#include "Poco/Crypto/KeyPairImpl.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <istream>
+#include <ostream>
+#include <vector>
+
+
+struct bignum_st;
+struct rsa_st;
+typedef struct bignum_st BIGNUM;
+typedef struct rsa_st RSA;
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class X509Certificate;
+class PKCS12Container;
+
+
+class RSAKeyImpl: public KeyPairImpl
+	/// class RSAKeyImpl
+{
+public:
+	typedef Poco::AutoPtr<RSAKeyImpl> Ptr;
+	typedef std::vector<unsigned char> ByteVec;
+
+	RSAKeyImpl(const EVPPKey& key);
+		/// Constructs ECKeyImpl by extracting the EC key.
+
+	RSAKeyImpl(const X509Certificate& cert);
+		/// Extracts the RSA public key from the given certificate.
+
+	RSAKeyImpl(const PKCS12Container& cert);
+		/// Extracts the EC private key from the given certificate.
+
+	RSAKeyImpl(int keyLength, unsigned long exponent);
+		/// Creates the RSAKey. Creates a new public/private keypair using the given parameters.
+		/// Can be used to sign data and verify signatures.
+
+	RSAKeyImpl(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase);
+		/// Creates the RSAKey, by reading public and private key from the given files and
+		/// using the given passphrase for the private key. Can only by used for signing if 
+		/// a private key is available. 
+
+	RSAKeyImpl(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, const std::string& privateKeyPassphrase);
+		/// Creates the RSAKey. Can only by used for signing if pPrivKey
+		/// is not null. If a private key file is specified, you don't need to
+		/// specify a public key file. OpenSSL will auto-create it from the private key.
+
+	~RSAKeyImpl();
+		/// Destroys the RSAKeyImpl.
+
+	RSA* getRSA();
+		/// Returns the OpenSSL RSA object.
+
+	const RSA* getRSA() const;
+		/// Returns the OpenSSL RSA object.
+
+	int size() const;
+		/// Returns the RSA modulus size.
+
+	ByteVec modulus() const;
+		/// Returns the RSA modulus.
+
+	ByteVec encryptionExponent() const;
+		/// Returns the RSA encryption exponent.
+
+	ByteVec decryptionExponent() const;
+		/// Returns the RSA decryption exponent.
+
+	void save(const std::string& publicKeyFile,
+		const std::string& privateKeyFile = "",
+		const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and private keys to the given files. 
+		///
+		/// If an empty filename is specified, the corresponding key
+		/// is not exported.
+
+	void save(std::ostream* pPublicKeyStream,
+		std::ostream* pPrivateKeyStream = 0,
+		const std::string& privateKeyPassphrase = "") const;
+		/// Exports the public and private key to the given streams.
+		///
+		/// If a null pointer is passed for a stream, the corresponding
+		/// key is not exported.
+
+private:
+	RSAKeyImpl();
+
+	void freeRSA();
+	static ByteVec convertToByteVec(const BIGNUM* bn);
+
+	RSA* _pRSA;
+};
+
+
+//
+// inlines
+//
+inline RSA* RSAKeyImpl::getRSA()
+{
+	return _pRSA;
+}
+
+
+inline const RSA* RSAKeyImpl::getRSA() const
+{
+	return _pRSA;
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_RSAKeyImplImpl_INCLUDED

+ 245 - 0
ThirdParty/include/Poco/Crypto/X509Certificate.h

@@ -0,0 +1,245 @@
+//
+// X509Certificate.h
+//
+// Library: Crypto
+// Package: Certificate
+// Module:  X509Certificate
+//
+// Definition of the X509Certificate class.
+//
+// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Crypto_X509Certificate_INCLUDED
+#define Crypto_X509Certificate_INCLUDED
+
+
+#include "Poco/Crypto/Crypto.h"
+#include "Poco/Crypto/OpenSSLInitializer.h"
+#include "Poco/DateTime.h"
+#include "Poco/SharedPtr.h"
+#include <vector>
+#include <set>
+#include <istream>
+#include <openssl/ssl.h>
+
+
+namespace Poco {
+namespace Crypto {
+
+
+class Crypto_API X509Certificate
+	/// This class represents a X509 Certificate.
+{
+public:
+	typedef std::vector<X509Certificate> List;
+
+	enum NID
+		/// Name identifier for extracting information from
+		/// a certificate subject's or issuer's distinguished name.
+	{
+		NID_COMMON_NAME = 13,
+		NID_COUNTRY = 14,
+		NID_LOCALITY_NAME = 15,
+		NID_STATE_OR_PROVINCE = 16,
+		NID_ORGANIZATION_NAME = 17,
+		NID_ORGANIZATION_UNIT_NAME = 18,
+		NID_PKCS9_EMAIL_ADDRESS = 48,
+		NID_SERIAL_NUMBER = 105
+	};
+
+	explicit X509Certificate(std::istream& istr);
+		/// Creates the X509Certificate object by reading
+		/// a certificate in PEM format from a stream.
+
+	explicit X509Certificate(const std::string& path);
+		/// Creates the X509Certificate object by reading
+		/// a certificate in PEM format from a file.
+
+	explicit X509Certificate(X509* pCert);
+		/// Creates the X509Certificate from an existing
+		/// OpenSSL certificate. Ownership is taken of
+		/// the certificate.
+
+	X509Certificate(X509* pCert, bool shared);
+		/// Creates the X509Certificate from an existing
+		/// OpenSSL certificate. Ownership is taken of
+		/// the certificate. If shared is true, the
+		/// certificate's reference count is incremented.
+
+	X509Certificate(const X509Certificate& cert);
+		/// Creates the certificate by copying another one.
+
+	X509Certificate& operator = (const X509Certificate& cert);
+		/// Assigns a certificate.
+
+	void swap(X509Certificate& cert);
+		/// Exchanges the certificate with another one.
+
+	~X509Certificate();
+		/// Destroys the X509Certificate.
+
+	long version() const;
+		/// Returns the version of the certificate.
+
+	const std::string& serialNumber() const;
+		/// Returns the certificate serial number as a
+		/// string in decimal encoding.
+
+	const std::string& issuerName() const;
+		/// Returns the certificate issuer's distinguished name.
+
+	std::string issuerName(NID nid) const;
+		/// Extracts the information specified by the given
+		/// NID (name identifier) from the certificate issuer's
+		/// distinguished name.
+
+	const std::string& subjectName() const;
+		/// Returns the certificate subject's distinguished name.
+
+	std::string subjectName(NID nid) const;
+		/// Extracts the information specified by the given
+		/// NID (name identifier) from the certificate subject's
+		/// distinguished name.
+
+	std::string commonName() const;
+		/// Returns the common name stored in the certificate
+		/// subject's distinguished name.
+
+	void extractNames(std::string& commonName, std::set<std::string>& domainNames) const;
+		/// Extracts the common name and the alias domain names from the
+		/// certificate.
+
+	Poco::DateTime validFrom() const;
+		/// Returns the date and time the certificate is valid from.
+
+	Poco::DateTime expiresOn() const;
+		/// Returns the date and time the certificate expires.
+
+	void save(std::ostream& stream) const;
+		/// Writes the certificate to the given stream.
+		/// The certificate is written in PEM format.
+
+	void save(const std::string& path) const;
+		/// Writes the certificate to the file given by path.
+		/// The certificate is written in PEM format.
+
+	bool issuedBy(const X509Certificate& issuerCertificate) const;
+		/// Checks whether the certificate has been issued by
+		/// the issuer given by issuerCertificate. This can be
+		/// used to validate a certificate chain.
+		///
+		/// Verifies if the certificate has been signed with the
+		/// issuer's private key, using the public key from the issuer
+		/// certificate.
+		///
+		/// Returns true if verification against the issuer certificate
+		/// was successful, false otherwise.
+
+	bool equals(const X509Certificate& otherCertificate) const;
+		/// Checks whether the certificate is equal to
+		/// the other certificate, by comparing the hashes
+		/// of both certificates.
+		///
+		/// Returns true if both certificates are identical,
+		/// otherwise false.
+
+	const X509* certificate() const;
+		/// Returns the underlying OpenSSL certificate.
+
+	X509* dup() const;
+		/// Duplicates and returns the underlying OpenSSL certificate. Note that
+		/// the caller assumes responsibility for the lifecycle of the created
+		/// certificate.
+
+	std::string signatureAlgorithm() const;
+		/// Returns the certificate signature algorithm long name.
+
+	void print(std::ostream& out) const;
+		/// Prints the certificate information to ostream.
+
+	static List readPEM(const std::string& pemFileName);
+		/// Reads and returns a list of certificates from
+		/// the specified PEM file.
+
+	static void writePEM(const std::string& pemFileName, const List& list);
+		/// Writes the list of certificates to the specified PEM file.
+
+protected:
+	void load(std::istream& stream);
+		/// Loads the certificate from the given stream. The
+		/// certificate must be in PEM format.
+
+	void load(const std::string& path);
+		/// Loads the certificate from the given file. The
+		/// certificate must be in PEM format.
+
+	void init();
+		/// Extracts issuer and subject name from the certificate.
+
+private:
+	enum
+	{
+		NAME_BUFFER_SIZE = 256
+	};
+
+	std::string _issuerName;
+	std::string _subjectName;
+	std::string _serialNumber;
+	X509*       _pCert;
+	OpenSSLInitializer _openSSLInitializer;
+};
+
+
+//
+// inlines
+//
+
+
+inline long X509Certificate::version() const
+{
+	// This is defined by standards (X.509 et al) to be
+	// one less than the certificate version.
+	// So, eg. a version 3 certificate will return 2.
+	return X509_get_version(_pCert) + 1;
+}
+
+
+inline const std::string& X509Certificate::serialNumber() const
+{
+	return _serialNumber;
+}
+
+
+inline const std::string& X509Certificate::issuerName() const
+{
+	return _issuerName;
+}
+
+
+inline const std::string& X509Certificate::subjectName() const
+{
+	return _subjectName;
+}
+
+
+inline const X509* X509Certificate::certificate() const
+{
+	return _pCert;
+}
+
+
+inline X509* X509Certificate::dup() const
+{
+	return X509_dup(_pCert);
+}
+
+
+} } // namespace Poco::Crypto
+
+
+#endif // Crypto_X509Certificate_INCLUDED

+ 373 - 0
ThirdParty/include/Poco/Data/AbstractBinder.h

@@ -0,0 +1,373 @@
+//
+// AbstractBinder.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractBinder
+//
+// Definition of the AbstractBinder class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractBinder_INCLUDED
+#define Data_AbstractBinder_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Date.h"
+#include "Poco/Data/Time.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/DateTime.h"
+#include "Poco/Nullable.h"
+#include "Poco/Any.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/UTFString.h"
+#include <vector>
+#include <deque>
+#include <list>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+typedef NullType NullData;
+
+
+namespace Keywords {
+
+
+static const NullData null = NULL_GENERIC;
+
+
+} // namespace Keywords
+
+
+class Data_API AbstractBinder
+	/// Interface for Binding data types to placeholders.
+{
+public:
+	typedef SharedPtr<AbstractBinder> Ptr;
+
+	enum Direction
+		/// Binding direction for a parameter.
+	{
+		PD_IN,
+		PD_OUT,
+		PD_IN_OUT
+	};
+
+	AbstractBinder();
+		/// Creates the AbstractBinder.
+
+	virtual ~AbstractBinder();
+		/// Destroys the AbstractBinder.
+
+	virtual void bind(std::size_t pos, const Poco::Int8& val, Direction dir = PD_IN) = 0;
+		/// Binds an Int8.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir = PD_IN);
+		/// Binds an Int8 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::Int8>& val, Direction dir = PD_IN);
+		/// Binds an Int8 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir = PD_IN);
+		/// Binds an Int8 list.
+
+	virtual void bind(std::size_t pos, const Poco::UInt8& val, Direction dir = PD_IN) = 0;
+		/// Binds an UInt8.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir = PD_IN);
+		/// Binds an UInt8 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::UInt8>& val, Direction dir = PD_IN);
+		/// Binds an UInt8 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir = PD_IN);
+		/// Binds an UInt8 list.
+
+	virtual void bind(std::size_t pos, const Poco::Int16& val, Direction dir = PD_IN) = 0;
+		/// Binds an Int16.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir = PD_IN);
+		/// Binds an Int16 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::Int16>& val, Direction dir = PD_IN);
+		/// Binds an Int16 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir = PD_IN);
+		/// Binds an Int16 list.
+
+	virtual void bind(std::size_t pos, const Poco::UInt16& val, Direction dir = PD_IN) = 0;
+		/// Binds an UInt16.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir = PD_IN);
+		/// Binds an UInt16 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::UInt16>& val, Direction dir = PD_IN);
+		/// Binds an UInt16 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir = PD_IN);
+		/// Binds an UInt16 list.
+
+	virtual void bind(std::size_t pos, const Poco::Int32& val, Direction dir = PD_IN) = 0;
+		/// Binds an Int32.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir = PD_IN);
+		/// Binds an Int32 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction dir = PD_IN);
+		/// Binds an Int32 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir = PD_IN);
+		/// Binds an Int32 list.
+
+	virtual void bind(std::size_t pos, const Poco::UInt32& val, Direction dir = PD_IN) = 0;
+		/// Binds an UInt32.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir = PD_IN);
+		/// Binds an UInt32 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Direction dir = PD_IN);
+		/// Binds an UInt32 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir = PD_IN);
+		/// Binds an UInt32 list.
+		
+	virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir = PD_IN) = 0;
+		/// Binds an Int64.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir = PD_IN);
+		/// Binds an Int64 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction dir = PD_IN);
+		/// Binds an Int64 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir = PD_IN);
+		/// Binds an Int64 list.
+
+	virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir = PD_IN) = 0;
+		/// Binds an UInt64.
+
+	virtual void bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir = PD_IN);
+		/// Binds an UInt64 vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Direction dir = PD_IN);
+		/// Binds an UInt64 deque.
+
+	virtual void bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir = PD_IN);
+		/// Binds an UInt64 list.
+
+#ifndef POCO_LONG_IS_64_BIT
+	virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN) = 0;
+		/// Binds a long.
+
+	virtual void bind(std::size_t pos, const unsigned long& val, Direction dir = PD_IN) = 0;
+		/// Binds an unsiged long.
+
+	virtual void bind(std::size_t pos, const std::vector<long>& val, Direction dir = PD_IN);
+		/// Binds a long vector.
+
+	virtual void bind(std::size_t pos, const std::deque<long>& val, Direction dir = PD_IN);
+		/// Binds a long deque.
+
+	virtual void bind(std::size_t pos, const std::list<long>& val, Direction dir = PD_IN);
+		/// Binds a long list.
+#endif
+
+	virtual void bind(std::size_t pos, const bool& val, Direction dir = PD_IN) = 0;
+		/// Binds a boolean.
+
+	virtual void bind(std::size_t pos, const std::vector<bool>& val, Direction dir = PD_IN);
+		/// Binds a boolean vector.
+
+	virtual void bind(std::size_t pos, const std::deque<bool>& val, Direction dir = PD_IN);
+		/// Binds a boolean deque.
+
+	virtual void bind(std::size_t pos, const std::list<bool>& val, Direction dir = PD_IN);
+		/// Binds a boolean list.
+
+	virtual void bind(std::size_t pos, const float& val, Direction dir = PD_IN) = 0;
+		/// Binds a float.
+
+	virtual void bind(std::size_t pos, const std::vector<float>& val, Direction dir = PD_IN);
+		/// Binds a float vector.
+
+	virtual void bind(std::size_t pos, const std::deque<float>& val, Direction dir = PD_IN);
+		/// Binds a float deque.
+
+	virtual void bind(std::size_t pos, const std::list<float>& val, Direction dir = PD_IN);
+		/// Binds a float list.
+
+	virtual void bind(std::size_t pos, const double& val, Direction dir = PD_IN) = 0;
+		/// Binds a double.
+
+	virtual void bind(std::size_t pos, const std::vector<double>& val, Direction dir = PD_IN);
+		/// Binds a double vector.
+
+	virtual void bind(std::size_t pos, const std::deque<double>& val, Direction dir = PD_IN);
+		/// Binds a double deque.
+
+	virtual void bind(std::size_t pos, const std::list<double>& val, Direction dir = PD_IN);
+		/// Binds a double list.
+
+	virtual void bind(std::size_t pos, const char& val, Direction dir = PD_IN) = 0;
+		/// Binds a single character.
+
+	virtual void bind(std::size_t pos, const std::vector<char>& val, Direction dir = PD_IN);
+		/// Binds a character vector.
+
+	virtual void bind(std::size_t pos, const std::deque<char>& val, Direction dir = PD_IN);
+		/// Binds a character deque.
+
+	virtual void bind(std::size_t pos, const std::list<char>& val, Direction dir = PD_IN);
+		/// Binds a character list.
+
+	virtual void bind(std::size_t pos, const char* const& pVal, Direction dir = PD_IN) = 0;
+		/// Binds a const char ptr.
+
+	virtual void bind(std::size_t pos, const std::string& val, Direction dir = PD_IN) = 0;
+		/// Binds a string.
+
+	virtual void bind(std::size_t pos, const std::vector<std::string>& val, Direction dir = PD_IN);
+		/// Binds a string vector.
+
+	virtual void bind(std::size_t pos, const std::deque<std::string>& val, Direction dir = PD_IN);
+		/// Binds a string deque.
+
+	virtual void bind(std::size_t pos, const std::list<std::string>& val, Direction dir = PD_IN);
+		/// Binds a string list.
+
+	virtual void bind(std::size_t pos, const UTF16String& val, Direction dir = PD_IN);
+		/// Binds a UTF-16 Unicode string.
+
+	virtual void bind(std::size_t pos, const std::vector<UTF16String>& val, Direction dir = PD_IN);
+		/// Binds a UTF-16 Unicode string vector.
+
+	virtual void bind(std::size_t pos, const std::deque<UTF16String>& val, Direction dir = PD_IN);
+		/// Binds a UTF-16 Unicode string deque.
+
+	virtual void bind(std::size_t pos, const std::list<UTF16String>& val, Direction dir = PD_IN);
+		/// Binds a UTF-16 Unicode string list.
+
+	virtual void bind(std::size_t pos, const BLOB& val, Direction dir = PD_IN) = 0;
+		/// Binds a BLOB.
+
+	virtual void bind(std::size_t pos, const CLOB& val, Direction dir = PD_IN) = 0;
+		/// Binds a CLOB.
+
+	virtual void bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir = PD_IN);
+		/// Binds a BLOB vector.
+
+	virtual void bind(std::size_t pos, const std::deque<BLOB>& val, Direction dir = PD_IN);
+		/// Binds a BLOB deque.
+
+	virtual void bind(std::size_t pos, const std::list<BLOB>& val, Direction dir = PD_IN);
+		/// Binds a BLOB list.
+
+	virtual void bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir = PD_IN);
+		/// Binds a CLOB vector.
+
+	virtual void bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir = PD_IN);
+		/// Binds a CLOB deque.
+
+	virtual void bind(std::size_t pos, const std::list<CLOB>& val, Direction dir = PD_IN);
+		/// Binds a CLOB list.
+
+	virtual void bind(std::size_t pos, const DateTime& val, Direction dir = PD_IN) = 0;
+		/// Binds a DateTime.
+
+	virtual void bind(std::size_t pos, const std::vector<DateTime>& val, Direction dir = PD_IN);
+		/// Binds a DateTime vector.
+
+	virtual void bind(std::size_t pos, const std::deque<DateTime>& val, Direction dir = PD_IN);
+		/// Binds a DateTime deque.
+
+	virtual void bind(std::size_t pos, const std::list<DateTime>& val, Direction dir = PD_IN);
+		/// Binds a DateTime list.
+
+	virtual void bind(std::size_t pos, const Date& val, Direction dir = PD_IN) = 0;
+		/// Binds a Date.
+
+	virtual void bind(std::size_t pos, const std::vector<Date>& val, Direction dir = PD_IN);
+		/// Binds a Date vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Date>& val, Direction dir = PD_IN);
+		/// Binds a Date deque.
+
+	virtual void bind(std::size_t pos, const std::list<Date>& val, Direction dir = PD_IN);
+		/// Binds a Date list.
+
+	virtual void bind(std::size_t pos, const Time& val, Direction dir = PD_IN) = 0;
+		/// Binds a Time.
+
+	virtual void bind(std::size_t pos, const std::vector<Time>& val, Direction dir = PD_IN);
+		/// Binds a Time vector.
+
+	virtual void bind(std::size_t pos, const std::deque<Time>& val, Direction dir = PD_IN);
+		/// Binds a Time deque.
+
+	virtual void bind(std::size_t pos, const std::list<Time>& val, Direction dir = PD_IN);
+		/// Binds a Time list.
+
+	virtual void bind(std::size_t pos, const NullData& val, Direction dir = PD_IN) = 0;
+		/// Binds a null.
+
+	virtual void bind(std::size_t pos, const std::vector<NullData>& val, Direction dir = PD_IN);
+		/// Binds a null vector.
+
+	virtual void bind(std::size_t pos, const std::deque<NullData>& val, Direction dir = PD_IN);
+		/// Binds a null deque.
+
+	virtual void bind(std::size_t pos, const std::list<NullData>& val, Direction dir = PD_IN);
+		/// Binds a null list.
+
+	void bind(std::size_t pos, const Any& val, Direction dir = PD_IN);
+		/// Binds an Any.
+	
+	void bind(std::size_t pos, const Poco::Dynamic::Var& val, Direction dir = PD_IN);
+	/// Binds a Var.
+
+	virtual void reset();
+		/// Resets a binder. No-op by default. Implement for binders that cache data.
+
+	static bool isOutBound(Direction dir);
+		/// Returns true if direction is out bound;
+
+	static bool isInBound(Direction dir);
+		/// Returns true if direction is in bound;
+};
+
+
+//
+// inlines
+//
+inline void AbstractBinder::reset()
+{
+	//no-op
+}
+
+
+inline bool AbstractBinder::isOutBound(Direction dir)
+{
+	return PD_OUT == dir || PD_IN_OUT == dir;
+}
+
+
+inline bool AbstractBinder::isInBound(Direction dir)
+{
+	return PD_IN == dir || PD_IN_OUT == dir;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractBinder_INCLUDED

+ 144 - 0
ThirdParty/include/Poco/Data/AbstractBinding.h

@@ -0,0 +1,144 @@
+//
+// AbstractBinding.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractBinding
+//
+// Definition of the AbstractBinding class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractBinding_INCLUDED
+#define Data_AbstractBinding_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractBinder.h"
+#include "Poco/Any.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <vector>
+#include <list>
+#include <deque>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API AbstractBinding
+	/// AbstractBinding connects a value with a placeholder via an AbstractBinder interface.
+{
+public:
+	typedef SharedPtr<AbstractBinding> Ptr;
+	typedef AbstractBinder::Ptr        BinderPtr;
+
+	enum Direction
+	{
+		PD_IN = AbstractBinder::PD_IN,
+		PD_OUT = AbstractBinder::PD_OUT,
+		PD_IN_OUT = AbstractBinder::PD_IN_OUT
+	};
+
+	AbstractBinding(const std::string& name = "", Direction direction = PD_IN, Poco::UInt32 bulkSize = 0);
+		/// Creates the AbstractBinding.
+
+	virtual ~AbstractBinding();
+		/// Destroys the AbstractBinding.
+
+	void setBinder(BinderPtr pBinder);
+		/// Sets the object used for binding; object does NOT take ownership of the pointer.
+
+	BinderPtr getBinder() const;
+		/// Returns the AbstractBinder used for binding data.
+
+	virtual std::size_t numOfColumnsHandled() const = 0;
+		/// Returns the number of columns that the binding handles.
+		///
+		/// The trivial case will be one single column but when
+		/// complex types are used this value can be larger than one.
+
+	virtual std::size_t numOfRowsHandled() const = 0;
+		/// Returns the number of rows that the binding handles.
+		///
+		/// The trivial case will be one single row but 
+		/// for collection data types it can be larger.
+
+	virtual bool canBind() const = 0;
+		/// Returns true if we have enough data to bind
+
+	virtual void bind(std::size_t pos) = 0;
+		/// Binds a value to the given column position
+
+	virtual void reset() = 0;
+		/// Allows a binding to be reused.
+
+	AbstractBinder::Direction getDirection() const;
+		/// Returns the binding direction.
+
+	const std::string& name() const;
+		/// Returns the name for this binding.
+
+	bool isBulk() const;
+		/// Returns true if extraction is bulk.
+
+	Poco::UInt32 bulkSize() const;
+		/// Returns the size of the bulk binding.
+
+private:
+	BinderPtr    _pBinder;
+	std::string  _name;
+	Direction    _direction;
+	Poco::UInt32 _bulkSize;
+};
+
+
+typedef std::vector<AbstractBinding::Ptr> AbstractBindingVec;
+typedef std::deque<AbstractBinding::Ptr>  AbstractBindingDeq;
+typedef std::list<AbstractBinding::Ptr>   AbstractBindingLst;
+
+
+//
+// inlines
+//
+inline AbstractBinder::Ptr AbstractBinding::getBinder() const
+{
+	return _pBinder;
+}
+
+
+inline const std::string& AbstractBinding::name() const
+{
+	return _name;
+}
+
+
+inline AbstractBinder::Direction AbstractBinding::getDirection() const
+{
+	return (AbstractBinder::Direction) _direction;
+}
+
+
+inline bool AbstractBinding::isBulk() const
+{
+	return _bulkSize > 0;
+}
+
+
+inline Poco::UInt32 AbstractBinding::bulkSize() const
+{
+	return _bulkSize;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractBinding_INCLUDED

+ 278 - 0
ThirdParty/include/Poco/Data/AbstractExtraction.h

@@ -0,0 +1,278 @@
+//
+// AbstractExtraction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractExtraction
+//
+// Definition of the AbstractExtraction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractExtraction_INCLUDED
+#define Data_AbstractExtraction_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractExtractor.h"
+#include "Poco/Data/AbstractPreparation.h"
+#include "Poco/Data/Limit.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/UTFString.h"
+#include "Poco/AutoPtr.h"
+#include <vector>
+#include <deque>
+#include <list>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+class AbstractPreparator;
+
+
+class Data_API AbstractExtraction
+	/// AbstractExtraction is the interface class that connects output positions to concrete values
+	/// retrieved via an AbstractExtractor.
+{
+public:
+	typedef SharedPtr<AbstractExtraction> Ptr;
+	typedef SharedPtr<AbstractExtractor>  ExtractorPtr;
+	typedef SharedPtr<AbstractPreparator> PreparatorPtr;
+
+	AbstractExtraction(Poco::UInt32 limit = Limit::LIMIT_UNLIMITED,
+		Poco::UInt32 position = 0, bool bulk = false);
+		/// Creates the AbstractExtraction. A limit value equal to EXTRACT_UNLIMITED (0xffffffffu) 
+		/// means that we extract as much data as possible during one execute.
+		/// Otherwise the limit value is used to partition data extracting to a limited amount of rows.
+
+	virtual ~AbstractExtraction();
+		/// Destroys the AbstractExtraction.
+
+	void setExtractor(ExtractorPtr pExtractor);
+		/// Sets the class used for extracting the data. Does not take ownership of the pointer.
+
+	ExtractorPtr getExtractor() const;
+		/// Retrieves the extractor object
+
+	Poco::UInt32 position() const;
+		/// Returns the extraction position.
+
+	virtual std::size_t numOfColumnsHandled() const = 0;
+		/// Returns the number of columns that the extraction handles.
+		///
+		/// The trivial case will be one single column but when
+		/// complex types are used this value can be larger than one.
+
+	virtual std::size_t numOfRowsHandled() const = 0;
+		/// Returns the number of rows that the extraction handles.
+		///
+		/// The trivial case will be one single row but 
+		/// for collection data types (ie vector) it can be larger.
+
+	virtual std::size_t numOfRowsAllowed() const = 0;
+		/// Returns the upper limit on number of rows that the extraction will handle.
+
+	virtual std::size_t extract(std::size_t pos) = 0;
+		/// Extracts a value from the param, starting at the given column position.
+		/// Returns the number of rows extracted.
+
+	virtual void reset();
+		/// Resets the extractor so that it can be re-used.
+		/// Does nothing in this implementation.
+		/// Implementations should override it for different behavior.
+
+	virtual bool canExtract() const;
+		/// Returns true. Implementations should override it for different behavior.
+
+	virtual AbstractPreparation::Ptr createPreparation(PreparatorPtr& pPrep, std::size_t pos) = 0;
+		/// Creates and returns shared pointer to Preparation object for the extracting object.
+
+	void setLimit(Poco::UInt32 limit);
+		/// Sets the limit.
+
+	Poco::UInt32 getLimit() const;
+		/// Gets the limit.
+
+	virtual bool isNull(std::size_t row) const;
+		/// In implementations, this function returns true if value at row is null, 
+		/// false otherwise. 
+		/// Normal behavior is to replace nulls with default values.
+		/// However, extraction implementations may remember the underlying database
+		/// null values and be able to later provide information about them.
+		/// Here, this function throws NotImplementedException.
+
+	bool isBulk() const;
+		/// Returns true if this is bulk extraction.
+
+	void setEmptyStringIsNull(bool emptyStringIsNull);
+		/// Sets the empty string handling flag.
+
+	bool getEmptyStringIsNull() const;
+		/// Returns the empty string handling flag.
+
+	void setForceEmptyString(bool forceEmptyString);
+		/// Sets the force empty string flag.
+
+	bool getForceEmptyString() const;
+		/// Returns the force empty string flag.
+
+	template <typename T>
+	bool isValueNull(const T& str, bool deflt)
+		/// Utility function to determine the nullness of the value.
+		/// This generic version always returns default value
+		/// (i.e. does nothing). The std::string overload does
+		/// the actual work.
+		///
+	{
+		return deflt;
+	}
+
+	bool isValueNull(const std::string& str, bool deflt);
+		/// Overload for const reference to std::string.
+		///
+		/// Returns true when folowing conditions are met:
+		///
+		/// - string is empty 
+		/// - getEmptyStringIsNull() returns true
+
+	bool isValueNull(const Poco::UTF16String& str, bool deflt);
+		/// Overload for const reference to UTF16String.
+		///
+		/// Returns true when folowing conditions are met:
+		///
+		/// - string is empty 
+		/// - getEmptyStringIsNull() returns true
+
+private:
+	template <typename S>
+	bool isStringNull(const S& str, bool deflt)
+	{
+		if (getForceEmptyString()) return false;
+
+		if (getEmptyStringIsNull() && str.empty())
+			return true;
+
+		return deflt;
+	}
+
+	ExtractorPtr _pExtractor;
+	Poco::UInt32 _limit;
+	Poco::UInt32 _position;
+	bool         _bulk;
+	bool         _emptyStringIsNull;
+	bool         _forceEmptyString;
+};
+
+
+typedef std::vector<AbstractExtraction::Ptr> AbstractExtractionVec;
+typedef std::vector<AbstractExtractionVec>   AbstractExtractionVecVec;
+typedef std::deque<AbstractExtraction::Ptr>  AbstractExtractionDeq;
+typedef std::vector<AbstractExtractionDeq>   AbstractExtractionDeqVec;
+typedef std::list<AbstractExtraction::Ptr>   AbstractExtractionLst;
+typedef std::vector<AbstractExtractionLst>   AbstractExtractionLstVec;
+
+
+//
+// inlines
+//
+inline void AbstractExtraction::setExtractor(ExtractorPtr pExtractor)
+{
+	_pExtractor = pExtractor;
+}
+
+
+inline AbstractExtraction::ExtractorPtr AbstractExtraction::getExtractor() const
+{
+	return _pExtractor;
+}
+
+
+inline void AbstractExtraction::setLimit(Poco::UInt32 limit)
+{
+	_limit = limit;
+}
+
+
+inline Poco::UInt32 AbstractExtraction::getLimit() const
+{
+	return _limit;
+}
+
+
+inline bool AbstractExtraction::isNull(std::size_t row) const
+{
+	throw NotImplementedException("Check for null values not implemented.");
+}
+
+
+inline Poco::UInt32 AbstractExtraction::position() const
+{
+	return _position;
+}
+
+
+inline bool AbstractExtraction::isBulk() const
+{
+	return _bulk;
+}
+
+
+inline void AbstractExtraction::reset()
+{
+}
+
+
+inline bool AbstractExtraction::canExtract() const
+{
+	return true;
+}
+
+
+inline void AbstractExtraction::setEmptyStringIsNull(bool emptyStringIsNull)
+{
+	_emptyStringIsNull = emptyStringIsNull;
+}
+
+
+inline bool AbstractExtraction::getEmptyStringIsNull() const
+{
+	return _emptyStringIsNull;
+}
+
+
+inline void AbstractExtraction::setForceEmptyString(bool forceEmptyString)
+{
+	_forceEmptyString = forceEmptyString;
+}
+
+
+inline bool AbstractExtraction::getForceEmptyString() const
+{
+	return _forceEmptyString;
+}
+
+
+inline bool AbstractExtraction::isValueNull(const std::string& str, bool deflt)
+{
+	return isStringNull(str, deflt);
+}
+
+
+inline bool AbstractExtraction::isValueNull(const Poco::UTF16String& str, bool deflt)
+{
+	return isStringNull(str, deflt);
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractExtraction_INCLUDED

+ 351 - 0
ThirdParty/include/Poco/Data/AbstractExtractor.h

@@ -0,0 +1,351 @@
+//
+// AbstractExtractor.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractExtractor
+//
+// Definition of the AbstractExtractor class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractExtractor_INCLUDED
+#define Data_AbstractExtractor_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Constants.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/UTFString.h"
+#include <vector>
+#include <deque>
+#include <list>
+#include <string>
+#include <cstddef>
+
+
+namespace Poco {
+
+
+class DateTime;
+class Any;
+
+namespace Dynamic {
+class Var;
+}
+
+namespace Data {
+
+
+class Date;
+class Time;
+
+
+class Data_API AbstractExtractor
+	/// Interface used to extract data from a single result row.
+	/// If an extractor receives null it is not allowed to change val!
+{
+public:
+	typedef SharedPtr<AbstractExtractor> Ptr;
+
+	AbstractExtractor();
+		/// Creates the AbstractExtractor.
+
+	virtual ~AbstractExtractor();
+		/// Destroys the AbstractExtractor.
+
+	virtual bool extract(std::size_t pos, Poco::Int8& val) = 0;
+		/// Extracts an Int8. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::Int8>& val);
+		/// Extracts an Int8 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::Int8>& val);
+		/// Extracts an Int8 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::Int8>& val);
+		/// Extracts an Int8 list.
+
+	virtual bool extract(std::size_t pos, Poco::UInt8& val) = 0;
+		/// Extracts an UInt8. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::UInt8>& val);
+		/// Extracts an UInt8 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::UInt8>& val);
+		/// Extracts an UInt8 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::UInt8>& val);
+		/// Extracts an UInt8 list.
+
+	virtual bool extract(std::size_t pos, Poco::Int16& val) = 0;
+		/// Extracts an Int16. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::Int16>& val);
+		/// Extracts an Int16 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::Int16>& val);
+		/// Extracts an Int16 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::Int16>& val);
+		/// Extracts an Int16 list.
+
+	virtual bool extract(std::size_t pos, Poco::UInt16& val) = 0;
+		/// Extracts an UInt16. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::UInt16>& val);
+		/// Extracts an UInt16 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::UInt16>& val);
+		/// Extracts an UInt16 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::UInt16>& val);
+		/// Extracts an UInt16 list.
+
+	virtual bool extract(std::size_t pos, Poco::Int32& val) = 0;
+		/// Extracts an Int32. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::Int32>& val);
+		/// Extracts an Int32 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::Int32>& val);
+		/// Extracts an Int32 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::Int32>& val);
+		/// Extracts an Int32 list.
+
+	virtual bool extract(std::size_t pos, Poco::UInt32& val) = 0;
+		/// Extracts an UInt32. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::UInt32>& val);
+		/// Extracts an UInt32 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::UInt32>& val);
+		/// Extracts an UInt32 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::UInt32>& val);
+		/// Extracts an UInt32 list.
+
+	virtual bool extract(std::size_t pos, Poco::Int64& val) = 0;
+		/// Extracts an Int64. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::Int64>& val);
+		/// Extracts an Int64 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::Int64>& val);
+		/// Extracts an Int64 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::Int64>& val);
+		/// Extracts an Int64 list.
+
+	virtual bool extract(std::size_t pos, Poco::UInt64& val) = 0;
+		/// Extracts an UInt64. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::UInt64>& val);
+		/// Extracts an UInt64 vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::UInt64>& val);
+		/// Extracts an UInt64 deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::UInt64>& val);
+		/// Extracts an UInt64 list.
+
+#ifndef POCO_LONG_IS_64_BIT
+	virtual bool extract(std::size_t pos, long& val) = 0;
+		/// Extracts a long. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, unsigned long& val) = 0;
+		/// Extracts an unsigned long. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<long>& val);
+		/// Extracts a long vector.
+
+	virtual bool extract(std::size_t pos, std::deque<long>& val);
+		/// Extracts a long deque.
+
+	virtual bool extract(std::size_t pos, std::list<long>& val);
+		/// Extracts a long list.
+#endif
+
+	virtual bool extract(std::size_t pos, bool& val) = 0;
+		/// Extracts a boolean. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<bool>& val);
+		/// Extracts a boolean vector.
+
+	virtual bool extract(std::size_t pos, std::deque<bool>& val);
+		/// Extracts a boolean deque.
+
+	virtual bool extract(std::size_t pos, std::list<bool>& val);
+		/// Extracts a boolean list.
+
+	virtual bool extract(std::size_t pos, float& val) = 0;
+		/// Extracts a float. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<float>& val);
+		/// Extracts a float vector.
+
+	virtual bool extract(std::size_t pos, std::deque<float>& val);
+		/// Extracts a float deque.
+
+	virtual bool extract(std::size_t pos, std::list<float>& val);
+		/// Extracts a float list.
+
+	virtual bool extract(std::size_t pos, double& val) = 0;
+		/// Extracts a double. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<double>& val);
+		/// Extracts a double vector.
+
+	virtual bool extract(std::size_t pos, std::deque<double>& val);
+		/// Extracts a double deque.
+
+	virtual bool extract(std::size_t pos, std::list<double>& val);
+		/// Extracts a double list.
+
+	virtual bool extract(std::size_t pos, char& val) = 0;
+		/// Extracts a single character. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<char>& val);
+		/// Extracts a character vector.
+
+	virtual bool extract(std::size_t pos, std::deque<char>& val);
+		/// Extracts a character deque.
+
+	virtual bool extract(std::size_t pos, std::list<char>& val);
+		/// Extracts a character list.
+
+	virtual bool extract(std::size_t pos, std::string& val) = 0;
+		/// Extracts a string. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<std::string>& val);
+		/// Extracts a string vector.
+
+	virtual bool extract(std::size_t pos, std::deque<std::string>& val);
+		/// Extracts a string deque.
+
+	virtual bool extract(std::size_t pos, std::list<std::string>& val);
+		/// Extracts a string list.
+
+	virtual bool extract(std::size_t pos, UTF16String& val);
+		/// Extracts a UTF16String. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<UTF16String>& val);
+		/// Extracts a UTF16String vector.
+
+	virtual bool extract(std::size_t pos, std::deque<UTF16String>& val);
+		/// Extracts a UTF16String deque.
+
+	virtual bool extract(std::size_t pos, std::list<UTF16String>& val);
+		/// Extracts a UTF16String list.
+
+	virtual bool extract(std::size_t pos, BLOB& val) = 0;
+		/// Extracts a BLOB. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, CLOB& val) = 0;
+		/// Extracts a CLOB. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<BLOB>& val);
+		/// Extracts a BLOB vector.
+
+	virtual bool extract(std::size_t pos, std::deque<BLOB>& val);
+		/// Extracts a BLOB deque.
+
+	virtual bool extract(std::size_t pos, std::list<BLOB>& val);
+		/// Extracts a BLOB list.
+
+	virtual bool extract(std::size_t pos, std::vector<CLOB>& val);
+		/// Extracts a CLOB vector.
+
+	virtual bool extract(std::size_t pos, std::deque<CLOB>& val);
+		/// Extracts a CLOB deque.
+
+	virtual bool extract(std::size_t pos, std::list<CLOB>& val);
+		/// Extracts a CLOB list.
+
+	virtual bool extract(std::size_t pos, DateTime& val) = 0;
+		/// Extracts a DateTime. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<DateTime>& val);
+		/// Extracts a DateTime vector.
+
+	virtual bool extract(std::size_t pos, std::deque<DateTime>& val);
+		/// Extracts a DateTime deque.
+
+	virtual bool extract(std::size_t pos, std::list<DateTime>& val);
+		/// Extracts a DateTime list.
+
+	virtual bool extract(std::size_t pos, Date& val) = 0;
+		/// Extracts a Date. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Date>& val);
+		/// Extracts a Date vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Date>& val);
+		/// Extracts a Date deque.
+
+	virtual bool extract(std::size_t pos, std::list<Date>& val);
+		/// Extracts a Date list.
+
+	virtual bool extract(std::size_t pos, Time& val) = 0;
+		/// Extracts a Time. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Time>& val);
+		/// Extracts a Time vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Time>& val);
+		/// Extracts a Time deque.
+
+	virtual bool extract(std::size_t pos, std::list<Time>& val);
+		/// Extracts a Time list.
+
+	virtual bool extract(std::size_t pos, Any& val) = 0;
+		/// Extracts an Any. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Any>& val);
+		/// Extracts an Any vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Any>& val);
+		/// Extracts an Any deque.
+
+	virtual bool extract(std::size_t pos, std::list<Any>& val);
+		/// Extracts an Any list.
+
+	virtual bool extract(std::size_t pos, Poco::Dynamic::Var& val) = 0;
+		/// Extracts a Var. Returns false if null was received.
+
+	virtual bool extract(std::size_t pos, std::vector<Poco::Dynamic::Var>& val);
+		/// Extracts a Var vector.
+
+	virtual bool extract(std::size_t pos, std::deque<Poco::Dynamic::Var>& val);
+		/// Extracts a Var deque.
+
+	virtual bool extract(std::size_t pos, std::list<Poco::Dynamic::Var>& val);
+		/// Extracts a Var list.
+
+	virtual bool isNull(std::size_t col, std::size_t row = POCO_DATA_INVALID_ROW) = 0;
+		/// Returns true if the value at [col,row] position is null.
+
+	virtual void reset();
+		/// Resets any information internally cached by the extractor.
+};
+
+
+///
+/// inlines
+///
+inline void AbstractExtractor::reset()
+{
+	//default no-op
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractExtractor_INCLUDED

+ 71 - 0
ThirdParty/include/Poco/Data/AbstractPreparation.h

@@ -0,0 +1,71 @@
+//
+// AbstractPreparation.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractPreparation
+//
+// Definition of the AbstractPreparation class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractPreparation_INCLUDED
+#define Data_AbstractPreparation_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractPreparator.h"
+#include "Poco/SharedPtr.h"
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API AbstractPreparation
+	/// Interface for calling the appropriate AbstractPreparator method
+{
+public:
+	typedef SharedPtr<AbstractPreparation> Ptr;
+	typedef AbstractPreparator::Ptr PreparatorPtr;
+
+	AbstractPreparation(PreparatorPtr pPreparator);
+		/// Creates the AbstractPreparation.
+
+	virtual ~AbstractPreparation();
+		/// Destroys the AbstractPreparation.
+
+	virtual void prepare() = 0;
+		/// Prepares data.
+
+protected:
+	AbstractPreparation();
+	AbstractPreparation(const AbstractPreparation&);
+	AbstractPreparation& operator = (const AbstractPreparation&);
+
+	PreparatorPtr preparation();
+		/// Returns the preparation object
+
+	PreparatorPtr _pPreparator;
+};
+
+
+//
+// inlines
+//
+inline AbstractPreparation::PreparatorPtr AbstractPreparation::preparation()
+{
+	return _pPreparator;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractPreparation_INCLUDED

+ 388 - 0
ThirdParty/include/Poco/Data/AbstractPreparator.h

@@ -0,0 +1,388 @@
+//
+// AbstractPreparator.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractPreparator
+//
+// Definition of the AbstractPreparator class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractPreparator_INCLUDED
+#define Data_AbstractPreparator_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/UTFString.h"
+#include <vector>
+#include <deque>
+#include <list>
+#include <cstddef>
+
+
+namespace Poco {
+
+
+class DateTime;
+class Any;
+
+namespace Dynamic {
+class Var;
+}
+
+
+namespace Data {
+
+
+class Date;
+class Time;
+
+
+class Data_API AbstractPreparator
+	/// Interface used for database preparation where we first have to register all data types
+	/// (and memory output locations) before extracting data, e.g. ODBC.
+	/// Extract works as two-phase extract: first we call prepare once, then extract n-times.
+	/// There are cases (bulk operations using std::vector storage) when extract is called only once.
+	/// The value passed to a prepare() call is not used by the prepare, serving only as an indication 
+	/// of the data type being prepared, thus all values are passed as const references. 
+	/// Implementing this interface is not mandatory for a connector. Connectors that only extract data 
+	/// after SQL execution (e.g. SQLite) do not need this functionality at all.
+{
+public:
+	typedef SharedPtr<AbstractPreparator> Ptr;
+
+	AbstractPreparator(Poco::UInt32 length = 1u);
+		/// Creates the AbstractPreparator.
+
+	virtual ~AbstractPreparator();
+		/// Destroys the AbstractPreparator.
+
+	virtual void prepare(std::size_t pos, const Poco::Int8&) = 0;
+		/// Prepares an Int8.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::Int8>& val);
+		/// Prepares an Int8 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::Int8>& val);
+		/// Prepares an Int8 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::Int8>& val);
+		/// Prepares an Int8 list.
+
+	virtual void prepare(std::size_t pos, const Poco::UInt8&) = 0;
+		/// Prepares an UInt8.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::UInt8>& val);
+		/// Prepares an UInt8 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::UInt8>& val);
+		/// Prepares an UInt8 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::UInt8>& val);
+		/// Prepares an UInt8 list.
+
+	virtual void prepare(std::size_t pos, const Poco::Int16&) = 0;
+		/// Prepares an Int16.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::Int16>& val);
+		/// Prepares an Int16 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::Int16>& val);
+		/// Prepares an Int16 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::Int16>& val);
+		/// Prepares an Int16 list.
+
+	virtual void prepare(std::size_t pos, const Poco::UInt16&) = 0;
+		/// Prepares an UInt16.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::UInt16>& val);
+		/// Prepares an UInt16 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::UInt16>& val);
+		/// Prepares an UInt16 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::UInt16>& val);
+		/// Prepares an UInt16 list.
+
+	virtual void prepare(std::size_t pos, const Poco::Int32&) = 0;
+		/// Prepares an Int32.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::Int32>& val);
+		/// Prepares an Int32 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::Int32>& val);
+		/// Prepares an Int32 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::Int32>& val);
+		/// Prepares an Int32 list.
+
+	virtual void prepare(std::size_t pos, const Poco::UInt32&) = 0;
+		/// Prepares an UInt32.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::UInt32>& val);
+		/// Prepares an UInt32 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::UInt32>& val);
+		/// Prepares an UInt32 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::UInt32>& val);
+		/// Prepares an UInt32 list.
+
+	virtual void prepare(std::size_t pos, const Poco::Int64&) = 0;
+		/// Prepares an Int64.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::Int64>& val);
+		/// Prepares an Int64 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::Int64>& val);
+		/// Prepares an Int64 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::Int64>& val);
+		/// Prepares an Int64 list.
+
+	virtual void prepare(std::size_t pos, const Poco::UInt64&) = 0;
+		/// Prepares an UInt64.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::UInt64>& val);
+		/// Prepares an UInt64 vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::UInt64>& val);
+		/// Prepares an UInt64 deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::UInt64>& val);
+		/// Prepares an UInt64 list.
+
+#ifndef POCO_LONG_IS_64_BIT
+	virtual void prepare(std::size_t pos, const long&) = 0;
+		/// Prepares a long.
+
+	virtual void prepare(std::size_t pos, const unsigned long&) = 0;
+		/// Prepares an unsigned long.
+
+	virtual void prepare(std::size_t pos, const std::vector<long>& val);
+		/// Prepares a long vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<long>& val);
+		/// Prepares a long deque.
+
+	virtual void prepare(std::size_t pos, const std::list<long>& val);
+		/// Prepares a long list.
+#endif
+
+	virtual void prepare(std::size_t pos, const bool&) = 0;
+		/// Prepares a boolean.
+
+	virtual void prepare(std::size_t pos, const std::vector<bool>& val);
+		/// Prepares a boolean vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<bool>& val);
+		/// Prepares a boolean deque.
+
+	virtual void prepare(std::size_t pos, const std::list<bool>& val);
+		/// Prepares a boolean list.
+
+	virtual void prepare(std::size_t pos, const float&) = 0;
+		/// Prepares a float.
+
+	virtual void prepare(std::size_t pos, const std::vector<float>& val);
+		/// Prepares a float vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<float>& val);
+		/// Prepares a float deque.
+
+	virtual void prepare(std::size_t pos, const std::list<float>& val);
+		/// Prepares a float list.
+
+	virtual void prepare(std::size_t pos, const double&) = 0;
+		/// Prepares a double.
+
+	virtual void prepare(std::size_t pos, const std::vector<double>& val);
+		/// Prepares a double vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<double>& val);
+		/// Prepares a double deque.
+
+	virtual void prepare(std::size_t pos, const std::list<double>& val);
+		/// Prepares a double list.
+
+	virtual void prepare(std::size_t pos, const char&) = 0;
+		/// Prepares a single character.
+
+	virtual void prepare(std::size_t pos, const std::vector<char>& val);
+		/// Prepares a character vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<char>& val);
+		/// Prepares a character deque.
+
+	virtual void prepare(std::size_t pos, const std::list<char>& val);
+		/// Prepares a character list.
+
+	virtual void prepare(std::size_t pos, const std::string&) = 0;
+		/// Prepares a string.
+
+	virtual void prepare(std::size_t pos, const std::vector<std::string>& val);
+		/// Prepares a string vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<std::string>& val);
+		/// Prepares a string deque.
+
+	virtual void prepare(std::size_t pos, const std::list<std::string>& val);
+		/// Prepares a character list.
+
+	virtual void prepare(std::size_t pos, const UTF16String&);
+		/// Prepares a UTF16String.
+
+	virtual void prepare(std::size_t pos, const std::vector<UTF16String>& val);
+		/// Prepares a UTF16String vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<UTF16String>& val);
+		/// Prepares a UTF16String deque.
+
+	virtual void prepare(std::size_t pos, const std::list<UTF16String>& val);
+		/// Prepares a UTF16String list.
+
+	virtual void prepare(std::size_t pos, const BLOB&) = 0;
+		/// Prepares a BLOB.
+
+	virtual void prepare(std::size_t pos, const CLOB&) = 0;
+		/// Prepares a CLOB.
+
+	virtual void prepare(std::size_t pos, const std::vector<BLOB>& val);
+		/// Prepares a BLOB vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<BLOB>& val);
+		/// Prepares a BLOB deque.
+
+	virtual void prepare(std::size_t pos, const std::list<BLOB>& val);
+		/// Prepares a BLOB list.
+
+	virtual void prepare(std::size_t pos, const std::vector<CLOB>& val);
+		/// Prepares a CLOB vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<CLOB>& val);
+		/// Prepares a CLOB deque.
+
+	virtual void prepare(std::size_t pos, const std::list<CLOB>& val);
+		/// Prepares a CLOB list.
+
+	virtual void prepare(std::size_t pos, const DateTime&) = 0;
+		/// Prepares a DateTime.
+
+	virtual void prepare(std::size_t pos, const std::vector<DateTime>& val);
+		/// Prepares a DateTime vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<DateTime>& val);
+		/// Prepares a DateTime deque.
+
+	virtual void prepare(std::size_t pos, const std::list<DateTime>& val);
+		/// Prepares a DateTime list.
+
+	virtual void prepare(std::size_t pos, const Date&) = 0;
+		/// Prepares a Date.
+
+	virtual void prepare(std::size_t pos, const std::vector<Date>& val);
+		/// Prepares a Date vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Date>& val);
+		/// Prepares a Date deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Date>& val);
+		/// Prepares a Date list.
+
+	virtual void prepare(std::size_t pos, const Time&) = 0;
+		/// Prepares a Time.
+
+	virtual void prepare(std::size_t pos, const std::vector<Time>& val);
+		/// Prepares a Time vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Time>& val);
+		/// Prepares a Time deque.
+	
+	virtual void prepare(std::size_t pos, const std::list<Time>& val);
+		/// Prepares a Time list.
+
+	virtual void prepare(std::size_t pos, const Any&) = 0;
+		/// Prepares an Any.
+
+	virtual void prepare(std::size_t pos, const std::vector<Any>& val);
+		/// Prepares an Any vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Any>& val);
+		/// Prepares an Any deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Any>& val);
+		/// Prepares an Any list.
+
+	virtual void prepare(std::size_t pos, const Poco::Dynamic::Var&) = 0;
+		/// Prepares a Var.
+
+	virtual void prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val);
+		/// Prepares a Var vector.
+
+	virtual void prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val);
+		/// Prepares a Var deque.
+
+	virtual void prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val);
+		/// Prepares a Var list.
+
+	void setLength(Poco::UInt32 length);
+		/// Sets the length of prepared data.
+		/// Needed only for data lengths greater than 1 (i.e. for
+		/// bulk operations).
+
+	Poco::UInt32 getLength() const;
+		/// Returns the length of prepared data. Defaults to 1.
+		/// The length is greater than one for bulk operations.
+
+	void setBulk(bool bulkPrep = true);
+		/// Sets bulk operation flag (always false at object creation time)
+
+	bool isBulk() const;
+		/// Returns bulk operation flag.
+
+private:
+	Poco::UInt32 _length;
+	bool         _bulk;
+};
+
+
+///
+/// inlines
+///
+inline void AbstractPreparator::setLength(Poco::UInt32 length)
+{
+	_length = length;
+}
+
+
+inline Poco::UInt32 AbstractPreparator::getLength() const
+{
+	return _length;
+}
+
+
+inline void AbstractPreparator::setBulk(bool bulkPrep)
+{
+	_bulk = bulkPrep;
+}
+
+
+inline bool AbstractPreparator::isBulk() const
+{
+	return _bulk;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractPreparator_INCLUDED

+ 315 - 0
ThirdParty/include/Poco/Data/AbstractSessionImpl.h

@@ -0,0 +1,315 @@
+//
+// AbstractSessionImpl.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AbstractSessionImpl
+//
+// Definition of the AbstractSessionImpl class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_AbstractSessionImpl_INCLUDED
+#define Data_AbstractSessionImpl_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/SessionImpl.h"
+#include "Poco/Data/DataException.h"
+#include <map>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class C>
+class AbstractSessionImpl: public SessionImpl
+	/// A partial implementation of SessionImpl, providing
+	/// features and properties management.
+	///
+	/// To implement a certain feature or property, a subclass
+	/// must provide setter and getter methods and register
+	/// them with addFeature() or addProperty().
+{
+public:
+	typedef void (C::*FeatureSetter)(const std::string&, bool);
+		/// The setter method for a feature.
+		
+	typedef bool (C::*FeatureGetter)(const std::string&);
+		/// The getter method for a feature.
+		
+	typedef void (C::*PropertySetter)(const std::string&, const Poco::Any&);
+		/// The setter method for a property.
+		
+	typedef Poco::Any (C::*PropertyGetter)(const std::string&);
+		/// The getter method for a property.
+
+	AbstractSessionImpl(const std::string& connectionString,
+		std::size_t timeout = LOGIN_TIMEOUT_DEFAULT): SessionImpl(connectionString, timeout),
+			_storage(std::string("deque")),
+			_bulk(false),
+			_emptyStringIsNull(false),
+			_forceEmptyString(false)
+		/// Creates the AbstractSessionImpl.
+		/// 
+		/// Adds "storage" property and sets the default internal storage container 
+		/// type to std::deque.
+		/// The storage is created by statements automatically whenever a query 
+		/// returning results is executed but external storage is provided by the user.
+		/// Storage type can be reconfigured at runtime both globally (for the
+		/// duration of the session) and locally (for a single statement execution only). 
+		/// See StatementImpl for details on how this property is used at runtime.
+		/// 
+		/// Adds "handle" property which, if set by the back end, returns native handle
+		/// for the back end DB.
+		/// 
+		/// Adds "bulk" feature and sets it to false.
+		/// Bulk feature determines whether the session is capable of bulk operations.
+		/// Connectors that are capable of it must set this feature prior to attempting 
+		/// bulk operations.
+		///
+		/// Adds "emptyStringIsNull" feature and sets it to false. This feature should be
+		/// set to true in order to modify the behavior of the databases that distinguish
+		/// between zero-length character strings as nulls. Setting this feature to true 
+		/// shall disregard any difference between empty character strings and nulls,
+		/// causing the framework to treat them the same (i.e. behave like Oracle).		
+		///
+		/// Adds "forceEmptyString" feature and sets it to false. This feature should be set
+		/// to true in order to force the databases that do not distinguish empty strings from
+		/// nulls (e.g. Oracle) to always report empty string.
+		///
+		/// The "emptyStringIsNull" and "forceEmptyString" features are mutually exclusive.
+		/// While these features can not both be true at the same time, they can both be false,
+		/// resulting in default underlying database behavior.
+		///
+	{
+		addProperty("storage", 
+			&AbstractSessionImpl<C>::setStorage, 
+			&AbstractSessionImpl<C>::getStorage);
+
+		addProperty("handle", 
+			&AbstractSessionImpl<C>::setHandle,
+			&AbstractSessionImpl<C>::getHandle);
+
+		addFeature("bulk", 
+			&AbstractSessionImpl<C>::setBulk, 
+			&AbstractSessionImpl<C>::getBulk);
+
+		addFeature("emptyStringIsNull", 
+			&AbstractSessionImpl<C>::setEmptyStringIsNull,
+			&AbstractSessionImpl<C>::getEmptyStringIsNull);
+
+		addFeature("forceEmptyString", 
+			&AbstractSessionImpl<C>::setForceEmptyString,
+			&AbstractSessionImpl<C>::getForceEmptyString);
+	}
+
+	~AbstractSessionImpl()
+		/// Destroys the AbstractSessionImpl.
+	{
+	}
+
+	void setFeature(const std::string& name, bool state)
+		/// Looks a feature up in the features map
+		/// and calls the feature's setter, if there is one.
+	{
+		typename FeatureMap::const_iterator it = _features.find(name);
+		if (it != _features.end())
+		{
+			if (it->second.setter)
+				(static_cast<C*>(this)->*it->second.setter)(name, state);
+			else
+				throw NotImplementedException("set", name);
+		}
+		else throw NotSupportedException(name);
+	}
+	
+	bool getFeature(const std::string& name)
+		/// Looks a feature up in the features map
+		/// and calls the feature's getter, if there is one.
+	{
+		typename FeatureMap::const_iterator it = _features.find(name);
+		if (it != _features.end())
+		{
+			if (it->second.getter)
+				return (static_cast<C*>(this)->*it->second.getter)(name);
+			else
+				throw NotImplementedException("get", name);
+		}
+		else throw NotSupportedException(name);
+	}
+	
+	void setProperty(const std::string& name, const Poco::Any& value)
+		/// Looks a property up in the properties map
+		/// and calls the property's setter, if there is one.
+	{
+		typename PropertyMap::const_iterator it = _properties.find(name);
+		if (it != _properties.end())
+		{
+			if (it->second.setter)
+				(static_cast<C*>(this)->*it->second.setter)(name, value);
+			else
+				throw NotImplementedException("set", name);
+		}
+		else throw NotSupportedException(name);
+	}
+
+	Poco::Any getProperty(const std::string& name)
+		/// Looks a property up in the properties map
+		/// and calls the property's getter, if there is one.
+	{
+		typename PropertyMap::const_iterator it = _properties.find(name);
+		if (it != _properties.end())
+		{
+			if (it->second.getter)
+				return (static_cast<C*>(this)->*it->second.getter)(name);
+			else
+				throw NotImplementedException("set", name);
+		}
+		else throw NotSupportedException(name);
+	}
+	
+	void setStorage(const std::string& value)
+		/// Sets the storage type.
+	{
+		_storage = value;
+	}
+
+	void setStorage(const std::string& name, const Poco::Any& value)
+		/// Sets the storage type.
+	{
+		_storage = Poco::RefAnyCast<std::string>(value);
+	}
+		
+	Poco::Any getStorage(const std::string& name="")
+		/// Returns the storage type
+	{
+		return _storage;
+	}
+
+	void setHandle(const std::string& name, const Poco::Any& handle)
+		/// Sets the native session handle. 
+	{
+		_handle = handle;
+	}
+		
+	Poco::Any getHandle(const std::string& name="")
+		/// Returns the native session handle. 
+	{
+		return _handle;
+	}
+
+	void setBulk(const std::string& name, bool bulk)
+		/// Sets the execution type.
+	{
+		_bulk = bulk;
+	}
+		
+	bool getBulk(const std::string& name="")
+		/// Returns the execution type
+	{
+		return _bulk;
+	}
+
+	void setEmptyStringIsNull(const std::string& name, bool emptyStringIsNull)
+		/// Sets the behavior regarding empty variable length strings.
+		/// Those are treated as NULL by Oracle and as empty string by
+		/// most other databases.
+		/// When this feature is true, empty strings are treated as NULL.
+	{
+		if (emptyStringIsNull && _forceEmptyString)
+			throw InvalidAccessException("Features mutually exclusive");
+
+		_emptyStringIsNull = emptyStringIsNull;
+	}
+		
+	bool getEmptyStringIsNull(const std::string& name="")
+		/// Returns the setting for the behavior regarding empty variable
+		/// length strings. See setEmptyStringIsNull(const std::string&, bool)
+		/// and this class documentation for feature rationale and details.
+	{
+		return _emptyStringIsNull;
+	}
+
+	void setForceEmptyString(const std::string& name, bool forceEmptyString)
+		/// Sets the behavior regarding empty variable length strings.
+		/// Those are treated as NULL by Oracle and as empty string by
+		/// most other databases.
+		/// When this feature is true, both empty strings and NULL values
+		/// are reported as empty strings.
+	{
+		if (forceEmptyString && _emptyStringIsNull)
+			throw InvalidAccessException("Features mutually exclusive");
+
+		_forceEmptyString = forceEmptyString;
+	}
+		
+	bool getForceEmptyString(const std::string& name="")
+		/// Returns the setting for the behavior regarding empty variable
+		/// length strings. See setForceEmptyString(const std::string&, bool)
+		/// and this class documentation for feature rationale and details.
+	{
+		return _forceEmptyString;
+	}
+
+protected:
+	void addFeature(const std::string& name, FeatureSetter setter, FeatureGetter getter)
+		/// Adds a feature to the map of supported features.
+		///
+		/// The setter or getter can be null, in case setting or getting a feature
+		/// is not supported.
+	{
+		Feature feature;
+		feature.setter = setter;
+		feature.getter = getter;
+		_features[name] = feature;
+	}
+		
+	void addProperty(const std::string& name, PropertySetter setter, PropertyGetter getter)
+		/// Adds a property to the map of supported properties.
+		///
+		/// The setter or getter can be null, in case setting or getting a property
+		/// is not supported.
+	{
+		Property property;
+		property.setter = setter;
+		property.getter = getter;
+		_properties[name] = property;
+	}
+
+private:
+	struct Feature
+	{
+		FeatureSetter setter;
+		FeatureGetter getter;
+	};
+	
+	struct Property
+	{
+		PropertySetter setter;
+		PropertyGetter getter;
+	};
+	
+	typedef std::map<std::string, Feature>  FeatureMap;
+	typedef std::map<std::string, Property> PropertyMap;
+	
+	FeatureMap  _features;
+	PropertyMap _properties;
+	std::string _storage;
+	bool        _bulk;
+	bool        _emptyStringIsNull;
+	bool        _forceEmptyString;
+	Poco::Any   _handle;
+};
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AbstractSessionImpl_INCLUDED

+ 222 - 0
ThirdParty/include/Poco/Data/ArchiveStrategy.h

@@ -0,0 +1,222 @@
+//
+// ArchiveStrategy.h
+//
+// Library: Data
+// Package: Logging
+// Module:  ArchiveStrategy
+//
+// Definition of the ArchiveStrategy class and subclasses.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_ArchiveStrategy_INCLUDED
+#define Data_ArchiveStrategy_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Session.h"
+#include "Poco/DateTime.h"
+#include "Poco/Timespan.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/SharedPtr.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API ArchiveStrategy
+	/// The ArchiveStrategy is used by SQLChannel to archive log rows.
+{
+public:
+	static const std::string DEFAULT_ARCHIVE_DESTINATION;
+
+	ArchiveStrategy(const std::string& connector, 
+		const std::string& connect, 
+		const std::string& source, 
+		const std::string& destination = DEFAULT_ARCHIVE_DESTINATION);
+		/// Creates archive strategy.
+
+	virtual ~ArchiveStrategy();
+		/// Destroys archive strategy.
+
+	void open();
+		/// Opens the session.
+
+	virtual void archive() = 0;
+		/// Archives the rows.
+
+	const std::string& getSource() const;
+		/// Returns the name of the source table containing rows to be archived.
+
+	void setSource(const std::string& source);
+		/// Sets the name of the source table.
+
+	const std::string& getDestination() const;
+		/// Returns the name of the destination table for rows to be archived.
+
+	void setDestination(const std::string& destination);
+		/// Sets the name of the destination table.
+
+	virtual const std::string& getThreshold() const = 0;
+		/// Returns the archive threshold.
+
+	virtual void setThreshold(const std::string& threshold) = 0;
+		/// Sets the archive threshold.
+
+protected:
+	typedef Poco::SharedPtr<Session>   SessionPtr;
+	typedef Poco::SharedPtr<Statement> StatementPtr;
+
+	Session& session();
+
+	void setCopyStatement();
+	void setDeleteStatement();
+	void setCountStatement();
+
+	Statement& getCopyStatement();
+	Statement& getDeleteStatement();
+	Statement& getCountStatement();
+private:
+	
+	ArchiveStrategy();
+	ArchiveStrategy(const ArchiveStrategy&);
+	ArchiveStrategy& operator = (const ArchiveStrategy&);
+
+	std::string  _connector;
+	std::string  _connect;
+	SessionPtr   _pSession;
+	StatementPtr _pCopyStatement;
+	StatementPtr _pDeleteStatement;
+	StatementPtr _pCountStatement;
+	std::string  _source;
+	std::string  _destination;
+};
+
+
+//
+// inlines
+//
+
+inline const std::string& ArchiveStrategy::getSource() const
+{
+	return _source;
+}
+
+
+inline void ArchiveStrategy::setSource(const std::string& source)
+{
+	_source = source;
+}
+
+
+inline void ArchiveStrategy::setDestination(const std::string& destination)
+{
+	_destination = destination;
+}
+
+
+inline const std::string& ArchiveStrategy::getDestination() const
+{
+	return _destination;
+}
+
+
+inline Session& ArchiveStrategy::session()
+{
+	return *_pSession;
+}
+
+
+inline void ArchiveStrategy::setCopyStatement()
+{
+	_pCopyStatement = new Statement(*_pSession);
+}
+
+
+inline void ArchiveStrategy::setDeleteStatement()
+{
+	_pDeleteStatement = new Statement(*_pSession);
+}
+
+
+inline void ArchiveStrategy::setCountStatement()
+{
+	_pCountStatement = new Statement(*_pSession);
+}
+
+
+inline Statement& ArchiveStrategy::getCopyStatement()
+{
+	return *_pCopyStatement;
+}
+
+
+inline Statement& ArchiveStrategy::getDeleteStatement()
+{
+	return *_pDeleteStatement;
+}
+
+
+inline Statement& ArchiveStrategy::getCountStatement()
+{
+	return *_pCountStatement;
+}
+
+
+
+//
+// ArchiveByAgeStrategy
+//
+class Data_API ArchiveByAgeStrategy: public ArchiveStrategy
+	/// Archives rows scheduled for archiving.
+{
+public:
+	ArchiveByAgeStrategy(const std::string& connector, 
+		const std::string& connect, 
+		const std::string& sourceTable, 
+		const std::string& destinationTable = DEFAULT_ARCHIVE_DESTINATION);
+	
+	~ArchiveByAgeStrategy();
+
+	void archive();
+
+	const std::string& getThreshold() const;
+		/// Returns the archive threshold.
+
+	void setThreshold(const std::string& threshold);
+		/// Sets the archive threshold.
+
+private:
+	ArchiveByAgeStrategy();
+	ArchiveByAgeStrategy(const ArchiveByAgeStrategy&);
+	ArchiveByAgeStrategy& operator = (const ArchiveByAgeStrategy&);
+
+	void initStatements();
+
+	Timespan     _maxAge;
+	std::string  _ageString;
+	DateTime     _archiveDateTime;
+	Poco::Dynamic::Var _archiveCount;
+};
+
+
+//
+// inlines
+//
+
+inline const std::string& ArchiveByAgeStrategy::getThreshold() const
+{
+	return _ageString;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_ArchiveStrategy_INCLUDED

+ 35 - 0
ThirdParty/include/Poco/Data/AutoTransaction.h

@@ -0,0 +1,35 @@
+//
+// AutoTransaction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  AutoTransaction
+//
+// Forward header for the Transaction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+
+#ifndef Data_AutoTransaction_INCLUDED
+#define Data_AutoTransaction_INCLUDED
+
+
+#include "Poco/Data/Transaction.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+typedef Transaction AutoTransaction;
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_AutoTransaction_INCLUDED

+ 1496 - 0
ThirdParty/include/Poco/Data/Binding.h

@@ -0,0 +1,1496 @@
+//
+// Binding.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Binding
+//
+// Definition of the Binding class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Binding_INCLUDED
+#define Data_Binding_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractBinding.h"
+#include "Poco/Data/DataException.h"
+#include "Poco/Data/TypeHandler.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/MetaProgramming.h"
+#include "Poco/Bugcheck.h"
+#include <vector>
+#include <list>
+#include <deque>
+#include <set>
+#include <map>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class T>
+class Binding: public AbstractBinding
+	/// Binding maps a value or multiple values (see Binding specializations for STL containers as
+	/// well as type handlers) to database column(s). Values to be bound can be either mapped 
+	/// directly (by reference) or a copy can be created, depending on the value of the copy argument.
+	/// To pass a reference to a variable, it is recommended to pass it to the intermediate
+	/// utility function use(), which will create the proper binding. In cases when a reference 
+	/// is passed to binding, the storage it refers to must be valid at the statement execution time.
+	/// To pass a copy of a variable, constant or string literal, use utility function bind().
+	/// Variables can be passed as either copies or references (i.e. using either use() or bind()).
+	/// Constants, however, can only be passed as copies. this is best achieved using bind() utility 
+	/// function. An attempt to pass a constant by reference shall result in compile-time error.
+{
+public:
+	typedef T                  ValType;
+	typedef SharedPtr<ValType> ValPtr;
+	typedef Binding<ValType>   Type;
+	typedef SharedPtr<Type>    Ptr;
+
+	explicit Binding(T& val,
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction),
+		_val(val), 
+		_bound(false)
+		/// Creates the Binding using the passed reference as bound value.
+		/// If copy is true, a copy of the value referred to is created.
+	{
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return 1u;
+	}
+
+	bool canBind() const
+	{
+		return !_bound;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		TypeHandler<T>::bind(pos, _val, getBinder(), getDirection());
+		_bound = true;
+	}
+
+	void reset ()
+	{
+		_bound = false;
+		AbstractBinder::Ptr pBinder = getBinder();
+		poco_assert_dbg (!pBinder.isNull());
+		pBinder->reset();
+	}
+
+private:
+	const T& _val;
+	bool     _bound;
+};
+
+
+
+template <class T>
+class CopyBinding: public AbstractBinding
+	/// Binding maps a value or multiple values (see Binding specializations for STL containers as
+	/// well as type handlers) to database column(s). Values to be bound can be either mapped 
+	/// directly (by reference) or a copy can be created, depending on the value of the copy argument.
+	/// To pass a reference to a variable, it is recommended to pass it to the intermediate
+	/// utility function use(), which will create the proper binding. In cases when a reference 
+	/// is passed to binding, the storage it refers to must be valid at the statement execution time.
+	/// To pass a copy of a variable, constant or string literal, use utility function bind().
+	/// Variables can be passed as either copies or references (i.e. using either use() or bind()).
+{
+public:
+	typedef T                    ValType;
+	typedef SharedPtr<ValType>   ValPtr;
+	typedef CopyBinding<ValType> Type;
+	typedef SharedPtr<Type>      Ptr;
+
+	explicit CopyBinding(T& val,
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction),
+		_pVal(new T(val)),
+		_bound(false)
+		/// Creates the Binding using the passed reference as bound value.
+		/// If copy is true, a copy of the value referred to is created.
+	{
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return 1;
+	}
+
+	bool canBind() const
+	{
+		return !_bound;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		TypeHandler<T>::bind(pos, *_pVal, getBinder(), getDirection());
+		_bound = true;
+	}
+
+	void reset ()
+	{
+		_bound = false;
+		AbstractBinder::Ptr pBinder = getBinder();
+		poco_assert_dbg (!pBinder.isNull());
+		pBinder->reset();
+	}
+
+private:
+	//typedef typename TypeWrapper<T>::TYPE ValueType;
+	ValPtr _pVal;
+	bool   _bound;
+};
+
+
+template <>
+class Binding<const char*>: public AbstractBinding
+	/// Binding const char* specialization wraps char pointer into string.
+{
+public:
+	typedef const char*          ValType;
+	typedef SharedPtr<ValType>   ValPtr;
+	typedef Binding<const char*> Type;
+	typedef SharedPtr<Type>      Ptr;
+
+	explicit Binding(const char* pVal, 
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(pVal ? pVal : throw NullPointerException() ),
+		_bound(false)
+		/// Creates the Binding by copying the passed string.
+	{
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return 1u;
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return 1u;
+	}
+
+	bool canBind() const
+	{
+		return !_bound;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		TypeHandler<std::string>::bind(pos, _val, getBinder(), getDirection());
+		_bound = true;
+	}
+
+	void reset ()
+	{
+		_bound = false;
+		AbstractBinder::Ptr pBinder = getBinder();
+		poco_assert_dbg (!pBinder.isNull());
+		pBinder->reset();
+	}
+
+private:
+	std::string _val;
+	bool        _bound;
+};
+
+
+
+template <>
+class CopyBinding<const char*>: public AbstractBinding
+	/// Binding const char* specialization wraps char pointer into string.
+{
+public:
+	typedef const char*              ValType;
+	typedef SharedPtr<ValType>       ValPtr;
+	typedef CopyBinding<const char*> Type;
+	typedef SharedPtr<Type>          Ptr;
+
+	explicit CopyBinding(const char* pVal, 
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(pVal ? pVal : throw NullPointerException() ),
+		_bound(false)
+		/// Creates the Binding by copying the passed string.
+	{
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return 1u;
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return 1u;
+	}
+
+	bool canBind() const
+	{
+		return !_bound;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		TypeHandler<std::string>::bind(pos, _val, getBinder(), getDirection());
+		_bound = true;
+	}
+
+	void reset ()
+	{
+		_bound = false;
+		AbstractBinder::Ptr pBinder = getBinder();
+		poco_assert_dbg (!pBinder.isNull());
+		pBinder->reset();
+	}
+
+private:
+	std::string _val;
+	bool        _bound;
+};
+
+
+template <class T>
+class Binding<std::vector<T> >: public AbstractBinding
+	/// Specialization for std::vector.
+{
+public:
+	typedef std::vector<T>                   ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::vector<T>& val, 
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction),
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class T>
+class CopyBinding<std::vector<T> >: public AbstractBinding
+	/// Specialization for std::vector.
+{
+public:
+	
+	typedef std::vector<T>                   ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::vector<T>& val, 
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction),
+		_pVal(new std::vector<T>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <>
+class Binding<std::vector<bool> >: public AbstractBinding
+	/// Specialization for std::vector<bool>.
+	/// This specialization is necessary due to the nature of std::vector<bool>.
+	/// For details, see the standard library implementation of std::vector<bool> 
+	/// or
+	/// S. Meyers: "Effective STL" (Copyright Addison-Wesley 2001),
+	/// Item 18: "Avoid using vector<bool>."
+	/// 
+	/// The workaround employed here is using std::deque<bool> as an
+	/// internal replacement container. 
+	/// 
+	/// IMPORTANT:
+	/// Only IN binding is supported.
+{
+public:
+	typedef std::vector<bool>            ValType;
+	typedef SharedPtr<ValType>           ValPtr;
+	typedef SharedPtr<Binding<ValType> > Ptr;
+	typedef ValType::const_iterator      Iterator;
+
+	explicit Binding(const std::vector<bool>& val, 
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_deq(_val.begin(), _val.end()),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN != direction)
+			throw BindingException("Only IN direction is legal for std:vector<bool> binding.");
+
+		if (numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return 1u;
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<bool>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+
+	}
+
+	void reset()
+	{
+		_begin = _deq.begin();
+		_end   = _deq.end();
+	}
+
+private:
+	const std::vector<bool>&         _val;
+	std::deque<bool>                 _deq;
+	std::deque<bool>::const_iterator _begin;
+	std::deque<bool>::const_iterator _end;
+};
+
+
+template <>
+class CopyBinding<std::vector<bool> >: public AbstractBinding
+	/// Specialization for std::vector<bool>.
+	/// This specialization is necessary due to the nature of std::vector<bool>.
+	/// For details, see the standard library implementation of std::vector<bool> 
+	/// or
+	/// S. Meyers: "Effective STL" (Copyright Addison-Wesley 2001),
+	/// Item 18: "Avoid using vector<bool>."
+	/// 
+	/// The workaround employed here is using std::deque<bool> as an
+	/// internal replacement container. 
+	/// 
+	/// IMPORTANT:
+	/// Only IN binding is supported.
+{
+public:
+	typedef std::vector<bool>                ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef ValType::const_iterator          Iterator;
+
+	explicit CopyBinding(const std::vector<bool>& val, 
+		const std::string& name = "", 
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_deq(val.begin(), val.end()),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN != direction)
+			throw BindingException("Only IN direction is legal for std:vector<bool> binding.");
+
+		if (numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return 1u;
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_deq.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<bool>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _deq.begin();
+		_end   = _deq.end();
+	}
+
+private:
+	std::deque<bool>                 _deq;
+	std::deque<bool>::const_iterator _begin;
+	std::deque<bool>::const_iterator _end;
+};
+
+
+template <class T>
+class Binding<std::list<T> >: public AbstractBinding
+	/// Specialization for std::list.
+{
+public:
+	typedef std::list<T>                     ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::list<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _val.size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class T>
+class CopyBinding<std::list<T> >: public AbstractBinding
+	/// Specialization for std::list.
+{
+public:
+	typedef typename std::list<T>            ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(ValType& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::list<T>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <class T>
+class Binding<std::deque<T> >: public AbstractBinding
+	/// Specialization for std::deque.
+{
+public:
+	typedef std::deque<T>                    ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::deque<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _val.size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class T>
+class CopyBinding<std::deque<T> >: public AbstractBinding
+	/// Specialization for std::deque.
+{
+public:
+	typedef std::deque<T>                    ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::deque<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::deque<T>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <class T>
+class Binding<std::set<T> >: public AbstractBinding
+	/// Specialization for std::set.
+{
+public:
+	typedef std::set<T>                      ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::set<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class T>
+class CopyBinding<std::set<T> >: public AbstractBinding
+	/// Specialization for std::set.
+{
+public:
+	typedef std::set<T>                      ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::set<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::set<T>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <class T>
+class Binding<std::multiset<T> >: public AbstractBinding
+	/// Specialization for std::multiset.
+{
+public:
+	typedef std::multiset<T>                 ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::multiset<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class T>
+class CopyBinding<std::multiset<T> >: public AbstractBinding
+	/// Specialization for std::multiset.
+{
+public:
+	typedef std::multiset<T>             ValType;
+	typedef SharedPtr<ValType>           ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::multiset<T>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::multiset<T>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<T>::bind(pos, *_begin, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr    _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <class K, class V>
+class Binding<std::map<K, V> >: public AbstractBinding
+	/// Specialization for std::map.
+{
+public:
+	typedef std::map<K, V>                   ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::map<K, V>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<V>::bind(pos, _begin->second, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class K, class V>
+class CopyBinding<std::map<K, V> >: public AbstractBinding
+	/// Specialization for std::map.
+{
+public:
+	typedef std::map<K, V>                   ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::map<K, V>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::map<K, V>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<V>::bind(pos, _begin->second, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+template <class K, class V>
+class Binding<std::multimap<K, V> >: public AbstractBinding
+	/// Specialization for std::multimap.
+{
+public:
+	typedef std::multimap<K, V>              ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<Binding<ValType> >     Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit Binding(std::multimap<K, V>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_val(val), 
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~Binding()
+		/// Destroys the Binding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_val.size());
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<V>::bind(pos, _begin->second, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _val.begin();
+		_end   = _val.end();
+	}
+
+private:
+	const ValType& _val;
+	Iterator       _begin;
+	Iterator       _end;
+};
+
+
+template <class K, class V>
+class CopyBinding<std::multimap<K, V> >: public AbstractBinding
+	/// Specialization for std::multimap.
+{
+public:
+	typedef std::multimap<K, V>              ValType;
+	typedef SharedPtr<ValType>               ValPtr;
+	typedef SharedPtr<CopyBinding<ValType> > Ptr;
+	typedef typename ValType::const_iterator Iterator;
+
+	explicit CopyBinding(std::multimap<K, V>& val,
+		const std::string& name = "",
+		Direction direction = PD_IN): 
+		AbstractBinding(name, direction), 
+		_pVal(new std::multimap<K, V>(val)),
+		_begin(), 
+		_end()
+		/// Creates the Binding.
+	{
+		if (PD_IN == direction && numOfRowsHandled() == 0)
+			throw BindingException("It is illegal to bind to an empty data collection");
+		reset();
+	}
+
+	~CopyBinding()
+		/// Destroys the CopyBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _pVal->size();
+	}
+
+	bool canBind() const
+	{
+		return _begin != _end;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		poco_assert_dbg(canBind());
+		TypeHandler<V>::bind(pos, _begin->second, getBinder(), getDirection());
+		++_begin;
+	}
+
+	void reset()
+	{
+		_begin = _pVal->begin();
+		_end   = _pVal->end();
+	}
+
+private:
+	ValPtr   _pVal;
+	Iterator _begin;
+	Iterator _end;
+};
+
+
+namespace Keywords {
+
+
+template <typename T> 
+inline AbstractBinding::Ptr use(T& t, const std::string& name = "")
+	/// Convenience function for a more compact Binding creation.
+{
+	// If this fails to compile, a const ref was passed to use().
+	// This can be resolved by either (a) using bind (which will copy the value),
+	// or (b) if the const ref is guaranteed to exist when execute is called 
+	// (which can be much later!), by using the "useRef" keyword instead
+	poco_static_assert (!IsConst<T>::VALUE);
+	return new Binding<T>(t, name, AbstractBinding::PD_IN);
+}
+
+
+inline AbstractBinding::Ptr use(const NullData& t, const std::string& name = "")
+	/// NullData overload.
+{
+	return new Binding<NullData>(const_cast<NullData&>(t), name, AbstractBinding::PD_IN);
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr useRef(T& t, const std::string& name = "")
+	/// Convenience function for a more compact Binding creation.
+{
+	return new Binding<T>(t, name, AbstractBinding::PD_IN);
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr in(T& t, const std::string& name = "")
+	/// Convenience function for a more compact Binding creation.
+{
+	return use(t, name);
+}
+
+
+inline AbstractBinding::Ptr in(const NullData& t, const std::string& name = "")
+	/// NullData overload.
+{
+	return use(t, name);
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr out(T& t)
+	/// Convenience function for a more compact Binding creation.
+{
+	poco_static_assert (!IsConst<T>::VALUE);
+	return new Binding<T>(t, "", AbstractBinding::PD_OUT);
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr io(T& t)
+	/// Convenience function for a more compact Binding creation.
+{
+	poco_static_assert (!IsConst<T>::VALUE);
+	return new Binding<T>(t, "", AbstractBinding::PD_IN_OUT);
+}
+
+
+inline AbstractBindingVec& use(AbstractBindingVec& bv)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return bv;
+}
+
+
+inline AbstractBindingVec& in(AbstractBindingVec& bv)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return bv;
+}
+
+
+inline AbstractBindingVec& out(AbstractBindingVec& bv)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return bv;
+}
+
+
+inline AbstractBindingVec& io(AbstractBindingVec& bv)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return bv;
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr bind(T t, const std::string& name)
+	/// Convenience function for a more compact Binding creation.
+	/// This funtion differs from use() in its value copy semantics.
+{
+	return new CopyBinding<T>(t, name, AbstractBinding::PD_IN);
+}
+
+
+template <typename T> 
+inline AbstractBinding::Ptr bind(T t)
+	/// Convenience function for a more compact Binding creation.
+	/// This funtion differs from use() in its value copy semantics.
+{
+	return Poco::Data::Keywords::bind(t, "");
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Binding_INCLUDED

+ 96 - 0
ThirdParty/include/Poco/Data/Bulk.h

@@ -0,0 +1,96 @@
+//
+// BulkExtraction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Bulk
+//
+// Definition of the BulkExtraction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Bulk_INCLUDED
+#define Data_Bulk_INCLUDED
+
+
+#include "Poco/Void.h"
+#include "Poco/Data/Limit.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API Bulk
+{
+public:
+	Bulk(const Limit& limit);
+		/// Creates the Bulk.
+
+	Bulk(Poco::UInt32 value);
+		/// Creates the Bulk.
+
+	~Bulk();
+		/// Destroys the bulk.
+
+	const Limit& limit() const;
+		/// Returns the limit asociated with this bulk object.
+
+	Poco::UInt32 size() const;
+		/// Returns the value of the limit asociated with 
+		/// this bulk object.
+	
+private:
+	Bulk();
+
+	Limit _limit;
+};
+
+
+///
+/// inlines
+///
+inline const Limit& Bulk::limit() const 
+{ 
+	return _limit; 
+}
+
+
+inline Poco::UInt32 Bulk::size() const 
+{ 
+	return _limit.value(); 
+}
+
+
+namespace Keywords {
+
+
+inline Bulk bulk(const Limit& limit = Limit(Limit::LIMIT_UNLIMITED, false, false))
+	/// Convenience function for creation of bulk.
+{
+	return Bulk(limit);
+}
+
+
+inline void bulk(Void)
+	/// Dummy bulk function. Used for bulk binding creation
+	/// (see BulkBinding) and bulk extraction signalling to Statement.
+{
+}
+
+
+} // namespace Keywords
+
+
+typedef void (*BulkFnType)(Void);
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Bulk_INCLUDED

+ 148 - 0
ThirdParty/include/Poco/Data/BulkBinding.h

@@ -0,0 +1,148 @@
+//
+// BulkBinding.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  BulkBinding
+//
+// Definition of the BulkBinding class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_BulkBinding_INCLUDED
+#define Data_BulkBinding_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractBinding.h"
+#include "Poco/Data/DataException.h"
+#include "Poco/Data/TypeHandler.h"
+#include "Poco/Data/Bulk.h"
+#include <vector>
+#include <deque>
+#include <list>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class T>
+class BulkBinding: public AbstractBinding
+	/// A BulkBinding maps a value to a column. 
+	/// Bulk binding support is provided only for std::vector.
+{
+public:
+	BulkBinding(const T& val, Poco::UInt32 bulkSize, const std::string& name = "", Direction direction = PD_IN): 
+		AbstractBinding(name, direction, bulkSize), 
+		_val(val), 
+		_bound(false)
+		/// Creates the BulkBinding.
+	{
+		if (0 == _val.size())
+			throw BindingException("Zero size containers not allowed.");
+	}
+
+	~BulkBinding()
+		/// Destroys the BulkBinding.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return 1;
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _val.size();
+	}
+
+	bool canBind() const
+	{
+		return !_bound;
+	}
+
+	void bind(std::size_t pos)
+	{
+		poco_assert_dbg(!getBinder().isNull());
+		TypeHandler<T>::bind(pos, _val, getBinder(), getDirection());
+		_bound = true;
+	}
+
+	void reset ()
+	{
+		_bound = false;
+		getBinder()->reset();
+	}
+
+private:
+	const T& _val;
+	bool     _bound;
+};
+
+
+namespace Keywords {
+
+
+template <typename T> 
+AbstractBinding::Ptr use(const std::vector<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::vector.
+{
+	return new BulkBinding<std::vector<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+template <typename T> 
+AbstractBinding::Ptr in(const std::vector<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::vector.
+{
+	return new BulkBinding<std::vector<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+template <typename T> 
+AbstractBinding::Ptr use(const std::deque<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::deque.
+{
+	return new BulkBinding<std::deque<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+template <typename T> 
+AbstractBinding::Ptr in(const std::deque<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::deque.
+{
+	return new BulkBinding<std::deque<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+template <typename T> 
+AbstractBinding::Ptr use(const std::list<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::list.
+{
+	return new BulkBinding<std::list<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+template <typename T> 
+AbstractBinding::Ptr in(const std::list<T>& t, BulkFnType, const std::string& name = "")
+	/// Convenience function for a more compact BulkBinding creation for std::list.
+{
+	return new BulkBinding<std::list<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_BulkBinding_INCLUDED

+ 276 - 0
ThirdParty/include/Poco/Data/BulkExtraction.h

@@ -0,0 +1,276 @@
+//
+// BulkExtraction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  BulkExtraction
+//
+// Definition of the BulkExtraction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_BulkExtraction_INCLUDED
+#define Data_BulkExtraction_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractExtraction.h"
+#include "Poco/Data/Bulk.h"
+#include "Poco/Data/Preparation.h"
+#include <vector>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class C>
+class BulkExtraction: public AbstractExtraction
+	/// Specialization for bulk extraction of values from a query result set.
+	/// Bulk extraction support is provided only for following STL containers:
+	/// - std::vector
+	/// - std::deque
+	/// - std::list
+{
+public:
+	typedef C                       ValType;
+	typedef typename C::value_type  CValType;
+	typedef SharedPtr<ValType>      ValPtr;
+	typedef BulkExtraction<ValType> Type;
+	typedef SharedPtr<Type>         Ptr;
+
+	BulkExtraction(C& result, Poco::UInt32 limit, const Position& pos = Position(0)): 
+		AbstractExtraction(limit, pos.value(), true),
+		_rResult(result), 
+		_default()
+	{
+		if (static_cast<Poco::UInt32>(result.size()) != limit)
+			result.resize(limit);
+	}
+
+	BulkExtraction(C& result, const CValType& def, Poco::UInt32 limit, const Position& pos = Position(0)): 
+		AbstractExtraction(limit, pos.value(), true),
+		_rResult(result), 
+		_default(def)
+	{
+		if (static_cast<Poco::UInt32>(result.size()) != limit)
+			result.resize(limit);
+	}
+
+	virtual ~BulkExtraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<C>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _rResult.size();
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		try
+		{
+			return _nulls.at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	std::size_t extract(std::size_t col)
+	{
+		AbstractExtractor::Ptr pExt = getExtractor();
+		TypeHandler<C>::extract(col, _rResult, _default, pExt);
+		typename C::iterator it = _rResult.begin();
+		typename C::iterator end = _rResult.end();
+		for (int row = 0; it !=end; ++it, ++row)
+		{
+			_nulls.push_back(isValueNull(*it, pExt->isNull(col, row)));
+		}
+
+		return _rResult.size();
+	}
+
+	virtual void reset()
+	{
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t col)
+	{
+		Poco::UInt32 limit = getLimit();
+		if (limit != _rResult.size()) _rResult.resize(limit);
+		pPrep->setLength(limit);
+		pPrep->setBulk(true);
+		return new Preparation<C>(pPrep, col, _rResult);
+	}
+
+protected:
+	const C& result() const
+	{
+		return _rResult;
+	}
+
+private:
+	C&               _rResult;
+	CValType         _default;
+	std::deque<bool> _nulls;
+};
+
+
+template <class C>
+class InternalBulkExtraction: public BulkExtraction<C>
+	/// Container Data Type specialization extension for extraction of values from a query result set.
+	///
+	/// This class is intended for PocoData internal use - it is used by StatementImpl 
+	/// to automaticaly create internal BulkExtraction in cases when statement returns data and no external storage
+	/// was supplied. It is later used by RecordSet to retrieve the fetched data after statement execution.
+	/// It takes ownership of the Column pointer supplied as constructor argument. Column object, in turn
+	/// owns the data container pointer.
+	///
+	/// InternalBulkExtraction objects can not be copied or assigned.
+{
+public:
+	typedef C                               ValType;
+	typedef typename C::value_type          CValType;
+	typedef SharedPtr<ValType>              ValPtr;
+	typedef InternalBulkExtraction<ValType> Type;
+	typedef SharedPtr<Type>                 Ptr;
+
+	InternalBulkExtraction(C& result,
+		Column<C>* pColumn,
+		Poco::UInt32 limit,
+		const Position& pos = Position(0)): 
+		BulkExtraction<C>(result, CValType(), limit, pos), 
+		_pColumn(pColumn)
+		/// Creates InternalBulkExtraction.
+	{
+	}
+
+	~InternalBulkExtraction()
+		/// Destroys InternalBulkExtraction.
+	{
+		delete _pColumn;
+	}
+
+	void reset()
+	{
+		_pColumn->reset();
+	}	
+
+	const CValType& value(int index) const
+	{
+		try
+		{ 
+			return BulkExtraction<C>::result().at(index); 
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		return BulkExtraction<C>::isNull(row);
+	}
+
+	const Column<C>& column() const
+	{
+		return *_pColumn;
+	}
+
+private:
+	InternalBulkExtraction();
+	InternalBulkExtraction(const InternalBulkExtraction&);
+	InternalBulkExtraction& operator = (const InternalBulkExtraction&);
+
+	Column<C>* _pColumn;
+};
+
+
+namespace Keywords {
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::vector<T>& t, const Bulk& bulk, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::vector bulk extraction support.
+{
+	return new BulkExtraction<std::vector<T> >(t, bulk.size(), pos);
+}
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::vector<T>& t, BulkFnType, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::vector bulk extraction support.
+{
+	Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
+	if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
+	return new BulkExtraction<std::vector<T> >(t, size, pos);
+}
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::deque<T>& t, const Bulk& bulk, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::deque bulk extraction support.
+{
+	return new BulkExtraction<std::deque<T> >(t, bulk.size(), pos);
+}
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::deque<T>& t, BulkFnType, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::deque bulk extraction support.
+{
+	Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
+	if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
+	return new BulkExtraction<std::deque<T> >(t, size, pos);
+}
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::list<T>& t, const Bulk& bulk, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::list bulk extraction support.
+{
+	return new BulkExtraction<std::list<T> >(t, bulk.size(), pos);
+}
+
+
+template <typename T> 
+AbstractExtraction::Ptr into(std::list<T>& t, BulkFnType, const Position& pos = Position(0))
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with std::list bulk extraction support.
+{
+	Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
+	if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
+	return new BulkExtraction<std::list<T> >(t, size, pos);
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_BulkExtraction_INCLUDED

+ 490 - 0
ThirdParty/include/Poco/Data/Column.h

@@ -0,0 +1,490 @@
+//
+// Column.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Column
+//
+// Definition of the Column class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Column_INCLUDED
+#define Data_Column_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/MetaColumn.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/RefCountedObject.h"
+#include <vector>
+#include <list>
+#include <deque>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class C>
+class Column
+	/// Column class is column data container.
+	/// Data (a pointer to underlying STL container) is assigned to the class 
+	/// at construction time. Construction with null pointer is not allowed.
+	/// This class owns the data assigned to it and deletes the storage on destruction.
+{
+public:
+	typedef C                                  Container;
+	typedef Poco::SharedPtr<C>                 ContainerPtr;
+	typedef typename C::const_iterator         Iterator;
+	typedef typename C::const_reverse_iterator RIterator;
+	typedef typename C::size_type              Size;
+	typedef typename C::value_type             Type;
+
+	Column(const MetaColumn& metaColumn, Container* pData): 
+		_metaColumn(metaColumn),
+		_pData(pData)
+		/// Creates the Column.
+	{
+		if (!_pData)
+			throw NullPointerException("Container pointer must point to valid storage.");
+	}
+
+	Column(const Column& col): 
+		_metaColumn(col._metaColumn), 
+		_pData(col._pData)
+		/// Creates the Column.
+	{
+	}
+
+	~Column()
+		/// Destroys the Column.
+	{
+	}
+
+	Column& operator = (const Column& col)
+		/// Assignment operator.
+	{
+		Column tmp(col);
+		swap(tmp);
+		return *this;
+	}
+
+	void swap(Column& other)
+		/// Swaps the column with another one.
+	{
+		using std::swap;
+		swap(_metaColumn, other._metaColumn);
+		swap(_pData, other._pData);
+	}
+
+	Container& data()
+		/// Returns reference to contained data.
+	{
+		return *_pData;
+	}
+
+	const Type& value(std::size_t row) const
+		/// Returns the field value in specified row.
+	{
+		try
+		{
+			return _pData->at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	const Type& operator [] (std::size_t row) const
+		/// Returns the field value in specified row.
+	{
+		return value(row);
+	}
+
+	Size rowCount() const
+		/// Returns number of rows.
+	{
+		return _pData->size();
+	}
+
+	void reset()
+		/// Clears and shrinks the storage.
+	{
+		Container().swap(*_pData);
+	}
+
+	const std::string& name() const
+		/// Returns column name.
+	{
+		return _metaColumn.name();
+	}
+
+	std::size_t length() const
+		/// Returns column maximum length.
+	{
+		return _metaColumn.length();
+	}
+
+	std::size_t precision() const
+		/// Returns column precision.
+		/// Valid for floating point fields only (zero for other data types).
+	{
+		return _metaColumn.precision();
+	}
+
+	std::size_t position() const
+		/// Returns column position.
+	{
+		return _metaColumn.position();
+	}
+
+	MetaColumn::ColumnDataType type() const
+		/// Returns column type.
+	{
+		return _metaColumn.type();
+	}
+
+	Iterator begin() const
+		/// Returns iterator pointing to the beginning of data storage vector.
+	{
+		return _pData->begin();
+	}
+
+	Iterator end() const
+		/// Returns iterator pointing to the end of data storage vector.
+	{
+		return _pData->end();
+	}
+
+private:
+	Column();
+
+	MetaColumn   _metaColumn;
+	ContainerPtr _pData;
+};
+
+
+template <>
+class Column<std::vector<bool> >
+	/// The std::vector<bool> specialization for the Column class.
+	/// 
+	/// This specialization is necessary due to the nature of std::vector<bool>.
+	/// For details, see the standard library implementation of vector<bool> 
+	/// or
+	/// S. Meyers: "Effective STL" (Copyright Addison-Wesley 2001),
+	/// Item 18: "Avoid using vector<bool>."
+	/// 
+	/// The workaround employed here is using deque<bool> as an
+	/// internal "companion" container kept in sync with the vector<bool>
+	/// column data.
+{
+public:
+	typedef std::vector<bool>                 Container;
+	typedef Poco::SharedPtr<Container>        ContainerPtr;
+	typedef Container::const_iterator         Iterator;
+	typedef Container::const_reverse_iterator RIterator;
+	typedef Container::size_type              Size;
+
+	Column(const MetaColumn& metaColumn, Container* pData): 
+		_metaColumn(metaColumn), 
+		_pData(pData)
+		/// Creates the Column.
+	{
+		poco_check_ptr (_pData);
+		_deque.assign(_pData->begin(), _pData->end());
+	}
+
+	Column(const Column& col): 
+		_metaColumn(col._metaColumn), 
+		_pData(col._pData)
+		/// Creates the Column.
+	{
+		_deque.assign(_pData->begin(), _pData->end());
+	}
+
+	~Column()
+		/// Destroys the Column.
+	{
+	}
+
+	Column& operator = (const Column& col)
+		/// Assignment operator.
+	{
+		Column tmp(col);
+		swap(tmp);
+		return *this;
+	}
+
+	void swap(Column& other)
+		/// Swaps the column with another one.
+	{
+		using std::swap;
+		swap(_metaColumn, other._metaColumn);
+		swap(_pData, other._pData);
+		swap(_deque, other._deque);
+	}
+
+	Container& data()
+		/// Returns reference to contained data.
+	{
+		return *_pData;
+	}
+
+	const bool& value(std::size_t row) const
+		/// Returns the field value in specified row.
+	{
+		if (_deque.size() < _pData->size())
+			_deque.resize(_pData->size());
+
+		try
+		{
+			return _deque.at(row) = _pData->at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	const bool& operator [] (std::size_t row) const
+		/// Returns the field value in specified row.
+	{
+		return value(row);
+	}
+
+	Size rowCount() const
+		/// Returns number of rows.
+	{
+		return _pData->size();
+	}
+
+	void reset()
+		/// Clears and shrinks the storage.
+	{
+		Container().swap(*_pData);
+		_deque.clear();
+	}
+
+	const std::string& name() const
+		/// Returns column name.
+	{
+		return _metaColumn.name();
+	}
+
+	std::size_t length() const
+		/// Returns column maximum length.
+	{
+		return _metaColumn.length();
+	}
+
+	std::size_t precision() const
+		/// Returns column precision.
+		/// Valid for floating point fields only (zero for other data types).
+	{
+		return _metaColumn.precision();
+	}
+
+	std::size_t position() const
+		/// Returns column position.
+	{
+		return _metaColumn.position();
+	}
+
+	MetaColumn::ColumnDataType type() const
+		/// Returns column type.
+	{
+		return _metaColumn.type();
+	}
+
+	Iterator begin() const
+		/// Returns iterator pointing to the beginning of data storage vector.
+	{
+		return _pData->begin();
+	}
+
+	Iterator end() const
+		/// Returns iterator pointing to the end of data storage vector.
+	{
+		return _pData->end();
+	}
+
+private:
+	Column();
+
+	MetaColumn               _metaColumn;
+	ContainerPtr             _pData;
+	mutable std::deque<bool> _deque;
+};
+
+
+template <class T>
+class Column<std::list<T> >
+	/// Column specialization for std::list
+{
+public:
+	typedef std::list<T>                               Container;
+	typedef Poco::SharedPtr<Container>                 ContainerPtr;
+	typedef typename Container::const_iterator         Iterator;
+	typedef typename Container::const_reverse_iterator RIterator;
+	typedef typename Container::size_type              Size;
+
+	Column(const MetaColumn& metaColumn, std::list<T>* pData): 
+		_metaColumn(metaColumn), 
+		_pData(pData)
+		/// Creates the Column.
+	{
+		poco_check_ptr (_pData);
+	}
+
+	Column(const Column& col):
+		_metaColumn(col._metaColumn),
+		_pData(col._pData)
+		/// Creates the Column.
+	{
+	}
+
+	~Column()
+		/// Destroys the Column.
+	{
+	}
+
+	Column& operator = (const Column& col)
+		/// Assignment operator.
+	{
+		Column tmp(col);
+		swap(tmp);
+		return *this;
+	}
+
+	void swap(Column& other)
+		/// Swaps the column with another one.
+	{
+		using std::swap;
+		swap(_metaColumn, other._metaColumn);
+		swap(_pData, other._pData);
+	}
+
+	Container& data()
+		/// Returns reference to contained data.
+	{
+		return *_pData;
+	}
+
+	const T& value(std::size_t row) const
+		/// Returns the field value in specified row.
+		/// This is the std::list specialization and std::list
+		/// is not the optimal solution for cases where random 
+		/// access is needed.
+		/// However, to allow for compatibility with other
+		/// containers, this functionality is provided here.
+		/// To alleviate the problem, an effort is made
+		/// to start iteration from beginning or end,
+		/// depending on the position requested.
+	{
+		if (row <= (std::size_t) (_pData->size() / 2))
+		{
+			Iterator it = _pData->begin();
+			Iterator end = _pData->end();
+			for (int i = 0; it != end; ++it, ++i)
+				if (i == row) return *it;
+		}
+		else
+		{
+			row = _pData->size() - row;
+			RIterator it = _pData->rbegin();
+			RIterator end = _pData->rend();
+			for (int i = 1; it != end; ++it, ++i)
+				if (i == row) return *it;
+		}
+
+		throw RangeException("Invalid row number."); 
+	}
+
+	const T& operator [] (std::size_t row) const
+		/// Returns the field value in specified row.
+	{
+		return value(row);
+	}
+
+	Size rowCount() const
+		/// Returns number of rows.
+	{
+		return _pData->size();
+	}
+
+	void reset()
+		/// Clears the storage.
+	{
+		_pData->clear();
+	}
+
+	const std::string& name() const
+		/// Returns column name.
+	{
+		return _metaColumn.name();
+	}
+
+	std::size_t length() const
+		/// Returns column maximum length.
+	{
+		return _metaColumn.length();
+	}
+
+	std::size_t precision() const
+		/// Returns column precision.
+		/// Valid for floating point fields only (zero for other data types).
+	{
+		return _metaColumn.precision();
+	}
+
+	std::size_t position() const
+		/// Returns column position.
+	{
+		return _metaColumn.position();
+	}
+
+	MetaColumn::ColumnDataType type() const
+		/// Returns column type.
+	{
+		return _metaColumn.type();
+	}
+
+	Iterator begin() const
+		/// Returns iterator pointing to the beginning of data storage vector.
+	{
+		return _pData->begin();
+	}
+
+	Iterator end() const
+		/// Returns iterator pointing to the end of data storage vector.
+	{
+		return _pData->end();
+	}
+
+private:
+	Column();
+
+	MetaColumn   _metaColumn;
+	ContainerPtr _pData;
+};
+
+
+template <typename C>
+inline void swap(Column<C>& c1, Column<C>& c2)
+{
+	c1.swap(c2);
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Column_INCLUDED
+

+ 56 - 0
ThirdParty/include/Poco/Data/Connector.h

@@ -0,0 +1,56 @@
+//
+// Connector.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Connector
+//
+// Definition of the Connector class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Connector_INCLUDED
+#define Data_Connector_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/SessionImpl.h"
+#include "Poco/AutoPtr.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API Connector
+	/// A Connector creates SessionImpl objects.
+	///
+	/// Every connector library (like the SQLite or the ODBC connector)
+	/// provides a subclass of this class, an instance of which is
+	/// registered with the SessionFactory.
+{
+public:
+	Connector();
+		/// Creates the Connector.
+
+	virtual ~Connector();
+		/// Destroys the Connector.
+
+	virtual const std::string& name() const = 0;
+		/// Returns the name associated with this connector.
+
+	virtual Poco::AutoPtr<SessionImpl> createSession(const std::string& connectionString,
+		std::size_t timeout = SessionImpl::LOGIN_TIMEOUT_DEFAULT) = 0;
+		/// Create a SessionImpl object and initialize it with the given connectionString.
+};
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Connector_INCLUDED

+ 36 - 0
ThirdParty/include/Poco/Data/Constants.h

@@ -0,0 +1,36 @@
+//
+// Data.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Constants
+//
+// Constant definitions for the Poco Data library.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Constants_INCLUDED
+#define Data_Constants_INCLUDED
+
+
+#undef max
+#include <limits>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+static const std::size_t POCO_DATA_INVALID_ROW = std::numeric_limits<std::size_t>::max();
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Constants_INCLUDED

+ 62 - 0
ThirdParty/include/Poco/Data/Data.h

@@ -0,0 +1,62 @@
+//
+// Data.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Data
+//
+// Basic definitions for the Poco Data library.
+// This file must be the first file included by every other Data
+// header file.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Data_INCLUDED
+#define Data_Data_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+//
+// The following block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the Data_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// Data_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+//
+#if defined(_WIN32) && defined(POCO_DLL)
+	#if defined(Data_EXPORTS)
+		#define Data_API __declspec(dllexport)
+	#else
+		#define Data_API __declspec(dllimport)
+	#endif
+#endif
+
+
+#if !defined(Data_API)
+	#if !defined(POCO_NO_GCC_API_ATTRIBUTE) && defined (__GNUC__) && (__GNUC__ >= 4)
+		#define Data_API __attribute__ ((visibility ("default")))
+	#else
+		#define Data_API
+	#endif
+#endif
+
+
+//
+// Automatically link Data library.
+//
+#if defined(_MSC_VER)
+	#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Data_EXPORTS)
+		#pragma comment(lib, "PocoData" POCO_LIB_SUFFIX)
+	#endif
+#endif
+
+
+#endif // Data_Data_INCLUDED

+ 50 - 0
ThirdParty/include/Poco/Data/DataException.h

@@ -0,0 +1,50 @@
+//
+// DataException.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  DataException
+//
+// Definition of the DataException class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_DataException_INCLUDED
+#define Data_DataException_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Exception.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+POCO_DECLARE_EXCEPTION(Data_API, DataException, Poco::IOException)
+POCO_DECLARE_EXCEPTION(Data_API, RowDataMissingException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, UnknownDataBaseException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, UnknownTypeException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, ExecutionException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, BindingException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, ExtractException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, LimitException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, NotSupportedException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, SessionUnavailableException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, SessionPoolExhaustedException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, SessionPoolExistsException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, NoDataException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, LengthExceededException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, ConnectionFailedException, DataException)
+POCO_DECLARE_EXCEPTION(Data_API, NotConnectedException, DataException)
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_DataException_INCLUDED

+ 225 - 0
ThirdParty/include/Poco/Data/Date.h

@@ -0,0 +1,225 @@
+//
+// Date.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Date
+//
+// Definition of the Date class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Date_INCLUDED
+#define Data_Date_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Dynamic/VarHolder.h"
+#include "Poco/Exception.h"
+
+
+namespace Poco {
+
+class DateTime;
+
+namespace Dynamic {
+
+class Var;
+
+}
+
+namespace Data {
+
+
+class Time;
+
+
+class Data_API Date
+	/// Date class wraps a DateTime and exposes date related interface.
+	/// The purpose of this class is binding/extraction support for date fields.
+{
+public:
+	Date();
+		/// Creates the Date
+
+	Date(int year, int month, int day);
+		/// Creates the Date
+
+	Date(const DateTime& dt);
+		/// Creates the Date from DateTime
+
+	~Date();
+		/// Destroys the Date.
+
+	int year() const;
+		/// Returns the year.
+
+	int month() const;
+		/// Returns the month.
+
+	int day() const;
+		/// Returns the day.
+
+	void assign(int year, int month, int day);
+		/// Assigns date.
+
+	Date& operator = (const Date& d);
+		/// Assignment operator for Date.
+
+	Date& operator = (const DateTime& dt);
+		/// Assignment operator for DateTime.
+
+	Date& operator = (const Poco::Dynamic::Var& var);
+		/// Assignment operator for Var.
+
+	bool operator == (const Date& date) const;
+		/// Equality operator.
+
+	bool operator != (const Date& date) const;
+		/// Inequality operator.
+
+	bool operator < (const Date& date) const;
+		/// Less then operator.
+
+	bool operator > (const Date& date) const;
+		/// Greater then operator.
+
+private:
+	int _year;
+	int _month;
+	int _day;
+};
+
+
+//
+// inlines
+//
+inline int Date::year() const
+{
+	return _year;
+}
+
+
+inline int Date::month() const
+{
+	return _month;
+}
+
+
+inline int Date::day() const
+{
+	return _day;
+}
+
+
+inline Date& Date::operator = (const Date& d)
+{
+	assign(d.year(), d.month(), d.day());
+	return *this;
+}
+
+
+inline Date& Date::operator = (const DateTime& dt)
+{
+	assign(dt.year(), dt.month(), dt.day());
+	return *this;
+}
+
+
+inline bool Date::operator == (const Date& date) const
+{
+	return _year == date.year() &&
+		_month == date.month() &&
+		_day == date.day();
+}
+
+
+inline bool Date::operator != (const Date& date) const
+{
+	return !(*this == date);
+}
+
+
+inline bool Date::operator > (const Date& date) const
+{
+	return !(*this == date) && !(*this < date);
+}
+
+
+} } // namespace Poco::Data
+
+
+//
+// VarHolderImpl<Date>
+//
+
+
+namespace Poco {
+namespace Dynamic {
+
+
+template <>
+class VarHolderImpl<Poco::Data::Date>: public VarHolder
+{
+public:
+	VarHolderImpl(const Poco::Data::Date& val): _val(val)
+	{
+	}
+
+	~VarHolderImpl()
+	{
+	}
+	
+	const std::type_info& type() const
+	{
+		return typeid(Poco::Data::Date);
+	}
+
+	void convert(Poco::Timestamp& val) const
+	{
+		DateTime dt;
+		dt.assign(_val.year(), _val.month(), _val.day());
+		val = dt.timestamp();
+	}
+
+	void convert(Poco::DateTime& val) const
+	{
+		val.assign(_val.year(), _val.month(), _val.day());
+	}
+
+	void convert(Poco::LocalDateTime& val) const
+	{
+		val.assign(_val.year(), _val.month(), _val.day());
+	}
+
+	void convert(std::string& val) const
+	{
+		DateTime dt(_val.year(), _val.month(), _val.day());
+		val = DateTimeFormatter::format(dt, "%Y/%m/%d");
+	}
+
+	VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
+	{
+		return cloneHolder(pVarHolder, _val);
+	}
+	
+	const Poco::Data::Date& value() const
+	{
+		return _val;
+	}
+
+private:
+	VarHolderImpl();
+	Poco::Data::Date _val;
+};
+
+
+} } // namespace Poco::Dynamic
+
+
+#endif // Data_Date_INCLUDED

+ 47 - 0
ThirdParty/include/Poco/Data/DynamicDateTime.h

@@ -0,0 +1,47 @@
+//
+// DynamicDateTime.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  DynamicDateTime
+//
+// Definition of the Date and Time cast operators for Poco::Dynamic::Var.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_DynamicDateTime_INCLUDED
+#define Data_DynamicDateTime_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Date.h"
+#include "Poco/Data/Time.h"
+#include "Poco/Dynamic/Var.h"
+
+
+namespace Poco {
+namespace Data {
+
+class Date;
+class Time;
+
+} } // namespace Poco::Data
+
+
+namespace Poco {
+namespace Dynamic {
+
+
+template <> Data_API Var::operator Poco::Data::Date () const;
+template <> Data_API Var::operator Poco::Data::Time () const;
+
+
+} } // namespace Poco::Dynamic
+
+
+#endif // Data_DynamicDateTime_INCLUDED

+ 45 - 0
ThirdParty/include/Poco/Data/DynamicLOB.h

@@ -0,0 +1,45 @@
+//
+// DynamicLOB.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  DynamicLOB
+//
+// Definition of the Poco::Dynamic::Var LOB cast operators.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_DynamicLOB_INCLUDED
+#define Data_DynamicLOB_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/Dynamic/Var.h"
+
+
+namespace Poco {
+namespace Data {
+
+template <typename T> class LOB;
+typedef LOB<unsigned char> BLOB;
+typedef LOB<char> CLOB;
+
+} } // namespace Poco::Data
+
+
+namespace Poco {
+namespace Dynamic {
+
+template <> Data_API Var::operator Poco::Data::CLOB () const;
+template <> Data_API Var::operator Poco::Data::BLOB () const;
+
+} } // namespace Poco::Dynamic
+
+
+#endif // Data_DynamicLOB_INCLUDED

+ 869 - 0
ThirdParty/include/Poco/Data/Extraction.h

@@ -0,0 +1,869 @@
+//
+// Extraction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Extraction
+//
+// Definition of the Extraction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Extraction_INCLUDED
+#define Data_Extraction_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractExtraction.h"
+#include "Poco/Data/Preparation.h"
+#include "Poco/Data/TypeHandler.h"
+#include "Poco/Data/Column.h"
+#include "Poco/Data/Position.h"
+#include "Poco/Data/DataException.h"
+#include <set>
+#include <vector>
+#include <list>
+#include <deque>
+#include <map>
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <class T>
+class Extraction: public AbstractExtraction
+	/// Concrete Data Type specific extraction of values from a query result set.
+{
+public:
+	typedef T                   ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(T& result, const Position& pos = Position(0)):
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(), 
+		_extracted(false),
+		_null(false)
+		/// Creates an Extraction object at specified position.
+		/// Uses an empty object T as default value.
+	{
+	}
+
+	Extraction(T& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def), 
+		_extracted(false),
+		_null(false)
+		/// Creates an Extraction object at specified position.
+		/// Uses the provided def object as default value.
+	{
+	}
+
+	~Extraction()
+		/// Destroys the Extraction object.
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _extracted ? 1u : 0;
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return 1u;
+	}
+
+	bool isNull(std::size_t row = 0) const
+	{
+		return _null;
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		if (_extracted) throw ExtractException("value already extracted");
+		_extracted = true;
+		AbstractExtractor::Ptr pExt = getExtractor();
+		TypeHandler<T>::extract(pos, _rResult, _default, pExt);
+		_null = isValueNull<T>(_rResult, pExt->isNull(pos));
+		
+		return 1u;
+	}
+
+	void reset()
+	{
+		_extracted = false;
+	}
+
+	bool canExtract() const
+	{
+		return !_extracted;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _rResult);
+	}
+
+private:
+	T&   _rResult;
+	T    _default;
+	bool _extracted;
+	bool _null;
+};
+
+
+template <class T>
+class Extraction<std::vector<T> >: public AbstractExtraction
+	/// Vector Data Type specialization for extraction of values from a query result set.
+{
+public:
+	
+	typedef std::vector<T>      ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::vector<T>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::vector<T>& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	virtual ~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		try
+		{
+			return _nulls.at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		AbstractExtractor::Ptr pExt = getExtractor();
+		_rResult.push_back(_default);
+		TypeHandler<T>::extract(pos, _rResult.back(), _default, pExt);
+		_nulls.push_back(isValueNull(_rResult.back(), pExt->isNull(pos)));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _default);
+	}
+
+	void reset()
+	{
+		_nulls.clear();
+	}
+
+protected:
+
+	const std::vector<T>& result() const
+	{
+		return _rResult;
+	}
+
+private:
+	std::vector<T>&  _rResult;
+	T                _default;
+	std::deque<bool> _nulls;
+};
+
+
+template <>
+class Extraction<std::vector<bool> >: public AbstractExtraction
+	/// Vector bool specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::vector<bool>   ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::vector<bool>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::vector<bool>& result, const bool& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	virtual ~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<bool>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		try
+		{
+			return _nulls.at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		AbstractExtractor::Ptr pExt = getExtractor();
+
+		bool tmp = _default;
+		TypeHandler<bool>::extract(pos, tmp, _default, pExt);
+		_rResult.push_back(tmp);
+		_nulls.push_back(pExt->isNull(pos));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<bool>(pPrep, pos, _default);
+	}
+
+	void reset()
+	{
+		_nulls.clear();
+	}
+
+protected:
+
+	const std::vector<bool>& result() const
+	{
+		return _rResult;
+	}
+
+private:
+	std::vector<bool>& _rResult;
+	bool               _default;
+	std::deque<bool>   _nulls;
+};
+
+
+template <class T>
+class Extraction<std::list<T> >: public AbstractExtraction
+	/// List Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::list<T>        ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::list<T>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::list<T>& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	virtual ~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _rResult.size();
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		try
+		{
+			return _nulls.at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		AbstractExtractor::Ptr pExt = getExtractor();
+		_rResult.push_back(_default);
+		TypeHandler<T>::extract(pos, _rResult.back(), _default, pExt);
+		_nulls.push_back(isValueNull(_rResult.back(), pExt->isNull(pos)));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _default);
+	}
+
+	void reset()
+	{
+		_nulls.clear();
+	}
+
+protected:
+
+	const std::list<T>& result() const
+	{
+		return _rResult;
+	}
+
+private:
+	std::list<T>&    _rResult;
+	T                _default;
+	std::deque<bool> _nulls;
+};
+
+
+template <class T>
+class Extraction<std::deque<T> >: public AbstractExtraction
+	/// Deque Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::deque<T>       ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::deque<T>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::deque<T>& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	virtual ~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return _rResult.size();
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		try
+		{
+			return _nulls.at(row);
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		AbstractExtractor::Ptr pExt = getExtractor();
+		_rResult.push_back(_default);
+		TypeHandler<T>::extract(pos, _rResult.back(), _default, pExt);
+		_nulls.push_back(isValueNull(_rResult.back(), pExt->isNull(pos)));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _default);
+	}
+
+	void reset()
+	{
+		_nulls.clear();
+	}
+
+protected:
+
+	const std::deque<T>& result() const
+	{
+		return _rResult;
+	}
+
+private:
+	std::deque<T>&   _rResult;
+	T                _default;
+	std::deque<bool> _nulls;
+};
+
+
+template <class C>
+class InternalExtraction: public Extraction<C>
+	/// Container Data Type specialization extension for extraction of values from a query result set.
+	///
+	/// This class is intended for PocoData internal use - it is used by StatementImpl 
+	/// to automaticaly create internal Extraction in cases when statement returns data and no external storage
+	/// was supplied. It is later used by RecordSet to retrieve the fetched data after statement execution.
+	/// It takes ownership of the Column pointer supplied as constructor argument. Column object, in turn
+	/// owns the data container pointer.
+	///
+	/// InternalExtraction objects can not be copied or assigned.
+{
+public:
+	typedef typename C::value_type ValType;
+	typedef SharedPtr<ValType>     ValPtr;
+	typedef Extraction<ValType>    Type;
+	typedef SharedPtr<Type>        Ptr;
+
+
+	InternalExtraction(C& result, Column<C>* pColumn, const Position& pos = Position(0)): 
+		Extraction<C>(result, ValType(), pos), 
+		_pColumn(pColumn)
+		/// Creates InternalExtraction.
+	{
+	}
+
+	~InternalExtraction()
+		/// Destroys InternalExtraction.
+	{
+		delete _pColumn;
+	}
+
+	void reset()
+	{
+		Extraction<C>::reset();
+		_pColumn->reset();
+	}	
+
+	const ValType& value(int index) const
+	{
+		try
+		{ 
+			return Extraction<C>::result().at(index); 
+		}
+		catch (std::out_of_range& ex)
+		{ 
+			throw RangeException(ex.what()); 
+		}
+	}
+
+	bool isNull(std::size_t row) const
+	{
+		return Extraction<C>::isNull(row);
+	}
+
+	const Column<C>& column() const
+	{
+		return *_pColumn;
+	}
+
+private:
+	InternalExtraction();
+	InternalExtraction(const InternalExtraction&);
+	InternalExtraction& operator = (const InternalExtraction&);
+
+	Column<C>* _pColumn;
+};
+
+
+template <class T>
+class Extraction<std::set<T> >: public AbstractExtraction
+	/// Set Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::set<T>                ValType;
+	typedef SharedPtr<ValType>         ValPtr;
+	typedef Extraction<ValType>        Type;
+	typedef SharedPtr<Type>            Ptr;
+	typedef typename ValType::iterator Iterator;
+
+	Extraction(std::set<T>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::set<T>& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		T tmp;
+		TypeHandler<T>::extract(pos, tmp, _default, getExtractor());
+		_rResult.insert(tmp);
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _default);
+	}
+
+private:
+	std::set<T>& _rResult;
+	T            _default;
+};
+
+
+template <class T>
+class Extraction<std::multiset<T> >: public AbstractExtraction
+	/// Multiset Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::multiset<T>    ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::multiset<T>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::multiset<T>& result, const T& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<T>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		T tmp;
+		TypeHandler<T>::extract(pos, tmp, _default, getExtractor());
+		_rResult.insert(tmp);
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<T>(pPrep, pos, _default);
+	}
+
+private:
+	std::multiset<T>& _rResult;
+	T                 _default;
+};
+
+
+template <class K, class V>
+class Extraction<std::map<K, V> >: public AbstractExtraction
+	/// Map Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::map<K, V>      ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::map<K, V>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::map<K, V>& result, const V& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		V tmp;
+		TypeHandler<V>::extract(pos, tmp, _default, getExtractor());
+		_rResult.insert(std::make_pair(tmp(), tmp));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<V>(pPrep, pos, _default);
+	}
+
+private:
+	std::map<K, V>& _rResult;
+	V               _default;
+};
+
+
+template <class K, class V>
+class Extraction<std::multimap<K, V> >: public AbstractExtraction
+	/// Multimap Data Type specialization for extraction of values from a query result set.
+{
+public:
+	typedef std::multimap<K, V> ValType;
+	typedef SharedPtr<ValType>  ValPtr;
+	typedef Extraction<ValType> Type;
+	typedef SharedPtr<Type>     Ptr;
+
+	Extraction(std::multimap<K, V>& result, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default()
+	{
+		_rResult.clear();
+	}
+
+	Extraction(std::multimap<K, V>& result, const V& def, const Position& pos = Position(0)): 
+		AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
+		_rResult(result), 
+		_default(def)
+	{
+		_rResult.clear();
+	}
+
+	~Extraction()
+	{
+	}
+
+	std::size_t numOfColumnsHandled() const
+	{
+		return TypeHandler<V>::size();
+	}
+
+	std::size_t numOfRowsHandled() const
+	{
+		return static_cast<std::size_t>(_rResult.size());
+	}
+
+	std::size_t numOfRowsAllowed() const
+	{
+		return getLimit();
+	}
+
+	std::size_t extract(std::size_t pos)
+	{
+		V tmp;
+		TypeHandler<V>::extract(pos, tmp, _default, getExtractor());
+		_rResult.insert(std::make_pair(tmp(), tmp));
+		return 1u;
+	}
+
+	AbstractPreparation::Ptr createPreparation(AbstractPreparator::Ptr& pPrep, std::size_t pos)
+	{
+		return new Preparation<V>(pPrep, pos, _default);
+	}
+
+private:
+	std::multimap<K, V>& _rResult;
+	V                    _default;
+};
+
+
+namespace Keywords {
+
+
+template <typename T> 
+inline AbstractExtraction::Ptr into(T& t)
+	/// Convenience function to allow for a more compact creation of an extraction object.
+{
+	return new Extraction<T>(t);
+}
+
+
+template <typename T> 
+inline AbstractExtraction::Ptr into(T& t, const Position& pos)
+	/// Convenience function to allow for a more compact creation of an extraction object
+	/// with multiple recordset support.
+{
+	return new Extraction<T>(t, pos);
+}
+
+
+template <typename T> 
+inline AbstractExtraction::Ptr into(T& t, const Position& pos, const T& def)
+	/// Convenience function to allow for a more compact creation of an extraction object 
+	/// with multiple recordset support and the given default
+{
+	return new Extraction<T>(t, def, pos);
+}
+
+
+inline AbstractExtractionVecVec& into(AbstractExtractionVecVec& evv)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return evv;
+}
+
+
+inline AbstractExtractionVec& into(AbstractExtractionVec& ev)
+	/// Convenience dummy function (for syntax purposes only).
+{
+	return ev;
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Extraction_INCLUDED

+ 309 - 0
ThirdParty/include/Poco/Data/LOB.h

@@ -0,0 +1,309 @@
+//
+// LOB.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  LOB
+//
+// Definition of the LOB class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_LOB_INCLUDED
+#define Data_LOB_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/Dynamic/VarHolder.h"
+#include "Poco/Exception.h"
+#include <vector>
+#include <algorithm>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <typename T>
+class LOB
+	/// Representation of a Large OBject.
+	///
+	/// A LOB can hold arbitrary data.
+	/// The maximum size depends on the underlying database.
+	///
+	/// The LOBInputStream and LOBOutputStream classes provide
+	/// a convenient way to access the data in a LOB.
+{
+public:
+	typedef typename std::vector<T>::const_iterator Iterator;
+	typedef T ValueType;
+	typedef typename std::vector<T> Container;
+	typedef Poco::SharedPtr<Container> ContentPtr;
+
+	LOB(): _pContent(new std::vector<T>())
+		/// Creates an empty LOB.
+	{
+	}
+
+	LOB(const std::vector<T>& content):
+		_pContent(new std::vector<T>(content))
+		/// Creates the LOB, content is deep-copied.
+	{
+	}
+
+	LOB(const T* const pContent, std::size_t size):
+		_pContent(new std::vector<T>(pContent, pContent + size))
+		/// Creates the LOB by deep-copying pContent.
+	{
+	}
+
+	LOB(const std::basic_string<T>& content):
+		_pContent(new std::vector<T>(content.begin(), content.end()))
+		/// Creates a LOB from a string.
+	{
+	}
+
+	LOB(const LOB& other): _pContent(other._pContent)
+		/// Creates a LOB by copying another one.
+	{
+	}
+
+	~LOB()
+		/// Destroys the LOB.
+	{
+	}
+
+	LOB& operator = (const LOB& other)
+		/// Assignment operator.
+	{
+		LOB tmp(other);
+		swap(tmp);
+		return *this;
+	}
+
+	bool operator == (const LOB& other) const
+		/// Compares for equality LOB by value.
+	{
+		return *_pContent == *other._pContent;
+	}
+
+	bool operator != (const LOB& other) const
+		/// Compares for inequality LOB by value.
+	{
+		return *_pContent != *other._pContent;
+	}
+
+	void swap(LOB& other)
+		/// Swaps the LOB with another one.
+	{
+		using std::swap;
+		swap(_pContent, other._pContent);
+	}
+
+	const std::vector<T>& content() const
+		/// Returns the content.
+	{
+		return *_pContent;
+	}
+
+	const T* rawContent() const
+		/// Returns the raw content.
+		///
+		/// If the LOB is empty, returns NULL.
+	{
+		if (_pContent->empty())
+			return 0;
+		else
+			return &(*_pContent)[0];
+	}
+
+	void assignVal(std::size_t count, const T& val)
+		/// Assigns raw content to internal storage.
+	{
+		ContentPtr tmp = new Container(count, val);
+		_pContent.swap(tmp);
+	}
+
+	void assignRaw(const T* ptr, std::size_t count)
+		/// Assigns raw content to internal storage.
+	{
+		poco_assert_dbg (ptr);
+		LOB tmp(ptr, count);
+		swap(tmp);
+	}
+
+	void appendRaw(const T* pChar, std::size_t count)
+		/// Assigns raw content to internal storage.
+	{
+		poco_assert_dbg (pChar);
+		_pContent->insert(_pContent->end(), pChar, pChar+count);
+	}
+
+	void clear(bool doCompact = false)
+		/// Clears the content of the blob.
+		/// If doCompact is true, trims the excess capacity.
+	{
+		_pContent->clear();
+		if (doCompact) compact();
+	}
+
+	void compact()
+		/// Trims the internal storage excess capacity.
+	{
+		std::vector<T>(*_pContent).swap(*_pContent);
+	}
+
+	Iterator begin() const
+	{
+		return _pContent->begin();
+	}
+
+	Iterator end() const
+	{
+		return _pContent->end();
+	}
+
+	std::size_t size() const
+		/// Returns the size of the LOB in bytes.
+	{
+		return static_cast<std::size_t>(_pContent->size());
+	}
+
+private:
+	ContentPtr _pContent;
+};
+
+
+typedef LOB<unsigned char> BLOB;
+typedef LOB<char> CLOB;
+
+
+//
+// inlines
+//
+
+template <typename T>
+inline void swap(LOB<T>& b1, LOB<T>& b2)
+{
+	b1.swap(b2);
+}
+
+
+} } // namespace Poco::Data
+
+
+namespace std
+{
+	template<>
+	inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1, 
+		Poco::Data::BLOB& b2)
+		/// Full template specalization of std:::swap for BLOB
+	{
+		b1.swap(b2);
+	}
+
+	template<>
+	inline void swap<Poco::Data::CLOB>(Poco::Data::CLOB& c1, 
+		Poco::Data::CLOB& c2)
+		/// Full template specalization of std:::swap for CLOB
+	{
+		c1.swap(c2);
+	}
+}
+
+
+//
+// VarHolderImpl<LOB>
+//
+
+
+namespace Poco {
+namespace Dynamic {
+
+
+template <>
+class VarHolderImpl<Poco::Data::BLOB>: public VarHolder
+{
+public:
+	VarHolderImpl(const Poco::Data::BLOB& val): _val(val)
+	{
+	}
+
+	~VarHolderImpl()
+	{
+	}
+	
+	const std::type_info& type() const
+	{
+		return typeid(Poco::Data::BLOB);
+	}
+
+	void convert(std::string& val) const
+	{
+		val.assign(_val.begin(), _val.end());
+	}
+
+	VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
+	{
+		return cloneHolder(pVarHolder, _val);
+	}
+	
+	const Poco::Data::BLOB& value() const
+	{
+		return _val;
+	}
+
+private:
+	VarHolderImpl();
+	Poco::Data::BLOB _val;
+};
+
+
+template <>
+class VarHolderImpl<Poco::Data::CLOB>: public VarHolder
+{
+public:
+	VarHolderImpl(const Poco::Data::CLOB& val): _val(val)
+	{
+	}
+
+	~VarHolderImpl()
+	{
+	}
+	
+	const std::type_info& type() const
+	{
+		return typeid(Poco::Data::CLOB);
+	}
+
+	void convert(std::string& val) const
+	{
+		val.assign(_val.begin(), _val.end());
+	}
+
+	VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
+	{
+		return cloneHolder(pVarHolder, _val);
+	}
+	
+	const Poco::Data::CLOB& value() const
+	{
+		return _val;
+	}
+
+private:
+	VarHolderImpl();
+	Poco::Data::CLOB _val;
+};
+
+
+} } // namespace Poco::Dynamic
+
+
+#endif // Data_LOB_INCLUDED

+ 150 - 0
ThirdParty/include/Poco/Data/LOBStream.h

@@ -0,0 +1,150 @@
+//
+// LOBStream.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  LOBStream
+//
+// Definition of the LOBStream class.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_LOBStream_INCLUDED
+#define Data_LOBStream_INCLUDED
+
+
+#include "Poco/Foundation.h"
+#include "Poco/UnbufferedStreamBuf.h"
+#include "Poco/Data/LOB.h"
+#include <istream>
+#include <ostream>
+
+
+namespace Poco {
+namespace Data {
+
+
+template <typename T>
+class LOBStreamBuf: public BasicUnbufferedStreamBuf<T, std::char_traits<T> >
+	/// This is the streambuf class used for reading from and writing to a LOB.
+{
+public:	
+	LOBStreamBuf(LOB<T>& lob): _lob(lob), _it(_lob.begin())
+		/// Creates LOBStreamBuf.
+	{
+	}
+
+
+	~LOBStreamBuf()
+		/// Destroys LOBStreamBuf.
+	{
+	}
+
+protected:
+	typedef std::char_traits<T> TraitsType;
+	typedef BasicUnbufferedStreamBuf<T, TraitsType> BaseType;
+
+	typename BaseType::int_type readFromDevice()
+	{
+		if (_it != _lob.end())
+			return BaseType::charToInt(*_it++);
+		else
+			return -1;
+	}
+
+	typename BaseType::int_type writeToDevice(T c)
+	{
+		_lob.appendRaw(&c, 1);
+		return 1;
+	}
+
+private:
+	LOB<T>& _lob;
+	typename LOB<T>::Iterator _it;
+};
+
+
+template <typename T>
+class LOBIOS: public virtual std::ios
+	/// The base class for LOBInputStream and
+	/// LOBOutputStream.
+	///
+	/// This class is needed to ensure the correct initialization
+	/// order of the stream buffer and base classes.
+{
+public:
+	LOBIOS(LOB<T>& lob, openmode mode): _buf(lob)
+		/// Creates the LOBIOS with the given LOB.
+	{
+		poco_ios_init(&_buf);
+	}
+
+	~LOBIOS()
+		/// Destroys the LOBIOS.
+	{
+	}
+
+	LOBStreamBuf<T>* rdbuf()
+		/// Returns a pointer to the internal LOBStreamBuf.
+	{
+		return &_buf;
+	}
+
+protected:
+	LOBStreamBuf<T> _buf;
+};
+
+
+template <typename T>
+class LOBOutputStream: public LOBIOS<T>, public std::basic_ostream<T, std::char_traits<T> >
+	/// An output stream for writing to a LOB.
+{
+public:
+	LOBOutputStream(LOB<T>& lob):
+		LOBIOS<T>(lob, std::ios::out),
+		std::ostream(LOBIOS<T>::rdbuf())
+		/// Creates the LOBOutputStream with the given LOB.
+	{
+	}
+
+	~LOBOutputStream()
+		/// Destroys the LOBOutputStream.
+	{
+	}
+};
+
+
+template <typename T>
+class LOBInputStream: public LOBIOS<T>, public std::basic_istream<T, std::char_traits<T> >
+	/// An input stream for reading from a LOB.
+{
+public:
+	LOBInputStream(LOB<T>& lob):
+		LOBIOS<T>(lob, std::ios::in),
+		std::istream(LOBIOS<T>::rdbuf())
+		/// Creates the LOBInputStream with the given LOB.
+	{
+	}
+
+	~LOBInputStream()
+		/// Destroys the LOBInputStream.
+	{
+	}
+};
+
+
+typedef LOBOutputStream<unsigned char> BLOBOutputStream;
+typedef LOBOutputStream<char> CLOBOutputStream;
+
+typedef LOBInputStream<unsigned char> BLOBInputStream;
+typedef LOBInputStream<char> CLOBInputStream;
+
+} } // namespace Poco::Data
+
+
+#endif // Data_LOBStream_INCLUDED

+ 113 - 0
ThirdParty/include/Poco/Data/Limit.h

@@ -0,0 +1,113 @@
+//
+// Limit.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Limit
+//
+// Definition of the Limit class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Limit_INCLUDED
+#define Data_Limit_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API Limit
+	/// Limit stores information how many rows a query should return.
+{
+public:
+	typedef Poco::UInt32 SizeT;
+
+	enum Type
+	{
+		LIMIT_UNLIMITED = ~((SizeT) 0)
+	};
+	
+	Limit(SizeT value, bool hardLimit = false, bool isLowerLimit = false);
+		/// Creates the Limit. 
+		///
+		/// Value contains the upper row hint, if hardLimit is set to true, the limit acts as a hard
+		/// border, ie. every query must return exactly value rows, returning more than value objects will throw an exception!
+		/// LowerLimits always act as hard-limits!
+		///
+		/// A value of LIMIT_UNLIMITED disables the limit.
+
+	~Limit();
+		/// Destroys the Limit.
+
+	SizeT value() const;
+		/// Returns the value of the limit
+
+	bool isHardLimit() const;
+		/// Returns true if the limit is a hard limit.
+
+	bool isLowerLimit() const;
+		/// Returns true if the limit is a lower limit, otherwise it is an upperLimit
+
+	bool operator == (const Limit& other) const;
+		/// Equality operator.
+
+	bool operator != (const Limit& other) const;
+		/// Inequality operator.
+
+private:
+	SizeT _value;
+	bool  _hardLimit;
+	bool  _isLowerLimit;
+};
+
+
+//
+// inlines
+//
+inline Poco::UInt32 Limit::value() const
+{
+	return _value;
+}
+
+
+inline bool Limit::isHardLimit() const
+{
+	return _hardLimit;
+}
+
+
+inline bool Limit::isLowerLimit() const
+{
+	return _isLowerLimit;
+}
+
+
+inline bool Limit::operator == (const Limit& other) const
+{
+	return other._value == _value &&
+		other._hardLimit == _hardLimit &&
+		other._isLowerLimit == _isLowerLimit;
+}
+
+
+inline bool Limit::operator != (const Limit& other) const
+{
+	return other._value != _value ||
+		other._hardLimit != _hardLimit ||
+		other._isLowerLimit != _isLowerLimit;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Limit_INCLUDED

+ 188 - 0
ThirdParty/include/Poco/Data/MetaColumn.h

@@ -0,0 +1,188 @@
+//
+// MetaColumn.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  MetaColumn
+//
+// Definition of the MetaColumn class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_MetaColumn_INCLUDED
+#define Data_MetaColumn_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include <cstddef>
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API MetaColumn
+	/// MetaColumn class contains column metadata information.
+{
+public:
+	enum ColumnDataType
+	{
+		FDT_BOOL,
+		FDT_INT8,
+		FDT_UINT8,
+		FDT_INT16,
+		FDT_UINT16,
+		FDT_INT32,
+		FDT_UINT32,
+		FDT_INT64,
+		FDT_UINT64,
+		FDT_FLOAT,
+		FDT_DOUBLE,
+		FDT_STRING,
+		FDT_WSTRING,
+		FDT_BLOB,
+		FDT_CLOB,
+		FDT_DATE,
+		FDT_TIME,
+		FDT_TIMESTAMP,
+		FDT_UNKNOWN
+	};
+
+	MetaColumn();
+		/// Creates the MetaColumn.
+
+	explicit MetaColumn(std::size_t position,
+		const std::string& name = "",
+		ColumnDataType type = FDT_UNKNOWN,
+		std::size_t length = 0,
+		std::size_t precision = 0,
+		bool nullable = false);
+		/// Creates the MetaColumn.
+
+	virtual ~MetaColumn();
+		/// Destroys the MetaColumn.
+
+	const std::string& name() const;
+		/// Returns column name.
+
+	std::size_t length() const;
+		/// Returns column maximum length.
+
+	std::size_t precision() const;
+		/// Returns column precision.
+		/// Valid for floating point fields only
+		/// (zero for other data types).
+
+	std::size_t position() const;
+		/// Returns column position.
+
+	ColumnDataType type() const;
+		/// Returns column type.
+
+	bool isNullable() const;
+		/// Returns true if column allows null values, false otherwise.
+
+protected:
+	void setName(const std::string& name);
+		/// Sets the column name.
+
+	void setLength(std::size_t length);
+		/// Sets the column length.
+
+	void setPrecision(std::size_t precision);
+		/// Sets the column precision.
+
+	void setType(ColumnDataType type);
+		/// Sets the column data type.
+
+	void setNullable(bool nullable);
+		/// Sets the column nullability.
+
+private:
+	std::string     _name;
+	std::size_t     _length;
+	std::size_t     _precision;
+	std::size_t     _position;
+	ColumnDataType  _type;
+	bool            _nullable;
+};
+
+
+///
+/// inlines
+///
+inline const std::string& MetaColumn::name() const
+{
+	return _name;
+}
+
+
+inline std::size_t MetaColumn::length() const
+{
+	return _length;
+}
+
+
+inline std::size_t MetaColumn::precision() const
+{
+	return _precision;
+}
+
+
+inline std::size_t MetaColumn::position() const
+{
+	return _position;
+}
+
+
+inline MetaColumn::ColumnDataType MetaColumn::type() const
+{
+	return _type;
+}
+
+
+inline bool MetaColumn::isNullable() const
+{
+	return _nullable;
+}
+
+
+inline void MetaColumn::setName(const std::string& name)
+{
+	_name = name;
+}
+
+
+inline void MetaColumn::setLength(std::size_t length)
+{
+	_length = length;
+}
+
+
+inline void MetaColumn::setPrecision(std::size_t precision)
+{
+	_precision = precision;
+}
+
+
+inline void MetaColumn::setType(ColumnDataType type)
+{
+	_type = type;
+}
+
+
+inline void MetaColumn::setNullable(bool nullable)
+{
+	_nullable = nullable;
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_MetaColumn_INCLUDED

+ 99 - 0
ThirdParty/include/Poco/Data/PooledSessionHolder.h

@@ -0,0 +1,99 @@
+//
+// PooledSessionHolder.h
+//
+// Library: Data
+// Package: SessionPooling
+// Module:  PooledSessionHolder
+//
+// Definition of the PooledSessionHolder class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_PooledSessionHolder_INCLUDED
+#define Data_PooledSessionHolder_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/SessionImpl.h"
+#include "Poco/AutoPtr.h"
+#include "Poco/Timestamp.h"
+#include "Poco/Mutex.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class SessionPool;
+
+
+class Data_API PooledSessionHolder: public Poco::RefCountedObject
+	/// This class is used by SessionPool to manage SessionImpl objects.
+{
+public:
+	PooledSessionHolder(SessionPool& owner, SessionImpl* pSessionImpl);
+		/// Creates the PooledSessionHolder.
+
+	~PooledSessionHolder();
+		/// Destroys the PooledSessionHolder.
+
+	SessionImpl* session();
+		/// Returns a pointer to the SessionImpl.
+
+	SessionPool& owner();
+		/// Returns a reference to the SessionHolder's owner.
+
+	void access();
+		/// Updates the last access timestamp.
+
+	int idle() const;
+		/// Returns the number of seconds the session has not been used.
+
+private:
+	SessionPool& _owner;
+	Poco::AutoPtr<SessionImpl> _pImpl;
+	Poco::Timestamp _lastUsed;
+	mutable Poco::FastMutex _mutex;
+};
+
+
+//
+// inlines
+//
+inline SessionImpl* PooledSessionHolder::session()
+{
+	return _pImpl;
+}
+
+
+inline SessionPool& PooledSessionHolder::owner()
+{
+	return _owner;
+}
+
+
+inline void PooledSessionHolder::access()
+{
+	Poco::FastMutex::ScopedLock lock(_mutex);
+	
+	_lastUsed.update();
+}
+
+
+inline int PooledSessionHolder::idle() const
+{
+	Poco::FastMutex::ScopedLock lock(_mutex);
+
+	return (int) (_lastUsed.elapsed()/Poco::Timestamp::resolution());
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_PooledSessionHolder_INCLUDED

+ 97 - 0
ThirdParty/include/Poco/Data/PooledSessionImpl.h

@@ -0,0 +1,97 @@
+//
+// PooledSessionImpl.h
+//
+// Library: Data
+// Package: SessionPooling
+// Module:  PooledSessionImpl
+//
+// Definition of the PooledSessionImpl class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_PooledSessionImpl_INCLUDED
+#define Data_PooledSessionImpl_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/SessionImpl.h"
+#include "Poco/Data/PooledSessionHolder.h"
+#include "Poco/AutoPtr.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class SessionPool;
+
+
+class Data_API PooledSessionImpl: public SessionImpl
+	/// PooledSessionImpl is a decorator created by
+	/// SessionPool that adds session pool
+	/// management to SessionImpl objects.
+{
+public:
+	PooledSessionImpl(PooledSessionHolder* pHolder);
+		/// Creates the PooledSessionImpl.
+
+	~PooledSessionImpl();
+		/// Destroys the PooledSessionImpl.
+
+	// SessionImpl
+	StatementImpl* createStatementImpl();
+	void begin();
+	void commit();
+	void rollback();
+	void open(const std::string& connect = "");
+	void close();
+	bool isConnected();
+	void setConnectionTimeout(std::size_t timeout);
+	std::size_t getConnectionTimeout();
+	bool canTransact();
+	bool isTransaction();
+	void setTransactionIsolation(Poco::UInt32);
+	Poco::UInt32 getTransactionIsolation();
+	bool hasTransactionIsolation(Poco::UInt32);
+	bool isTransactionIsolation(Poco::UInt32);
+	const std::string& connectorName() const;
+	void setFeature(const std::string& name, bool state);	
+	bool getFeature(const std::string& name);
+	void setProperty(const std::string& name, const Poco::Any& value);
+	Poco::Any getProperty(const std::string& name);
+	
+protected:
+	SessionImpl* access() const;
+		/// Updates the last access timestamp,
+		/// verifies validity of the session
+		/// and returns the session if it is valid.
+		///
+		/// Throws an SessionUnavailableException if the
+		/// session is no longer valid.
+		
+	SessionImpl* impl() const;
+		/// Returns a pointer to the SessionImpl.
+				
+private:	
+	mutable Poco::AutoPtr<PooledSessionHolder> _pHolder;
+};
+
+
+//
+// inlines
+//
+inline SessionImpl* PooledSessionImpl::impl() const
+{
+	return _pHolder->session();
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_PooledSessionImpl_INCLUDED

+ 75 - 0
ThirdParty/include/Poco/Data/Position.h

@@ -0,0 +1,75 @@
+//
+// PositionExtraction.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Position
+//
+// Definition of the PositionExtraction class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Position_INCLUDED
+#define Data_Position_INCLUDED
+
+
+#include "Poco/Data/Limit.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API Position
+	/// Utility class wrapping unsigned integer. Used to
+	/// indicate the recordset position in batch SQL statements.
+{
+public:
+	Position(Poco::UInt32 value);
+		/// Creates the Position.
+
+	~Position();
+		/// Destroys the Position.
+
+	Poco::UInt32 value() const;
+		/// Returns the position value.
+	
+private:
+	Position();
+
+	Poco::UInt32 _value;
+};
+
+
+///
+/// inlines
+///
+inline Poco::UInt32 Position::value() const 
+{ 
+	return _value; 
+}
+
+
+namespace Keywords {
+
+
+template <typename T>
+inline Position from(const T& value)
+	/// Convenience function for creation of position.
+{
+	return Position(value);
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Position_INCLUDED

+ 161 - 0
ThirdParty/include/Poco/Data/Preparation.h

@@ -0,0 +1,161 @@
+//
+// Preparation.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Preparation
+//
+// Definition of the Preparation class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Preparation_INCLUDED
+#define Data_Preparation_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/AbstractPreparation.h"
+#include "Poco/Data/TypeHandler.h"
+#include <cstddef>
+#include <vector>
+
+
+namespace Poco {
+namespace Data {
+
+
+template<typename T>
+class Preparation: public AbstractPreparation
+	/// Class for calling the appropriate AbstractPreparator method.
+{
+public:
+	Preparation(AbstractPreparator::Ptr& pPreparator, std::size_t pos, T& val): 
+		AbstractPreparation(pPreparator), 
+		_pos(pos), 
+		_val(val)
+		/// Creates the Preparation.
+	{
+	}
+
+	~Preparation()
+		/// Destroys the Preparation.
+	{
+	}
+
+	void prepare()
+		/// Prepares data.
+	{
+		TypeHandler<T>::prepare(_pos, _val, preparation());
+	}
+
+private:
+	std::size_t _pos;
+	T&          _val;
+};
+
+
+template<typename T>
+class Preparation<std::vector<T> >: public AbstractPreparation
+	/// Preparation specialization for std::vector.
+	/// This specialization is needed for bulk operations to enforce
+	/// the whole vector preparation, rather than only individual contained values.
+{
+public:
+	Preparation(AbstractPreparator::Ptr pPreparator, std::size_t pos, std::vector<T>& val = std::vector<T>()): 
+		AbstractPreparation(pPreparator), 
+		_pos(pos), 
+		_val(val)
+		/// Creates the Preparation.
+	{
+	}
+
+	~Preparation()
+		/// Destroys the Preparation.
+	{
+	}
+
+	void prepare()
+		/// Prepares data.
+	{
+		TypeHandler<std::vector<T> >::prepare(_pos, _val, preparation());
+	}
+
+private:
+	std::size_t     _pos;
+	std::vector<T>& _val;
+};
+
+
+template<typename T>
+class Preparation<std::deque<T> >: public AbstractPreparation
+	/// Preparation specialization for std::deque.
+	/// This specialization is needed for bulk operations to enforce
+	/// the whole deque preparation, rather than only individual contained values.
+{
+public:
+	Preparation(AbstractPreparator::Ptr pPreparator, std::size_t pos, std::deque<T>& val = std::deque<T>()): 
+		AbstractPreparation(pPreparator), 
+		_pos(pos), 
+		_val(val)
+		/// Creates the Preparation.
+	{
+	}
+
+	~Preparation()
+		/// Destroys the Preparation.
+	{
+	}
+
+	void prepare()
+		/// Prepares data.
+	{
+		TypeHandler<std::deque<T> >::prepare(_pos, _val, preparation());
+	}
+
+private:
+	std::size_t     _pos;
+	std::deque<T>&  _val;
+};
+
+
+template<typename T>
+class Preparation<std::list<T> >: public AbstractPreparation
+	/// Preparation specialization for std::list.
+	/// This specialization is needed for bulk operations to enforce
+	/// the whole list preparation, rather than only individual contained values.
+{
+public:
+	Preparation(AbstractPreparator::Ptr pPreparator, std::size_t pos, std::list<T>& val = std::list<T>()): 
+		AbstractPreparation(pPreparator), 
+		_pos(pos), 
+		_val(val)
+		/// Creates the Preparation.
+	{
+	}
+
+	~Preparation()
+		/// Destroys the Preparation.
+	{
+	}
+
+	void prepare()
+		/// Prepares data.
+	{
+		TypeHandler<std::list<T> >::prepare(_pos, _val, preparation());
+	}
+
+private:
+	std::size_t   _pos;
+	std::list<T>& _val;
+};
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Preparation_INCLUDED

+ 104 - 0
ThirdParty/include/Poco/Data/Range.h

@@ -0,0 +1,104 @@
+//
+// Range.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Range
+//
+// Definition of the Range class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Range_INCLUDED
+#define Data_Range_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Limit.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API Range
+	/// Range stores information how many rows a query should return.
+{
+public:
+	Range(Limit::SizeT lowValue, Limit::SizeT upValue, bool hardLimit);
+		/// Creates the Range. lowValue must be smaller equal than upValue
+
+	~Range();
+		/// Destroys the Limit.
+
+	const Limit& lower() const;
+		/// Returns the lower limit
+
+	const Limit& upper() const;
+		/// Returns the upper limit
+
+private:
+	Limit _lower;
+	Limit _upper;
+};
+
+
+//
+// inlines
+//
+inline const Limit& Range::lower() const
+{
+	return _lower;
+}
+
+
+inline const Limit& Range::upper() const
+{
+	return _upper;
+}
+
+
+namespace Keywords {
+
+
+template <typename T> 
+Limit limit(T lim, bool hard = false)
+	/// Creates an upperLimit
+{
+	return Limit(static_cast<Limit::SizeT>(lim), hard, false);
+}
+
+
+template <typename T> 
+Limit upperLimit(T lim, bool hard = false)
+{
+	return limit(lim, hard);
+}
+
+
+template <typename T> 
+Limit lowerLimit(T lim)
+{
+	return Limit(static_cast<Limit::SizeT>(lim), true, true);
+}
+
+
+template <typename T> 
+Range range(T low, T upp, bool hard = false)
+{
+	return Range(static_cast<Limit::SizeT>(low), static_cast<Limit::SizeT>(upp), hard);
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Range_INCLUDED

+ 653 - 0
ThirdParty/include/Poco/Data/RecordSet.h

@@ -0,0 +1,653 @@
+//
+// RecordSet.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  RecordSet
+//
+// Definition of the RecordSet class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_RecordSet_INCLUDED
+#define Data_RecordSet_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Session.h"
+#include "Poco/Data/Extraction.h"
+#include "Poco/Data/BulkExtraction.h"
+#include "Poco/Data/Statement.h"
+#include "Poco/Data/RowIterator.h"
+#include "Poco/Data/RowFilter.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/String.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/Exception.h"
+#include "Poco/AutoPtr.h"
+#include <ostream>
+#include <limits>
+
+
+namespace Poco {
+namespace Data {
+
+
+class RowFilter;
+
+
+class Data_API RecordSet: private Statement
+	/// RecordSet provides access to data returned from a query.
+	/// Data access indices (row and column) are 0-based, as usual in C++.
+	/// 
+	/// Recordset provides navigation methods to iterate through the
+	/// recordset, retrieval methods to extract data, and methods
+	/// to get metadata (type, etc.) about columns.
+	///
+	/// To work with a RecordSet, first create a Statement, execute it, and
+	/// create the RecordSet from the Statement, as follows:
+	///
+	///     Statement select(session);
+	///     select << "SELECT * FROM Person";
+	///     select.execute();
+	///     RecordSet rs(select);
+	///
+	/// The shorter way to do the above is following:
+	///
+	///     RecordSet rs(session, "SELECT * FROM Person"[, new SimpleRowFormatter]);
+	///
+	/// The third (optional) argument passed to the Recordset constructor is a RowFormatter
+	/// implementation. The formatter is used in conjunction with << operator for recordset
+	/// data formating.
+	/// 
+	/// The number of rows in the RecordSet can be limited by specifying
+	/// a limit for the Statement.
+{
+public:
+	typedef std::map<std::size_t, Row*> RowMap;
+	typedef const RowIterator           ConstIterator;
+	typedef RowIterator                 Iterator;
+
+	using Statement::isNull;
+	using Statement::subTotalRowCount;
+
+	static const std::size_t UNKNOWN_TOTAL_ROW_COUNT;
+
+	explicit RecordSet(const Statement& rStatement,
+		RowFormatter::Ptr pRowFormatter = 0);
+		/// Creates the RecordSet.
+
+	RecordSet(Session& rSession, 
+		const std::string& query,
+		RowFormatter::Ptr pRowFormatter = 0);
+		/// Creates the RecordSet.
+
+	RecordSet(Session& rSession, 
+		const std::string& query,
+		const RowFormatter& rowFormatter);
+		/// Creates the RecordSet.
+
+	template <class RF>
+	RecordSet(Session& rSession, const std::string& query, const RF& rowFormatter): 
+		Statement((rSession << query, Keywords::now)),
+		_currentRow(0),
+		_pBegin(new RowIterator(this, 0 == rowsExtracted())),
+		_pEnd(new RowIterator(this, true)),
+		_totalRowCount(UNKNOWN_TOTAL_ROW_COUNT)
+		/// Creates the RecordSet.
+	{
+		setRowFormatter(Keywords::format(rowFormatter));
+	}
+
+	RecordSet(const RecordSet& other);
+		/// Copy-creates the recordset.
+
+	~RecordSet();
+		/// Destroys the RecordSet.
+
+	void setRowFormatter(RowFormatter::Ptr pRowFormatter);
+		/// Assigns the row formatter to the statement and all recordset rows.
+
+	Statement& operator = (const Statement& stmt);
+		/// Assignment operator.
+
+	std::size_t rowCount() const;
+		/// Returns the number of rows in the RecordSet.
+		/// The number of rows reported is dependent on filtering.
+		/// Due to the need for filter conditions checking,
+		/// this function may suffer significant performance penalty
+		/// for large recordsets, so it should be used judiciously.
+		/// Use totalRowCount() to obtain the total number of rows.
+
+	std::size_t extractedRowCount() const;
+		/// Returns the number of rows extracted during the last statement
+		/// execution.
+		/// The number of rows reported is independent of filtering.
+
+	std::size_t totalRowCount() const;
+		//@ deprecated
+		/// Replaced with subTotalRowCount() and getTotalRowCount().
+
+	std::size_t getTotalRowCount() const;
+		/// Returns the total number of rows in the RecordSet.
+		/// The number of rows reported is independent of filtering.
+		/// If the total row count has not been set externally 
+		/// (either explicitly or implicitly through SQL), the value
+		/// returned shall only be accurate if the statement limit
+		/// is less or equal to the total row count.
+
+	void setTotalRowCount(std::size_t totalRowCount);
+		/// Explicitly sets the total row count.
+
+	void setTotalRowCount(const std::string& sql);
+		/// Implicitly sets the total row count.
+		/// The supplied sql must return exactly one column
+		/// and one row. The returned value must be an unsigned
+		/// integer. The value is set as the total number of rows.
+
+	std::size_t columnCount() const;
+		/// Returns the number of columns in the recordset.
+
+	template <class C>
+	const Column<C>& column(const std::string& name) const
+		/// Returns the reference to the first Column with the specified name.
+	{
+		if (isBulkExtraction())
+		{
+			typedef InternalBulkExtraction<C> E;
+			return columnImpl<C,E>(name);
+		}
+		else
+		{
+			typedef InternalExtraction<C> E;
+			return columnImpl<C,E>(name);
+		}
+	}
+
+	template <class C>
+	const Column<C>& column(std::size_t pos) const
+		/// Returns the reference to column at specified position.
+	{
+		if (isBulkExtraction())
+		{
+			typedef InternalBulkExtraction<C> E;
+			return columnImpl<C,E>(pos);
+		}
+		else
+		{
+			typedef InternalExtraction<C> E;
+			return columnImpl<C,E>(pos);
+		}
+	}
+
+	Row& row(std::size_t pos);
+		/// Returns reference to row at position pos.
+		/// Rows are lazy-created and cached.
+
+	template <class T>
+	const T& value(std::size_t col, std::size_t row, bool useFilter = true) const
+		/// Returns the reference to data value at [col, row] location.
+	{
+		if (useFilter && isFiltered() && !isAllowed(row))
+			throw InvalidAccessException("Row not allowed");
+
+		switch (storage())
+		{
+			case STORAGE_VECTOR:
+			{
+				typedef typename std::vector<T> C;
+				return column<C>(col).value(row);
+			}
+			case STORAGE_LIST:
+			{
+				typedef typename std::list<T> C;
+				return column<C>(col).value(row);
+			}
+			case STORAGE_DEQUE:
+			case STORAGE_UNKNOWN:
+			{
+				typedef typename std::deque<T> C;
+				return column<C>(col).value(row);
+			}
+			default:
+				throw IllegalStateException("Invalid storage setting.");
+		}
+	}
+
+	template <class T>
+	const T& value(const std::string& name, std::size_t row, bool useFilter = true) const
+		/// Returns the reference to data value at named column, row location.
+	{
+		if (useFilter && isFiltered() && !isAllowed(row))
+			throw InvalidAccessException("Row not allowed");
+
+		switch (storage())
+		{
+			case STORAGE_VECTOR:
+			{
+				typedef typename std::vector<T> C;
+				return column<C>(name).value(row);
+			}
+			case STORAGE_LIST:
+			{
+				typedef typename std::list<T> C;
+				return column<C>(name).value(row);
+			}
+			case STORAGE_DEQUE:
+			case STORAGE_UNKNOWN:
+			{
+				typedef typename std::deque<T> C;
+				return column<C>(name).value(row);
+			}
+			default:
+				throw IllegalStateException("Invalid storage setting.");
+		}
+	}
+
+	Poco::Dynamic::Var value(std::size_t col, std::size_t row, bool checkFiltering = true) const;
+		/// Returns the data value at column, row location.
+
+	Poco::Dynamic::Var value(const std::string& name, std::size_t row, bool checkFiltering = true) const;
+		/// Returns the data value at named column, row location.
+
+	template <typename T>
+	Poco::Dynamic::Var nvl(const std::string& name, const T& deflt = T()) const
+		/// Returns the value in the named column of the current row
+		/// if the value is not NULL, or deflt otherwise.
+	{
+		if (isNull(name))
+			return Poco::Dynamic::Var(deflt);
+		else
+			return value(name, _currentRow);
+	}
+	
+	template <typename T>
+	Poco::Dynamic::Var nvl(std::size_t index, const T& deflt = T()) const
+		/// Returns the value in the given column of the current row
+		/// if the value is not NULL, or deflt otherwise.
+	{
+		if (isNull(index, _currentRow))
+			return Poco::Dynamic::Var(deflt);
+		else
+			return value(index, _currentRow);
+	}
+
+	ConstIterator& begin() const;
+		/// Returns the const row iterator.
+
+	ConstIterator& end() const;
+		/// Returns the const row iterator.
+
+	Iterator begin();
+		/// Returns the row iterator.
+
+	Iterator end();
+		/// Returns the row iterator.
+
+	bool moveFirst();
+		/// Moves the row cursor to the first row.
+		///
+		/// Returns true if there is at least one row in the RecordSet,
+		/// false otherwise.
+
+	bool moveNext();
+		/// Moves the row cursor to the next row.
+		///
+		/// Returns true if the row is available, or false
+		/// if the end of the record set has been reached and
+		/// no more rows are available.
+
+	bool movePrevious();
+		/// Moves the row cursor to the previous row.
+		///
+		/// Returns true if the row is available, or false
+		/// if there are no more rows available.
+
+	bool moveLast();
+		/// Moves the row cursor to the last row.
+		///
+		/// Returns true if there is at least one row in the RecordSet,
+		/// false otherwise.
+
+	using Statement::reset;
+		/// Don't hide base class method.
+
+	void reset(const Statement& stmt);
+		/// Resets the RecordSet and assigns a new statement.
+		/// Should be called after the given statement has been reset,
+		/// assigned a new SQL statement, and executed.
+		///
+		/// Does not remove the associated RowFilter or RowFormatter.
+
+	Poco::Dynamic::Var value(const std::string& name);
+		/// Returns the value in the named column of the current row.
+
+	Poco::Dynamic::Var value(std::size_t index);
+		/// Returns the value in the given column of the current row.
+
+	Poco::Dynamic::Var operator [] (const std::string& name);
+		/// Returns the value in the named column of the current row.
+
+	Poco::Dynamic::Var operator [] (std::size_t index);
+		/// Returns the value in the named column of the current row.
+
+	MetaColumn::ColumnDataType columnType(std::size_t pos) const;
+		/// Returns the type for the column at specified position.
+
+	MetaColumn::ColumnDataType columnType(const std::string& name) const;
+		/// Returns the type for the column with specified name.
+
+	const std::string& columnName(std::size_t pos) const;
+		/// Returns column name for the column at specified position.
+
+	std::size_t columnLength(std::size_t pos) const;
+		/// Returns column maximum length for the column at specified position.
+
+	std::size_t columnLength(const std::string& name) const;
+		/// Returns column maximum length for the column with specified name.
+
+	std::size_t columnPrecision(std::size_t pos) const;
+		/// Returns column precision for the column at specified position.
+		/// Valid for floating point fields only (zero for other data types).
+
+	std::size_t columnPrecision(const std::string& name) const;
+		/// Returns column precision for the column with specified name.
+		/// Valid for floating point fields only (zero for other data types).
+
+	bool isNull(const std::string& name) const;
+		/// Returns true if column value of the current row is null.
+
+	std::ostream& copyNames(std::ostream& os) const;
+		/// Copies the column names to the target output stream.
+		/// Copied string is formatted by the current RowFormatter.
+
+	void formatNames() const;
+		/// Formats names using the current RowFormatter.
+
+	std::ostream& copyValues(std::ostream& os, 
+		std::size_t offset = 0, 
+		std::size_t length = RowIterator::POSITION_END) const;
+		/// Copies the data values to the supplied output stream.
+		/// The data set to be copied is starting at the specified offset 
+		/// from the recordset beginning. The number of rows to be copied
+		/// is specified by length argument.
+		/// An invalid combination of offset/length arguments shall
+		/// cause RangeException to be thrown.
+		/// Copied string is formatted by the current RowFormatter.
+
+	void formatValues(std::size_t offset, std::size_t length) const;
+		/// Formats values using the current RowFormatter.
+		/// The data set to be formatted is starting at the specified offset 
+		/// from the recordset beginning. The number of rows to be copied
+		/// is specified by length argument.
+		/// An invalid combination of offset/length arguments shall
+		/// cause RangeException to be thrown.
+
+	std::ostream& copy(std::ostream& os,
+		std::size_t offset = 0,
+		std::size_t length = RowIterator::POSITION_END) const;
+		/// Copies the column names and values to the target output stream.
+		/// Copied strings are formatted by the current RowFormatter.
+
+	bool isFiltered() const;
+		/// Returns true if recordset is filtered.
+
+private:
+	RecordSet();
+
+	template<class C, class E>
+	std::size_t columnPosition(const std::string& name) const
+		/// Returns the position of the column with specified name.
+	{
+		typedef typename C::value_type T;
+		typedef const E* ExtractionVecPtr;
+
+		bool typeFound = false;
+
+		const AbstractExtractionVec& rExtractions = extractions();
+		AbstractExtractionVec::const_iterator it = rExtractions.begin();
+		AbstractExtractionVec::const_iterator end = rExtractions.end();
+		
+		for (; it != end; ++it)
+		{
+			ExtractionVecPtr pExtraction = dynamic_cast<ExtractionVecPtr>(it->get());
+
+			if (pExtraction)
+			{
+				typeFound = true;
+				const Column<C>& col = pExtraction->column();
+				if (0 == Poco::icompare(name, col.name()))
+					return col.position();
+			}
+		}
+
+		if (typeFound)
+			throw NotFoundException(Poco::format("Column name: %s", name));
+		else
+			throw NotFoundException(Poco::format("Column type: %s, name: %s", std::string(typeid(T).name()), name));
+	}
+
+	template <class C, class E>
+	const Column<C>& columnImpl(const std::string& name) const
+		/// Returns the reference to the first Column with the specified name.
+	{
+		return columnImpl<C,E>(columnPosition<C,E>(name));
+	}
+
+	template <class C, class E>
+	const Column<C>& columnImpl(std::size_t pos) const
+		/// Returns the reference to column at specified position.
+	{
+		typedef typename C::value_type T;
+		typedef const E* ExtractionVecPtr;
+
+		const AbstractExtractionVec& rExtractions = extractions();
+
+		std::size_t s = rExtractions.size();
+		if (0 == s || pos >= s)
+			throw RangeException(Poco::format("Invalid column index: %z", pos));
+
+		ExtractionVecPtr pExtraction = dynamic_cast<ExtractionVecPtr>(rExtractions[pos].get());
+
+		if (pExtraction)
+		{
+			return pExtraction->column();
+		}
+		else 
+		{
+			throw Poco::BadCastException(Poco::format("Type cast failed!\nColumn: %z\nTarget type:\t%s",  
+				pos,
+				std::string(typeid(T).name())));
+		}
+	}
+
+	bool isAllowed(std::size_t row) const;
+		/// Returns true if the specified row is allowed by the
+		/// currently active filter.
+
+	void filter(const Poco::AutoPtr<RowFilter>& pFilter);
+		/// Sets the filter for the RecordSet.
+
+	const Poco::AutoPtr<RowFilter>& getFilter() const;
+		/// Returns the filter associated with the RecordSet.
+
+	std::size_t  _currentRow;
+	RowIterator* _pBegin;
+	RowIterator* _pEnd;
+	RowMap       _rowMap;
+	Poco::AutoPtr<RowFilter> _pFilter;
+	std::size_t  _totalRowCount;
+
+	friend class RowIterator;
+	friend class RowFilter;
+};
+
+
+///
+/// inlines
+///
+
+
+inline Data_API std::ostream& operator << (std::ostream &os, const RecordSet& rs)
+{
+	return rs.copy(os);
+}
+
+
+inline std::size_t RecordSet::getTotalRowCount() const
+{
+	if (UNKNOWN_TOTAL_ROW_COUNT == _totalRowCount)
+		return subTotalRowCount();
+	else
+		return _totalRowCount;
+}
+
+
+inline std::size_t RecordSet::totalRowCount() const
+{
+	return getTotalRowCount();
+}
+
+
+inline void RecordSet::setTotalRowCount(std::size_t totalRowCount)
+{
+	_totalRowCount = totalRowCount;
+}
+
+
+inline std::size_t RecordSet::extractedRowCount() const
+{
+	return rowsExtracted();
+}
+
+
+inline std::size_t RecordSet::columnCount() const
+{
+	return static_cast<std::size_t>(extractions().size());
+}
+
+
+inline Statement& RecordSet::operator = (const Statement& stmt)
+{
+	reset(stmt);
+	return *this;
+}
+
+
+inline Poco::Dynamic::Var RecordSet::value(const std::string& name)
+{
+	return value(name, _currentRow);
+}
+
+
+inline Poco::Dynamic::Var RecordSet::value(std::size_t index)
+{
+	return value(index, _currentRow);
+}
+
+
+inline Poco::Dynamic::Var RecordSet::operator [] (const std::string& name)
+{
+	return value(name, _currentRow);
+}
+
+
+inline Poco::Dynamic::Var RecordSet::operator [] (std::size_t index)
+{
+	return value(index, _currentRow);
+}
+
+
+inline MetaColumn::ColumnDataType RecordSet::columnType(std::size_t pos)const
+{
+	return metaColumn(static_cast<UInt32>(pos)).type();
+}
+
+
+inline MetaColumn::ColumnDataType RecordSet::columnType(const std::string& name)const
+{
+	return metaColumn(name).type();
+}
+
+
+inline const std::string& RecordSet::columnName(std::size_t pos) const
+{
+	return metaColumn(static_cast<UInt32>(pos)).name();
+}
+
+
+inline std::size_t RecordSet::columnLength(std::size_t pos) const
+{
+	return metaColumn(static_cast<UInt32>(pos)).length();
+}
+
+
+inline std::size_t RecordSet::columnLength(const std::string& name)const
+{
+	return metaColumn(name).length();
+}
+
+
+inline std::size_t RecordSet::columnPrecision(std::size_t pos) const
+{
+	return metaColumn(static_cast<UInt32>(pos)).precision();
+}
+
+
+inline std::size_t RecordSet::columnPrecision(const std::string& name)const
+{
+	return metaColumn(name).precision();
+}
+
+
+inline bool RecordSet::isNull(const std::string& name) const
+{
+	return isNull(metaColumn(name).position(), _currentRow);
+}
+
+
+inline RecordSet::ConstIterator& RecordSet::begin() const
+{
+	return *_pBegin;
+}
+
+
+inline RecordSet::ConstIterator& RecordSet::end() const
+{
+	return *_pEnd;
+}
+
+
+inline RecordSet::Iterator RecordSet::begin()
+{
+	return *_pBegin;
+}
+
+
+inline RecordSet::Iterator RecordSet::end()
+{
+	return *_pEnd;
+}
+
+
+inline const Poco::AutoPtr<RowFilter>& RecordSet::getFilter() const
+{
+	return _pFilter;
+}
+
+
+inline void RecordSet::formatNames() const
+{
+	(*_pBegin)->formatNames();
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_RecordSet_INCLUDED

+ 312 - 0
ThirdParty/include/Poco/Data/Row.h

@@ -0,0 +1,312 @@
+//
+// Row.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  Row
+//
+// Definition of the Row class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_Row_INCLUDED
+#define Data_Row_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/RowFormatter.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/Tuple.h"
+#include "Poco/SharedPtr.h"
+#include <vector>
+#include <string>
+#include <ostream>
+
+
+namespace Poco {
+namespace Data {
+
+
+class RecordSet;
+
+
+class Data_API Row
+	/// Row class provides a data type for RecordSet iteration purposes.
+	/// Dereferencing a RowIterator returns Row.
+	/// Rows are sortable. The sortability is maintained at all times (i.e. there
+	/// is always at least one column specified as a sorting criteria) .
+	/// The default and minimal sorting criteria is the first field (position 0).
+	/// The default sorting criteria can be replaced with any other field by 
+	/// calling replaceSortField() member function.
+	/// Additional fields can be added to sorting criteria, in which case the
+	/// field precedence corresponds to addition order (i.e. later added fields
+	/// have lower sorting precedence).
+	/// These features make Row suitable for use with standard sorted 
+	/// containers and algorithms. The main constraint is that all the rows from
+	/// a set that is being sorted must have the same sorting criteria (i.e., the same
+	/// set of fields must be in sorting criteria in the same order). Since rows don't
+	/// know about each other, it is the programmer's responsibility to ensure this
+	/// constraint is satisfied.
+	/// Field names are a shared pointer to a vector of strings. For efficiency sake,
+	/// a constructor taking a shared pointer to names vector argument is provided.
+	/// The stream operator is provided for Row data type as a free-standing function.
+{
+public:
+	typedef RowFormatter::NameVec    NameVec;
+	typedef RowFormatter::NameVecPtr NameVecPtr;
+	typedef RowFormatter::ValueVec   ValueVec;
+
+	enum ComparisonType
+	{
+		COMPARE_AS_EMPTY,
+		COMPARE_AS_INTEGER,
+		COMPARE_AS_FLOAT,
+		COMPARE_AS_STRING
+	};
+
+	typedef Tuple<std::size_t, ComparisonType> SortTuple;
+	typedef std::vector<SortTuple>             SortMap;
+		/// The type for map holding fields used for sorting criteria.
+		/// Fields are added sequentially and have precedence that
+		/// corresponds to field adding sequence order (rather than field's 
+		/// position in the row).
+		/// This requirement rules out use of std::map due to its sorted nature.
+	typedef SharedPtr<SortMap> SortMapPtr;
+
+	Row();
+		/// Creates the Row.
+
+	Row(NameVecPtr pNames,
+		const RowFormatter::Ptr& pFormatter = 0);
+		/// Creates the Row.
+
+	Row(NameVecPtr pNames,
+		const SortMapPtr& pSortMap,
+		const RowFormatter::Ptr& pFormatter = 0);
+		/// Creates the Row.
+
+	~Row();
+		/// Destroys the Row.
+
+	Poco::Dynamic::Var& get(std::size_t col);
+		/// Returns the reference to data value at column location.
+
+	Poco::Dynamic::Var& operator [] (std::size_t col);
+		/// Returns the reference to data value at column location.
+
+	Poco::Dynamic::Var& operator [] (const std::string& name);
+		/// Returns the reference to data value at named column location.
+
+	template <typename T>
+	void append(const std::string& name, const T& val)
+		/// Appends the value to the row.
+	{
+		if (!_pNames) _pNames = new NameVec;
+		_values.push_back(val);
+		_pNames->push_back(name);
+		if (1 == _values.size()) addSortField(0);
+	}
+	
+	template <typename T>
+	void set(std::size_t pos, const T& val)
+		/// Assigns the value to the row.
+	{
+		try
+		{
+			_values.at(pos) = val;
+		}
+		catch (std::out_of_range&)
+		{
+			throw RangeException("Invalid column number.");
+		}
+	}
+
+	template <typename T>
+	void set(const std::string& name, const T& val)
+		/// Assigns the value to the row.
+	{
+		NameVec::iterator it = _pNames->begin();
+		NameVec::iterator end = _pNames->end();
+		for (int i = 0; it != end; ++it, ++i)
+		{
+			if (*it == name)
+				return set(i, val);
+		}
+
+		std::ostringstream os;
+		os << "Column with name " << name << " not found.";
+		throw NotFoundException(os.str());
+	}
+
+	std::size_t fieldCount() const;
+		/// Returns the number of fields in this row.
+
+	void reset();
+		/// Resets the row by clearing all field names and values.
+
+	void separator(const std::string& sep);
+		/// Sets the separator.
+
+	void addSortField(std::size_t pos);
+		/// Adds the field used for sorting.
+
+	void addSortField(const std::string& name);
+		/// Adds the field used for sorting.
+
+	void removeSortField(std::size_t pos);
+		/// Removes the field used for sorting.
+
+	void removeSortField(const std::string& name);
+		/// Removes the field used for sorting.
+
+	void replaceSortField(std::size_t oldPos, std::size_t newPos);
+		/// Replaces the field used for sorting.
+
+	void replaceSortField(const std::string& oldName, const std::string& newName);
+		/// Replaces the field used for sorting.
+
+	void resetSort();
+		/// Resets the sorting criteria to field 0 only.
+
+	const std::string& namesToString() const;
+		/// Converts the column names to string.
+
+	void formatNames() const;
+		/// Fomats the column names.
+
+	const std::string& valuesToString() const;
+		/// Converts the row values to string and returns the formated string.
+
+	void formatValues() const;
+		/// Fomats the row values.
+
+	bool operator == (const Row& other) const;
+		/// Equality operator.
+
+	bool operator != (const Row& other) const;
+		/// Inequality operator.
+
+	bool operator < (const Row& other) const;
+		/// Less-than operator.
+
+	const NameVecPtr names() const;
+		/// Returns the shared pointer to names vector.
+
+	const ValueVec& values() const;
+		/// Returns the const reference to values vector.
+
+	void setFormatter(const RowFormatter::Ptr& pFormatter = 0);
+		/// Sets the formatter for this row and takes the
+		/// shared ownership of it.
+
+	const RowFormatter& getFormatter() const;
+		/// Returns the reference to the formatter.
+
+	void setSortMap(const SortMapPtr& pSortMap = 0);
+		/// Adds the sorting fields entry and takes the
+		/// shared ownership of it.
+
+	const SortMapPtr& getSortMap() const;
+		/// Returns the reference to the sorting fields.
+
+private:
+	void init(const SortMapPtr& pSortMap, const RowFormatter::Ptr& pFormatter);
+
+	ValueVec& values();
+		/// Returns the reference to values vector.
+
+	std::size_t getPosition(const std::string& name);
+	bool isEqualSize(const Row& other) const;
+	bool isEqualType(const Row& other) const;
+
+	NameVecPtr                _pNames;
+	ValueVec                  _values;
+	SortMapPtr                _pSortMap;
+	mutable RowFormatter::Ptr _pFormatter;
+	mutable std::string       _nameStr;
+	mutable std::string       _valueStr;
+};
+
+
+Data_API std::ostream& operator << (std::ostream &os, const Row& row);
+
+
+///
+/// inlines
+///
+inline std::size_t Row::fieldCount() const
+{
+	return static_cast<std::size_t>(_values.size());
+}
+
+
+inline void Row::reset()
+{
+	_pNames->clear();
+	_values.clear();
+}
+
+
+inline const Row::NameVecPtr Row::names() const
+{
+	return _pNames;
+}
+
+
+inline const Row::ValueVec& Row::values() const
+{
+	return _values;
+}
+
+
+inline Row::ValueVec& Row::values()
+{
+	return _values;
+}
+
+
+inline Poco::Dynamic::Var& Row::operator [] (std::size_t col)
+{
+	return get(col);
+}
+
+
+inline Poco::Dynamic::Var& Row::operator [] (const std::string& name)
+{
+	return get(getPosition(name));
+}
+
+
+inline const RowFormatter& Row::getFormatter() const
+{
+	return *_pFormatter;
+}
+
+
+inline const Row::SortMapPtr& Row::getSortMap() const
+{
+	return _pSortMap;
+}
+
+
+inline const std::string& Row::valuesToString() const
+{
+	return _pFormatter->formatValues(values(), _valueStr);
+}
+
+
+inline void Row::formatValues() const
+{
+	return _pFormatter->formatValues(values());
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_Row_INCLUDED

+ 276 - 0
ThirdParty/include/Poco/Data/RowFilter.h

@@ -0,0 +1,276 @@
+//
+// RowFilter.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  RowFilter
+//
+// Definition of the RowFilter class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_RowFilter_INCLUDED
+#define Data_RowFilter_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/Tuple.h"
+#include "Poco/String.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include <map>
+#include <list>
+#include <utility>
+
+
+namespace Poco {
+namespace Data {
+
+
+class RecordSet;
+
+
+class Data_API RowFilter: public RefCountedObject
+	/// RowFilter class provides row filtering functionality.
+	/// A filter contains a set of criteria (field name, value and
+	/// logical operation) for row filtering.
+	/// Additionally, a row filter contains a map of pointers to other
+	/// filters with related logical operations between filters.
+	/// RowFilter is typically added to recordset in order to filter
+	/// its content. Since the recordset own iteration is dependent upon
+	/// filtering, whenever the filtering criteria is changed,
+	/// the filter automatically notifies all associated recordsets
+	/// by rewinding them to the first position.
+{
+public:
+	enum Comparison
+	{
+		VALUE_LESS_THAN,
+		VALUE_LESS_THAN_OR_EQUAL,
+		VALUE_EQUAL,
+		VALUE_GREATER_THAN,
+		VALUE_GREATER_THAN_OR_EQUAL,
+		VALUE_NOT_EQUAL,
+		VALUE_IS_NULL
+	};
+
+	enum LogicOperator
+	{
+		OP_AND,
+		OP_OR,
+		OP_NOT
+	};
+
+	typedef bool (*CompT)(const Poco::Dynamic::Var&, const Poco::Dynamic::Var&);
+	typedef AutoPtr<RowFilter> Ptr;
+	typedef std::map<std::string, Comparison> Comparisons;
+	typedef Tuple<Poco::Dynamic::Var, Comparison, LogicOperator> ComparisonEntry;
+	typedef std::multimap<std::string, ComparisonEntry> ComparisonMap;
+	typedef std::map<AutoPtr<RowFilter>, LogicOperator> FilterMap;
+
+	RowFilter(RecordSet* pRecordSet);
+		/// Creates the top-level RowFilter and associates it with the recordset.
+
+	RowFilter(Ptr pParent, LogicOperator op = OP_OR);
+		/// Creates child RowFilter and associates it with the parent filter.
+
+	~RowFilter();
+		/// Destroys the RowFilter.
+
+	void addFilter(Ptr pFilter, LogicOperator comparison);
+		/// Appends another filter to this one.
+
+	void removeFilter(Ptr pFilter);
+		/// Removes filter from this filter.
+
+	bool has(Ptr pFilter) const;
+		/// Returns true if this filter is parent of pFilter;
+
+	template <typename T>
+	void add(const std::string& name, Comparison comparison, const T& value, LogicOperator op = OP_OR)
+		/// Adds value to the filter.
+	{
+		rewindRecordSet();
+		_comparisonMap.insert(ComparisonMap::value_type(toUpper(name),
+			ComparisonEntry(value, comparison, op)));
+	}
+
+	template <typename T>
+	void add(const std::string& name, const std::string& comp, const T& value, LogicOperator op = OP_OR)
+		/// Adds value to the filter.
+	{
+		add(name, getComparison(comp), value, op);
+	}
+
+	template <typename T>
+	void addAnd(const std::string& name, const std::string& comp, const T& value)
+		/// Adds logically AND-ed value to the filter.
+	{
+		add(name, getComparison(comp), value, OP_AND);
+	}
+
+	template <typename T>
+	void addOr(const std::string& name, const std::string& comp, const T& value)
+		/// Adds logically OR-ed value to the filter.
+	{
+		add(name, getComparison(comp), value, OP_OR);
+	}
+
+	int remove(const std::string& name);
+		/// Removes named comparisons from the filter.
+		/// All comparisons with specified name are removed.
+		/// Returns the number of comparisons removed.
+
+	void toggleNot();
+		/// Togless the NOT operator for this filter;
+
+	bool isNot() const;
+		/// Returns true if filter is NOT-ed, false otherwise.
+
+	bool isEmpty() const;
+		/// Returns true if there is not filtering criteria specified.
+
+	bool isAllowed(std::size_t row) const;
+		/// Returns true if name and value are allowed.
+
+	bool exists(const std::string& name) const;
+		/// Returns true if name is known to this row filter.
+
+private:
+	RowFilter();
+	RowFilter(const RowFilter&);
+	RowFilter& operator=(const RowFilter&);
+
+	void init();
+
+	static bool equal(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool notEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool less(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool greater(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool lessOrEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool greaterOrEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool logicalAnd(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool logicalOr(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2);
+	static bool isNull(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var&);
+
+	static void doCompare(Poco::Dynamic::Var& ret,
+		Poco::Dynamic::Var& val,
+		CompT comp,
+		const ComparisonEntry& ce);
+
+	RecordSet& recordSet() const;
+
+	Comparison getComparison(const std::string& comp) const;
+	
+	void rewindRecordSet();
+
+	Comparisons        _comparisons;
+	ComparisonMap      _comparisonMap;
+	mutable RecordSet* _pRecordSet;
+	Ptr                _pParent;
+	FilterMap          _filterMap;
+	bool               _not;
+
+	friend class RecordSet;
+};
+
+
+///
+/// inlines
+///
+
+
+inline bool RowFilter::has(Ptr pFilter) const
+{
+	return _filterMap.find(pFilter) != _filterMap.end();
+}
+
+
+inline bool RowFilter::isEmpty() const
+{
+	return _comparisonMap.size() == 0;
+}
+
+
+inline bool RowFilter::exists(const std::string& name) const
+{
+	return _comparisonMap.find(name) != _comparisonMap.end();
+}
+
+
+inline void RowFilter::toggleNot()
+{
+	_not = !_not;
+}
+
+
+inline bool RowFilter::isNot() const
+{
+	return _not;
+}
+
+
+inline bool RowFilter::equal(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 == p2;
+}
+
+
+inline bool RowFilter::notEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 != p2;
+}
+
+
+inline bool RowFilter::less(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 < p2;
+}
+
+
+inline bool RowFilter::greater(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 > p2;
+}
+
+
+inline bool RowFilter::lessOrEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 <= p2;
+}
+
+
+inline bool RowFilter::greaterOrEqual(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 >= p2;
+}
+
+
+inline bool RowFilter::logicalAnd(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 && p2;
+}
+
+
+inline bool RowFilter::logicalOr(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var& p2)
+{
+	return p1 || p2;
+}
+
+
+inline bool RowFilter::isNull(const Poco::Dynamic::Var& p1, const Poco::Dynamic::Var&)
+{
+	return p1.isEmpty();
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_RowFilter_INCLUDED

+ 231 - 0
ThirdParty/include/Poco/Data/RowFormatter.h

@@ -0,0 +1,231 @@
+//
+// RowFormatter.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  RowFormatter
+//
+// Definition of the RowFormatter class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_RowFormatter_INCLUDED
+#define Data_RowFormatter_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/Dynamic/Var.h"
+#include <sstream>
+#include <vector>
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API RowFormatter
+	/// Row formatter is an abstract class providing definition for row formatting functionality.
+	/// For custom formatting strategies, inherit from this class and override formatNames()
+	/// and formatValues() member functions.
+	///
+	/// Row formatter can be either passed to the RecordSet at construction time,
+	/// like in the following example:
+	///
+	/// RecordSet rs(session. "SELECT * FROM Table", new MyRowFormater);
+	///
+	/// or it can be supplied to the statement as in the following example:
+	///
+	/// MyRowFormatter rf
+	/// session << "SELECT * FROM Table", format(rf);
+	///
+	/// If no formatter is externally supplied to the statement, the SimpleRowFormatter is used.
+	/// Statement always has the ownership of the row formatter and shares
+	/// it with rows through RecordSet.
+	///
+	/// To accomodate for various formatting needs, a formatter can operate in two modes:
+	/// 
+	///	  - progressive: formatted individual row strings are gemerated and returned from each 
+	///     call to formatValues;
+	///     std::string& formatNames(const NameVecPtr, std::string&) and
+	///     std::string& formatValues(const ValueVec&, std::string&) member calls should be
+	///     used in this case; this is the default mode
+	///
+	///   - bulk: formatted resulting string is accumulated internally and obtained at
+	///     the end of iteration via toString() member function;
+	///     void formatNames(const NameVecPtr) and
+	///     void formatValues(const ValueVec&) member calls should be used in this case
+	///
+	/// When formatter is used in conjunction with Row/RecordSet, the formatting members corresponding
+	/// to the formater mode are expected to be implemented. If a call is propagated to this parent
+	/// class, the functions do nothing or silently return empty string respectively.
+	///
+{
+public:
+	typedef SharedPtr<RowFormatter>              Ptr;
+	typedef std::vector<std::string>             NameVec;
+	typedef SharedPtr<std::vector<std::string> > NameVecPtr;
+	typedef std::vector<Poco::Dynamic::Var>      ValueVec;
+
+	static const int INVALID_ROW_COUNT = -1;
+
+	enum Mode
+	{
+		FORMAT_PROGRESSIVE,
+		FORMAT_BULK
+	};
+
+	RowFormatter(const std::string& prefix = "",
+		const std::string& postfix = "",
+		Mode mode = FORMAT_PROGRESSIVE);
+		/// Creates the RowFormatter and sets the prefix and postfix to specified values.
+
+	virtual ~RowFormatter();
+		/// Destroys the RowFormatter.
+
+	virtual std::string& formatNames(const NameVecPtr pNames, std::string& formattedNames);
+		/// Should be implemented to format the row fields names and return the formatted string.
+		/// The default implementation clears the names string and returns it.
+
+	virtual void formatNames(const NameVecPtr pNames);
+		/// Should be implemented to format the row fields names.
+		/// The default implementation does nothing.
+
+	virtual std::string& formatValues(const ValueVec& vals, std::string& formattedValues);
+		/// Should be implemented to format the row fields values and return the formatted string.
+		/// The default implementation clears the values string and returns it.
+
+	virtual void formatValues(const ValueVec& vals);
+		/// Should be implemented to format the row fields values.
+		/// The default implementation does nothing.
+
+	virtual const std::string& toString();
+		/// Throws NotImplementedException. Formatters operating in bulk mode should 
+		/// implement this member function to return valid pointer to the formatted result.
+
+	virtual int rowCount() const;
+		/// Returns INVALID_ROW_COUNT. Must be implemented by inheriting classes
+		/// which maintain count of processed rows.
+
+	int getTotalRowCount() const;
+		/// Returns zero. Must be implemented by inheriting classes.
+		/// Typically, total row count shall be set up front through
+		/// setTotalRowCount() call.
+
+	void setTotalRowCount(int count);
+		/// Sets total row count.
+
+	virtual const std::string& prefix() const;
+		/// Returns prefix string;
+
+	virtual const std::string& postfix() const;
+		/// Returns postfix string;
+
+	void reset();
+		/// Resets the formatter by setting prefix and postfix
+		/// to empty strings and row count to INVALID_ROW_COUNT.
+
+	Mode getMode() const;
+		/// Returns the formater mode.
+
+	void setMode(Mode mode);
+		/// Sets the fromatter mode.
+
+protected:
+
+	void setPrefix(const std::string& prefix);
+		/// Sets the prefix for the formatter.
+
+	void setPostfix(const std::string& postfix);
+		/// Sets the postfix for the formatter
+
+private:
+
+	mutable std::string _prefix;
+	mutable std::string _postfix;
+	Mode                _mode;
+	int                 _totalRowCount;
+};
+
+
+///
+/// inlines
+///
+inline int RowFormatter::rowCount() const
+{
+	return INVALID_ROW_COUNT;
+}
+
+
+inline int RowFormatter::getTotalRowCount() const
+{
+	return _totalRowCount;
+}
+
+
+inline void RowFormatter::setTotalRowCount(int count)
+{
+	_totalRowCount = count;
+}
+
+
+inline void RowFormatter::setPrefix(const std::string& prefix)
+{
+	_prefix = prefix;
+}
+
+
+inline void RowFormatter::setPostfix(const std::string& postfix)
+{
+	_postfix = postfix;
+}
+
+
+inline const std::string& RowFormatter::prefix() const
+{
+	return _prefix;
+}
+
+
+inline const std::string& RowFormatter::postfix() const
+{
+	return _postfix;
+}
+
+
+inline RowFormatter::Mode RowFormatter::getMode() const
+{
+	return _mode;
+}
+
+
+inline void RowFormatter::setMode(Mode mode)
+{
+	_mode = mode;
+}
+
+
+namespace Keywords {
+
+
+template <typename T>
+inline RowFormatter::Ptr format(const T& formatter)
+	/// Utility function used to pass formatter to the statement.
+{
+	return new T(formatter);
+}
+
+
+} // namespace Keywords
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_RowFormatter_INCLUDED

+ 150 - 0
ThirdParty/include/Poco/Data/RowIterator.h

@@ -0,0 +1,150 @@
+//
+// RowIterator.h
+//
+// Library: Data
+// Package: DataCore
+// Module:  RowIterator
+//
+// Definition of the RowIterator class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_RowIterator_INCLUDED
+#define Data_RowIterator_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Row.h"
+#include "Poco/Dynamic/Var.h"
+#include <iterator>
+#include <algorithm>
+
+
+namespace Poco {
+namespace Data {
+
+
+class RecordSet;
+
+
+class Data_API RowIterator
+	/// RowIterator class.
+{
+public:
+	typedef std::bidirectional_iterator_tag iterator_category;
+	typedef Row                             value_type;
+	typedef std::ptrdiff_t                  difference_type;
+	typedef Row*                            pointer;
+	typedef Row&                            reference;
+
+	static const std::size_t POSITION_END;
+		/// End position indicator.
+
+	RowIterator(RecordSet* pRecordSet, bool positionEnd);
+		/// Creates the RowIterator and positions it at the end of
+		/// the recordset if positionEnd is true. Otherwise, it is
+		/// positioned at the beginning.
+
+	RowIterator(const RowIterator& other);
+		/// Creates a copy of other RowIterator.
+
+	~RowIterator();
+		/// Destroys the RowIterator.
+
+	RowIterator& operator = (const RowIterator& other);
+		/// Assigns the other RowIterator.
+
+	bool operator == (const RowIterator& other) const;
+		/// Equality operator.
+
+	bool operator != (const RowIterator& other) const;
+		/// Inequality operator.
+
+	Row& operator * () const;
+		/// Returns reference to the current row.
+
+	Row* operator -> () const;
+		/// Returns pointer to the current row.
+
+	const RowIterator& operator ++ () const;
+		/// Advances by one position and returns current position.
+
+	RowIterator operator ++ (int) const;
+		/// Advances by one position and returns copy of the iterator with 
+		/// previous current position.
+
+	const RowIterator& operator -- () const;
+		/// Goes back by one position and returns copy of the iterator with 
+		/// previous current position.
+
+	RowIterator operator -- (int) const;
+		/// Goes back by one position and returns previous current position.
+
+	RowIterator operator + (std::size_t diff) const;
+		/// Returns a copy the RowIterator advanced by diff positions.
+
+	RowIterator operator - (std::size_t diff) const;
+		/// Returns a copy the RowIterator backed by diff positions.
+		/// Throws RangeException if diff is larger than current position.
+
+	void swap(RowIterator& other);
+		/// Swaps the RowIterator with another one.
+
+private:
+	RowIterator();
+
+	void increment() const;
+		/// Increments the iterator position by one. 
+		/// Throws RangeException if position is out of range.
+
+	void decrement() const;
+		/// Decrements the iterator position by one. 
+		/// Throws RangeException if position is out of range.
+
+	void setPosition(std::size_t pos) const;
+		/// Sets the iterator position. 
+		/// Throws RangeException if position is out of range.
+
+	RecordSet*          _pRecordSet;
+	mutable std::size_t _position;
+};
+
+
+///
+/// inlines
+///
+
+
+inline bool RowIterator::operator == (const RowIterator& other) const
+{
+	return _pRecordSet == other._pRecordSet && _position == other._position;
+}
+
+
+inline bool RowIterator::operator != (const RowIterator& other) const
+{
+	return _pRecordSet != other._pRecordSet || _position != other._position;
+}
+
+
+} } // namespace Poco::Data
+
+
+namespace std
+{
+	template<>
+	inline void swap<Poco::Data::RowIterator>(Poco::Data::RowIterator& s1, 
+		Poco::Data::RowIterator& s2)
+		/// Full template specalization of std:::swap for RowIterator
+	{
+		s1.swap(s2);
+	}
+}
+
+
+#endif // Data_RowIterator_INCLUDED

+ 217 - 0
ThirdParty/include/Poco/Data/SQLChannel.h

@@ -0,0 +1,217 @@
+//
+// SQLChannel.h
+//
+// Library: Data
+// Package: Logging
+// Module:  SQLChannel
+//
+// Definition of the SQLChannel class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLChannel_INCLUDED
+#define Data_SQLChannel_INCLUDED
+
+
+#include "Poco/Data/Data.h"
+#include "Poco/Data/Connector.h"
+#include "Poco/Data/Session.h"
+#include "Poco/Data/Statement.h"
+#include "Poco/Data/ArchiveStrategy.h"
+#include "Poco/Channel.h"
+#include "Poco/Message.h"
+#include "Poco/AutoPtr.h"
+#include "Poco/String.h"
+
+
+namespace Poco {
+namespace Data {
+
+
+class Data_API SQLChannel: public Poco::Channel
+	/// This Channel implements logging to a SQL database.
+	/// The channel is dependent on the schema. The DDL for
+	/// table creation (subject to target DDL dialect dependent 
+	/// modifications) is:
+	///
+	/// "CREATE TABLE T_POCO_LOG (Source VARCHAR, 
+	///		Name VARCHAR, 
+	///		ProcessId INTEGER, 
+	///		Thread VARCHAR, 
+	///		ThreadId INTEGER, 
+	///		Priority INTEGER, 
+	///		Text VARCHAR, 
+	///		DateTime DATE)"
+	///
+	/// The table name is configurable through "table" property. 
+	/// Other than DateTime filed name used for optiona time-based archiving purposes, currently the 
+	/// field names are not mandated. However, it is recomended to use names as specified above.
+	/// 
+	/// To provide as non-intrusive operation as possbile, the log entries are cached and 
+	/// inserted into the target database asynchronously by default . The blocking, however, will occur 
+	/// before the next entry insertion with default timeout of 1 second. The default settings can be 
+	/// overriden (see async, timeout and throw properties for details).
+	/// If throw property is false, insertion timeouts are ignored, otherwise a TimeoutException is thrown.
+	/// To force insertion of every entry, set timeout to 0. This setting, however, introduces
+	/// a risk of long blocking periods in case of remote server communication delays.
+{
+public:
+	SQLChannel();
+		/// Creates SQLChannel.
+
+	SQLChannel(const std::string& connector, 
+		const std::string& connect,
+		const std::string& name = "-");
+		/// Creates a SQLChannel with the given connector, connect string, timeout, table and name.
+		/// The connector must be already registered.
+	
+	void open();
+		/// Opens the SQLChannel.
+		
+	void close();
+		/// Closes the SQLChannel.
+		
+	void log(const Message& msg);
+		/// Sends the message's text to the syslog service.
+		
+	void setProperty(const std::string& name, const std::string& value);
+		/// Sets the property with the given value.
+		///
+		/// The following properties are supported:
+		///     * name:      The name used to identify the source of log messages.
+		///                  Defaults to "-".
+		///
+		///     * target:    The target data storage type ("SQLite", "ODBC", ...).
+		///
+		///     * connector: The target data storage connector name.
+		///
+		///     * connect:   The target data storage connection string.
+		///
+		///     * table:     Destination log table name. Defaults to "T_POCO_LOG".
+		///                  Table must exist in the target database.
+		///
+		///     * keep:      Max row age for the log table. To disable archiving,
+		///                  set this property to empty string or "forever".
+		///
+		///     * archive:   Archive table name. Defaults to "T_POCO_LOG_ARCHIVE".
+		///                  Table must exist in the target database. To disable archiving,
+		///                  set this property to empty string.
+		///
+		///     * async:     Indicates asynchronous execution. When excuting asynchronously,
+		///                  messages are sent to the target using asyncronous execution.
+		///                  However, prior to the next message being processed and sent to
+		///                  the target, the previous operation must have been either completed 
+		///                  or timed out (see timeout and throw properties for details on
+		///                  how abnormal conditos are handled).
+		///
+		///     * timeout:   Timeout (ms) to wait for previous log operation completion.
+		///                  Values "0" and "" mean no timeout. Only valid when logging
+		///                  is asynchronous, otherwise ignored.
+		///
+		///     * throw:     Boolean value indicating whether to throw in case of timeout.
+		///                  Setting this property to false may result in log entries being lost.
+		///                  True values are (case insensitive) "true", "t", "yes", "y".
+		///                  Anything else yields false.
+		
+	std::string getProperty(const std::string& name) const;
+		/// Returns the value of the property with the given name.
+
+	std::size_t wait();
+		/// Waits for the completion of the previous operation and returns
+		/// the result. If chanel is in synchronous mode, returns 0 immediately.
+
+	static void registerChannel();
+		/// Registers the channel with the global LoggingFactory.
+
+	static const std::string PROP_CONNECT;
+	static const std::string PROP_CONNECTOR;
+	static const std::string PROP_NAME;
+	static const std::string PROP_TABLE;
+	static const std::string PROP_ARCHIVE_TABLE;
+	static const std::string PROP_MAX_AGE;
+	static const std::string PROP_ASYNC;
+	static const std::string PROP_TIMEOUT;
+	static const std::string PROP_THROW;
+
+protected:
+	~SQLChannel();
+
+private:
+	typedef Poco::SharedPtr<Session>         SessionPtr;
+	typedef Poco::SharedPtr<Statement>       StatementPtr;
+	typedef Poco::Message::Priority          Priority;
+	typedef Poco::SharedPtr<ArchiveStrategy> StrategyPtr;
+
+	void initLogStatement();
+		/// Initiallizes the log statement.
+
+	void initArchiveStatements();
+	/// Initiallizes the archive statement.
+
+	void logAsync(const Message& msg);
+		/// Waits for previous operation completion and
+		/// calls logSync(). If the previous operation times out,
+		/// and _throw is true, TimeoutException is thrown, oterwise
+		/// the timeout is ignored and log entry is lost.
+
+	void logSync(const Message& msg);
+		/// Inserts the message in the target database.
+
+	bool isTrue(const std::string& value) const;
+		/// Returns true is value is "true", "t", "yes" or "y".
+		/// Case insensitive.
+
+	std::string  _connector;
+	std::string  _connect;
+	SessionPtr   _pSession;
+	StatementPtr _pLogStatement;
+	std::string  _name;
+	std::string  _table;
+	int          _timeout;
+	bool         _throw;
+	bool         _async;
+	
+	// members for log entry cache (needed for async mode)
+	std::string _source;
+	long        _pid;
+	std::string _thread;
+	long        _tid;
+	int         _priority;
+	std::string _text;
+	DateTime    _dateTime;
+
+	StrategyPtr _pArchiveStrategy;
+};
+
+
+//
+// inlines
+//
+
+inline std::size_t SQLChannel::wait()
+{
+	if (_async && _pLogStatement) 
+		return _pLogStatement->wait(_timeout);
+	
+	return 0;
+}
+
+
+inline bool SQLChannel::isTrue(const std::string& value) const
+{
+	return ((0 == icompare(value, "true")) ||
+			(0 == icompare(value, "t")) ||
+			(0 == icompare(value, "yes")) ||
+			(0 == icompare(value, "y")));
+}
+
+
+} } // namespace Poco::Data
+
+
+#endif // Data_SQLChannel_INCLUDED

+ 220 - 0
ThirdParty/include/Poco/Data/SQLite/Binder.h

@@ -0,0 +1,220 @@
+//
+// Binder.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  Binder
+//
+// Definition of the Binder class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLite_Binder_INCLUDED
+#define Data_SQLite_Binder_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/AbstractBinder.h"
+#include "Poco/Data/LOB.h"
+#include "Poco/Any.h"
+#include "Poco/DynamicAny.h"
+#include "sqlite3.h"
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API Binder: public Poco::Data::AbstractBinder
+	/// Binds placeholders in the sql query to the provided values. Performs data types mapping.
+{
+public:
+	Binder(sqlite3_stmt* pStmt);
+		/// Creates the Binder.
+
+	~Binder();
+		/// Destroys the Binder.
+
+	void bind(std::size_t pos, const Poco::Int8 &val, Direction dir);
+		/// Binds an Int8.
+
+	void bind(std::size_t pos, const Poco::UInt8 &val, Direction dir);
+		/// Binds an UInt8.
+
+	void bind(std::size_t pos, const Poco::Int16 &val, Direction dir);
+		/// Binds an Int16.
+
+	void bind(std::size_t pos, const Poco::UInt16 &val, Direction dir);
+		/// Binds an UInt16.
+
+	void bind(std::size_t pos, const Poco::Int32 &val, Direction dir);
+		/// Binds an Int32.
+
+	void bind(std::size_t pos, const Poco::UInt32 &val, Direction dir);
+		/// Binds an UInt32.
+
+	void bind(std::size_t pos, const Poco::Int64 &val, Direction dir);
+		/// Binds an Int64.
+
+	void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir);
+		/// Binds an UInt64.
+
+#ifndef POCO_LONG_IS_64_BIT
+	void bind(std::size_t pos, const long &val, Direction dir);
+		/// Binds a long
+
+	void bind(std::size_t pos, const unsigned long &val, Direction dir);
+		/// Binds an unsigned long
+#endif
+
+	void bind(std::size_t pos, const bool &val, Direction dir);
+		/// Binds a boolean.
+
+	void bind(std::size_t pos, const float &val, Direction dir);
+		/// Binds a float.
+
+	void bind(std::size_t pos, const double &val, Direction dir);
+		/// Binds a double.
+
+	void bind(std::size_t pos, const char &val, Direction dir);
+		/// Binds a single character.
+
+	void bind(std::size_t pos, const char* const &pVal, Direction dir);
+		/// Binds a const char ptr.
+
+	void bind(std::size_t pos, const std::string& val, Direction dir);
+		/// Binds a string.
+
+	void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir);
+		/// Binds a BLOB.
+
+	void bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir);
+		/// Binds a CLOB.
+
+	void bind(std::size_t pos, const Date& val, Direction dir);
+		/// Binds a Date.
+
+	void bind(std::size_t pos, const Time& val, Direction dir);
+		/// Binds a Time.
+
+	void bind(std::size_t pos, const DateTime& val, Direction dir);
+		/// Binds a DateTime.
+
+	void bind(std::size_t pos, const NullData& val, Direction dir);
+		/// Binds a null.
+
+private:
+	void checkReturn(int rc);
+		/// Checks the SQLite return code and throws an appropriate exception
+		/// if error has occurred.
+
+	template <typename T>
+	void bindLOB(std::size_t pos, const Poco::Data::LOB<T>& val, Direction dir)
+	{
+		// convert a blob to a an unsigned char* array
+		const T* pData = reinterpret_cast<const T*>(val.rawContent());
+		int valSize = static_cast<int>(val.size());
+
+		int rc = sqlite3_bind_blob(_pStmt, static_cast<int>(pos), pData, valSize, SQLITE_STATIC); // no deep copy, do not free memory
+		checkReturn(rc);
+	}
+
+	sqlite3_stmt* _pStmt;
+};
+
+
+//
+// inlines
+//
+inline void Binder::bind(std::size_t pos, const Poco::Int8 &val, Direction dir)
+{
+	Poco::Int32 tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::UInt8 &val, Direction dir)
+{
+	Poco::Int32 tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::Int16 &val, Direction dir)
+{
+	Poco::Int32 tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::UInt16 &val, Direction dir)
+{
+	Poco::Int32 tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::UInt32 &val, Direction dir)
+{
+	Poco::Int32 tmp = static_cast<Poco::Int32>(val);
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::UInt64 &val, Direction dir)
+{
+	Poco::Int64 tmp = static_cast<Poco::Int64>(val);
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const bool &val, Direction dir)
+{
+	Poco::Int32 tmp = (val ? 1 : 0);
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const float &val, Direction dir)
+{
+	double tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const char &val, Direction dir)
+{
+	Poco::Int32 tmp = val;
+	bind(pos, tmp, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const char* const &pVal, Direction dir)
+{
+	std::string val(pVal);
+	bind(pos, val, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir)
+{
+	bindLOB<Poco::Data::BLOB::ValueType>(pos, val, dir);
+}
+
+
+inline void Binder::bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir)
+{
+	bindLOB<Poco::Data::CLOB::ValueType>(pos, val, dir);
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // Data_SQLite_Binder_INCLUDED

+ 79 - 0
ThirdParty/include/Poco/Data/SQLite/Connector.h

@@ -0,0 +1,79 @@
+//
+// Connector.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  Connector
+//
+// Definition of the Connector class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLite_Connector_INCLUDED
+#define Data_SQLite_Connector_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/Connector.h"
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API Connector: public Poco::Data::Connector
+	/// Connector instantiates SqLite SessionImpl objects.
+{
+public:
+	static const std::string KEY;
+		/// Keyword for creating SQLite sessions ("sqlite").
+
+	Connector();
+		/// Creates the Connector.
+
+	~Connector();
+		/// Destroys the Connector.
+
+	const std::string& name() const;
+		/// Returns the name associated with this connector.
+
+	Poco::AutoPtr<Poco::Data::SessionImpl> createSession(const std::string& connectionString,
+		std::size_t timeout = Poco::Data::SessionImpl::LOGIN_TIMEOUT_DEFAULT);
+		/// Creates a SQLite SessionImpl object and initializes it with the given connectionString.
+
+	static void registerConnector();
+		/// Registers the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory.
+
+	static void unregisterConnector();
+		/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory.
+
+	static void enableSharedCache(bool flag = true);
+		/// Enables or disables SQlite shared cache mode
+		/// (see http://www.sqlite.org/sharedcache.html for a discussion).
+
+	static void enableSoftHeapLimit(int limit);
+		/// Sets a soft upper limit to the amount of memory allocated
+		/// by SQLite. For more information, please see the SQLite
+		/// sqlite_soft_heap_limit() function (http://www.sqlite.org/c3ref/soft_heap_limit.html).
+};
+
+
+///
+/// inlines
+///
+inline const std::string& Connector::name() const
+{
+	return KEY;
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // Data_SQLite_Connector_INCLUDED

+ 313 - 0
ThirdParty/include/Poco/Data/SQLite/Extractor.h

@@ -0,0 +1,313 @@
+//
+// Extractor.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  Extractor
+//
+// Definition of the Extractor class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLite_Extractor_INCLUDED
+#define Data_SQLite_Extractor_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/SQLite/Utility.h"
+#include "Poco/Data/AbstractExtractor.h"
+#include "Poco/Data/MetaColumn.h"
+#include "Poco/Data/DataException.h"
+#include "Poco/Data/Constants.h"
+#include "Poco/Data/Date.h"
+#include "Poco/Data/Time.h"
+#include "Poco/Data/Date.h"
+#include "Poco/Data/Time.h"
+#include "Poco/Any.h"
+#include "Poco/DynamicAny.h"
+#include "sqlite3.h"
+#include <vector>
+#include <utility>
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API Extractor: public Poco::Data::AbstractExtractor
+	/// Extracts and converts data values form the result row returned by SQLite.
+	/// If NULL is received, the incoming val value is not changed and false is returned
+{
+public:
+	typedef std::vector<std::pair<bool, bool> > NullIndVec;
+		/// Type for null indicators container.
+
+	Extractor(sqlite3_stmt* pStmt);
+		/// Creates the Extractor.
+
+	~Extractor();
+		/// Destroys the Extractor.
+
+	bool extract(std::size_t pos, Poco::Int8& val);
+		/// Extracts an Int8.
+
+	bool extract(std::size_t pos, Poco::UInt8& val);
+		/// Extracts an UInt8.
+
+	bool extract(std::size_t pos, Poco::Int16& val);
+		/// Extracts an Int16.
+
+	bool extract(std::size_t pos, Poco::UInt16& val);
+		/// Extracts an UInt16.
+
+	bool extract(std::size_t pos, Poco::Int32& val);
+		/// Extracts an Int32.
+
+	bool extract(std::size_t pos, Poco::UInt32& val);
+		/// Extracts an UInt32.
+
+	bool extract(std::size_t pos, Poco::Int64& val);
+		/// Extracts an Int64.
+
+	bool extract(std::size_t pos, Poco::UInt64& val);
+		/// Extracts an UInt64.
+
+#ifndef POCO_LONG_IS_64_BIT
+	bool extract(std::size_t pos, long& val);
+		/// Extracts a long.
+
+	bool extract(std::size_t pos, unsigned long& val);
+		/// Extracts an unsigned long.
+#endif
+
+	bool extract(std::size_t pos, bool& val);
+		/// Extracts a boolean.
+
+	bool extract(std::size_t pos, float& val);
+		/// Extracts a float.
+
+	bool extract(std::size_t pos, double& val);
+		/// Extracts a double.
+
+	bool extract(std::size_t pos, char& val);
+		/// Extracts a single character.
+
+	bool extract(std::size_t pos, std::string& val);
+		/// Extracts a string.
+
+	bool extract(std::size_t pos, Poco::Data::BLOB& val);
+		/// Extracts a BLOB.
+
+	bool extract(std::size_t pos, Poco::Data::CLOB& val);
+		/// Extracts a CLOB.
+
+	bool extract(std::size_t pos, Poco::Data::Date& val);
+		/// Extracts a Date.
+
+	bool extract(std::size_t pos, Poco::Data::Time& val);
+		/// Extracts a Time.
+
+	bool extract(std::size_t pos, Poco::DateTime& val);
+		/// Extracts a DateTime.
+
+	bool extract(std::size_t pos, Poco::Any& val);
+		/// Extracts an Any.
+
+	bool extract(std::size_t pos, Poco::DynamicAny& val);
+		/// Extracts a DynamicAny.
+
+	bool isNull(std::size_t pos, std::size_t row = POCO_DATA_INVALID_ROW);
+		/// Returns true if the current row value at pos column is null.
+		/// Because of the loss of information about null-ness of the 
+		/// underlying database values due to the nature of SQLite engine, 
+		/// (once null value is converted to default value, SQLite API 
+		/// treats it  as non-null), a null indicator container member
+		/// variable is used to cache the indicators of the underlying nulls 
+		/// thus rendering this function idempotent. 
+		/// The container is a vector of [bool, bool] pairs.
+		/// The vector index corresponds to the column position, the first
+		/// bool value in the pair is true if the null indicator has 
+		/// been set and the second bool value in the pair is true if
+		/// the column is actually null.
+		/// The row argument, needed for connectors with bulk capabilities,
+		/// is ignored in this implementation.
+
+	void reset();
+		/// Clears the cached nulls indicator vector.
+
+private:
+	template <typename T>
+	bool extractImpl(std::size_t pos, T& val)
+		/// Utility function for extraction of Any and DynamicAny.
+	{
+		if (isNull(pos)) return false;
+
+		bool ret = false;
+
+		switch (Utility::getColumnType(_pStmt, pos))
+		{
+		case MetaColumn::FDT_BOOL:
+		{
+			bool i = false;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_INT8:
+		{
+			Poco::Int8 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_UINT8:
+		{
+			Poco::UInt8 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_INT16:
+		{
+			Poco::Int16 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_UINT16:
+		{
+			Poco::UInt16 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_INT32:
+		{
+			Poco::Int32 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_UINT32:
+		{
+			Poco::UInt32 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_INT64:
+		{
+			Poco::Int64 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_UINT64:
+		{
+			Poco::UInt64 i = 0;
+			ret = extract(pos, i); 
+			val = i;
+			break;
+		}
+		case MetaColumn::FDT_STRING:
+		{
+			std::string s;
+			ret = extract(pos, s); 
+			val = s;
+			break;
+		}
+		case MetaColumn::FDT_DOUBLE:
+		{
+			double d(0.0);
+			ret = extract(pos, d); 
+			val = d;
+			break;
+		}
+		case MetaColumn::FDT_FLOAT:
+		{
+			float f(0.0);
+			ret = extract(pos, f); 
+			val = f;
+			break;
+		}
+		case MetaColumn::FDT_BLOB:
+		{
+			BLOB b;
+			ret = extract(pos, b); 
+			val = b;
+			break;
+		}
+		case MetaColumn::FDT_DATE:
+		{
+			Date d;
+			ret = extract(pos, d); 
+			val = d;
+			break;
+		}
+		case MetaColumn::FDT_TIME:
+		{
+			Time t;
+			ret = extract(pos, t); 
+			val = t;
+			break;
+		}
+		case MetaColumn::FDT_TIMESTAMP:
+		{
+			DateTime dt;
+			ret = extract(pos, dt); 
+			val = dt;
+			break;
+		}
+		default:
+			throw Poco::Data::UnknownTypeException("Unknown type during extraction");
+		}
+
+		return ret;
+	}
+
+	template <typename T>
+	bool extractLOB(std::size_t pos, Poco::Data::LOB<T>& val)
+	{
+		if (isNull(pos)) return false;
+		int size = sqlite3_column_bytes(_pStmt, (int) pos);
+		const T* pTmp = reinterpret_cast<const T*>(sqlite3_column_blob(_pStmt, (int) pos));
+		val = Poco::Data::LOB<T>(pTmp, size);
+		return true;
+	}
+
+	sqlite3_stmt* _pStmt;
+	NullIndVec    _nulls;
+};
+
+
+///
+/// inlines
+///
+inline void Extractor::reset()
+{
+	_nulls.clear();
+}
+
+
+inline bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
+{
+	return extractLOB<Poco::Data::BLOB::ValueType>(pos, val);
+}
+
+
+inline bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
+{
+	return extractLOB<Poco::Data::CLOB::ValueType>(pos, val);
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // Data_SQLite_Extractor_INCLUDED

+ 195 - 0
ThirdParty/include/Poco/Data/SQLite/Notifier.h

@@ -0,0 +1,195 @@
+//
+// Notifier.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  Notifier
+//
+// Definition of Notifier.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef SQLite_Notifier_INCLUDED
+#define SQLite_Notifier_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/SQLite/Utility.h"
+#include "Poco/Data/Session.h"
+#include "Poco/Mutex.h"
+#include "Poco/Types.h"
+#include "Poco/Dynamic/Var.h"
+#include "Poco/BasicEvent.h"
+#include <map>
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API Notifier
+	/// Notifier is a wrapper for SQLite callback calls. It supports event callbacks
+	/// for insert, update, delete, commit and rollback events. While (un)registering 
+	/// callbacks is thread-safe, execution of the callbacks themselves are not; 
+	/// it is the user's responsibility to ensure the thread-safey of the functions 
+	/// they provide as callback target. Additionally, commit callbacks may prevent
+	/// database transactions from succeeding (see sqliteCommitCallbackFn documentation
+	/// for details). 
+	/// 
+	/// There can be only one set of callbacks per session (i.e. registering a new
+	/// callback automatically unregisters the previous one). All callbacks are 
+	/// registered and enabled at Notifier contruction time and can be disabled
+	/// at a later point time.
+{
+public:
+	typedef unsigned char EnabledEventType;
+		/// A type definition for events-enabled bitmap.
+
+	typedef Poco::BasicEvent<void> Event;
+
+	// 
+	// Events
+	// 
+	Event update;
+	Event insert;
+	Event erase;
+	Event commit;
+	Event rollback;
+
+	// Event types.
+	static const EnabledEventType SQLITE_NOTIFY_UPDATE   = 1;
+	static const EnabledEventType SQLITE_NOTIFY_COMMIT   = 2;
+	static const EnabledEventType SQLITE_NOTIFY_ROLLBACK = 4;
+
+	Notifier(const Session& session,
+		EnabledEventType enabled = SQLITE_NOTIFY_UPDATE | SQLITE_NOTIFY_COMMIT | SQLITE_NOTIFY_ROLLBACK);
+			/// Creates a Notifier and enables all callbacks.
+
+	Notifier(const Session& session,
+		const Any& value,
+		EnabledEventType enabled = SQLITE_NOTIFY_UPDATE | SQLITE_NOTIFY_COMMIT | SQLITE_NOTIFY_ROLLBACK);
+			/// Creates a Notifier, assigns the value to the internal storage and and enables all callbacks.
+
+	~Notifier();
+		/// Disables all callbacks and destroys the Notifier.
+
+	bool enableUpdate();
+		/// Enables update callbacks.
+
+	bool disableUpdate();
+		/// Disables update callbacks.
+
+	bool updateEnabled() const;
+		/// Returns true if update callbacks are enabled, false otherwise.
+
+	bool enableCommit();
+		/// Enables commit callbacks.
+
+	bool disableCommit();
+		/// Disables commit callbacks.
+
+	bool commitEnabled() const;
+		/// Returns true if update callbacks are enabled, false otherwise.
+
+	bool enableRollback();
+		/// Enables rollback callbacks.
+
+	bool disableRollback();
+		/// Disables rollback callbacks.
+
+	bool rollbackEnabled() const;
+		/// Returns true if rollback callbacks are enabled, false otherwise.
+
+	bool enableAll();
+		/// Enables all callbacks.
+
+	bool disableAll();
+		/// Disables all callbacks.
+
+	static void sqliteUpdateCallbackFn(void* pVal, int opCode, const char* pDB, const char* pTable, Poco::Int64 row);
+		/// Update callback event dispatcher. Determines the type of the event, updates the row number 
+		/// and triggers the event.
+
+	static int sqliteCommitCallbackFn(void* pVal);
+		/// Commit callback event dispatcher. If an exception occurs, it is catched inside this function,
+		/// non-zero value is returned, which causes SQLite engine to turn commit into a rollback.
+		/// Therefore, callers should check for return value - if it is zero, callback completed succesfuly
+		/// and transaction was committed.
+
+	static void sqliteRollbackCallbackFn(void* pVal);
+		/// Rollback callback event dispatcher.
+
+	bool operator == (const Notifier& other) const;
+		/// Equality operator. Compares value, row and database handles and
+		/// returns true iff all are equal.
+
+	Poco::Int64 getRow() const;
+		/// Returns the row number.
+
+	void setRow(Poco::Int64 row);
+		/// Sets the row number.
+
+	const Poco::Dynamic::Var& getValue() const;
+		/// Returns the value.
+
+	template <typename T>
+	inline void setValue(const T& val)
+		/// Sets the value.
+	{
+		_value = val;
+	}
+
+private:
+	Notifier();
+	Notifier(const Notifier&);
+	Notifier& operator=(const Notifier&);
+
+	const Session&     _session;
+	Poco::Dynamic::Var _value;
+	Poco::Int64        _row;
+	EnabledEventType   _enabledEvents;
+	Poco::Mutex        _mutex;
+};
+
+
+// 
+// inlines
+// 
+
+inline bool Notifier::operator == (const Notifier& other) const
+{
+	return _value == other._value &&
+		_row == other._row &&
+		Utility::dbHandle(_session) == Utility::dbHandle(other._session);
+}
+
+
+inline Poco::Int64 Notifier::getRow() const
+{
+	return _row;
+}
+
+
+inline void Notifier::setRow(Poco::Int64 row)
+	/// Sets the row number.
+{
+	_row = row;
+}
+
+
+inline const Poco::Dynamic::Var& Notifier::getValue() const
+{
+	return _value;
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // SQLite_Notifier_INCLUDED

+ 62 - 0
ThirdParty/include/Poco/Data/SQLite/SQLite.h

@@ -0,0 +1,62 @@
+//
+// SQLite.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  SQLite
+//
+// Basic definitions for the Poco SQLite library.
+// This file must be the first file included by every other SQLite
+// header file.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef SQLite_SQLite_INCLUDED
+#define SQLite_SQLite_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+//
+// The following block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the SQLite_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// SQLite_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+//
+#if defined(_WIN32) && defined(POCO_DLL)
+	#if defined(SQLite_EXPORTS)
+		#define SQLite_API __declspec(dllexport)
+	#else
+		#define SQLite_API __declspec(dllimport)
+	#endif
+#endif
+
+
+#if !defined(SQLite_API)
+	#if !defined(POCO_NO_GCC_API_ATTRIBUTE) && defined (__GNUC__) && (__GNUC__ >= 4)
+		#define SQLite_API __attribute__ ((visibility ("default")))
+	#else
+		#define SQLite_API
+	#endif
+#endif
+
+
+//
+// Automatically link SQLite library.
+//
+#if defined(_MSC_VER)
+	#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(SQLite_EXPORTS)
+		#pragma comment(lib, "PocoDataSQLite" POCO_LIB_SUFFIX)
+	#endif
+#endif
+
+
+#endif // SQLite_SQLite_INCLUDED

+ 60 - 0
ThirdParty/include/Poco/Data/SQLite/SQLiteException.h

@@ -0,0 +1,60 @@
+//
+// SQLiteException.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  SQLiteException
+//
+// Definition of SQLiteException.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef SQLite_SQLiteException_INCLUDED
+#define SQLite_SQLiteException_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/DataException.h"
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+POCO_DECLARE_EXCEPTION(SQLite_API, SQLiteException, Poco::Data::DataException)
+POCO_DECLARE_EXCEPTION(SQLite_API, InvalidSQLStatementException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, InternalDBErrorException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, DBAccessDeniedException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, ExecutionAbortedException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, DBLockedException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, TableLockedException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, NoMemoryException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, ReadOnlyException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, InterruptException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, IOErrorException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, CorruptImageException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, TableNotFoundException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, DatabaseFullException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, CantOpenDBFileException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, LockProtocolException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, SchemaDiffersException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, RowTooBigException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, ConstraintViolationException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, DataTypeMismatchException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, ParameterCountMismatchException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, InvalidLibraryUseException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, OSFeaturesMissingException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, AuthorizationDeniedException, SQLiteException)
+POCO_DECLARE_EXCEPTION(SQLite_API, TransactionException, SQLiteException)
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif

+ 155 - 0
ThirdParty/include/Poco/Data/SQLite/SQLiteStatementImpl.h

@@ -0,0 +1,155 @@
+//
+// SQLiteStatementImpl.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  SQLiteStatementImpl
+//
+// Definition of the SQLiteStatementImpl class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLite_SQLiteStatementImpl_INCLUDED
+#define Data_SQLite_SQLiteStatementImpl_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/SQLite/Binder.h"
+#include "Poco/Data/SQLite/Extractor.h"
+#include "Poco/Data/StatementImpl.h"
+#include "Poco/Data/MetaColumn.h"
+#include "Poco/SharedPtr.h"
+
+
+extern "C"
+{
+	typedef struct sqlite3 sqlite3;
+	typedef struct sqlite3_stmt sqlite3_stmt;
+}
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API SQLiteStatementImpl: public Poco::Data::StatementImpl
+	/// Implements statement functionality needed for SQLite
+{
+public:
+	SQLiteStatementImpl(Poco::Data::SessionImpl& rSession, sqlite3* pDB);
+		/// Creates the SQLiteStatementImpl.
+
+	~SQLiteStatementImpl();
+		/// Destroys the SQLiteStatementImpl.
+
+protected:
+	std::size_t columnsReturned() const;
+		/// Returns number of columns returned by query.
+
+	int affectedRowCount() const;
+		/// Returns the number of affected rows.
+		/// Used to find out the number of rows affected by insert, delete or update.
+		/// All changes are counted, even if they are later undone by a ROLLBACK or ABORT. 
+		/// Changes associated with creating and dropping tables are not counted.
+
+	const MetaColumn& metaColumn(std::size_t pos) const;
+		/// Returns column meta data.
+
+	bool hasNext();
+		/// Returns true if a call to next() will return data.
+
+	std::size_t next();
+		/// Retrieves the next row from the resultset and returns 1.
+		/// Will throw, if the resultset is empty.
+
+	bool canBind() const;
+		/// Returns true if a valid statement is set and we can bind.
+
+	bool canCompile() const;
+		/// Returns true if statement can compile.
+
+	void compileImpl();
+		/// Compiles the statement, doesn't bind yet.
+		/// Returns true if the statement was succesfully compiled.
+		/// The way SQLite handles batches of statmeents is by compiling
+		/// one at a time and returning a pointer to the next one.
+		/// The remainder of the statement is kept in a string
+		/// buffer pointed to by _pLeftover member.
+
+	void bindImpl();
+		/// Binds parameters
+
+	AbstractExtraction::ExtractorPtr extractor();
+		/// Returns the concrete extractor used by the statement.
+
+	AbstractBinding::BinderPtr binder();
+		/// Returns the concrete binder used by the statement.
+
+private:
+	void clear();
+		/// Removes the _pStmt
+
+	typedef Poco::SharedPtr<Binder>             BinderPtr;
+	typedef Poco::SharedPtr<Extractor>          ExtractorPtr;
+	typedef Poco::Data::AbstractBindingVec      Bindings;
+	typedef Poco::Data::AbstractExtractionVec   Extractions;
+	typedef std::vector<Poco::Data::MetaColumn> MetaColumnVec;
+	typedef std::vector<MetaColumnVec>          MetaColumnVecVec;
+	typedef Poco::SharedPtr<std::string>        StrPtr;
+	typedef Bindings::iterator                  BindIt;
+
+	sqlite3*         _pDB;
+	sqlite3_stmt*    _pStmt;
+	bool             _stepCalled;
+	int              _nextResponse;
+	BinderPtr        _pBinder;
+	ExtractorPtr     _pExtractor;
+	MetaColumnVecVec _columns;
+	int              _affectedRowCount;
+	StrPtr           _pLeftover;
+	BindIt           _bindBegin;
+	bool             _canBind;
+	bool             _isExtracted;
+	bool             _canCompile;
+
+	static const int POCO_SQLITE_INV_ROW_CNT;
+};
+
+
+//
+// inlines
+//
+inline AbstractExtraction::ExtractorPtr SQLiteStatementImpl::extractor()
+{
+	return _pExtractor;
+}
+
+
+inline AbstractBinding::BinderPtr SQLiteStatementImpl::binder()
+{
+	return _pBinder;
+}
+
+
+inline bool SQLiteStatementImpl::canBind() const
+{
+	return _canBind;
+}
+
+
+inline bool SQLiteStatementImpl::canCompile() const
+{
+	return _canCompile;
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // Data_SQLite_SQLiteStatementImpl_INCLUDED

+ 168 - 0
ThirdParty/include/Poco/Data/SQLite/SessionImpl.h

@@ -0,0 +1,168 @@
+//
+// SessionImpl.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  SessionImpl
+//
+// Definition of the SessionImpl class.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef Data_SQLite_SessionImpl_INCLUDED
+#define Data_SQLite_SessionImpl_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/SQLite/Connector.h"
+#include "Poco/Data/SQLite/Binder.h"
+#include "Poco/Data/AbstractSessionImpl.h"
+#include "Poco/SharedPtr.h"
+#include "Poco/Mutex.h"
+
+
+extern "C"
+{
+	typedef struct sqlite3 sqlite3;
+}
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API SessionImpl: public Poco::Data::AbstractSessionImpl<SessionImpl>
+	/// Implements SessionImpl interface.
+{
+public:
+	SessionImpl(const std::string& fileName,
+		std::size_t loginTimeout = LOGIN_TIMEOUT_DEFAULT);
+		/// Creates the SessionImpl. Opens a connection to the database.
+
+	~SessionImpl();
+		/// Destroys the SessionImpl.
+
+	Poco::Data::StatementImpl* createStatementImpl();
+		/// Returns an SQLite StatementImpl.
+
+	void open(const std::string& connect = "");
+		/// Opens a connection to the Database.
+		/// 
+		/// An in-memory system database (sys), with a single table (dual) 
+		/// containing single field (dummy) is attached to the database.
+		/// The in-memory system database is used to force change count
+		/// to be reset to zero on every new query (or batch of queries) 
+		/// execution. Without this functionality, select statements
+		/// executions that do not return any rows return the count of
+		/// changes effected by the most recent insert, update or delete.
+		/// In-memory system database can be queried and updated but can not
+		/// be dropped. It may be used for other purposes 
+		/// in the future.
+
+	void close();
+		/// Closes the session.
+
+	bool isConnected();
+		/// Returns true if connected, false otherwise.
+
+	void setConnectionTimeout(std::size_t timeout);
+		/// Sets the session connection timeout value.
+		/// Timeout value is in seconds.
+
+	std::size_t getConnectionTimeout();
+		/// Returns the session connection timeout value.
+		/// Timeout value is in seconds.
+
+	void begin();
+		/// Starts a transaction.
+
+	void commit();
+		/// Commits and ends a transaction.
+
+	void rollback();
+		/// Aborts a transaction.
+
+	bool canTransact();
+		/// Returns true if session has transaction capabilities.
+
+	bool isTransaction();
+		/// Returns true iff a transaction is a transaction is in progress, false otherwise.
+
+	void setTransactionIsolation(Poco::UInt32 ti);
+		/// Sets the transaction isolation level.
+
+	Poco::UInt32 getTransactionIsolation();
+		/// Returns the transaction isolation level.
+
+	bool hasTransactionIsolation(Poco::UInt32 ti);
+		/// Returns true iff the transaction isolation level corresponding
+		/// to the supplied bitmask is supported.
+
+	bool isTransactionIsolation(Poco::UInt32 ti);
+		/// Returns true iff the transaction isolation level corresponds
+		/// to the supplied bitmask.
+
+	void autoCommit(const std::string&, bool val);
+		/// Sets autocommit property for the session.
+
+	bool isAutoCommit(const std::string& name="");
+		/// Returns autocommit property value.
+
+	const std::string& connectorName() const;
+		/// Returns the name of the connector.
+
+protected:
+	void setConnectionTimeout(const std::string& prop, const Poco::Any& value);
+	Poco::Any getConnectionTimeout(const std::string& prop);
+
+private:
+	std::string _connector;
+	sqlite3*    _pDB;
+	bool        _connected;
+	bool        _isTransaction;
+	int         _timeout;
+	Poco::Mutex _mutex;
+
+	static const std::string DEFERRED_BEGIN_TRANSACTION;
+	static const std::string COMMIT_TRANSACTION;
+	static const std::string ABORT_TRANSACTION;
+};
+
+
+//
+// inlines
+//
+inline bool SessionImpl::canTransact()
+{
+	return true;
+}
+
+
+inline 	bool SessionImpl::isTransaction()
+{
+	return _isTransaction;
+}
+
+
+inline const std::string& SessionImpl::connectorName() const
+{
+	return _connector;
+}
+
+
+inline std::size_t SessionImpl::getConnectionTimeout()
+{
+	return static_cast<std::size_t>(_timeout/1000);
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // Data_SQLite_SessionImpl_INCLUDED

+ 240 - 0
ThirdParty/include/Poco/Data/SQLite/Utility.h

@@ -0,0 +1,240 @@
+//
+// Utility.h
+//
+// Library: Data/SQLite
+// Package: SQLite
+// Module:  Utility
+//
+// Definition of Utility.
+//
+// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier:	BSL-1.0
+//
+
+
+#ifndef SQLite_Utility_INCLUDED
+#define SQLite_Utility_INCLUDED
+
+
+#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/MetaColumn.h"
+#include "Poco/Data/Session.h"
+#include "Poco/Mutex.h"
+#include "Poco/Types.h"
+#include <map>
+
+
+extern "C"
+{
+	typedef struct sqlite3 sqlite3;
+	typedef struct sqlite3_stmt sqlite3_stmt;
+	typedef struct sqlite3_mutex* _pMutex;
+}
+
+
+namespace Poco {
+namespace Data {
+namespace SQLite {
+
+
+class SQLite_API Utility
+	/// Various utility functions for SQLite.
+{
+public:
+	static const std::string SQLITE_DATE_FORMAT;
+	static const std::string SQLITE_TIME_FORMAT;
+	typedef std::map<std::string, MetaColumn::ColumnDataType> TypeMap;
+
+	static const int THREAD_MODE_SINGLE;
+	static const int THREAD_MODE_MULTI;
+	static const int THREAD_MODE_SERIAL;
+
+	static const int OPERATION_INSERT;
+	static const int OPERATION_DELETE;
+	static const int OPERATION_UPDATE;
+
+	static sqlite3* dbHandle(const Session& session);
+		/// Returns native DB handle.
+
+	static std::string lastError(sqlite3* pDB);
+		/// Retreives the last error code from sqlite and converts it to a string.
+
+	static std::string lastError(const Session& session);
+		/// Retreives the last error code from sqlite and converts it to a string.
+
+	static void throwException(sqlite3* pDB, int rc, const std::string& addErrMsg = std::string());
+		/// Throws for an error code the appropriate exception
+
+	static MetaColumn::ColumnDataType getColumnType(sqlite3_stmt* pStmt, std::size_t pos);
+		/// Returns column data type.
+
+	static bool fileToMemory(sqlite3* pInMemory, const std::string& fileName);
+		/// Loads the contents of a database file on disk into an opened
+		/// database in memory.
+		/// 
+		/// Returns true if succesful.
+
+	static bool fileToMemory(const Session& session, const std::string& fileName);
+		/// Loads the contents of a database file on disk into an opened
+		/// database in memory.
+		/// 
+		/// Returns true if succesful.
+
+	static bool memoryToFile(const std::string& fileName, sqlite3* pInMemory);
+		/// Saves the contents of an opened database in memory to the
+		/// database on disk.
+		/// 
+		/// Returns true if succesful.
+
+	static bool memoryToFile(const std::string& fileName, const Session& session);
+		/// Saves the contents of an opened database in memory to the
+		/// database on disk.
+		/// 
+		/// Returns true if succesful.
+
+	static bool isThreadSafe();
+		/// Returns true if SQLite was compiled in multi-thread or serialized mode.
+		/// See http://www.sqlite.org/c3ref/threadsafe.html for details.
+		/// 
+		/// Returns true if succesful
+
+	static bool setThreadMode(int mode);
+		/// Sets the threading mode to single, multi or serialized.
+		/// See http://www.sqlite.org/threadsafe.html for details.
+		/// 
+		/// Returns true if succesful
+
+	static int getThreadMode();
+		/// Returns the thread mode.
+
+	typedef void(*UpdateCallbackType)(void*, int, const char*, const char*, Poco::Int64);
+		/// Update callback function type.
+ 
+	typedef int(*CommitCallbackType)(void*);
+		/// Commit callback function type.
+
+	typedef void(*RollbackCallbackType)(void*);
+		/// Rollback callback function type.
+
+	template <typename T, typename CBT>
+	static bool registerUpdateHandler(sqlite3* pDB, CBT callbackFn, T* pParam)
+		/// Registers the callback for (1)(insert, delete, update), (2)(commit) or 
+		/// or (3)(rollback) events. Only one function per group can be registered
+		/// at a time. Registration is not thread-safe. Storage pointed to by pParam
+		/// must remain valid as long as registration is active. Registering with
+		/// callbackFn set to zero disables notifications.
+		/// 
+		/// See http://www.sqlite.org/c3ref/update_hook.html and 
+		/// http://www.sqlite.org/c3ref/commit_hook.html for details.
+	{
+		typedef std::pair<CBT, T*> CBPair;
+		typedef std::multimap<sqlite3*, CBPair> CBMap;
+		typedef typename CBMap::iterator CBMapIt;
+		typedef std::pair<CBMapIt, CBMapIt> CBMapItPair;
+
+		static CBMap retMap;
+		T* pRet = reinterpret_cast<T*>(eventHookRegister(pDB, callbackFn, pParam));
+
+		if (pRet == 0)
+		{
+			if (retMap.find(pDB) == retMap.end())
+			{
+				retMap.insert(std::make_pair(pDB, CBPair(callbackFn, pParam)));
+				return true;
+			}
+		}
+		else
+		{
+			CBMapItPair retMapRange = retMap.equal_range(pDB);
+			for (CBMapIt it = retMapRange.first; it != retMapRange.second; ++it)
+			{
+				poco_assert (it->second.first != 0);
+				if ((callbackFn == 0) && (*pRet == *it->second.second))
+				{
+					retMap.erase(it);
+					return true;
+				}
+
+				if ((callbackFn == it->second.first) && (*pRet == *it->second.second))
+				{
+					it->second.second = pParam;
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+	template <typename T, typename CBT>
+	static bool registerUpdateHandler(const Session& session, CBT callbackFn, T* pParam)
+		/// Registers the callback by calling registerUpdateHandler(sqlite3*, CBT, T*).
+	{
+		return registerUpdateHandler(dbHandle(session), callbackFn, pParam);
+	}
+
+	class SQLiteMutex
+	{
+	public:
+		SQLiteMutex(sqlite3* pDB);
+		~SQLiteMutex();
+
+	private:
+		SQLiteMutex();
+		sqlite3_mutex* _pMutex;
+	};
+
+private:
+	Utility();
+		/// Maps SQLite column declared types to Poco::Data types through
+		/// static TypeMap member.
+		/// 
+		/// Note: SQLite is type-agnostic and it is the end-user responsibility
+		/// to ensure that column declared data type corresponds to the type of 
+		/// data actually held in the database.
+		/// 
+		/// Column types are case-insensitive.
+
+	Utility(const Utility&);
+	Utility& operator = (const Utility&);
+
+	static void* eventHookRegister(sqlite3* pDB, UpdateCallbackType callbackFn, void* pParam);
+	static void* eventHookRegister(sqlite3* pDB, CommitCallbackType callbackFn, void* pParam);
+	static void* eventHookRegister(sqlite3* pDB, RollbackCallbackType callbackFn, void* pParam);
+
+	static TypeMap     _types;
+	static Poco::Mutex _mutex;
+	static int         _threadMode;
+};
+
+
+//
+// inlines
+//
+inline std::string Utility::lastError(const Session& session)
+{
+	poco_assert_dbg ((0 == icompare(session.connector(), 0, 6, "sqlite")));
+	return lastError(dbHandle(session));
+}
+
+
+inline bool Utility::memoryToFile(const std::string& fileName, const Session& session)
+{
+	poco_assert_dbg ((0 == icompare(session.connector(), 0, 6, "sqlite")));
+	return memoryToFile(fileName, dbHandle(session));
+}
+
+
+inline bool Utility::fileToMemory(const Session& session, const std::string& fileName)
+{
+	poco_assert_dbg ((0 == icompare(session.connector(), 0, 6, "sqlite")));
+	return fileToMemory(dbHandle(session), fileName);
+}
+
+
+} } } // namespace Poco::Data::SQLite
+
+
+#endif // SQLite_Utility_INCLUDED

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio