From 210676c6797ef6b75d957988f583a5e52ea224ca Mon Sep 17 00:00:00 2001 From: Marin Dusserre Date: Fri, 1 Sep 2017 11:18:32 +0200 Subject: [PATCH] IFR improvment --- InvenSenseController.cpp | 7 + InvenSenseController.h | 4 + com_sensics_InvenSense.cpp | 771 ++- .../external/include/Poco/ASCIIEncoding.h | 53 + .../external/include/Poco/AbstractCache.h | 368 ++ .../external/include/Poco/AbstractDelegate.h | 112 + .../external/include/Poco/AbstractEvent.h | 560 +++ .../external/include/Poco/AbstractObserver.h | 52 + .../include/Poco/AbstractPriorityDelegate.h | 65 + .../external/include/Poco/AbstractStrategy.h | 79 + .../include/Poco/AccessExpirationDecorator.h | 85 + .../external/include/Poco/AccessExpireCache.h | 65 + .../include/Poco/AccessExpireLRUCache.h | 64 + .../include/Poco/AccessExpireStrategy.h | 73 + .../external/include/Poco/ActiveDispatcher.h | 118 + .../invn/external/include/Poco/ActiveMethod.h | 220 + .../invn/external/include/Poco/ActiveResult.h | 497 ++ .../external/include/Poco/ActiveRunnable.h | 233 + .../external/include/Poco/ActiveStarter.h | 50 + vendor/invn/external/include/Poco/Activity.h | 210 + vendor/invn/external/include/Poco/Alignment.h | 248 + vendor/invn/external/include/Poco/Any.h | 601 +++ .../external/include/Poco/ArchiveStrategy.h | 148 + vendor/invn/external/include/Poco/Array.h | 251 + vendor/invn/external/include/Poco/Ascii.h | 222 + .../invn/external/include/Poco/AsyncChannel.h | 102 + .../external/include/Poco/AtomicCounter.h | 358 ++ vendor/invn/external/include/Poco/AutoPtr.h | 358 ++ .../external/include/Poco/AutoReleasePool.h | 88 + .../external/include/Poco/Base32Decoder.h | 106 + .../external/include/Poco/Base32Encoder.h | 112 + .../external/include/Poco/Base64Decoder.h | 106 + .../external/include/Poco/Base64Encoder.h | 124 + .../invn/external/include/Poco/BasicEvent.h | 62 + .../invn/external/include/Poco/BinaryReader.h | 267 + .../invn/external/include/Poco/BinaryWriter.h | 271 + vendor/invn/external/include/Poco/Buffer.h | 331 ++ .../external/include/Poco/BufferAllocator.h | 54 + .../Poco/BufferedBidirectionalStreamBuf.h | 176 + .../external/include/Poco/BufferedStreamBuf.h | 168 + vendor/invn/external/include/Poco/Bugcheck.h | 187 + vendor/invn/external/include/Poco/ByteOrder.h | 241 + vendor/invn/external/include/Poco/Channel.h | 80 + vendor/invn/external/include/Poco/Checksum.h | 110 + .../invn/external/include/Poco/ClassLibrary.h | 103 + .../invn/external/include/Poco/ClassLoader.h | 365 ++ vendor/invn/external/include/Poco/Clock.h | 240 + vendor/invn/external/include/Poco/Condition.h | 139 + vendor/invn/external/include/Poco/Config.h | 171 + .../invn/external/include/Poco/Configurable.h | 72 + .../external/include/Poco/ConsoleChannel.h | 189 + .../external/include/Poco/CountingStream.h | 239 + .../include/Poco/CppParser/Attributes.h | 125 + .../include/Poco/CppParser/AttributesParser.h | 116 + .../external/include/Poco/CppParser/BuiltIn.h | 49 + .../include/Poco/CppParser/CppParser.h | 60 + .../include/Poco/CppParser/CppToken.h | 283 ++ .../external/include/Poco/CppParser/Decl.h | 64 + .../external/include/Poco/CppParser/Enum.h | 79 + .../include/Poco/CppParser/EnumValue.h | 68 + .../include/Poco/CppParser/Function.h | 168 + .../include/Poco/CppParser/NameSpace.h | 140 + .../include/Poco/CppParser/Parameter.h | 144 + .../external/include/Poco/CppParser/Parser.h | 129 + .../external/include/Poco/CppParser/Struct.h | 207 + .../external/include/Poco/CppParser/Symbol.h | 268 + .../include/Poco/CppParser/Tokenizer.h | 46 + .../external/include/Poco/CppParser/TypeDef.h | 51 + .../external/include/Poco/CppParser/Utility.h | 87 + .../include/Poco/CppParser/Variable.h | 94 + .../external/include/Poco/Crypto/Cipher.h | 140 + .../include/Poco/Crypto/CipherFactory.h | 77 + .../external/include/Poco/Crypto/CipherImpl.h | 71 + .../external/include/Poco/Crypto/CipherKey.h | 184 + .../include/Poco/Crypto/CipherKeyImpl.h | 172 + .../external/include/Poco/Crypto/Crypto.h | 119 + .../include/Poco/Crypto/CryptoStream.h | 194 + .../include/Poco/Crypto/CryptoTransform.h | 78 + .../include/Poco/Crypto/DigestEngine.h | 82 + .../include/Poco/Crypto/OpenSSLInitializer.h | 117 + .../include/Poco/Crypto/RSACipherImpl.h | 79 + .../include/Poco/Crypto/RSADigestEngine.h | 113 + .../external/include/Poco/Crypto/RSAKey.h | 133 + .../external/include/Poco/Crypto/RSAKeyImpl.h | 131 + .../include/Poco/Crypto/X509Certificate.h | 185 + .../include/Poco/DOM/AbstractContainerNode.h | 78 + .../external/include/Poco/DOM/AbstractNode.h | 127 + vendor/invn/external/include/Poco/DOM/Attr.h | 182 + .../invn/external/include/Poco/DOM/AttrMap.h | 67 + .../invn/external/include/Poco/DOM/AutoPtr.h | 37 + .../external/include/Poco/DOM/CDATASection.h | 86 + .../external/include/Poco/DOM/CharacterData.h | 125 + .../include/Poco/DOM/ChildNodesList.h | 57 + .../invn/external/include/Poco/DOM/Comment.h | 60 + .../external/include/Poco/DOM/DOMBuilder.h | 114 + .../external/include/Poco/DOM/DOMException.h | 114 + .../include/Poco/DOM/DOMImplementation.h | 84 + .../external/include/Poco/DOM/DOMObject.h | 105 + .../external/include/Poco/DOM/DOMParser.h | 109 + .../external/include/Poco/DOM/DOMSerializer.h | 124 + .../external/include/Poco/DOM/DOMWriter.h | 129 + .../invn/external/include/Poco/DOM/DTDMap.h | 69 + .../invn/external/include/Poco/DOM/Document.h | 279 ++ .../external/include/Poco/DOM/DocumentEvent.h | 67 + .../include/Poco/DOM/DocumentFragment.h | 86 + .../external/include/Poco/DOM/DocumentType.h | 127 + .../invn/external/include/Poco/DOM/Element.h | 221 + .../include/Poco/DOM/ElementsByTagNameList.h | 88 + .../invn/external/include/Poco/DOM/Entity.h | 128 + .../include/Poco/DOM/EntityReference.h | 75 + vendor/invn/external/include/Poco/DOM/Event.h | 211 + .../include/Poco/DOM/EventDispatcher.h | 99 + .../include/Poco/DOM/EventException.h | 83 + .../external/include/Poco/DOM/EventListener.h | 59 + .../external/include/Poco/DOM/EventTarget.h | 78 + .../external/include/Poco/DOM/MutationEvent.h | 145 + .../external/include/Poco/DOM/NamedNodeMap.h | 95 + vendor/invn/external/include/Poco/DOM/Node.h | 287 ++ .../external/include/Poco/DOM/NodeAppender.h | 83 + .../external/include/Poco/DOM/NodeFilter.h | 148 + .../external/include/Poco/DOM/NodeIterator.h | 169 + .../invn/external/include/Poco/DOM/NodeList.h | 63 + .../invn/external/include/Poco/DOM/Notation.h | 95 + .../include/Poco/DOM/ProcessingInstruction.h | 101 + vendor/invn/external/include/Poco/DOM/Text.h | 81 + .../external/include/Poco/DOM/TreeWalker.h | 213 + .../include/Poco/Data/AbstractBinder.h | 375 ++ .../include/Poco/Data/AbstractBinding.h | 146 + .../include/Poco/Data/AbstractExtraction.h | 280 ++ .../include/Poco/Data/AbstractExtractor.h | 353 ++ .../include/Poco/Data/AbstractPreparation.h | 73 + .../include/Poco/Data/AbstractPreparator.h | 390 ++ .../include/Poco/Data/AbstractSessionImpl.h | 317 ++ .../include/Poco/Data/ArchiveStrategy.h | 224 + .../include/Poco/Data/AutoTransaction.h | 37 + .../invn/external/include/Poco/Data/Binding.h | 1498 ++++++ vendor/invn/external/include/Poco/Data/Bulk.h | 98 + .../external/include/Poco/Data/BulkBinding.h | 150 + .../include/Poco/Data/BulkExtraction.h | 277 + .../invn/external/include/Poco/Data/Column.h | 492 ++ .../external/include/Poco/Data/Connector.h | 58 + .../external/include/Poco/Data/Constants.h | 38 + vendor/invn/external/include/Poco/Data/Data.h | 64 + .../include/Poco/Data/DataException.h | 52 + vendor/invn/external/include/Poco/Data/Date.h | 227 + .../include/Poco/Data/DynamicDateTime.h | 49 + .../external/include/Poco/Data/DynamicLOB.h | 47 + .../external/include/Poco/Data/Extraction.h | 870 ++++ vendor/invn/external/include/Poco/Data/LOB.h | 311 ++ .../external/include/Poco/Data/LOBStream.h | 152 + .../invn/external/include/Poco/Data/Limit.h | 115 + .../external/include/Poco/Data/MetaColumn.h | 190 + .../include/Poco/Data/PooledSessionHolder.h | 101 + .../include/Poco/Data/PooledSessionImpl.h | 99 + .../external/include/Poco/Data/Position.h | 77 + .../external/include/Poco/Data/Preparation.h | 163 + .../invn/external/include/Poco/Data/Range.h | 106 + .../external/include/Poco/Data/RecordSet.h | 675 +++ vendor/invn/external/include/Poco/Data/Row.h | 317 ++ .../external/include/Poco/Data/RowFilter.h | 265 + .../external/include/Poco/Data/RowFormatter.h | 233 + .../external/include/Poco/Data/RowIterator.h | 152 + .../external/include/Poco/Data/SQLChannel.h | 219 + .../include/Poco/Data/SQLite/Binder.h | 222 + .../include/Poco/Data/SQLite/Connector.h | 145 + .../include/Poco/Data/SQLite/Extractor.h | 315 ++ .../include/Poco/Data/SQLite/Notifier.h | 197 + .../include/Poco/Data/SQLite/SQLite.h | 64 + .../Poco/Data/SQLite/SQLiteException.h | 62 + .../Poco/Data/SQLite/SQLiteStatementImpl.h | 157 + .../include/Poco/Data/SQLite/SessionImpl.h | 168 + .../include/Poco/Data/SQLite/Utility.h | 230 + .../invn/external/include/Poco/Data/Session.h | 496 ++ .../include/Poco/Data/SessionFactory.h | 101 + .../external/include/Poco/Data/SessionImpl.h | 223 + .../external/include/Poco/Data/SessionPool.h | 229 + .../include/Poco/Data/SessionPoolContainer.h | 116 + .../include/Poco/Data/SimpleRowFormatter.h | 124 + .../external/include/Poco/Data/Statement.h | 813 +++ .../include/Poco/Data/StatementCreator.h | 75 + .../include/Poco/Data/StatementImpl.h | 633 +++ vendor/invn/external/include/Poco/Data/Time.h | 231 + .../external/include/Poco/Data/Transaction.h | 196 + .../external/include/Poco/Data/TypeHandler.h | 2092 ++++++++ vendor/invn/external/include/Poco/DateTime.h | 417 ++ .../external/include/Poco/DateTimeFormat.h | 111 + .../external/include/Poco/DateTimeFormatter.h | 217 + .../external/include/Poco/DateTimeParser.h | 118 + vendor/invn/external/include/Poco/Debugger.h | 75 + .../external/include/Poco/DefaultStrategy.h | 228 + .../external/include/Poco/DeflatingStream.h | 203 + vendor/invn/external/include/Poco/Delegate.h | 456 ++ .../external/include/Poco/DeviceIO/Channel.h | 242 + .../include/Poco/DeviceIO/ChannelConfig.h | 161 + .../Poco/DeviceIO/Serial/SerialChannel.h | 137 + .../Poco/DeviceIO/Serial/SerialConfig.h | 354 ++ .../Poco/DeviceIO/Serial/SerialPortEnum.h | 53 + .../DeviceIO/Serial/VirtualSerialPortEnum.h | 67 + .../Serial/impl/SerialChannel_WIN32.h | 84 + .../DeviceIO/Serial/impl/SerialConfig_WIN32.h | 335 ++ .../invn/external/include/Poco/DigestEngine.h | 108 + .../invn/external/include/Poco/DigestStream.h | 102 + .../external/include/Poco/DirectoryIterator.h | 155 + .../include/Poco/DirectoryIteratorStrategy.h | 94 + .../include/Poco/DirectoryIterator_UNIX.h | 74 + .../include/Poco/DirectoryIterator_VMS.h | 77 + .../include/Poco/DirectoryIterator_WIN32.h | 75 + .../include/Poco/DirectoryIterator_WIN32U.h | 75 + .../external/include/Poco/DirectoryWatcher.h | 234 + .../invn/external/include/Poco/Dynamic/Pair.h | 414 ++ .../external/include/Poco/Dynamic/Struct.h | 563 +++ .../invn/external/include/Poco/Dynamic/Var.h | 2194 ++++++++ .../external/include/Poco/Dynamic/VarHolder.h | 3554 +++++++++++++ .../include/Poco/Dynamic/VarIterator.h | 153 + .../invn/external/include/Poco/DynamicAny.h | 26 + .../external/include/Poco/DynamicAnyHolder.h | 26 + .../external/include/Poco/DynamicFactory.h | 138 + .../external/include/Poco/DynamicStruct.h | 26 + .../invn/external/include/Poco/Environment.h | 111 + .../external/include/Poco/Environment_UNIX.h | 58 + .../external/include/Poco/Environment_VMS.h | 59 + .../external/include/Poco/Environment_VX.h | 58 + .../external/include/Poco/Environment_WIN32.h | 50 + .../include/Poco/Environment_WIN32U.h | 50 + .../external/include/Poco/Environment_WINCE.h | 61 + vendor/invn/external/include/Poco/Error.h | 54 + .../invn/external/include/Poco/ErrorHandler.h | 122 + vendor/invn/external/include/Poco/Event.h | 125 + vendor/invn/external/include/Poco/EventArgs.h | 47 + .../external/include/Poco/EventLogChannel.h | 107 + .../invn/external/include/Poco/Event_POSIX.h | 79 + vendor/invn/external/include/Poco/Event_VX.h | 51 + .../invn/external/include/Poco/Event_WIN32.h | 70 + vendor/invn/external/include/Poco/Exception.h | 260 + .../include/Poco/ExpirationDecorator.h | 94 + vendor/invn/external/include/Poco/Expire.h | 196 + .../invn/external/include/Poco/ExpireCache.h | 67 + .../external/include/Poco/ExpireLRUCache.h | 64 + .../external/include/Poco/ExpireStrategy.h | 134 + .../invn/external/include/Poco/FIFOBuffer.h | 558 +++ .../external/include/Poco/FIFOBufferStream.h | 156 + vendor/invn/external/include/Poco/FIFOEvent.h | 65 + .../invn/external/include/Poco/FIFOStrategy.h | 61 + .../external/include/Poco/FPEnvironment.h | 207 + .../external/include/Poco/FPEnvironment_C99.h | 127 + .../external/include/Poco/FPEnvironment_DEC.h | 91 + .../include/Poco/FPEnvironment_DUMMY.h | 151 + .../external/include/Poco/FPEnvironment_SUN.h | 76 + .../include/Poco/FPEnvironment_WIN32.h | 152 + vendor/invn/external/include/Poco/File.h | 282 ++ .../invn/external/include/Poco/FileChannel.h | 266 + .../invn/external/include/Poco/FileStream.h | 178 + .../external/include/Poco/FileStreamFactory.h | 63 + .../external/include/Poco/FileStream_POSIX.h | 74 + .../external/include/Poco/FileStream_WIN32.h | 73 + vendor/invn/external/include/Poco/File_UNIX.h | 84 + vendor/invn/external/include/Poco/File_VMS.h | 81 + vendor/invn/external/include/Poco/File_VX.h | 82 + .../invn/external/include/Poco/File_WIN32.h | 85 + .../invn/external/include/Poco/File_WIN32U.h | 86 + .../invn/external/include/Poco/File_WINCE.h | 85 + vendor/invn/external/include/Poco/Format.h | 140 + vendor/invn/external/include/Poco/Formatter.h | 76 + .../external/include/Poco/FormattingChannel.h | 98 + .../invn/external/include/Poco/Foundation.h | 153 + .../external/include/Poco/FunctionDelegate.h | 440 ++ .../include/Poco/FunctionPriorityDelegate.h | 452 ++ vendor/invn/external/include/Poco/Glob.h | 154 + .../invn/external/include/Poco/HMACEngine.h | 148 + vendor/invn/external/include/Poco/Hash.h | 107 + .../invn/external/include/Poco/HashFunction.h | 59 + vendor/invn/external/include/Poco/HashMap.h | 230 + vendor/invn/external/include/Poco/HashSet.h | 179 + .../external/include/Poco/HashStatistic.h | 128 + vendor/invn/external/include/Poco/HashTable.h | 371 ++ .../external/include/Poco/HexBinaryDecoder.h | 96 + .../external/include/Poco/HexBinaryEncoder.h | 119 + .../external/include/Poco/InflatingStream.h | 213 + .../invn/external/include/Poco/Instantiator.h | 84 + .../invn/external/include/Poco/JSON/Array.h | 527 ++ .../invn/external/include/Poco/JSON/Handler.h | 103 + vendor/invn/external/include/Poco/JSON/JSON.h | 64 + .../include/Poco/JSON/JSONException.h | 37 + .../invn/external/include/Poco/JSON/Object.h | 625 +++ .../external/include/Poco/JSON/ParseHandler.h | 167 + .../invn/external/include/Poco/JSON/Parser.h | 741 +++ .../external/include/Poco/JSON/PrintHandler.h | 138 + .../invn/external/include/Poco/JSON/Query.h | 112 + .../external/include/Poco/JSON/Stringifier.h | 72 + .../external/include/Poco/JSON/Template.h | 149 + .../include/Poco/JSON/TemplateCache.h | 101 + .../invn/external/include/Poco/KeyValueArgs.h | 75 + vendor/invn/external/include/Poco/LRUCache.h | 58 + .../invn/external/include/Poco/LRUStrategy.h | 142 + .../external/include/Poco/Latin1Encoding.h | 53 + .../external/include/Poco/Latin2Encoding.h | 56 + .../external/include/Poco/Latin9Encoding.h | 56 + .../include/Poco/LineEndingConverter.h | 183 + .../external/include/Poco/LinearHashTable.h | 505 ++ vendor/invn/external/include/Poco/ListMap.h | 259 + .../external/include/Poco/LocalDateTime.h | 390 ++ vendor/invn/external/include/Poco/LogFile.h | 97 + .../invn/external/include/Poco/LogFile_STD.h | 54 + .../invn/external/include/Poco/LogFile_VMS.h | 55 + .../external/include/Poco/LogFile_WIN32.h | 56 + .../external/include/Poco/LogFile_WIN32U.h | 56 + vendor/invn/external/include/Poco/LogStream.h | 187 + vendor/invn/external/include/Poco/Logger.h | 1320 +++++ .../external/include/Poco/LoggingFactory.h | 95 + .../external/include/Poco/LoggingRegistry.h | 101 + vendor/invn/external/include/Poco/MD4Engine.h | 97 + vendor/invn/external/include/Poco/MD5Engine.h | 97 + vendor/invn/external/include/Poco/Manifest.h | 182 + .../invn/external/include/Poco/MemoryPool.h | 115 + .../invn/external/include/Poco/MemoryStream.h | 239 + vendor/invn/external/include/Poco/Message.h | 273 + .../invn/external/include/Poco/MetaObject.h | 203 + .../external/include/Poco/MetaProgramming.h | 146 + vendor/invn/external/include/Poco/Mutex.h | 272 + .../invn/external/include/Poco/Mutex_POSIX.h | 88 + vendor/invn/external/include/Poco/Mutex_VX.h | 82 + .../invn/external/include/Poco/Mutex_WIN32.h | 87 + .../invn/external/include/Poco/Mutex_WINCE.h | 52 + vendor/invn/external/include/Poco/NObserver.h | 128 + .../invn/external/include/Poco/NamedEvent.h | 100 + .../include/Poco/NamedEvent_Android.h | 42 + .../external/include/Poco/NamedEvent_UNIX.h | 57 + .../external/include/Poco/NamedEvent_VMS.h | 46 + .../external/include/Poco/NamedEvent_WIN32.h | 47 + .../external/include/Poco/NamedEvent_WIN32U.h | 48 + .../invn/external/include/Poco/NamedMutex.h | 114 + .../include/Poco/NamedMutex_Android.h | 43 + .../external/include/Poco/NamedMutex_UNIX.h | 60 + .../external/include/Poco/NamedMutex_VMS.h | 50 + .../external/include/Poco/NamedMutex_WIN32.h | 48 + .../external/include/Poco/NamedMutex_WIN32U.h | 49 + .../invn/external/include/Poco/NamedTuple.h | 4464 +++++++++++++++++ .../include/Poco/NestedDiagnosticContext.h | 183 + .../Poco/Net/AbstractHTTPRequestHandler.h | 138 + .../Poco/Net/AcceptCertificateHandler.h | 54 + .../Poco/Net/CertificateHandlerFactory.h | 95 + .../Poco/Net/CertificateHandlerFactoryMgr.h | 66 + .../Poco/Net/ConsoleCertificateHandler.h | 52 + .../invn/external/include/Poco/Net/Context.h | 319 ++ vendor/invn/external/include/Poco/Net/DNS.h | 158 + .../include/Poco/Net/DatagramSocket.h | 149 + .../include/Poco/Net/DatagramSocketImpl.h | 61 + .../external/include/Poco/Net/DialogSocket.h | 211 + .../include/Poco/Net/FTPClientSession.h | 405 ++ .../include/Poco/Net/FTPStreamFactory.h | 122 + .../include/Poco/Net/FilePartSource.h | 79 + .../invn/external/include/Poco/Net/HTMLForm.h | 248 + .../Poco/Net/HTTPAuthenticationParams.h | 105 + .../include/Poco/Net/HTTPBasicCredentials.h | 113 + .../include/Poco/Net/HTTPBasicStreamBuf.h | 38 + .../include/Poco/Net/HTTPBufferAllocator.h | 52 + .../include/Poco/Net/HTTPChunkedStream.h | 107 + .../include/Poco/Net/HTTPClientSession.h | 366 ++ .../external/include/Poco/Net/HTTPCookie.h | 274 + .../include/Poco/Net/HTTPCredentials.h | 193 + .../include/Poco/Net/HTTPDigestCredentials.h | 175 + .../include/Poco/Net/HTTPFixedLengthStream.h | 112 + .../include/Poco/Net/HTTPHeaderStream.h | 104 + .../external/include/Poco/Net/HTTPIOStream.h | 90 + .../external/include/Poco/Net/HTTPMessage.h | 187 + .../external/include/Poco/Net/HTTPRequest.h | 192 + .../include/Poco/Net/HTTPRequestHandler.h | 69 + .../Poco/Net/HTTPRequestHandlerFactory.h | 71 + .../external/include/Poco/Net/HTTPResponse.h | 251 + .../include/Poco/Net/HTTPSClientSession.h | 167 + .../Poco/Net/HTTPSSessionInstantiator.h | 67 + .../include/Poco/Net/HTTPSStreamFactory.h | 85 + .../external/include/Poco/Net/HTTPServer.h | 105 + .../include/Poco/Net/HTTPServerConnection.h | 67 + .../Poco/Net/HTTPServerConnectionFactory.h | 57 + .../include/Poco/Net/HTTPServerParams.h | 156 + .../include/Poco/Net/HTTPServerRequest.h | 80 + .../include/Poco/Net/HTTPServerRequestImpl.h | 136 + .../include/Poco/Net/HTTPServerResponse.h | 118 + .../include/Poco/Net/HTTPServerResponseImpl.h | 141 + .../include/Poco/Net/HTTPServerSession.h | 78 + .../external/include/Poco/Net/HTTPSession.h | 238 + .../include/Poco/Net/HTTPSessionFactory.h | 157 + .../Poco/Net/HTTPSessionInstantiator.h | 119 + .../external/include/Poco/Net/HTTPStream.h | 105 + .../include/Poco/Net/HTTPStreamFactory.h | 94 + .../external/include/Poco/Net/HostEntry.h | 117 + .../external/include/Poco/Net/ICMPClient.h | 87 + .../external/include/Poco/Net/ICMPEventArgs.h | 165 + .../external/include/Poco/Net/ICMPPacket.h | 91 + .../include/Poco/Net/ICMPPacketImpl.h | 143 + .../external/include/Poco/Net/ICMPSocket.h | 119 + .../include/Poco/Net/ICMPSocketImpl.h | 65 + .../include/Poco/Net/ICMPv4PacketImpl.h | 175 + .../external/include/Poco/Net/IPAddress.h | 520 ++ .../external/include/Poco/Net/IPAddressImpl.h | 187 + .../Poco/Net/InvalidCertificateHandler.h | 82 + .../include/Poco/Net/KeyConsoleHandler.h | 49 + .../include/Poco/Net/KeyFileHandler.h | 53 + .../external/include/Poco/Net/MailMessage.h | 317 ++ .../external/include/Poco/Net/MailRecipient.h | 122 + .../external/include/Poco/Net/MailStream.h | 148 + .../external/include/Poco/Net/MediaType.h | 171 + .../external/include/Poco/Net/MessageHeader.h | 166 + .../include/Poco/Net/MulticastSocket.h | 130 + .../include/Poco/Net/MultipartReader.h | 162 + .../include/Poco/Net/MultipartWriter.h | 111 + .../external/include/Poco/Net/NTPClient.h | 66 + .../external/include/Poco/Net/NTPEventArgs.h | 86 + .../external/include/Poco/Net/NTPPacket.h | 209 + .../include/Poco/Net/NameValueCollection.h | 128 + vendor/invn/external/include/Poco/Net/Net.h | 124 + .../external/include/Poco/Net/NetException.h | 61 + .../invn/external/include/Poco/Net/NetSSL.h | 93 + .../include/Poco/Net/NetworkInterface.h | 351 ++ .../include/Poco/Net/NullPartHandler.h | 49 + .../include/Poco/Net/OAuth10Credentials.h | 276 + .../include/Poco/Net/OAuth20Credentials.h | 134 + .../include/Poco/Net/POP3ClientSession.h | 187 + .../include/Poco/Net/ParallelSocketAcceptor.h | 235 + .../include/Poco/Net/ParallelSocketReactor.h | 92 + .../external/include/Poco/Net/PartHandler.h | 70 + .../external/include/Poco/Net/PartSource.h | 111 + .../external/include/Poco/Net/PartStore.h | 108 + .../include/Poco/Net/PrivateKeyFactory.h | 97 + .../include/Poco/Net/PrivateKeyFactoryMgr.h | 66 + .../Poco/Net/PrivateKeyPassphraseHandler.h | 86 + .../include/Poco/Net/QuotedPrintableDecoder.h | 88 + .../include/Poco/Net/QuotedPrintableEncoder.h | 87 + .../external/include/Poco/Net/RawSocket.h | 149 + .../external/include/Poco/Net/RawSocketImpl.h | 58 + .../Poco/Net/RejectCertificateHandler.h | 50 + .../include/Poco/Net/RemoteSyslogChannel.h | 152 + .../include/Poco/Net/RemoteSyslogListener.h | 121 + .../external/include/Poco/Net/SMTPChannel.h | 110 + .../include/Poco/Net/SMTPClientSession.h | 234 + .../external/include/Poco/Net/SSLException.h | 41 + .../external/include/Poco/Net/SSLManager.h | 374 ++ .../Poco/Net/SecureSMTPClientSession.h | 98 + .../include/Poco/Net/SecureServerSocket.h | 138 + .../include/Poco/Net/SecureServerSocketImpl.h | 148 + .../include/Poco/Net/SecureSocketImpl.h | 251 + .../include/Poco/Net/SecureStreamSocket.h | 274 + .../include/Poco/Net/SecureStreamSocketImpl.h | 301 ++ .../external/include/Poco/Net/ServerSocket.h | 169 + .../include/Poco/Net/ServerSocketImpl.h | 47 + .../invn/external/include/Poco/Net/Session.h | 81 + .../invn/external/include/Poco/Net/Socket.h | 633 +++ .../include/Poco/Net/SocketAcceptor.h | 197 + .../external/include/Poco/Net/SocketAddress.h | 279 ++ .../include/Poco/Net/SocketAddressImpl.h | 183 + .../include/Poco/Net/SocketConnector.h | 214 + .../external/include/Poco/Net/SocketDefs.h | 351 ++ .../external/include/Poco/Net/SocketImpl.h | 469 ++ .../include/Poco/Net/SocketNotification.h | 155 + .../include/Poco/Net/SocketNotifier.h | 112 + .../external/include/Poco/Net/SocketReactor.h | 237 + .../external/include/Poco/Net/SocketStream.h | 179 + .../external/include/Poco/Net/StreamSocket.h | 182 + .../include/Poco/Net/StreamSocketImpl.h | 61 + .../include/Poco/Net/StringPartSource.h | 73 + .../external/include/Poco/Net/TCPServer.h | 206 + .../include/Poco/Net/TCPServerConnection.h | 88 + .../Poco/Net/TCPServerConnectionFactory.h | 91 + .../include/Poco/Net/TCPServerDispatcher.h | 132 + .../include/Poco/Net/TCPServerParams.h | 139 + .../invn/external/include/Poco/Net/Utility.h | 54 + .../include/Poco/Net/VerificationErrorArgs.h | 110 + .../external/include/Poco/Net/WebSocket.h | 249 + .../external/include/Poco/Net/WebSocketImpl.h | 111 + .../include/Poco/Net/X509Certificate.h | 104 + .../invn/external/include/Poco/Notification.h | 57 + .../include/Poco/NotificationCenter.h | 141 + .../external/include/Poco/NotificationQueue.h | 157 + .../include/Poco/NotificationStrategy.h | 114 + .../invn/external/include/Poco/NullChannel.h | 57 + .../invn/external/include/Poco/NullStream.h | 92 + vendor/invn/external/include/Poco/Nullable.h | 321 ++ .../external/include/Poco/NumberFormatter.h | 686 +++ .../invn/external/include/Poco/NumberParser.h | 158 + .../external/include/Poco/NumericString.h | 540 ++ .../invn/external/include/Poco/ObjectPool.h | 317 ++ vendor/invn/external/include/Poco/Observer.h | 126 + .../invn/external/include/Poco/OpcomChannel.h | 82 + vendor/invn/external/include/Poco/Optional.h | 163 + .../invn/external/include/Poco/PBKDF2Engine.h | 151 + vendor/invn/external/include/Poco/Path.h | 475 ++ vendor/invn/external/include/Poco/Path_UNIX.h | 45 + vendor/invn/external/include/Poco/Path_VMS.h | 45 + .../invn/external/include/Poco/Path_WIN32.h | 46 + .../invn/external/include/Poco/Path_WIN32U.h | 51 + .../invn/external/include/Poco/Path_WINCE.h | 56 + .../external/include/Poco/PatternFormatter.h | 150 + vendor/invn/external/include/Poco/Pipe.h | 144 + vendor/invn/external/include/Poco/PipeImpl.h | 39 + .../external/include/Poco/PipeImpl_DUMMY.h | 51 + .../external/include/Poco/PipeImpl_POSIX.h | 55 + .../external/include/Poco/PipeImpl_WIN32.h | 56 + .../invn/external/include/Poco/PipeStream.h | 122 + vendor/invn/external/include/Poco/Platform.h | 267 + .../external/include/Poco/Platform_POSIX.h | 100 + .../invn/external/include/Poco/Platform_VMS.h | 72 + .../invn/external/include/Poco/Platform_VX.h | 31 + .../external/include/Poco/Platform_WIN32.h | 211 + vendor/invn/external/include/Poco/Poco.h | 26 + .../external/include/Poco/PriorityDelegate.h | 466 ++ .../external/include/Poco/PriorityEvent.h | 63 + .../external/include/Poco/PriorityExpire.h | 197 + .../include/Poco/PriorityNotificationQueue.h | 160 + .../external/include/Poco/PriorityStrategy.h | 232 + vendor/invn/external/include/Poco/Process.h | 270 + .../invn/external/include/Poco/Process_UNIX.h | 88 + .../invn/external/include/Poco/Process_VMS.h | 79 + .../invn/external/include/Poco/Process_VX.h | 80 + .../external/include/Poco/Process_WIN32.h | 85 + .../external/include/Poco/Process_WIN32U.h | 85 + .../external/include/Poco/Process_WINCE.h | 85 + .../external/include/Poco/PurgeStrategy.h | 99 + vendor/invn/external/include/Poco/RWLock.h | 205 + .../external/include/Poco/RWLock_Android.h | 99 + .../invn/external/include/Poco/RWLock_POSIX.h | 101 + vendor/invn/external/include/Poco/RWLock_VX.h | 94 + .../invn/external/include/Poco/RWLock_WIN32.h | 59 + .../invn/external/include/Poco/RWLock_WINCE.h | 63 + vendor/invn/external/include/Poco/Random.h | 167 + .../invn/external/include/Poco/RandomStream.h | 75 + .../include/Poco/RecursiveDirectoryIterator.h | 256 + .../Poco/RecursiveDirectoryIteratorImpl.h | 113 + .../external/include/Poco/RefCountedObject.h | 96 + .../external/include/Poco/RegularExpression.h | 259 + .../external/include/Poco/RotateStrategy.h | 167 + vendor/invn/external/include/Poco/Runnable.h | 47 + .../external/include/Poco/RunnableAdapter.h | 80 + .../external/include/Poco/SAX/Attributes.h | 122 + .../include/Poco/SAX/AttributesImpl.h | 298 ++ .../include/Poco/SAX/ContentHandler.h | 242 + .../external/include/Poco/SAX/DTDHandler.h | 88 + .../external/include/Poco/SAX/DeclHandler.h | 93 + .../include/Poco/SAX/DefaultHandler.h | 85 + .../include/Poco/SAX/EntityResolver.h | 88 + .../include/Poco/SAX/EntityResolverImpl.h | 80 + .../external/include/Poco/SAX/ErrorHandler.h | 94 + .../external/include/Poco/SAX/InputSource.h | 171 + .../include/Poco/SAX/LexicalHandler.h | 127 + .../invn/external/include/Poco/SAX/Locator.h | 105 + .../external/include/Poco/SAX/LocatorImpl.h | 90 + .../include/Poco/SAX/NamespaceSupport.h | 197 + .../external/include/Poco/SAX/SAXException.h | 178 + .../external/include/Poco/SAX/SAXParser.h | 105 + .../include/Poco/SAX/WhitespaceFilter.h | 83 + .../external/include/Poco/SAX/XMLFilter.h | 63 + .../external/include/Poco/SAX/XMLFilterImpl.h | 134 + .../external/include/Poco/SAX/XMLReader.h | 207 + .../invn/external/include/Poco/SHA1Engine.h | 83 + .../invn/external/include/Poco/ScopedLock.h | 123 + .../invn/external/include/Poco/ScopedUnlock.h | 66 + vendor/invn/external/include/Poco/Semaphore.h | 139 + .../external/include/Poco/Semaphore_POSIX.h | 77 + .../invn/external/include/Poco/Semaphore_VX.h | 58 + .../external/include/Poco/Semaphore_WIN32.h | 60 + .../external/include/Poco/SharedLibrary.h | 136 + .../include/Poco/SharedLibrary_HPUX.h | 53 + .../include/Poco/SharedLibrary_UNIX.h | 58 + .../external/include/Poco/SharedLibrary_VMS.h | 51 + .../external/include/Poco/SharedLibrary_VX.h | 53 + .../include/Poco/SharedLibrary_WIN32.h | 52 + .../include/Poco/SharedLibrary_WIN32U.h | 52 + .../invn/external/include/Poco/SharedMemory.h | 115 + .../include/Poco/SharedMemory_DUMMY.h | 90 + .../include/Poco/SharedMemory_POSIX.h | 109 + .../include/Poco/SharedMemory_WIN32.h | 105 + vendor/invn/external/include/Poco/SharedPtr.h | 429 ++ .../external/include/Poco/SignalHandler.h | 131 + .../external/include/Poco/SimpleFileChannel.h | 152 + .../external/include/Poco/SimpleHashTable.h | 400 ++ .../external/include/Poco/SingletonHolder.h | 71 + .../include/Poco/SortedDirectoryIterator.h | 72 + .../external/include/Poco/SplitterChannel.h | 79 + vendor/invn/external/include/Poco/Stopwatch.h | 110 + .../include/Poco/StrategyCollection.h | 135 + .../external/include/Poco/StreamChannel.h | 61 + .../external/include/Poco/StreamConverter.h | 130 + .../invn/external/include/Poco/StreamCopier.h | 87 + .../external/include/Poco/StreamTokenizer.h | 99 + .../invn/external/include/Poco/StreamUtil.h | 94 + vendor/invn/external/include/Poco/String.h | 702 +++ .../external/include/Poco/StringTokenizer.h | 137 + .../include/Poco/SynchronizedObject.h | 133 + .../external/include/Poco/SyslogChannel.h | 111 + vendor/invn/external/include/Poco/Task.h | 191 + .../invn/external/include/Poco/TaskManager.h | 139 + .../external/include/Poco/TaskNotification.h | 172 + vendor/invn/external/include/Poco/TeeStream.h | 134 + .../external/include/Poco/TemporaryFile.h | 86 + .../include/Poco/TextBufferIterator.h | 147 + .../external/include/Poco/TextConverter.h | 95 + .../invn/external/include/Poco/TextEncoding.h | 185 + .../invn/external/include/Poco/TextIterator.h | 143 + vendor/invn/external/include/Poco/Thread.h | 369 ++ .../invn/external/include/Poco/ThreadLocal.h | 159 + .../invn/external/include/Poco/ThreadPool.h | 210 + .../invn/external/include/Poco/ThreadTarget.h | 89 + .../invn/external/include/Poco/Thread_POSIX.h | 199 + vendor/invn/external/include/Poco/Thread_VX.h | 171 + .../invn/external/include/Poco/Thread_WIN32.h | 185 + .../invn/external/include/Poco/Thread_WINCE.h | 181 + .../include/Poco/TimedNotificationQueue.h | 145 + vendor/invn/external/include/Poco/Timer.h | 231 + vendor/invn/external/include/Poco/Timespan.h | 300 ++ vendor/invn/external/include/Poco/Timestamp.h | 279 ++ vendor/invn/external/include/Poco/Timezone.h | 69 + vendor/invn/external/include/Poco/Token.h | 174 + vendor/invn/external/include/Poco/Tuple.h | 1749 +++++++ vendor/invn/external/include/Poco/TypeList.h | 467 ++ vendor/invn/external/include/Poco/Types.h | 214 + vendor/invn/external/include/Poco/URI.h | 400 ++ .../external/include/Poco/URIStreamFactory.h | 99 + .../external/include/Poco/URIStreamOpener.h | 137 + .../external/include/Poco/UTF16Encoding.h | 87 + .../external/include/Poco/UTF32Encoding.h | 84 + .../invn/external/include/Poco/UTF8Encoding.h | 63 + .../invn/external/include/Poco/UTF8String.h | 67 + vendor/invn/external/include/Poco/UTFString.h | 307 ++ vendor/invn/external/include/Poco/UUID.h | 221 + .../external/include/Poco/UUIDGenerator.h | 106 + vendor/invn/external/include/Poco/UnWindows.h | 144 + .../include/Poco/UnbufferedStreamBuf.h | 174 + vendor/invn/external/include/Poco/Unicode.h | 275 + .../external/include/Poco/UnicodeConverter.h | 143 + .../include/Poco/UniqueAccessExpireCache.h | 75 + .../include/Poco/UniqueAccessExpireLRUCache.h | 73 + .../include/Poco/UniqueAccessExpireStrategy.h | 158 + .../external/include/Poco/UniqueExpireCache.h | 74 + .../include/Poco/UniqueExpireLRUCache.h | 72 + .../include/Poco/UniqueExpireStrategy.h | 140 + .../include/Poco/Util/AbstractConfiguration.h | 383 ++ .../external/include/Poco/Util/Application.h | 545 ++ .../include/Poco/Util/ConfigurationMapper.h | 96 + .../include/Poco/Util/ConfigurationView.h | 84 + .../Poco/Util/FilesystemConfiguration.h | 95 + .../include/Poco/Util/HelpFormatter.h | 204 + .../include/Poco/Util/IniFileConfiguration.h | 101 + .../external/include/Poco/Util/IntValidator.h | 58 + .../include/Poco/Util/JSONConfiguration.h | 152 + .../include/Poco/Util/LayeredConfiguration.h | 150 + .../include/Poco/Util/LoggingConfigurator.h | 141 + .../include/Poco/Util/LoggingSubsystem.h | 54 + .../include/Poco/Util/MapConfiguration.h | 63 + .../invn/external/include/Poco/Util/Option.h | 334 ++ .../include/Poco/Util/OptionCallback.h | 111 + .../include/Poco/Util/OptionException.h | 46 + .../include/Poco/Util/OptionProcessor.h | 139 + .../external/include/Poco/Util/OptionSet.h | 90 + .../Poco/Util/PropertyFileConfiguration.h | 101 + .../include/Poco/Util/RegExpValidator.h | 56 + .../include/Poco/Util/ServerApplication.h | 290 ++ .../external/include/Poco/Util/Subsystem.h | 100 + .../include/Poco/Util/SystemConfiguration.h | 91 + .../invn/external/include/Poco/Util/Timer.h | 171 + .../external/include/Poco/Util/TimerTask.h | 100 + .../include/Poco/Util/TimerTaskAdapter.h | 71 + .../invn/external/include/Poco/Util/Units.h | 1300 +++++ vendor/invn/external/include/Poco/Util/Util.h | 64 + .../external/include/Poco/Util/Validator.h | 59 + .../Poco/Util/WinRegistryConfiguration.h | 73 + .../include/Poco/Util/WinRegistryKey.h | 200 + .../external/include/Poco/Util/WinService.h | 143 + .../include/Poco/Util/XMLConfiguration.h | 205 + vendor/invn/external/include/Poco/ValidArgs.h | 76 + vendor/invn/external/include/Poco/Version.h | 43 + vendor/invn/external/include/Poco/Void.h | 75 + .../include/Poco/Windows1250Encoding.h | 54 + .../include/Poco/Windows1251Encoding.h | 54 + .../include/Poco/Windows1252Encoding.h | 53 + .../include/Poco/WindowsConsoleChannel.h | 185 + vendor/invn/external/include/Poco/XML/Name.h | 140 + .../invn/external/include/Poco/XML/NamePool.h | 76 + .../include/Poco/XML/NamespaceStrategy.h | 117 + .../external/include/Poco/XML/ParserEngine.h | 360 ++ vendor/invn/external/include/Poco/XML/XML.h | 64 + .../external/include/Poco/XML/XMLException.h | 39 + .../external/include/Poco/XML/XMLStream.h | 73 + .../external/include/Poco/XML/XMLString.h | 89 + .../external/include/Poco/XML/XMLWriter.h | 368 ++ vendor/invn/external/include/Poco/XML/expat.h | 1047 ++++ .../include/Poco/XML/expat_external.h | 115 + vendor/invn/external/include/Poco/Zip/Add.h | 53 + .../include/Poco/Zip/AutoDetectStream.h | 132 + .../invn/external/include/Poco/Zip/Compress.h | 147 + .../external/include/Poco/Zip/Decompress.h | 92 + .../invn/external/include/Poco/Zip/Delete.h | 50 + vendor/invn/external/include/Poco/Zip/Keep.h | 51 + .../external/include/Poco/Zip/ParseCallback.h | 56 + .../external/include/Poco/Zip/PartialStream.h | 189 + .../invn/external/include/Poco/Zip/Rename.h | 51 + .../invn/external/include/Poco/Zip/Replace.h | 52 + .../external/include/Poco/Zip/SkipCallback.h | 48 + vendor/invn/external/include/Poco/Zip/Zip.h | 64 + .../external/include/Poco/Zip/ZipArchive.h | 118 + .../include/Poco/Zip/ZipArchiveInfo.h | 193 + .../external/include/Poco/Zip/ZipCommon.h | 102 + .../external/include/Poco/Zip/ZipDataInfo.h | 140 + .../external/include/Poco/Zip/ZipException.h | 38 + .../external/include/Poco/Zip/ZipFileInfo.h | 464 ++ .../include/Poco/Zip/ZipLocalFileHeader.h | 466 ++ .../include/Poco/Zip/ZipManipulator.h | 111 + .../external/include/Poco/Zip/ZipOperation.h | 58 + .../external/include/Poco/Zip/ZipStream.h | 151 + .../invn/external/include/Poco/Zip/ZipUtil.h | 100 + vendor/invn/external/include/Poco/zconf.h | 513 ++ vendor/invn/external/include/Poco/zlib.h | 1768 +++++++ vendor/invn/external/include/inttypes.h | 305 ++ vendor/invn/external/include/stdbool.h | 54 + vendor/invn/external/include/stdint.h | 247 + vendor/invn/external/include/unistd.h | 12 + .../Invn/DynamicProtocol/DynProtocol.h | 278 + .../DynamicProtocol/DynProtocolTransport.h | 60 + .../DynProtocolTransportUart.h | 88 + .../include/Invn/EmbUtils/CBinaryReader.h | 85 + .../include/Invn/EmbUtils/CBinaryWriter.h | 93 + .../include/Invn/EmbUtils/DataConverter.c | 103 + .../include/Invn/EmbUtils/DataConverter.h | 87 + .../invn/include/Invn/EmbUtils/ErrorHelper.c | 47 + .../invn/include/Invn/EmbUtils/ErrorHelper.h | 51 + vendor/invn/include/Invn/EmbUtils/InvAssert.h | 69 + .../invn/include/Invn/EmbUtils/InvBasicMath.c | 82 + .../invn/include/Invn/EmbUtils/InvBasicMath.h | 94 + vendor/invn/include/Invn/EmbUtils/InvBits.h | 88 + vendor/invn/include/Invn/EmbUtils/InvCksum.c | 28 + vendor/invn/include/Invn/EmbUtils/InvCksum.h | 41 + vendor/invn/include/Invn/EmbUtils/InvFormat.c | 45 + vendor/invn/include/Invn/EmbUtils/InvFormat.h | 43 + vendor/invn/include/Invn/EmbUtils/InvList.c | 81 + vendor/invn/include/Invn/EmbUtils/InvList.h | 108 + vendor/invn/include/Invn/EmbUtils/InvPrintf.c | 223 + vendor/invn/include/Invn/EmbUtils/InvPrintf.h | 59 + .../invn/include/Invn/EmbUtils/InvProtocol.c | 269 + .../invn/include/Invn/EmbUtils/InvProtocol.h | 171 + vendor/invn/include/Invn/EmbUtils/InvQueue.c | 268 + vendor/invn/include/Invn/EmbUtils/InvQueue.h | 228 + .../invn/include/Invn/EmbUtils/InvScheduler.c | 291 ++ .../invn/include/Invn/EmbUtils/InvScheduler.h | 381 ++ vendor/invn/include/Invn/EmbUtils/InvString.h | 98 + vendor/invn/include/Invn/EmbUtils/Logger.c | 83 + vendor/invn/include/Invn/EmbUtils/Logger.h | 154 + vendor/invn/include/Invn/EmbUtils/Message.c | 75 + vendor/invn/include/Invn/EmbUtils/Message.h | 180 + .../invn/include/Invn/EmbUtils/RingBuffer.h | 194 + .../include/Invn/EmbUtils/RingByteBuffer.c | 111 + .../include/Invn/EmbUtils/RingByteBuffer.h | 139 + .../include/Invn/EmbUtils/UartTxEmulator.c | 110 + .../include/Invn/EmbUtils/UartTxEmulator.h | 85 + vendor/invn/include/Invn/VSensor/VSensor.h | 252 + .../invn/include/Invn/VSensor/VSensorConfig.h | 112 + .../invn/include/Invn/VSensor/VSensorData.h | 267 + .../invn/include/Invn/VSensor/VSensorEvent.h | 223 + vendor/invn/include/Invn/VSensor/VSensorId.h | 102 + .../include/Invn/VSensor/VSensorListener.h | 145 + .../Invn/VSensor/VSensorSmartListener.h | 154 + .../invn/include/Invn/VSensor/VSensorType.h | 212 + .../include/Invn/VSensor/VSensorVersion.h | 41 + .../Client/AsyncSensorEventsListener.cpp | 164 + .../Client/AsyncSensorEventsListener.h | 92 + .../Invn/Devices/Client/DataEventPoller.cpp | 52 + .../Invn/Devices/Client/DataEventPoller.h | 44 + .../Invn/Devices/Client/DeviceClient.cpp | 426 ++ .../Invn/Devices/Client/DeviceClient.h | 261 + .../Client/DeviceClientEmdWrapIcm20xxx.cpp | 237 + .../Client/DeviceClientEmdWrapIcm20xxx.h | 86 + .../Invn/Devices/Client/DevicePoller.cpp | 198 + .../Invn/Devices/Client/DevicePoller.h | 104 + .../Invn/Devices/Client/HostAdapterClient.cpp | 361 ++ .../Invn/Devices/Client/HostAdapterClient.h | 153 + .../Devices/Client/SensorEventsDispatcher.cpp | 64 + .../Devices/Client/SensorEventsDispatcher.h | 61 + .../Devices/Client/SensorEventsListener.h | 39 + .../Invn/Devices/Client/WatchdogPoller.cpp | 50 + .../Invn/Devices/Client/WatchdogPoller.h | 44 + vendor/invn/sources/Invn/Devices/Device.h | 746 +++ .../Invn/Devices/DeviceEmdWrapIcm20xxx.h | 159 + .../Invn/Devices/HostAdapter/DummyAdapter.cpp | 63 + .../Invn/Devices/HostAdapter/DummyAdapter.h | 45 + .../Invn/Devices/HostAdapter/HostAdapter.cpp | 55 + .../Invn/Devices/HostAdapter/HostAdapter.h | 174 + .../Devices/HostAdapter/SmartUartAdapter.cpp | 90 + .../Devices/HostAdapter/SmartUartAdapter.h | 75 + .../Devices/HostAdapter/UartHostAdapter.cpp | 33 + .../Devices/HostAdapter/UartHostAdapter.h | 93 + vendor/invn/sources/Invn/Devices/HostSerif.h | 282 ++ .../invn/sources/Invn/Devices/SensorConfig.h | 297 ++ .../invn/sources/Invn/Devices/SensorTypes.h | 430 ++ vendor/invn/sources/Invn/Devices/SerifHal.h | 180 + .../invn/sources/Invn/HostUtils/NamedPipe.cpp | 353 ++ .../invn/sources/Invn/HostUtils/NamedPipe.h | 53 + vendor/invn/sources/Invn/HostUtils/Os.cpp | 341 ++ vendor/invn/sources/Invn/HostUtils/Os.h | 214 + vendor/invn/sources/Invn/IDDVersion.h | 41 + vendor/invn/sources/Invn/InvBool.h | 47 + vendor/invn/sources/Invn/InvError.h | 64 + vendor/invn/sources/Invn/InvExport.h | 39 + 800 files changed, 141314 insertions(+), 245 deletions(-) create mode 100644 vendor/invn/external/include/Poco/ASCIIEncoding.h create mode 100644 vendor/invn/external/include/Poco/AbstractCache.h create mode 100644 vendor/invn/external/include/Poco/AbstractDelegate.h create mode 100644 vendor/invn/external/include/Poco/AbstractEvent.h create mode 100644 vendor/invn/external/include/Poco/AbstractObserver.h create mode 100644 vendor/invn/external/include/Poco/AbstractPriorityDelegate.h create mode 100644 vendor/invn/external/include/Poco/AbstractStrategy.h create mode 100644 vendor/invn/external/include/Poco/AccessExpirationDecorator.h create mode 100644 vendor/invn/external/include/Poco/AccessExpireCache.h create mode 100644 vendor/invn/external/include/Poco/AccessExpireLRUCache.h create mode 100644 vendor/invn/external/include/Poco/AccessExpireStrategy.h create mode 100644 vendor/invn/external/include/Poco/ActiveDispatcher.h create mode 100644 vendor/invn/external/include/Poco/ActiveMethod.h create mode 100644 vendor/invn/external/include/Poco/ActiveResult.h create mode 100644 vendor/invn/external/include/Poco/ActiveRunnable.h create mode 100644 vendor/invn/external/include/Poco/ActiveStarter.h create mode 100644 vendor/invn/external/include/Poco/Activity.h create mode 100644 vendor/invn/external/include/Poco/Alignment.h create mode 100644 vendor/invn/external/include/Poco/Any.h create mode 100644 vendor/invn/external/include/Poco/ArchiveStrategy.h create mode 100644 vendor/invn/external/include/Poco/Array.h create mode 100644 vendor/invn/external/include/Poco/Ascii.h create mode 100644 vendor/invn/external/include/Poco/AsyncChannel.h create mode 100644 vendor/invn/external/include/Poco/AtomicCounter.h create mode 100644 vendor/invn/external/include/Poco/AutoPtr.h create mode 100644 vendor/invn/external/include/Poco/AutoReleasePool.h create mode 100644 vendor/invn/external/include/Poco/Base32Decoder.h create mode 100644 vendor/invn/external/include/Poco/Base32Encoder.h create mode 100644 vendor/invn/external/include/Poco/Base64Decoder.h create mode 100644 vendor/invn/external/include/Poco/Base64Encoder.h create mode 100644 vendor/invn/external/include/Poco/BasicEvent.h create mode 100644 vendor/invn/external/include/Poco/BinaryReader.h create mode 100644 vendor/invn/external/include/Poco/BinaryWriter.h create mode 100644 vendor/invn/external/include/Poco/Buffer.h create mode 100644 vendor/invn/external/include/Poco/BufferAllocator.h create mode 100644 vendor/invn/external/include/Poco/BufferedBidirectionalStreamBuf.h create mode 100644 vendor/invn/external/include/Poco/BufferedStreamBuf.h create mode 100644 vendor/invn/external/include/Poco/Bugcheck.h create mode 100644 vendor/invn/external/include/Poco/ByteOrder.h create mode 100644 vendor/invn/external/include/Poco/Channel.h create mode 100644 vendor/invn/external/include/Poco/Checksum.h create mode 100644 vendor/invn/external/include/Poco/ClassLibrary.h create mode 100644 vendor/invn/external/include/Poco/ClassLoader.h create mode 100644 vendor/invn/external/include/Poco/Clock.h create mode 100644 vendor/invn/external/include/Poco/Condition.h create mode 100644 vendor/invn/external/include/Poco/Config.h create mode 100644 vendor/invn/external/include/Poco/Configurable.h create mode 100644 vendor/invn/external/include/Poco/ConsoleChannel.h create mode 100644 vendor/invn/external/include/Poco/CountingStream.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Attributes.h create mode 100644 vendor/invn/external/include/Poco/CppParser/AttributesParser.h create mode 100644 vendor/invn/external/include/Poco/CppParser/BuiltIn.h create mode 100644 vendor/invn/external/include/Poco/CppParser/CppParser.h create mode 100644 vendor/invn/external/include/Poco/CppParser/CppToken.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Decl.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Enum.h create mode 100644 vendor/invn/external/include/Poco/CppParser/EnumValue.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Function.h create mode 100644 vendor/invn/external/include/Poco/CppParser/NameSpace.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Parameter.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Parser.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Struct.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Symbol.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Tokenizer.h create mode 100644 vendor/invn/external/include/Poco/CppParser/TypeDef.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Utility.h create mode 100644 vendor/invn/external/include/Poco/CppParser/Variable.h create mode 100644 vendor/invn/external/include/Poco/Crypto/Cipher.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CipherFactory.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CipherImpl.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CipherKey.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CipherKeyImpl.h create mode 100644 vendor/invn/external/include/Poco/Crypto/Crypto.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CryptoStream.h create mode 100644 vendor/invn/external/include/Poco/Crypto/CryptoTransform.h create mode 100644 vendor/invn/external/include/Poco/Crypto/DigestEngine.h create mode 100644 vendor/invn/external/include/Poco/Crypto/OpenSSLInitializer.h create mode 100644 vendor/invn/external/include/Poco/Crypto/RSACipherImpl.h create mode 100644 vendor/invn/external/include/Poco/Crypto/RSADigestEngine.h create mode 100644 vendor/invn/external/include/Poco/Crypto/RSAKey.h create mode 100644 vendor/invn/external/include/Poco/Crypto/RSAKeyImpl.h create mode 100644 vendor/invn/external/include/Poco/Crypto/X509Certificate.h create mode 100644 vendor/invn/external/include/Poco/DOM/AbstractContainerNode.h create mode 100644 vendor/invn/external/include/Poco/DOM/AbstractNode.h create mode 100644 vendor/invn/external/include/Poco/DOM/Attr.h create mode 100644 vendor/invn/external/include/Poco/DOM/AttrMap.h create mode 100644 vendor/invn/external/include/Poco/DOM/AutoPtr.h create mode 100644 vendor/invn/external/include/Poco/DOM/CDATASection.h create mode 100644 vendor/invn/external/include/Poco/DOM/CharacterData.h create mode 100644 vendor/invn/external/include/Poco/DOM/ChildNodesList.h create mode 100644 vendor/invn/external/include/Poco/DOM/Comment.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMBuilder.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMException.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMImplementation.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMObject.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMParser.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMSerializer.h create mode 100644 vendor/invn/external/include/Poco/DOM/DOMWriter.h create mode 100644 vendor/invn/external/include/Poco/DOM/DTDMap.h create mode 100644 vendor/invn/external/include/Poco/DOM/Document.h create mode 100644 vendor/invn/external/include/Poco/DOM/DocumentEvent.h create mode 100644 vendor/invn/external/include/Poco/DOM/DocumentFragment.h create mode 100644 vendor/invn/external/include/Poco/DOM/DocumentType.h create mode 100644 vendor/invn/external/include/Poco/DOM/Element.h create mode 100644 vendor/invn/external/include/Poco/DOM/ElementsByTagNameList.h create mode 100644 vendor/invn/external/include/Poco/DOM/Entity.h create mode 100644 vendor/invn/external/include/Poco/DOM/EntityReference.h create mode 100644 vendor/invn/external/include/Poco/DOM/Event.h create mode 100644 vendor/invn/external/include/Poco/DOM/EventDispatcher.h create mode 100644 vendor/invn/external/include/Poco/DOM/EventException.h create mode 100644 vendor/invn/external/include/Poco/DOM/EventListener.h create mode 100644 vendor/invn/external/include/Poco/DOM/EventTarget.h create mode 100644 vendor/invn/external/include/Poco/DOM/MutationEvent.h create mode 100644 vendor/invn/external/include/Poco/DOM/NamedNodeMap.h create mode 100644 vendor/invn/external/include/Poco/DOM/Node.h create mode 100644 vendor/invn/external/include/Poco/DOM/NodeAppender.h create mode 100644 vendor/invn/external/include/Poco/DOM/NodeFilter.h create mode 100644 vendor/invn/external/include/Poco/DOM/NodeIterator.h create mode 100644 vendor/invn/external/include/Poco/DOM/NodeList.h create mode 100644 vendor/invn/external/include/Poco/DOM/Notation.h create mode 100644 vendor/invn/external/include/Poco/DOM/ProcessingInstruction.h create mode 100644 vendor/invn/external/include/Poco/DOM/Text.h create mode 100644 vendor/invn/external/include/Poco/DOM/TreeWalker.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractBinder.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractBinding.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractExtraction.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractExtractor.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractPreparation.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractPreparator.h create mode 100644 vendor/invn/external/include/Poco/Data/AbstractSessionImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/ArchiveStrategy.h create mode 100644 vendor/invn/external/include/Poco/Data/AutoTransaction.h create mode 100644 vendor/invn/external/include/Poco/Data/Binding.h create mode 100644 vendor/invn/external/include/Poco/Data/Bulk.h create mode 100644 vendor/invn/external/include/Poco/Data/BulkBinding.h create mode 100644 vendor/invn/external/include/Poco/Data/BulkExtraction.h create mode 100644 vendor/invn/external/include/Poco/Data/Column.h create mode 100644 vendor/invn/external/include/Poco/Data/Connector.h create mode 100644 vendor/invn/external/include/Poco/Data/Constants.h create mode 100644 vendor/invn/external/include/Poco/Data/Data.h create mode 100644 vendor/invn/external/include/Poco/Data/DataException.h create mode 100644 vendor/invn/external/include/Poco/Data/Date.h create mode 100644 vendor/invn/external/include/Poco/Data/DynamicDateTime.h create mode 100644 vendor/invn/external/include/Poco/Data/DynamicLOB.h create mode 100644 vendor/invn/external/include/Poco/Data/Extraction.h create mode 100644 vendor/invn/external/include/Poco/Data/LOB.h create mode 100644 vendor/invn/external/include/Poco/Data/LOBStream.h create mode 100644 vendor/invn/external/include/Poco/Data/Limit.h create mode 100644 vendor/invn/external/include/Poco/Data/MetaColumn.h create mode 100644 vendor/invn/external/include/Poco/Data/PooledSessionHolder.h create mode 100644 vendor/invn/external/include/Poco/Data/PooledSessionImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/Position.h create mode 100644 vendor/invn/external/include/Poco/Data/Preparation.h create mode 100644 vendor/invn/external/include/Poco/Data/Range.h create mode 100644 vendor/invn/external/include/Poco/Data/RecordSet.h create mode 100644 vendor/invn/external/include/Poco/Data/Row.h create mode 100644 vendor/invn/external/include/Poco/Data/RowFilter.h create mode 100644 vendor/invn/external/include/Poco/Data/RowFormatter.h create mode 100644 vendor/invn/external/include/Poco/Data/RowIterator.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLChannel.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/Binder.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/Connector.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/Extractor.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/Notifier.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/SQLite.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/SQLiteException.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/SQLiteStatementImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/SessionImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/SQLite/Utility.h create mode 100644 vendor/invn/external/include/Poco/Data/Session.h create mode 100644 vendor/invn/external/include/Poco/Data/SessionFactory.h create mode 100644 vendor/invn/external/include/Poco/Data/SessionImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/SessionPool.h create mode 100644 vendor/invn/external/include/Poco/Data/SessionPoolContainer.h create mode 100644 vendor/invn/external/include/Poco/Data/SimpleRowFormatter.h create mode 100644 vendor/invn/external/include/Poco/Data/Statement.h create mode 100644 vendor/invn/external/include/Poco/Data/StatementCreator.h create mode 100644 vendor/invn/external/include/Poco/Data/StatementImpl.h create mode 100644 vendor/invn/external/include/Poco/Data/Time.h create mode 100644 vendor/invn/external/include/Poco/Data/Transaction.h create mode 100644 vendor/invn/external/include/Poco/Data/TypeHandler.h create mode 100644 vendor/invn/external/include/Poco/DateTime.h create mode 100644 vendor/invn/external/include/Poco/DateTimeFormat.h create mode 100644 vendor/invn/external/include/Poco/DateTimeFormatter.h create mode 100644 vendor/invn/external/include/Poco/DateTimeParser.h create mode 100644 vendor/invn/external/include/Poco/Debugger.h create mode 100644 vendor/invn/external/include/Poco/DefaultStrategy.h create mode 100644 vendor/invn/external/include/Poco/DeflatingStream.h create mode 100644 vendor/invn/external/include/Poco/Delegate.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Channel.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/ChannelConfig.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/SerialChannel.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/SerialConfig.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/SerialPortEnum.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/VirtualSerialPortEnum.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/impl/SerialChannel_WIN32.h create mode 100644 vendor/invn/external/include/Poco/DeviceIO/Serial/impl/SerialConfig_WIN32.h create mode 100644 vendor/invn/external/include/Poco/DigestEngine.h create mode 100644 vendor/invn/external/include/Poco/DigestStream.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIterator.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIteratorStrategy.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIterator_UNIX.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIterator_VMS.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIterator_WIN32.h create mode 100644 vendor/invn/external/include/Poco/DirectoryIterator_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/DirectoryWatcher.h create mode 100644 vendor/invn/external/include/Poco/Dynamic/Pair.h create mode 100644 vendor/invn/external/include/Poco/Dynamic/Struct.h create mode 100644 vendor/invn/external/include/Poco/Dynamic/Var.h create mode 100644 vendor/invn/external/include/Poco/Dynamic/VarHolder.h create mode 100644 vendor/invn/external/include/Poco/Dynamic/VarIterator.h create mode 100644 vendor/invn/external/include/Poco/DynamicAny.h create mode 100644 vendor/invn/external/include/Poco/DynamicAnyHolder.h create mode 100644 vendor/invn/external/include/Poco/DynamicFactory.h create mode 100644 vendor/invn/external/include/Poco/DynamicStruct.h create mode 100644 vendor/invn/external/include/Poco/Environment.h create mode 100644 vendor/invn/external/include/Poco/Environment_UNIX.h create mode 100644 vendor/invn/external/include/Poco/Environment_VMS.h create mode 100644 vendor/invn/external/include/Poco/Environment_VX.h create mode 100644 vendor/invn/external/include/Poco/Environment_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Environment_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/Environment_WINCE.h create mode 100644 vendor/invn/external/include/Poco/Error.h create mode 100644 vendor/invn/external/include/Poco/ErrorHandler.h create mode 100644 vendor/invn/external/include/Poco/Event.h create mode 100644 vendor/invn/external/include/Poco/EventArgs.h create mode 100644 vendor/invn/external/include/Poco/EventLogChannel.h create mode 100644 vendor/invn/external/include/Poco/Event_POSIX.h create mode 100644 vendor/invn/external/include/Poco/Event_VX.h create mode 100644 vendor/invn/external/include/Poco/Event_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Exception.h create mode 100644 vendor/invn/external/include/Poco/ExpirationDecorator.h create mode 100644 vendor/invn/external/include/Poco/Expire.h create mode 100644 vendor/invn/external/include/Poco/ExpireCache.h create mode 100644 vendor/invn/external/include/Poco/ExpireLRUCache.h create mode 100644 vendor/invn/external/include/Poco/ExpireStrategy.h create mode 100644 vendor/invn/external/include/Poco/FIFOBuffer.h create mode 100644 vendor/invn/external/include/Poco/FIFOBufferStream.h create mode 100644 vendor/invn/external/include/Poco/FIFOEvent.h create mode 100644 vendor/invn/external/include/Poco/FIFOStrategy.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment_C99.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment_DEC.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment_DUMMY.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment_SUN.h create mode 100644 vendor/invn/external/include/Poco/FPEnvironment_WIN32.h create mode 100644 vendor/invn/external/include/Poco/File.h create mode 100644 vendor/invn/external/include/Poco/FileChannel.h create mode 100644 vendor/invn/external/include/Poco/FileStream.h create mode 100644 vendor/invn/external/include/Poco/FileStreamFactory.h create mode 100644 vendor/invn/external/include/Poco/FileStream_POSIX.h create mode 100644 vendor/invn/external/include/Poco/FileStream_WIN32.h create mode 100644 vendor/invn/external/include/Poco/File_UNIX.h create mode 100644 vendor/invn/external/include/Poco/File_VMS.h create mode 100644 vendor/invn/external/include/Poco/File_VX.h create mode 100644 vendor/invn/external/include/Poco/File_WIN32.h create mode 100644 vendor/invn/external/include/Poco/File_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/File_WINCE.h create mode 100644 vendor/invn/external/include/Poco/Format.h create mode 100644 vendor/invn/external/include/Poco/Formatter.h create mode 100644 vendor/invn/external/include/Poco/FormattingChannel.h create mode 100644 vendor/invn/external/include/Poco/Foundation.h create mode 100644 vendor/invn/external/include/Poco/FunctionDelegate.h create mode 100644 vendor/invn/external/include/Poco/FunctionPriorityDelegate.h create mode 100644 vendor/invn/external/include/Poco/Glob.h create mode 100644 vendor/invn/external/include/Poco/HMACEngine.h create mode 100644 vendor/invn/external/include/Poco/Hash.h create mode 100644 vendor/invn/external/include/Poco/HashFunction.h create mode 100644 vendor/invn/external/include/Poco/HashMap.h create mode 100644 vendor/invn/external/include/Poco/HashSet.h create mode 100644 vendor/invn/external/include/Poco/HashStatistic.h create mode 100644 vendor/invn/external/include/Poco/HashTable.h create mode 100644 vendor/invn/external/include/Poco/HexBinaryDecoder.h create mode 100644 vendor/invn/external/include/Poco/HexBinaryEncoder.h create mode 100644 vendor/invn/external/include/Poco/InflatingStream.h create mode 100644 vendor/invn/external/include/Poco/Instantiator.h create mode 100644 vendor/invn/external/include/Poco/JSON/Array.h create mode 100644 vendor/invn/external/include/Poco/JSON/Handler.h create mode 100644 vendor/invn/external/include/Poco/JSON/JSON.h create mode 100644 vendor/invn/external/include/Poco/JSON/JSONException.h create mode 100644 vendor/invn/external/include/Poco/JSON/Object.h create mode 100644 vendor/invn/external/include/Poco/JSON/ParseHandler.h create mode 100644 vendor/invn/external/include/Poco/JSON/Parser.h create mode 100644 vendor/invn/external/include/Poco/JSON/PrintHandler.h create mode 100644 vendor/invn/external/include/Poco/JSON/Query.h create mode 100644 vendor/invn/external/include/Poco/JSON/Stringifier.h create mode 100644 vendor/invn/external/include/Poco/JSON/Template.h create mode 100644 vendor/invn/external/include/Poco/JSON/TemplateCache.h create mode 100644 vendor/invn/external/include/Poco/KeyValueArgs.h create mode 100644 vendor/invn/external/include/Poco/LRUCache.h create mode 100644 vendor/invn/external/include/Poco/LRUStrategy.h create mode 100644 vendor/invn/external/include/Poco/Latin1Encoding.h create mode 100644 vendor/invn/external/include/Poco/Latin2Encoding.h create mode 100644 vendor/invn/external/include/Poco/Latin9Encoding.h create mode 100644 vendor/invn/external/include/Poco/LineEndingConverter.h create mode 100644 vendor/invn/external/include/Poco/LinearHashTable.h create mode 100644 vendor/invn/external/include/Poco/ListMap.h create mode 100644 vendor/invn/external/include/Poco/LocalDateTime.h create mode 100644 vendor/invn/external/include/Poco/LogFile.h create mode 100644 vendor/invn/external/include/Poco/LogFile_STD.h create mode 100644 vendor/invn/external/include/Poco/LogFile_VMS.h create mode 100644 vendor/invn/external/include/Poco/LogFile_WIN32.h create mode 100644 vendor/invn/external/include/Poco/LogFile_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/LogStream.h create mode 100644 vendor/invn/external/include/Poco/Logger.h create mode 100644 vendor/invn/external/include/Poco/LoggingFactory.h create mode 100644 vendor/invn/external/include/Poco/LoggingRegistry.h create mode 100644 vendor/invn/external/include/Poco/MD4Engine.h create mode 100644 vendor/invn/external/include/Poco/MD5Engine.h create mode 100644 vendor/invn/external/include/Poco/Manifest.h create mode 100644 vendor/invn/external/include/Poco/MemoryPool.h create mode 100644 vendor/invn/external/include/Poco/MemoryStream.h create mode 100644 vendor/invn/external/include/Poco/Message.h create mode 100644 vendor/invn/external/include/Poco/MetaObject.h create mode 100644 vendor/invn/external/include/Poco/MetaProgramming.h create mode 100644 vendor/invn/external/include/Poco/Mutex.h create mode 100644 vendor/invn/external/include/Poco/Mutex_POSIX.h create mode 100644 vendor/invn/external/include/Poco/Mutex_VX.h create mode 100644 vendor/invn/external/include/Poco/Mutex_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Mutex_WINCE.h create mode 100644 vendor/invn/external/include/Poco/NObserver.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent_Android.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent_UNIX.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent_VMS.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent_WIN32.h create mode 100644 vendor/invn/external/include/Poco/NamedEvent_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex_Android.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex_UNIX.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex_VMS.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex_WIN32.h create mode 100644 vendor/invn/external/include/Poco/NamedMutex_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/NamedTuple.h create mode 100644 vendor/invn/external/include/Poco/NestedDiagnosticContext.h create mode 100644 vendor/invn/external/include/Poco/Net/AbstractHTTPRequestHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/AcceptCertificateHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/CertificateHandlerFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/CertificateHandlerFactoryMgr.h create mode 100644 vendor/invn/external/include/Poco/Net/ConsoleCertificateHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/Context.h create mode 100644 vendor/invn/external/include/Poco/Net/DNS.h create mode 100644 vendor/invn/external/include/Poco/Net/DatagramSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/DatagramSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/DialogSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/FTPClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/FTPStreamFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/FilePartSource.h create mode 100644 vendor/invn/external/include/Poco/Net/HTMLForm.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPAuthenticationParams.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPBasicCredentials.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPBasicStreamBuf.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPBufferAllocator.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPChunkedStream.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPCookie.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPCredentials.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPDigestCredentials.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPFixedLengthStream.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPHeaderStream.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPIOStream.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPMessage.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPRequest.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPRequestHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPRequestHandlerFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPResponse.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSSessionInstantiator.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSStreamFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServer.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerConnection.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerConnectionFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerParams.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerRequest.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerRequestImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerResponse.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerResponseImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPServerSession.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSession.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSessionFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPSessionInstantiator.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPStream.h create mode 100644 vendor/invn/external/include/Poco/Net/HTTPStreamFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/HostEntry.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPClient.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPEventArgs.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPPacket.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPPacketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/ICMPv4PacketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/IPAddress.h create mode 100644 vendor/invn/external/include/Poco/Net/IPAddressImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/InvalidCertificateHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/KeyConsoleHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/KeyFileHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/MailMessage.h create mode 100644 vendor/invn/external/include/Poco/Net/MailRecipient.h create mode 100644 vendor/invn/external/include/Poco/Net/MailStream.h create mode 100644 vendor/invn/external/include/Poco/Net/MediaType.h create mode 100644 vendor/invn/external/include/Poco/Net/MessageHeader.h create mode 100644 vendor/invn/external/include/Poco/Net/MulticastSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/MultipartReader.h create mode 100644 vendor/invn/external/include/Poco/Net/MultipartWriter.h create mode 100644 vendor/invn/external/include/Poco/Net/NTPClient.h create mode 100644 vendor/invn/external/include/Poco/Net/NTPEventArgs.h create mode 100644 vendor/invn/external/include/Poco/Net/NTPPacket.h create mode 100644 vendor/invn/external/include/Poco/Net/NameValueCollection.h create mode 100644 vendor/invn/external/include/Poco/Net/Net.h create mode 100644 vendor/invn/external/include/Poco/Net/NetException.h create mode 100644 vendor/invn/external/include/Poco/Net/NetSSL.h create mode 100644 vendor/invn/external/include/Poco/Net/NetworkInterface.h create mode 100644 vendor/invn/external/include/Poco/Net/NullPartHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/OAuth10Credentials.h create mode 100644 vendor/invn/external/include/Poco/Net/OAuth20Credentials.h create mode 100644 vendor/invn/external/include/Poco/Net/POP3ClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/ParallelSocketAcceptor.h create mode 100644 vendor/invn/external/include/Poco/Net/ParallelSocketReactor.h create mode 100644 vendor/invn/external/include/Poco/Net/PartHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/PartSource.h create mode 100644 vendor/invn/external/include/Poco/Net/PartStore.h create mode 100644 vendor/invn/external/include/Poco/Net/PrivateKeyFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/PrivateKeyFactoryMgr.h create mode 100644 vendor/invn/external/include/Poco/Net/PrivateKeyPassphraseHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/QuotedPrintableDecoder.h create mode 100644 vendor/invn/external/include/Poco/Net/QuotedPrintableEncoder.h create mode 100644 vendor/invn/external/include/Poco/Net/RawSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/RawSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/RejectCertificateHandler.h create mode 100644 vendor/invn/external/include/Poco/Net/RemoteSyslogChannel.h create mode 100644 vendor/invn/external/include/Poco/Net/RemoteSyslogListener.h create mode 100644 vendor/invn/external/include/Poco/Net/SMTPChannel.h create mode 100644 vendor/invn/external/include/Poco/Net/SMTPClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/SSLException.h create mode 100644 vendor/invn/external/include/Poco/Net/SSLManager.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureSMTPClientSession.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureServerSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureServerSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureStreamSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/SecureStreamSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/ServerSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/ServerSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/Session.h create mode 100644 vendor/invn/external/include/Poco/Net/Socket.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketAcceptor.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketAddress.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketAddressImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketConnector.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketDefs.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketNotification.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketNotifier.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketReactor.h create mode 100644 vendor/invn/external/include/Poco/Net/SocketStream.h create mode 100644 vendor/invn/external/include/Poco/Net/StreamSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/StreamSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/StringPartSource.h create mode 100644 vendor/invn/external/include/Poco/Net/TCPServer.h create mode 100644 vendor/invn/external/include/Poco/Net/TCPServerConnection.h create mode 100644 vendor/invn/external/include/Poco/Net/TCPServerConnectionFactory.h create mode 100644 vendor/invn/external/include/Poco/Net/TCPServerDispatcher.h create mode 100644 vendor/invn/external/include/Poco/Net/TCPServerParams.h create mode 100644 vendor/invn/external/include/Poco/Net/Utility.h create mode 100644 vendor/invn/external/include/Poco/Net/VerificationErrorArgs.h create mode 100644 vendor/invn/external/include/Poco/Net/WebSocket.h create mode 100644 vendor/invn/external/include/Poco/Net/WebSocketImpl.h create mode 100644 vendor/invn/external/include/Poco/Net/X509Certificate.h create mode 100644 vendor/invn/external/include/Poco/Notification.h create mode 100644 vendor/invn/external/include/Poco/NotificationCenter.h create mode 100644 vendor/invn/external/include/Poco/NotificationQueue.h create mode 100644 vendor/invn/external/include/Poco/NotificationStrategy.h create mode 100644 vendor/invn/external/include/Poco/NullChannel.h create mode 100644 vendor/invn/external/include/Poco/NullStream.h create mode 100644 vendor/invn/external/include/Poco/Nullable.h create mode 100644 vendor/invn/external/include/Poco/NumberFormatter.h create mode 100644 vendor/invn/external/include/Poco/NumberParser.h create mode 100644 vendor/invn/external/include/Poco/NumericString.h create mode 100644 vendor/invn/external/include/Poco/ObjectPool.h create mode 100644 vendor/invn/external/include/Poco/Observer.h create mode 100644 vendor/invn/external/include/Poco/OpcomChannel.h create mode 100644 vendor/invn/external/include/Poco/Optional.h create mode 100644 vendor/invn/external/include/Poco/PBKDF2Engine.h create mode 100644 vendor/invn/external/include/Poco/Path.h create mode 100644 vendor/invn/external/include/Poco/Path_UNIX.h create mode 100644 vendor/invn/external/include/Poco/Path_VMS.h create mode 100644 vendor/invn/external/include/Poco/Path_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Path_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/Path_WINCE.h create mode 100644 vendor/invn/external/include/Poco/PatternFormatter.h create mode 100644 vendor/invn/external/include/Poco/Pipe.h create mode 100644 vendor/invn/external/include/Poco/PipeImpl.h create mode 100644 vendor/invn/external/include/Poco/PipeImpl_DUMMY.h create mode 100644 vendor/invn/external/include/Poco/PipeImpl_POSIX.h create mode 100644 vendor/invn/external/include/Poco/PipeImpl_WIN32.h create mode 100644 vendor/invn/external/include/Poco/PipeStream.h create mode 100644 vendor/invn/external/include/Poco/Platform.h create mode 100644 vendor/invn/external/include/Poco/Platform_POSIX.h create mode 100644 vendor/invn/external/include/Poco/Platform_VMS.h create mode 100644 vendor/invn/external/include/Poco/Platform_VX.h create mode 100644 vendor/invn/external/include/Poco/Platform_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Poco.h create mode 100644 vendor/invn/external/include/Poco/PriorityDelegate.h create mode 100644 vendor/invn/external/include/Poco/PriorityEvent.h create mode 100644 vendor/invn/external/include/Poco/PriorityExpire.h create mode 100644 vendor/invn/external/include/Poco/PriorityNotificationQueue.h create mode 100644 vendor/invn/external/include/Poco/PriorityStrategy.h create mode 100644 vendor/invn/external/include/Poco/Process.h create mode 100644 vendor/invn/external/include/Poco/Process_UNIX.h create mode 100644 vendor/invn/external/include/Poco/Process_VMS.h create mode 100644 vendor/invn/external/include/Poco/Process_VX.h create mode 100644 vendor/invn/external/include/Poco/Process_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Process_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/Process_WINCE.h create mode 100644 vendor/invn/external/include/Poco/PurgeStrategy.h create mode 100644 vendor/invn/external/include/Poco/RWLock.h create mode 100644 vendor/invn/external/include/Poco/RWLock_Android.h create mode 100644 vendor/invn/external/include/Poco/RWLock_POSIX.h create mode 100644 vendor/invn/external/include/Poco/RWLock_VX.h create mode 100644 vendor/invn/external/include/Poco/RWLock_WIN32.h create mode 100644 vendor/invn/external/include/Poco/RWLock_WINCE.h create mode 100644 vendor/invn/external/include/Poco/Random.h create mode 100644 vendor/invn/external/include/Poco/RandomStream.h create mode 100644 vendor/invn/external/include/Poco/RecursiveDirectoryIterator.h create mode 100644 vendor/invn/external/include/Poco/RecursiveDirectoryIteratorImpl.h create mode 100644 vendor/invn/external/include/Poco/RefCountedObject.h create mode 100644 vendor/invn/external/include/Poco/RegularExpression.h create mode 100644 vendor/invn/external/include/Poco/RotateStrategy.h create mode 100644 vendor/invn/external/include/Poco/Runnable.h create mode 100644 vendor/invn/external/include/Poco/RunnableAdapter.h create mode 100644 vendor/invn/external/include/Poco/SAX/Attributes.h create mode 100644 vendor/invn/external/include/Poco/SAX/AttributesImpl.h create mode 100644 vendor/invn/external/include/Poco/SAX/ContentHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/DTDHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/DeclHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/DefaultHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/EntityResolver.h create mode 100644 vendor/invn/external/include/Poco/SAX/EntityResolverImpl.h create mode 100644 vendor/invn/external/include/Poco/SAX/ErrorHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/InputSource.h create mode 100644 vendor/invn/external/include/Poco/SAX/LexicalHandler.h create mode 100644 vendor/invn/external/include/Poco/SAX/Locator.h create mode 100644 vendor/invn/external/include/Poco/SAX/LocatorImpl.h create mode 100644 vendor/invn/external/include/Poco/SAX/NamespaceSupport.h create mode 100644 vendor/invn/external/include/Poco/SAX/SAXException.h create mode 100644 vendor/invn/external/include/Poco/SAX/SAXParser.h create mode 100644 vendor/invn/external/include/Poco/SAX/WhitespaceFilter.h create mode 100644 vendor/invn/external/include/Poco/SAX/XMLFilter.h create mode 100644 vendor/invn/external/include/Poco/SAX/XMLFilterImpl.h create mode 100644 vendor/invn/external/include/Poco/SAX/XMLReader.h create mode 100644 vendor/invn/external/include/Poco/SHA1Engine.h create mode 100644 vendor/invn/external/include/Poco/ScopedLock.h create mode 100644 vendor/invn/external/include/Poco/ScopedUnlock.h create mode 100644 vendor/invn/external/include/Poco/Semaphore.h create mode 100644 vendor/invn/external/include/Poco/Semaphore_POSIX.h create mode 100644 vendor/invn/external/include/Poco/Semaphore_VX.h create mode 100644 vendor/invn/external/include/Poco/Semaphore_WIN32.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_HPUX.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_UNIX.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_VMS.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_VX.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_WIN32.h create mode 100644 vendor/invn/external/include/Poco/SharedLibrary_WIN32U.h create mode 100644 vendor/invn/external/include/Poco/SharedMemory.h create mode 100644 vendor/invn/external/include/Poco/SharedMemory_DUMMY.h create mode 100644 vendor/invn/external/include/Poco/SharedMemory_POSIX.h create mode 100644 vendor/invn/external/include/Poco/SharedMemory_WIN32.h create mode 100644 vendor/invn/external/include/Poco/SharedPtr.h create mode 100644 vendor/invn/external/include/Poco/SignalHandler.h create mode 100644 vendor/invn/external/include/Poco/SimpleFileChannel.h create mode 100644 vendor/invn/external/include/Poco/SimpleHashTable.h create mode 100644 vendor/invn/external/include/Poco/SingletonHolder.h create mode 100644 vendor/invn/external/include/Poco/SortedDirectoryIterator.h create mode 100644 vendor/invn/external/include/Poco/SplitterChannel.h create mode 100644 vendor/invn/external/include/Poco/Stopwatch.h create mode 100644 vendor/invn/external/include/Poco/StrategyCollection.h create mode 100644 vendor/invn/external/include/Poco/StreamChannel.h create mode 100644 vendor/invn/external/include/Poco/StreamConverter.h create mode 100644 vendor/invn/external/include/Poco/StreamCopier.h create mode 100644 vendor/invn/external/include/Poco/StreamTokenizer.h create mode 100644 vendor/invn/external/include/Poco/StreamUtil.h create mode 100644 vendor/invn/external/include/Poco/String.h create mode 100644 vendor/invn/external/include/Poco/StringTokenizer.h create mode 100644 vendor/invn/external/include/Poco/SynchronizedObject.h create mode 100644 vendor/invn/external/include/Poco/SyslogChannel.h create mode 100644 vendor/invn/external/include/Poco/Task.h create mode 100644 vendor/invn/external/include/Poco/TaskManager.h create mode 100644 vendor/invn/external/include/Poco/TaskNotification.h create mode 100644 vendor/invn/external/include/Poco/TeeStream.h create mode 100644 vendor/invn/external/include/Poco/TemporaryFile.h create mode 100644 vendor/invn/external/include/Poco/TextBufferIterator.h create mode 100644 vendor/invn/external/include/Poco/TextConverter.h create mode 100644 vendor/invn/external/include/Poco/TextEncoding.h create mode 100644 vendor/invn/external/include/Poco/TextIterator.h create mode 100644 vendor/invn/external/include/Poco/Thread.h create mode 100644 vendor/invn/external/include/Poco/ThreadLocal.h create mode 100644 vendor/invn/external/include/Poco/ThreadPool.h create mode 100644 vendor/invn/external/include/Poco/ThreadTarget.h create mode 100644 vendor/invn/external/include/Poco/Thread_POSIX.h create mode 100644 vendor/invn/external/include/Poco/Thread_VX.h create mode 100644 vendor/invn/external/include/Poco/Thread_WIN32.h create mode 100644 vendor/invn/external/include/Poco/Thread_WINCE.h create mode 100644 vendor/invn/external/include/Poco/TimedNotificationQueue.h create mode 100644 vendor/invn/external/include/Poco/Timer.h create mode 100644 vendor/invn/external/include/Poco/Timespan.h create mode 100644 vendor/invn/external/include/Poco/Timestamp.h create mode 100644 vendor/invn/external/include/Poco/Timezone.h create mode 100644 vendor/invn/external/include/Poco/Token.h create mode 100644 vendor/invn/external/include/Poco/Tuple.h create mode 100644 vendor/invn/external/include/Poco/TypeList.h create mode 100644 vendor/invn/external/include/Poco/Types.h create mode 100644 vendor/invn/external/include/Poco/URI.h create mode 100644 vendor/invn/external/include/Poco/URIStreamFactory.h create mode 100644 vendor/invn/external/include/Poco/URIStreamOpener.h create mode 100644 vendor/invn/external/include/Poco/UTF16Encoding.h create mode 100644 vendor/invn/external/include/Poco/UTF32Encoding.h create mode 100644 vendor/invn/external/include/Poco/UTF8Encoding.h create mode 100644 vendor/invn/external/include/Poco/UTF8String.h create mode 100644 vendor/invn/external/include/Poco/UTFString.h create mode 100644 vendor/invn/external/include/Poco/UUID.h create mode 100644 vendor/invn/external/include/Poco/UUIDGenerator.h create mode 100644 vendor/invn/external/include/Poco/UnWindows.h create mode 100644 vendor/invn/external/include/Poco/UnbufferedStreamBuf.h create mode 100644 vendor/invn/external/include/Poco/Unicode.h create mode 100644 vendor/invn/external/include/Poco/UnicodeConverter.h create mode 100644 vendor/invn/external/include/Poco/UniqueAccessExpireCache.h create mode 100644 vendor/invn/external/include/Poco/UniqueAccessExpireLRUCache.h create mode 100644 vendor/invn/external/include/Poco/UniqueAccessExpireStrategy.h create mode 100644 vendor/invn/external/include/Poco/UniqueExpireCache.h create mode 100644 vendor/invn/external/include/Poco/UniqueExpireLRUCache.h create mode 100644 vendor/invn/external/include/Poco/UniqueExpireStrategy.h create mode 100644 vendor/invn/external/include/Poco/Util/AbstractConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/Application.h create mode 100644 vendor/invn/external/include/Poco/Util/ConfigurationMapper.h create mode 100644 vendor/invn/external/include/Poco/Util/ConfigurationView.h create mode 100644 vendor/invn/external/include/Poco/Util/FilesystemConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/HelpFormatter.h create mode 100644 vendor/invn/external/include/Poco/Util/IniFileConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/IntValidator.h create mode 100644 vendor/invn/external/include/Poco/Util/JSONConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/LayeredConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/LoggingConfigurator.h create mode 100644 vendor/invn/external/include/Poco/Util/LoggingSubsystem.h create mode 100644 vendor/invn/external/include/Poco/Util/MapConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/Option.h create mode 100644 vendor/invn/external/include/Poco/Util/OptionCallback.h create mode 100644 vendor/invn/external/include/Poco/Util/OptionException.h create mode 100644 vendor/invn/external/include/Poco/Util/OptionProcessor.h create mode 100644 vendor/invn/external/include/Poco/Util/OptionSet.h create mode 100644 vendor/invn/external/include/Poco/Util/PropertyFileConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/RegExpValidator.h create mode 100644 vendor/invn/external/include/Poco/Util/ServerApplication.h create mode 100644 vendor/invn/external/include/Poco/Util/Subsystem.h create mode 100644 vendor/invn/external/include/Poco/Util/SystemConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/Timer.h create mode 100644 vendor/invn/external/include/Poco/Util/TimerTask.h create mode 100644 vendor/invn/external/include/Poco/Util/TimerTaskAdapter.h create mode 100644 vendor/invn/external/include/Poco/Util/Units.h create mode 100644 vendor/invn/external/include/Poco/Util/Util.h create mode 100644 vendor/invn/external/include/Poco/Util/Validator.h create mode 100644 vendor/invn/external/include/Poco/Util/WinRegistryConfiguration.h create mode 100644 vendor/invn/external/include/Poco/Util/WinRegistryKey.h create mode 100644 vendor/invn/external/include/Poco/Util/WinService.h create mode 100644 vendor/invn/external/include/Poco/Util/XMLConfiguration.h create mode 100644 vendor/invn/external/include/Poco/ValidArgs.h create mode 100644 vendor/invn/external/include/Poco/Version.h create mode 100644 vendor/invn/external/include/Poco/Void.h create mode 100644 vendor/invn/external/include/Poco/Windows1250Encoding.h create mode 100644 vendor/invn/external/include/Poco/Windows1251Encoding.h create mode 100644 vendor/invn/external/include/Poco/Windows1252Encoding.h create mode 100644 vendor/invn/external/include/Poco/WindowsConsoleChannel.h create mode 100644 vendor/invn/external/include/Poco/XML/Name.h create mode 100644 vendor/invn/external/include/Poco/XML/NamePool.h create mode 100644 vendor/invn/external/include/Poco/XML/NamespaceStrategy.h create mode 100644 vendor/invn/external/include/Poco/XML/ParserEngine.h create mode 100644 vendor/invn/external/include/Poco/XML/XML.h create mode 100644 vendor/invn/external/include/Poco/XML/XMLException.h create mode 100644 vendor/invn/external/include/Poco/XML/XMLStream.h create mode 100644 vendor/invn/external/include/Poco/XML/XMLString.h create mode 100644 vendor/invn/external/include/Poco/XML/XMLWriter.h create mode 100644 vendor/invn/external/include/Poco/XML/expat.h create mode 100644 vendor/invn/external/include/Poco/XML/expat_external.h create mode 100644 vendor/invn/external/include/Poco/Zip/Add.h create mode 100644 vendor/invn/external/include/Poco/Zip/AutoDetectStream.h create mode 100644 vendor/invn/external/include/Poco/Zip/Compress.h create mode 100644 vendor/invn/external/include/Poco/Zip/Decompress.h create mode 100644 vendor/invn/external/include/Poco/Zip/Delete.h create mode 100644 vendor/invn/external/include/Poco/Zip/Keep.h create mode 100644 vendor/invn/external/include/Poco/Zip/ParseCallback.h create mode 100644 vendor/invn/external/include/Poco/Zip/PartialStream.h create mode 100644 vendor/invn/external/include/Poco/Zip/Rename.h create mode 100644 vendor/invn/external/include/Poco/Zip/Replace.h create mode 100644 vendor/invn/external/include/Poco/Zip/SkipCallback.h create mode 100644 vendor/invn/external/include/Poco/Zip/Zip.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipArchive.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipArchiveInfo.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipCommon.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipDataInfo.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipException.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipFileInfo.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipLocalFileHeader.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipManipulator.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipOperation.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipStream.h create mode 100644 vendor/invn/external/include/Poco/Zip/ZipUtil.h create mode 100644 vendor/invn/external/include/Poco/zconf.h create mode 100644 vendor/invn/external/include/Poco/zlib.h create mode 100644 vendor/invn/external/include/inttypes.h create mode 100644 vendor/invn/external/include/stdbool.h create mode 100644 vendor/invn/external/include/stdint.h create mode 100644 vendor/invn/external/include/unistd.h create mode 100644 vendor/invn/include/Invn/DynamicProtocol/DynProtocol.h create mode 100644 vendor/invn/include/Invn/DynamicProtocol/DynProtocolTransport.h create mode 100644 vendor/invn/include/Invn/DynamicProtocol/DynProtocolTransportUart.h create mode 100644 vendor/invn/include/Invn/EmbUtils/CBinaryReader.h create mode 100644 vendor/invn/include/Invn/EmbUtils/CBinaryWriter.h create mode 100644 vendor/invn/include/Invn/EmbUtils/DataConverter.c create mode 100644 vendor/invn/include/Invn/EmbUtils/DataConverter.h create mode 100644 vendor/invn/include/Invn/EmbUtils/ErrorHelper.c create mode 100644 vendor/invn/include/Invn/EmbUtils/ErrorHelper.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvAssert.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvBasicMath.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvBasicMath.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvBits.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvCksum.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvCksum.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvFormat.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvFormat.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvList.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvList.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvPrintf.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvPrintf.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvProtocol.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvProtocol.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvQueue.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvQueue.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvScheduler.c create mode 100644 vendor/invn/include/Invn/EmbUtils/InvScheduler.h create mode 100644 vendor/invn/include/Invn/EmbUtils/InvString.h create mode 100644 vendor/invn/include/Invn/EmbUtils/Logger.c create mode 100644 vendor/invn/include/Invn/EmbUtils/Logger.h create mode 100644 vendor/invn/include/Invn/EmbUtils/Message.c create mode 100644 vendor/invn/include/Invn/EmbUtils/Message.h create mode 100644 vendor/invn/include/Invn/EmbUtils/RingBuffer.h create mode 100644 vendor/invn/include/Invn/EmbUtils/RingByteBuffer.c create mode 100644 vendor/invn/include/Invn/EmbUtils/RingByteBuffer.h create mode 100644 vendor/invn/include/Invn/EmbUtils/UartTxEmulator.c create mode 100644 vendor/invn/include/Invn/EmbUtils/UartTxEmulator.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensor.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorConfig.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorData.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorEvent.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorId.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorListener.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorSmartListener.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorType.h create mode 100644 vendor/invn/include/Invn/VSensor/VSensorVersion.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/AsyncSensorEventsListener.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/AsyncSensorEventsListener.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/DataEventPoller.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/DataEventPoller.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/DeviceClient.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/DeviceClient.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/DeviceClientEmdWrapIcm20xxx.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/DeviceClientEmdWrapIcm20xxx.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/DevicePoller.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/DevicePoller.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/HostAdapterClient.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/HostAdapterClient.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/SensorEventsDispatcher.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/SensorEventsDispatcher.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/SensorEventsListener.h create mode 100644 vendor/invn/sources/Invn/Devices/Client/WatchdogPoller.cpp create mode 100644 vendor/invn/sources/Invn/Devices/Client/WatchdogPoller.h create mode 100644 vendor/invn/sources/Invn/Devices/Device.h create mode 100644 vendor/invn/sources/Invn/Devices/DeviceEmdWrapIcm20xxx.h create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/DummyAdapter.cpp create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/DummyAdapter.h create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/HostAdapter.cpp create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/HostAdapter.h create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/SmartUartAdapter.cpp create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/SmartUartAdapter.h create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/UartHostAdapter.cpp create mode 100644 vendor/invn/sources/Invn/Devices/HostAdapter/UartHostAdapter.h create mode 100644 vendor/invn/sources/Invn/Devices/HostSerif.h create mode 100644 vendor/invn/sources/Invn/Devices/SensorConfig.h create mode 100644 vendor/invn/sources/Invn/Devices/SensorTypes.h create mode 100644 vendor/invn/sources/Invn/Devices/SerifHal.h create mode 100644 vendor/invn/sources/Invn/HostUtils/NamedPipe.cpp create mode 100644 vendor/invn/sources/Invn/HostUtils/NamedPipe.h create mode 100644 vendor/invn/sources/Invn/HostUtils/Os.cpp create mode 100644 vendor/invn/sources/Invn/HostUtils/Os.h create mode 100644 vendor/invn/sources/Invn/IDDVersion.h create mode 100644 vendor/invn/sources/Invn/InvBool.h create mode 100644 vendor/invn/sources/Invn/InvError.h create mode 100644 vendor/invn/sources/Invn/InvExport.h diff --git a/InvenSenseController.cpp b/InvenSenseController.cpp index 2af7319..8e20188 100644 --- a/InvenSenseController.cpp +++ b/InvenSenseController.cpp @@ -210,6 +210,13 @@ OSVR_ReturnCode InvenSenseController::setSensorConfig(int sensor, const std::str return OSVR_RETURN_SUCCESS; } +OSVR_ReturnCode InvenSenseController::getSensorConfig(int sensor, const std::string & settings, std::string & data){ + device->getSensorConfig(sensor, settings, data); + return OSVR_RETURN_SUCCESS; +} + + + void InvenSenseController::waitForDebugger(DeviceClient *device) { std::cout << "waitForDebugger" << std::endl; } diff --git a/InvenSenseController.h b/InvenSenseController.h index f411b77..bfe419a 100644 --- a/InvenSenseController.h +++ b/InvenSenseController.h @@ -67,6 +67,10 @@ class InvenSenseController : public DeviceDebuggerHook, OSVR_ReturnCode setSensorConfig(int sensor, const std::string & settings, const std::string & value); /* + @brief Get sesor config by sensor ID in given variable + */ + OSVR_ReturnCode InvenSenseController::getSensorConfig(int sensor, const std::string & settings, std::string & data); + /* @brief Implements required function for DeviceErrorHandler */ void handleDeviceError(DeviceClient *device, const std::exception &e); diff --git a/com_sensics_InvenSense.cpp b/com_sensics_InvenSense.cpp index 0f887f7..88f1d5b 100644 --- a/com_sensics_InvenSense.cpp +++ b/com_sensics_InvenSense.cpp @@ -1,8 +1,8 @@ /** @date 2016 - @author - Sensics, Inc. - +@author +Sensics, Inc. + */ // Copyright 2016 Sensics Corporation. @@ -40,256 +40,537 @@ #include #include #include +#include // Anonymous namespace to avoid symbol collision namespace { -static const auto DRIVER_NAME = "OSVR_InvenSense"; -static const auto PREFIX = "[OSVR-InvenSense] "; -typedef std::shared_ptr InvnCtlPtr; - -inline const std::string getTargetDefault() { return "emdwrapper"; } -inline const std::string getAdapterDefault() { return "dummy"; } - -static const double invensense_DT = 1.0 / 1000; - -class InvenSenseDevice : public SensorEventsListener { - public: - ~InvenSenseDevice() { _dispatcher.unsubscribe(this); } - InvenSenseDevice(OSVR_PluginRegContext ctx, InvnCtlPtr controller, unsigned long prediction_time, bool prediction_en) - : m_controller(controller), - _dispatcher(controller->getEventDispatcher()), m_gyro_cal(false), - m_prediction_enabled(prediction_en),m_prediction_time(prediction_time) - - { - osvrTimeValueGetNow(&m_last); - /// Create the initialization options - OSVR_DeviceInitOptions opts = osvrDeviceCreateInitOptions(ctx); - - osvrDeviceTrackerConfigure(opts, &m_tracker); - - /// Create the sync device token with the options - m_dev.initAsync(ctx, "InvenSense", opts); - - /// Send JSON descriptor - m_dev.sendJsonDescriptor(com_sensics_InvenSense_json); - - /// Register update callback - m_dev.registerUpdateCallback(this); - _dispatcher.subscribe(this); - // Enable Gyroscope vector at 1KHz. - controller->enableSensor(INV_SENSOR_TYPE_GYROSCOPE, 1000); - } - - OSVR_ReturnCode InvenSenseDevice::update() { return OSVR_RETURN_SUCCESS; } - - void InvenSenseDevice::setPredictionTime(unsigned long time){ - m_prediction_time = time; - } - - void InvenSenseDevice::setPredictionEnabled(bool enabled){ - m_prediction_enabled = enabled; - } - - void InvenSenseDevice::notify(const inv_sensor_event_t &event) { - int sensorId = (int)(event.sensor & ~INV_SENSOR_TYPE_WU_FLAG); - OSVR_OrientationState orientation; - OSVR_TimeValue timestamp; - switch (sensorId) { - case INV_SENSOR_TYPE_GAME_ROTATION_VECTOR: - case INV_SENSOR_TYPE_PRED_QUAT_1: - orientation.data[0] = event.data.quaternion.quat[0]; - orientation.data[1] = event.data.quaternion.quat[1]; - orientation.data[2] = event.data.quaternion.quat[2]; - orientation.data[3] = event.data.quaternion.quat[3]; - osvrTimeValueGetNow(×tamp); - osvrDeviceTrackerSendOrientationTimestamped( - m_dev, m_tracker, &orientation, 0, ×tamp); - break; - - case INV_SENSOR_TYPE_GYROSCOPE: - - // Wait for the calibration of gyro before starting game rotation - // vector. - if (!m_gyro_cal && event.data.gyr.accuracy_flag == 3) { - m_gyro_cal = true; - // Enable Game Rotation vector at 1KHz. - if(m_prediction_enabled){ - std::string payload = "2 " + std::to_string((unsigned long long)m_prediction_time); - m_controller->setSensorConfig(INV_SENSOR_TYPE_PRED_QUAT_1, "pred_quat", payload ); - m_controller->enableSensor(INV_SENSOR_TYPE_PRED_QUAT_1, 1000); - }else{ - m_controller->enableSensor(INV_SENSOR_TYPE_GAME_ROTATION_VECTOR, 1000); + static const auto DRIVER_NAME = "OSVR_InvenSense"; + static const auto PREFIX = "[OSVR-InvenSense] "; + typedef std::shared_ptr InvnCtlPtr; + + inline const std::string getTargetDefault() { return "emdwrapper"; } + inline const std::string getAdapterDefault() { return "dummy"; } + + double invensense_DT = 1.0 / 1000; + std::ofstream data_stream; + + class InvenSenseDevice : public SensorEventsListener { + public: + ~InvenSenseDevice() { _dispatcher.unsubscribe(this); } + InvenSenseDevice(OSVR_PluginRegContext ctx, InvnCtlPtr controller, long prediction_time, bool prediction_en, unsigned long periode, std::string fsrGyr, std::string fsrAcc, + bool datafile, bool logacc, bool loggyr, bool logpq1, bool loggrv, bool logracc, bool logrgyr, bool logrmag, bool logrtmp) + : m_controller(controller), + _dispatcher(controller->getEventDispatcher()), m_gyro_cal(false), + m_prediction_enabled(prediction_en), m_prediction_time(prediction_time), m_periode(periode), + m_fsrGyr(fsrGyr), m_fsrAcc(fsrAcc), + m_datafile(datafile), m_logacc(logacc), m_loggyr(loggyr), m_logpq1(logpq1), m_loggrv(loggrv), + m_logracc(logracc), m_logrgyr(logrgyr), m_logrmag(logrmag), m_logrtmp(logrtmp) + + { + osvrTimeValueGetNow(&m_last); + /// Create the initialization options + OSVR_DeviceInitOptions opts = osvrDeviceCreateInitOptions(ctx); + + osvrDeviceTrackerConfigure(opts, &m_tracker); + + /// Create the sync device token with the options + m_dev.initAsync(ctx, "InvenSense", opts); + + /// Send JSON descriptor + m_dev.sendJsonDescriptor(com_sensics_InvenSense_json); + + /// Register update callback + m_dev.registerUpdateCallback(this); + _dispatcher.subscribe(this); + + data_stream << "# Config: Prediction enabled=" << m_prediction_enabled + << " Prediction time=" << m_prediction_time + << " Periode=" << m_periode + << " GyrFSR=" << m_fsrGyr + << " AccFSR=" << m_fsrAcc << std::endl; + + // Set Gyroscope and Accelerometer FSR + //controller->setSensorConfig(INV_SENSOR_TYPE_GYROSCOPE, "fsr", m_fsrGyr); + //controller->setSensorConfig(INV_SENSOR_TYPE_ACCELEROMETER, "fsr", m_fsrAcc); + + // Enable Gyroscope and Accelerometer at the chosen periode + controller->enableSensor(INV_SENSOR_TYPE_GYROSCOPE, m_periode); + controller->enableSensor(INV_SENSOR_TYPE_ACCELEROMETER, m_periode); + + // Enable sensors for logging if needed + if (m_logracc) + controller->enableSensor(INV_SENSOR_TYPE_RAW_ACCELEROMETER, m_periode); + + if (m_logrgyr) + controller->enableSensor(INV_SENSOR_TYPE_RAW_GYROSCOPE, m_periode); + + if (m_logrmag) + controller->enableSensor(INV_SENSOR_TYPE_RAW_MAGNETOMETER); + + if (m_logrtmp) + controller->enableSensor(INV_SENSOR_TYPE_RAW_TEMPERATURE, m_periode); + + // Enable GRV in any case + controller->enableSensor(INV_SENSOR_TYPE_GAME_ROTATION_VECTOR, m_periode); + + // If predictive quat peridode is negative, create a buffer to add latency + if (m_prediction_time < 0) { + m_latencyadding = true; + m_buffer_size = (long)(1 - (long)m_periode * (long)m_prediction_time / 1000000); + if (m_buffer_size > 1000 || m_buffer_size < 1){ + m_buffer_size = 1000; } - } - // If gyro calibration is done use prediction - if (m_gyro_cal) { - q_type forward, inverse; - q_type delta; - q_type canonical; - double vel_quat[4]; - double vel_quat_dt = 0.0; - OSVR_VelocityState vel; - q_copy(forward, inverse); - q_invert(inverse, forward); - delta[Q_W] = 0; - delta[Q_X] = - event.data.gyr.vect[0] * invensense_DT * 0.5 * 0.0174533; - delta[Q_Y] = - event.data.gyr.vect[1] * invensense_DT * 0.5 * 0.0174533; - delta[Q_Z] = - event.data.gyr.vect[2] * invensense_DT * 0.5 * 0.0174533; - - q_exp(delta, delta); - q_normalize(delta, delta); - q_mult(canonical, delta, inverse); - vel_quat_dt = invensense_DT; - vel_quat[0] = vel_quat[1] = vel_quat[2] = 0.0; - vel_quat[3] = 1.0; - q_mult(vel_quat, forward, canonical); - vel.angularVelocity.dt = vel_quat_dt; - vel.angularVelocity.incrementalRotation.data[Q_W] = - vel_quat[Q_W]; - vel.angularVelocity.incrementalRotation.data[Q_X] = - vel_quat[Q_X]; - vel.angularVelocity.incrementalRotation.data[Q_Y] = - vel_quat[Q_Y]; - vel.angularVelocity.incrementalRotation.data[Q_Z] = - vel_quat[Q_Z]; - - osvrTimeValueGetNow(×tamp); - osvrDeviceTrackerSendVelocityTimestamped(m_dev, m_tracker, &vel, - 0, ×tamp); - } - break; - - default: - break; - } - } - - private: - osvr::pluginkit::DeviceToken m_dev; - OSVR_TrackerDeviceInterface m_tracker; - InvnCtlPtr m_controller; - OSVR_TimeValue m_last; - SensorEventsDispatcher &_dispatcher; - bool m_gyro_cal; - unsigned long m_prediction_time; - bool m_prediction_enabled; -}; - -class InvenSensePluginInstantiation { - - public: - InvenSensePluginInstantiation() : m_found(false) {} - - OSVR_ReturnCode operator()(OSVR_PluginRegContext ctx, const char *params) { - - if (m_found) { - return OSVR_RETURN_SUCCESS; - } - - Json::Value root; - { - Json::Reader reader; - if (!reader.parse(params, root)) { - std::cerr << PREFIX - << "Could not parse JSON for OSVR InvenSense plugin" - << std::endl; - return OSVR_RETURN_FAILURE; - } - } - - std::string portParam, targetParam, adapterParam; - unsigned long prediction_time; - bool prediction_enabled; - - if (!root.isMember("port")) { - std::cerr << PREFIX << "Could not find port parameter. Verify that " - "port is specified in the config file" - << std::endl; - return OSVR_RETURN_FAILURE; - } else { - portParam = root["port"].asString(); - if (portParam.empty()) { - std::cerr << PREFIX - << "Could not find port value. Verify that port " - "value is specified in the config file" - << std::endl; - return OSVR_RETURN_FAILURE; - } - } - - if (!root.isMember("target")) { - targetParam = getTargetDefault(); - std::cout << PREFIX - << "Could not find target param. Using default \"" - << targetParam << "\" parameter" << std::endl; - } else { - targetParam = root["target"].asString(); - } - - if (!root.isMember("adapter")) { - adapterParam = getAdapterDefault(); - std::cout << PREFIX - << "Could not find adapter param. Using default \"" - << targetParam << "\" parameter" << std::endl; - } else { - adapterParam = root["adapter"].asString(); - } - - if (!root.isMember("prediction")) { - prediction_enabled = true; - prediction_time = 3000; - std::cout << PREFIX - << "Could not find prediction param. Enabling prediction with 3ms " << std::endl; - } else { - Json::Value& prediction = root["prediction"]; - prediction_enabled = prediction["enabled"].asBool(); - prediction_time = prediction["time"].asUInt(); - std::cout << PREFIX - << "Setting up prediction from JSON" << std::endl; - std::cout << PREFIX - << "prediction enabled: " << prediction_enabled <( - new InvenSenseController(targetParam, portParam, adapterParam)); - - if (controller->isDeviceConnected()) { - std::cout << PREFIX << "Detected InvenSense device! " << std::endl; - m_found = true; - - /// Create our device object - InvenSenseDevice* pInvnDevice = new InvenSenseDevice(ctx, controller, prediction_time, prediction_enabled); - osvr::pluginkit::registerObjectForDeletion( - ctx, pInvnDevice); - } else { - std::cout << PREFIX << "NOT detected InvenSense tracker " - << std::endl; - return OSVR_RETURN_FAILURE; - } - - return OSVR_RETURN_SUCCESS; - } - - private: - InvnCtlPtr controller; - bool m_found; - -}; + m_prediction_time = 0; // set to 0 to start predictive quat + m_buffer_pos = 0; + } + else { + m_latencyadding = false; + } + + } + + OSVR_ReturnCode InvenSenseDevice::update() { return OSVR_RETURN_SUCCESS; } + + void InvenSenseDevice::setPredictionTime(unsigned long time){ + m_prediction_time = time; + } + + void InvenSenseDevice::setPredictionEnabled(bool enabled){ + m_prediction_enabled = enabled; + } + + void InvenSenseDevice::notify(const inv_sensor_event_t &event) { + int sensorId = (int)(event.sensor & ~INV_SENSOR_TYPE_WU_FLAG); + OSVR_OrientationState orientation; + OSVR_TimeValue timestamp; + char sensorIdhexa[10]; + sprintf(sensorIdhexa, "0x%08x", sensorId); + switch (sensorId) { + + case INV_SENSOR_TYPE_RAW_ACCELEROMETER: + if (m_datafile && m_logracc){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.raw3d.vect[0] << " " + << event.data.raw3d.vect[1] << " " + << event.data.raw3d.vect[2] << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_RAW_GYROSCOPE: + if (m_datafile && m_logrgyr){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.raw3d.vect[0] << " " + << event.data.raw3d.vect[1] << " " + << event.data.raw3d.vect[2] << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_RAW_MAGNETOMETER: + if (m_datafile && m_logrmag){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.raw3d.vect[0] << " " + << event.data.raw3d.vect[1] << " " + << event.data.raw3d.vect[2] << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_RAW_TEMPERATURE: + if (m_datafile && m_logrtmp){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.rawtemp.raw << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_GAME_ROTATION_VECTOR: + + orientation.data[0] = event.data.quaternion.quat[0]; + orientation.data[1] = event.data.quaternion.quat[1]; + orientation.data[2] = event.data.quaternion.quat[2]; + orientation.data[3] = event.data.quaternion.quat[3]; + osvrTimeValueGetNow(×tamp); + + if (m_latencyadding) + { + m_quat_buffer[m_buffer_pos][0] = orientation.data[0]; + m_quat_buffer[m_buffer_pos][1] = orientation.data[1]; + m_quat_buffer[m_buffer_pos][2] = orientation.data[2]; + m_quat_buffer[m_buffer_pos][3] = orientation.data[3]; + + orientation.data[0] = m_quat_buffer[(m_buffer_pos + 1) % m_buffer_size][0]; + orientation.data[1] = m_quat_buffer[(m_buffer_pos + 1) % m_buffer_size][1]; + orientation.data[2] = m_quat_buffer[(m_buffer_pos + 1) % m_buffer_size][2]; + orientation.data[3] = m_quat_buffer[(m_buffer_pos + 1) % m_buffer_size][3]; + + m_buffer_pos = (m_buffer_pos + 1) % m_buffer_size; + + osvrDeviceTrackerSendOrientationTimestamped(m_dev, m_tracker, &orientation, 0, ×tamp); + + } + + if (m_datafile && m_loggrv){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << orientation.data[0] << " " + << orientation.data[1] << " " + << orientation.data[2] << " " + << orientation.data[3] << " " + << int(event.data.quaternion.accuracy_flag) << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_PRED_QUAT_1: + orientation.data[0] = event.data.quaternion.quat[0]; + orientation.data[1] = event.data.quaternion.quat[1]; + orientation.data[2] = event.data.quaternion.quat[2]; + orientation.data[3] = event.data.quaternion.quat[3]; + osvrTimeValueGetNow(×tamp); + osvrDeviceTrackerSendOrientationTimestamped( + m_dev, m_tracker, &orientation, 0, ×tamp); + + if (m_datafile && m_logpq1){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << orientation.data[0] << " " + << orientation.data[1] << " " + << orientation.data[2] << " " + << orientation.data[3] << " " + << int(event.data.quaternion.accuracy_flag) << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_ACCELEROMETER: + if (m_datafile && m_logacc){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.acc.vect[0] << " " + << event.data.acc.vect[1] << " " + << event.data.acc.vect[2] << " " + << int(event.data.acc.accuracy_flag) << std::endl; + } + } + break; + + case INV_SENSOR_TYPE_GYROSCOPE: + // Wait for the calibration of gyro before starting game rotation + // vector. + if (!m_gyro_cal && event.data.gyr.accuracy_flag == 3) { + m_gyro_cal = true; + // Enable Game Rotation vector at 1KHz. + if (m_prediction_enabled && (!m_latencyadding)){ + std::string payload = "2 " + std::to_string((unsigned long long)m_prediction_time); + m_controller->setSensorConfig(INV_SENSOR_TYPE_PRED_QUAT_1, "pred_quat", payload); + m_controller->enableSensor(INV_SENSOR_TYPE_PRED_QUAT_1, m_periode); + } + } + // If gyro calibration is done use prediction + if (m_gyro_cal) { + q_type forward, inverse; + q_type delta; + q_type canonical; + double vel_quat[4]; + double vel_quat_dt = 0.0; + OSVR_VelocityState vel; + q_copy(forward, inverse); + q_invert(inverse, forward); + delta[Q_W] = 0; + delta[Q_X] = + event.data.gyr.vect[0] * invensense_DT * 0.5 * 0.0174533; + delta[Q_Y] = + event.data.gyr.vect[1] * invensense_DT * 0.5 * 0.0174533; + delta[Q_Z] = + event.data.gyr.vect[2] * invensense_DT * 0.5 * 0.0174533; + + q_exp(delta, delta); + q_normalize(delta, delta); + q_mult(canonical, delta, inverse); + vel_quat_dt = invensense_DT; + vel_quat[0] = vel_quat[1] = vel_quat[2] = 0.0; + vel_quat[3] = 1.0; + q_mult(vel_quat, forward, canonical); + vel.angularVelocity.dt = vel_quat_dt; + vel.angularVelocity.incrementalRotation.data[Q_W] = + vel_quat[Q_W]; + vel.angularVelocity.incrementalRotation.data[Q_X] = + vel_quat[Q_X]; + vel.angularVelocity.incrementalRotation.data[Q_Y] = + vel_quat[Q_Y]; + vel.angularVelocity.incrementalRotation.data[Q_Z] = + vel_quat[Q_Z]; + + osvrTimeValueGetNow(×tamp); + //osvrDeviceTrackerSendVelocityTimestamped(m_dev, m_tracker, &vel, + // 0, ×tamp); + + if (m_datafile && m_loggyr){ + if (data_stream.is_open()) + { + data_stream << "D " + << inv_sensor_2str(sensorId) << " " + << sensorIdhexa << " " + << event.status << " " + << event.timestamp << " " + << event.data.gyr.vect[0] << " " + << event.data.gyr.vect[1] << " " + << event.data.gyr.vect[2] << " " + << int(event.data.gyr.accuracy_flag) << std::endl; + } + } + + } + break; + + default: + break; + } + } + + private: + osvr::pluginkit::DeviceToken m_dev; + OSVR_TrackerDeviceInterface m_tracker; + InvnCtlPtr m_controller; + OSVR_TimeValue m_last; + SensorEventsDispatcher &_dispatcher; + bool m_gyro_cal, m_datafile, m_logacc, m_loggyr, m_logpq1, m_loggrv, + m_logracc, m_logrgyr, m_logrmag, m_logrtmp, m_latencyadding; + unsigned long m_periode; + long m_prediction_time; + bool m_prediction_enabled; + std::string m_fsrGyr, m_fsrAcc; + int m_buffer_size; + double m_quat_buffer[1000][4]; // 1s max at 1000Hz + int m_buffer_pos; + }; + + class InvenSensePluginInstantiation { + + public: + InvenSensePluginInstantiation() : m_found(false) {} + + OSVR_ReturnCode operator()(OSVR_PluginRegContext ctx, const char *params) { + + if (m_found) { + return OSVR_RETURN_SUCCESS; + } + + Json::Value root; + { + Json::Reader reader; + if (!reader.parse(params, root)) { + std::cerr << PREFIX + << "Could not parse JSON for OSVR InvenSense plugin" + << std::endl; + return OSVR_RETURN_FAILURE; + } + } + + std::string portParam, targetParam, adapterParam, fsrGyr, fsrAcc; + unsigned long periode; + long prediction_time; + bool prediction_enabled, datafile, logacc, loggyr, logpq1, + loggrv, logracc, logrgyr, logrmag, logrtmp; + + if (!root.isMember("port")) { + std::cerr << PREFIX << "Could not find port parameter. Verify that " + "port is specified in the config file" + << std::endl; + return OSVR_RETURN_FAILURE; + } + else { + portParam = root["port"].asString(); + if (portParam.empty()) { + std::cerr << PREFIX + << "Could not find port value. Verify that port " + "value is specified in the config file" + << std::endl; + return OSVR_RETURN_FAILURE; + } + } + + if (!root.isMember("target")) { + targetParam = getTargetDefault(); + std::cout << PREFIX + << "Could not find target param. Using default \"" + << targetParam << "\" parameter" << std::endl; + } + else { + targetParam = root["target"].asString(); + } + + if (!root.isMember("adapter")) { + adapterParam = getAdapterDefault(); + std::cout << PREFIX + << "Could not find adapter param. Using default \"" + << targetParam << "\" parameter" << std::endl; + } + else { + adapterParam = root["adapter"].asString(); + } + + if (!root.isMember("prediction")) { + prediction_enabled = true; + prediction_time = 3000; + std::cout << PREFIX + << "Could not find prediction param. Enabling prediction with 3ms " << std::endl; + } + else { + Json::Value& prediction = root["prediction"]; + prediction_enabled = prediction["enabled"].asBool(); + prediction_time = prediction["time"].asFloat(); + std::cout << PREFIX + << "Setting up prediction from JSON" << std::endl; + std::cout << PREFIX + << "prediction enabled: " << prediction_enabled << std::endl; + std::cout << PREFIX + << "prediction time: " << prediction_time << std::endl; + } + + if (!root.isMember("datalog")){ + datafile = false; + } + else { + Json::Value& datalog = root["datalog"]; + datafile = datalog["enabled"].asBool(); + if (datafile) { + std::string Datafile; + Datafile = datalog["path"].asString(); + logacc = datalog["Acc"].asBool(); + loggyr = datalog["Gyr"].asBool(); + logpq1 = datalog["PredictiveQuat"].asBool(); + loggrv = datalog["GRV"].asBool(); + logracc = datalog["RawAcc"].asBool(); + logrgyr = datalog["RawGyr"].asBool(); + logrmag = datalog["RawMag"].asBool(); + logrtmp = datalog["RawTmp"].asBool(); + data_stream.open(Datafile.c_str(), std::ostream::ate); + char mydate[128], mytime[128]; + _strdate_s(mydate); + _strtime_s(mytime); + mydate[2] = mydate[5] = mytime[2] = mytime[5] = '-'; + if (data_stream.is_open()){ + std::cout << "Data logging in progress" << std::endl; + data_stream << "# " << mydate << " " << mytime + << " LogAcc:" << logacc + << " LogGyr:" << loggyr + << " LogPQ1:" << logpq1 + << " LogGRV:" << loggrv + << " LogRAcc:" << logracc + << " LogRGyr:" << logrgyr + << " LogRMag:" << logrmag + << " LogRTmp:" << logrtmp + << std::endl; + } + } + } + + if (!root.isMember("periode")){ + periode = 1000; + std::cout << PREFIX + << "Could not find periode param. Enabling sensor periode at 1ms " << std::endl; + } + else { + periode = root["periode"].asUInt(); + } + invensense_DT = 1.0 / periode; + + if (!root.isMember("fsrGyr")){ + fsrGyr = "2000"; + std::cout << PREFIX + << "Could not find fsr gyr param. Enabling fsr at 2000 " << std::endl; + } + else { + fsrGyr = root["fsrGyr"].asString(); + } + + if (!root.isMember("fsrAcc")){ + fsrAcc = "8"; + std::cout << PREFIX + << "Could not find fsr acc param. Enabling fsr at 8 " << std::endl; + } + else { + fsrAcc = root["fsrAcc"].asString(); + } + + controller = std::shared_ptr( + new InvenSenseController(targetParam, portParam, adapterParam)); + + if (controller->isDeviceConnected()) { + std::cout << PREFIX << "Detected InvenSense device! " << std::endl; + m_found = true; + + /// Create our device object + InvenSenseDevice* pInvnDevice = new InvenSenseDevice(ctx, controller, prediction_time, prediction_enabled, periode, fsrGyr, fsrAcc, + datafile, logacc, loggyr, logpq1, loggrv, logracc, logrgyr, logrmag, logrtmp); + osvr::pluginkit::registerObjectForDeletion( + ctx, pInvnDevice); + } + else { + std::cout << PREFIX << "NOT detected InvenSense tracker " + << std::endl; + return OSVR_RETURN_FAILURE; + } + + return OSVR_RETURN_SUCCESS; + } + + private: + InvnCtlPtr controller; + bool m_found; + + }; } // namespace OSVR_PLUGIN(com_sensics_InvenSense) { - osvr::pluginkit::PluginContext context(ctx); - /// Register a detection callback function object. - context.registerDriverInstantiationCallback( - DRIVER_NAME, InvenSensePluginInstantiation()); + osvr::pluginkit::PluginContext context(ctx); + /// Register a detection callback function object. + context.registerDriverInstantiationCallback( + DRIVER_NAME, InvenSensePluginInstantiation()); - return OSVR_RETURN_SUCCESS; + return OSVR_RETURN_SUCCESS; } diff --git a/vendor/invn/external/include/Poco/ASCIIEncoding.h b/vendor/invn/external/include/Poco/ASCIIEncoding.h new file mode 100644 index 0000000..f31a6f5 --- /dev/null +++ b/vendor/invn/external/include/Poco/ASCIIEncoding.h @@ -0,0 +1,53 @@ +// +// ASCIIEncoding.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ASCIIEncoding.h#1 $ +// +// Library: Foundation +// Package: Text +// Module: ASCIIEncoding +// +// Definition of the ASCIIEncoding class. +// +// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ASCIIEncoding_INCLUDED +#define Foundation_ASCIIEncoding_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/TextEncoding.h" + + +namespace Poco { + + +class Foundation_API ASCIIEncoding: public TextEncoding + /// 7-bit ASCII text encoding. +{ +public: + ASCIIEncoding(); + ~ASCIIEncoding(); + const char* canonicalName() const; + bool isA(const std::string& encodingName) const; + const CharacterMap& characterMap() const; + int convert(const unsigned char* bytes) const; + int convert(int ch, unsigned char* bytes, int length) const; + int queryConvert(const unsigned char* bytes, int length) const; + int sequenceLength(const unsigned char* bytes, int length) const; + +private: + static const char* _names[]; + static const CharacterMap _charMap; +}; + + +} // namespace Poco + + +#endif // Foundation_ASCIIEncoding_INCLUDED diff --git a/vendor/invn/external/include/Poco/AbstractCache.h b/vendor/invn/external/include/Poco/AbstractCache.h new file mode 100644 index 0000000..ad9493b --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractCache.h @@ -0,0 +1,368 @@ +// +// AbstractCache.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractCache.h#1 $ +// +// 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 +#include +#include + + +namespace Poco { + + +template +class AbstractCache + /// An AbstractCache is the interface of all caches. +{ +public: + FIFOEvent, TEventMutex > Add; + FIFOEvent, TEventMutex > Update; + FIFOEvent Remove; + FIFOEvent Get; + FIFOEvent Clear; + + typedef std::map > DataHolder; + typedef typename DataHolder::iterator Iterator; + typedef typename DataHolder::const_iterator ConstIterator; + typedef std::set 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 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 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 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 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 result; + for (; it != itEnd; ++it) + result.insert(it->first); + + return result; + } + +protected: + mutable FIFOEvent > IsValid; + mutable FIFOEvent Replace; + + void initialize() + /// Sets up event registration. + { + Add += Delegate >(&_strategy, &TStrategy::onAdd); + Update += Delegate >(&_strategy, &TStrategy::onUpdate); + Remove += Delegate(&_strategy, &TStrategy::onRemove); + Get += Delegate(&_strategy, &TStrategy::onGet); + Clear += Delegate(&_strategy, &TStrategy::onClear); + IsValid += Delegate >(&_strategy, &TStrategy::onIsValid); + Replace += Delegate(&_strategy, &TStrategy::onReplace); + } + + void uninitialize() + /// Reverts event registration. + { + Add -= Delegate >(&_strategy, &TStrategy::onAdd ); + Update -= Delegate >(&_strategy, &TStrategy::onUpdate); + Remove -= Delegate(&_strategy, &TStrategy::onRemove); + Get -= Delegate(&_strategy, &TStrategy::onGet); + Clear -= Delegate(&_strategy, &TStrategy::onClear); + IsValid -= Delegate >(&_strategy, &TStrategy::onIsValid); + Replace -= Delegate(&_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 args(key, val); + Add.notify(this, args); + _data.insert(std::make_pair(key, SharedPtr(new TValue(val)))); + + doReplace(); + } + + void doAdd(const TKey& key, SharedPtr& 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 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 args(key, val); + Iterator it = _data.find(key); + if (it == _data.end()) + { + Add.notify(this, args); + _data.insert(std::make_pair(key, SharedPtr(new TValue(val)))); + } + else + { + Update.notify(this, args); + it->second = SharedPtr(new TValue(val)); + } + + doReplace(); + } + + void doUpdate(const TKey& key, SharedPtr& val) + /// Adds the key value pair to the cache. + /// If for the key already an entry exists, it will be overwritten. + { + KeyValueArgs 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 args(key); + IsValid.notify(this, args); + result = args.isValid(); + } + + return result; + } + + SharedPtr 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 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 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 delMe; + Replace.notify(this, delMe); + // delMe contains the to be removed elements + typename std::set::const_iterator it = delMe.begin(); + typename std::set::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 diff --git a/vendor/invn/external/include/Poco/AbstractDelegate.h b/vendor/invn/external/include/Poco/AbstractDelegate.h new file mode 100644 index 0000000..2538cab --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractDelegate.h @@ -0,0 +1,112 @@ +// +// AbstractDelegate.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractDelegate.h#4 $ +// +// 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 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 + /// 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 diff --git a/vendor/invn/external/include/Poco/AbstractEvent.h b/vendor/invn/external/include/Poco/AbstractEvent.h new file mode 100644 index 0000000..886df0e --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractEvent.h @@ -0,0 +1,560 @@ +// +// AbstractEvent.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractEvent.h#3 $ +// +// 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 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 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 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 !(_strategy.empty()); + } + + ActiveResult 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(new TStrategy(_strategy)); + params.enabled = _enabled; + } + ActiveResult 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 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 _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 AbstractEvent +{ +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 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 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(new TStrategy(_strategy)); + params.enabled = _enabled; + } + ActiveResult 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 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 _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 diff --git a/vendor/invn/external/include/Poco/AbstractObserver.h b/vendor/invn/external/include/Poco/AbstractObserver.h new file mode 100644 index 0000000..ec71472 --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractObserver.h @@ -0,0 +1,52 @@ +// +// AbstractObserver.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractObserver.h#2 $ +// +// 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 diff --git a/vendor/invn/external/include/Poco/AbstractPriorityDelegate.h b/vendor/invn/external/include/Poco/AbstractPriorityDelegate.h new file mode 100644 index 0000000..7b8f993 --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractPriorityDelegate.h @@ -0,0 +1,65 @@ +// +// AbstractPriorityDelegate.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractPriorityDelegate.h#3 $ +// +// 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 AbstractPriorityDelegate: public AbstractDelegate + /// Base class for PriorityDelegate and PriorityExpire. + /// + /// Extends AbstractDelegate with a priority value. +{ +public: + AbstractPriorityDelegate(int prio): + _priority(prio) + { + } + + AbstractPriorityDelegate(const AbstractPriorityDelegate& del): + AbstractDelegate(del), + _priority(del._priority) + { + } + + virtual ~AbstractPriorityDelegate() + { + } + + int priority() const + { + return _priority; + } + +protected: + int _priority; +}; + + +} // namespace Poco + + +#endif // Foundation_AbstractPriorityDelegate_INCLUDED diff --git a/vendor/invn/external/include/Poco/AbstractStrategy.h b/vendor/invn/external/include/Poco/AbstractStrategy.h new file mode 100644 index 0000000..c300a48 --- /dev/null +++ b/vendor/invn/external/include/Poco/AbstractStrategy.h @@ -0,0 +1,79 @@ +// +// AbstractStrategy.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AbstractStrategy.h#1 $ +// +// 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 + + +namespace Poco { + + +template +class AbstractStrategy + /// An AbstractStrategy is the interface for all strategies. +{ +public: + AbstractStrategy() + { + } + + virtual ~AbstractStrategy() + { + } + + virtual void onUpdate(const void* pSender, const KeyValueArgs & args) + /// Updates an existing entry. + { + onRemove(pSender,args.key()); + onAdd(pSender, args); + } + + virtual void onAdd(const void* pSender, const KeyValueArgs & 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& key) = 0; + /// Used to query if a key is still valid (i.e. cached). + + virtual void onReplace(const void* pSender, std::set& 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 diff --git a/vendor/invn/external/include/Poco/AccessExpirationDecorator.h b/vendor/invn/external/include/Poco/AccessExpirationDecorator.h new file mode 100644 index 0000000..bee74ff --- /dev/null +++ b/vendor/invn/external/include/Poco/AccessExpirationDecorator.h @@ -0,0 +1,85 @@ +// +// AccessExpirationDecorator.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AccessExpirationDecorator.h#2 $ +// +// 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 +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 diff --git a/vendor/invn/external/include/Poco/AccessExpireCache.h b/vendor/invn/external/include/Poco/AccessExpireCache.h new file mode 100644 index 0000000..726f347 --- /dev/null +++ b/vendor/invn/external/include/Poco/AccessExpireCache.h @@ -0,0 +1,65 @@ +// +// AccessExpireCache.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AccessExpireCache.h#1 $ +// +// 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, 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, TMutex, TEventMutex>(AccessExpireStrategy(expire)) + { + } + + ~AccessExpireCache() + { + } + +private: + AccessExpireCache(const AccessExpireCache& aCache); + AccessExpireCache& operator = (const AccessExpireCache& aCache); +}; + + +} // namespace Poco + + +#endif // Foundation_AccessExpireCache_INCLUDED diff --git a/vendor/invn/external/include/Poco/AccessExpireLRUCache.h b/vendor/invn/external/include/Poco/AccessExpireLRUCache.h new file mode 100644 index 0000000..13d29b9 --- /dev/null +++ b/vendor/invn/external/include/Poco/AccessExpireLRUCache.h @@ -0,0 +1,64 @@ +// +// AccessExpireLRUCache.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AccessExpireLRUCache.h#1 $ +// +// 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, 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, TMutex, TEventMutex >(StrategyCollection()) + { + this->_strategy.pushBack(new LRUStrategy(cacheSize)); + this->_strategy.pushBack(new AccessExpireStrategy(expire)); + } + + ~AccessExpireLRUCache() + { + } + +private: + AccessExpireLRUCache(const AccessExpireLRUCache& aCache); + AccessExpireLRUCache& operator = (const AccessExpireLRUCache& aCache); +}; + + +} // namespace Poco + + +#endif // Foundation_AccessExpireLRUCache_INCLUDED diff --git a/vendor/invn/external/include/Poco/AccessExpireStrategy.h b/vendor/invn/external/include/Poco/AccessExpireStrategy.h new file mode 100644 index 0000000..c92525b --- /dev/null +++ b/vendor/invn/external/include/Poco/AccessExpireStrategy.h @@ -0,0 +1,73 @@ +// +// AccessExpireStrategy.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AccessExpireStrategy.h#1 $ +// +// 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 +#include + + +namespace Poco { + + +template < + class TKey, + class TValue +> +class AccessExpireStrategy: public ExpireStrategy + /// An AccessExpireStrategy implements time and access based expiration of cache entries +{ +public: + AccessExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): ExpireStrategy(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::Iterator it = this->_keys.find(key); + if (it != this->_keys.end()) + { + this->_keyIndex.erase(it->second); + Timestamp now; + typename ExpireStrategy::IndexIterator itIdx = + this->_keyIndex.insert(typename ExpireStrategy::TimeIndex::value_type(now, key)); + it->second = itIdx; + } + } +}; + + +} // namespace Poco + + +#endif // Foundation_AccessExpireStrategy_INCLUDED diff --git a/vendor/invn/external/include/Poco/ActiveDispatcher.h b/vendor/invn/external/include/Poco/ActiveDispatcher.h new file mode 100644 index 0000000..69f9b75 --- /dev/null +++ b/vendor/invn/external/include/Poco/ActiveDispatcher.h @@ -0,0 +1,118 @@ +// +// ActiveDispatcher.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ActiveDispatcher.h#1 $ +// +// 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 > 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 + /// A specialization of ActiveStarter + /// for ActiveDispatcher. +{ +public: + static void start(ActiveDispatcher* pOwner, ActiveRunnableBase::Ptr pRunnable) + { + pOwner->start(pRunnable); + } +}; + + +} // namespace Poco + + +#endif // Foundation_ActiveDispatcher_INCLUDED diff --git a/vendor/invn/external/include/Poco/ActiveMethod.h b/vendor/invn/external/include/Poco/ActiveMethod.h new file mode 100644 index 0000000..bfe8c33 --- /dev/null +++ b/vendor/invn/external/include/Poco/ActiveMethod.h @@ -0,0 +1,220 @@ +// +// ActiveMethod.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ActiveMethod.h#1 $ +// +// 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 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 exampleActiveMethod; + /// + /// protected: + /// std::string exampleActiveMethodImpl(const std::string& arg) + /// { + /// ... + /// } + /// }; + /// + /// And following is an example that shows how to invoke an ActiveMethod. + /// + /// ActiveObject myActiveObject; + /// ActiveResult 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 ActiveResultType; + typedef ActiveRunnable 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()); + 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 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 exampleActiveMethod; + /// + /// protected: + /// std::string exampleActiveMethodImpl(const std::string& arg) + /// { + /// ... + /// } + /// }; + /// + /// And following is an example that shows how to invoke an ActiveMethod. + /// + /// ActiveObject myActiveObject; + /// ActiveResult 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 ActiveResultType; + typedef ActiveRunnable 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()); + 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 diff --git a/vendor/invn/external/include/Poco/ActiveResult.h b/vendor/invn/external/include/Poco/ActiveResult.h new file mode 100644 index 0000000..c71a39b --- /dev/null +++ b/vendor/invn/external/include/Poco/ActiveResult.h @@ -0,0 +1,497 @@ +// +// ActiveResult.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ActiveResult.h#1 $ +// +// 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 + + +namespace Poco { + + +template +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: 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 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 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 + /// 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 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 diff --git a/vendor/invn/external/include/Poco/ActiveRunnable.h b/vendor/invn/external/include/Poco/ActiveRunnable.h new file mode 100644 index 0000000..2fefbfa --- /dev/null +++ b/vendor/invn/external/include/Poco/ActiveRunnable.h @@ -0,0 +1,233 @@ +// +// ActiveRunnable.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ActiveRunnable.h#1 $ +// +// 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 Ptr; +}; + + +template +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 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 ActiveRunnable: public ActiveRunnableBase + /// This class is used by ActiveMethod. + /// See the ActiveMethod class for more information. +{ +public: + typedef void (OwnerType::*Callback)(const ArgType&); + typedef ActiveResult 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 ActiveRunnable: public ActiveRunnableBase + /// This class is used by ActiveMethod. + /// See the ActiveMethod class for more information. +{ +public: + typedef ResultType (OwnerType::*Callback)(); + typedef ActiveResult 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 ActiveRunnable: public ActiveRunnableBase + /// This class is used by ActiveMethod. + /// See the ActiveMethod class for more information. +{ +public: + typedef void (OwnerType::*Callback)(); + typedef ActiveResult 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 diff --git a/vendor/invn/external/include/Poco/ActiveStarter.h b/vendor/invn/external/include/Poco/ActiveStarter.h new file mode 100644 index 0000000..274cdce --- /dev/null +++ b/vendor/invn/external/include/Poco/ActiveStarter.h @@ -0,0 +1,50 @@ +// +// ActiveStarter.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ActiveStarter.h#1 $ +// +// 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 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 diff --git a/vendor/invn/external/include/Poco/Activity.h b/vendor/invn/external/include/Poco/Activity.h new file mode 100644 index 0000000..3aded9f --- /dev/null +++ b/vendor/invn/external/include/Poco/Activity.h @@ -0,0 +1,210 @@ +// +// Activity.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Activity.h#1 $ +// +// 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 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 _activity; + /// }; +{ +public: + typedef RunnableAdapter 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 diff --git a/vendor/invn/external/include/Poco/Alignment.h b/vendor/invn/external/include/Poco/Alignment.h new file mode 100644 index 0000000..3e75c90 --- /dev/null +++ b/vendor/invn/external/include/Poco/Alignment.h @@ -0,0 +1,248 @@ +// +// Alignment.h +// +// $Id: //poco/svn/Foundation/include/Poco/Alignment.h#2 $ +// +// 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 + + +#ifdef POCO_ENABLE_CPP11 + + + #include + #define POCO_HAVE_ALIGNMENT + + +#else + + + namespace Poco { + + + template + struct AlignmentCalcImpl + { + char x; + T t; + private: + AlignmentCalcImpl() {} // Never instantiate. + }; + + + template + struct AlignOf + /// A templated class that contains an enum value representing + /// the alignment of the template argument. For example, + /// AlignOf::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(sizeof(AlignmentCalcImpl) - 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 + 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() returns the alignment of an int. + { + return AlignOf::Alignment; + } + + + template 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 \ + { \ + char aligned alignas(x); \ + } + #define POCO_HAVE_ALIGNMENT + #endif + + #elif defined(__GNUC__) || defined(__IBM_ATTRIBUTES) + + #define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \ + template <> struct AlignedCharArrayImpl \ + { \ + 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 { \ + __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 + 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::Alignment> _nonceMember; + + }; + + #endif // POCO_HAVE_ALIGNMENT + + } // namespace Poco + + +#endif // POCO_ENABLE_CPP11 + + +#endif // Foundation_AlignOf_INCLUDED diff --git a/vendor/invn/external/include/Poco/Any.h b/vendor/invn/external/include/Poco/Any.h new file mode 100644 index 0000000..119a8b6 --- /dev/null +++ b/vendor/invn/external/include/Poco/Any.h @@ -0,0 +1,601 @@ +// +// Any.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Any.h#1 $ +// +// Library: Foundation +// Package: Core +// Module: Any +// +// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. +// Extracted from Boost 1.33.1 lib 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 +#include +#include + + +namespace Poco { + + +class Any; + + +namespace Dynamic { + +class Var; +class VarHolder; +template 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 +union Placeholder + /// ValueHolder union (used by Poco::Any and Poco::Dynamic::Var for small + /// object optimization, when enabled). + /// + /// If Holder 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(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::type AlignerType; + + PlaceholderT* pHolder; + mutable char holder [SizeV + 1]; + AlignerType aligner; + + friend class Any; + friend class Dynamic::Var; + friend class Dynamic::VarHolder; + template friend class Dynamic::VarHolderImpl; +}; + + +#else // !POCO_NO_SOO + + +template +union Placeholder + /// ValueHolder union (used by Poco::Any and Poco::Dynamic::Var for small + /// object optimization, when enabled). + /// + /// If Holder 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 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 + 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 + 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*) const = 0; + }; + + template + 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* pPlaceholder) const + { + if ((sizeof(Holder) <= 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 + void construct(const ValueType& value) + { + if (sizeof(Holder) <= Placeholder::Size::value) + { + new (reinterpret_cast(_valueHolder.holder)) Holder(value); + _valueHolder.setLocal(true); + } + else + { + _valueHolder.pHolder = new Holder(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; + + +#else // if POCO_NO_SOO + + + Any(): _pHolder(0) + /// Creates an empty any type. + { + } + + template + Any(const ValueType& value): + _pHolder(new Holder(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 + 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 + 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 + friend ValueType* AnyCast(Any*); + + template + friend ValueType* UnsafeAnyCast(Any*); + +}; + + +template +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(pAny). + /// Will return NULL if the cast fails, i.e. types don't match. +{ + return operand && operand->type() == typeid(ValueType) + ? &static_cast*>(operand->content())->_held + : 0; +} + + +template +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(pAny). + /// Will return NULL if the cast fails, i.e. types don't match. +{ + return AnyCast(const_cast(operand)); +} + + +template +ValueType AnyCast(Any& operand) + /// AnyCast operator used to extract a copy of the ValueType from an Any&. + /// + /// Example Usage: + /// MyType tmp = AnyCast(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::TYPE NonRef; + + NonRef* result = AnyCast(&operand); + if (!result) throw BadCastException("Failed to convert between Any types"); + return *result; +} + + +template +ValueType AnyCast(const Any& operand) + /// AnyCast operator used to extract a copy of the ValueType from an const Any&. + /// + /// Example Usage: + /// MyType tmp = AnyCast(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::TYPE NonRef; + + return AnyCast(const_cast(operand)); +} + + +template +const ValueType& RefAnyCast(const Any & operand) + /// AnyCast operator used to return a const reference to the internal data. + /// + /// Example Usage: + /// const MyType& tmp = RefAnyCast(anAny); +{ + ValueType* result = AnyCast(const_cast(&operand)); + if (!result) throw BadCastException("RefAnyCast: Failed to convert between const Any types"); + return *result; +} + + +template +ValueType& RefAnyCast(Any& operand) + /// AnyCast operator used to return a reference to the internal data. + /// + /// Example Usage: + /// MyType& tmp = RefAnyCast(anAny); +{ + ValueType* result = AnyCast(&operand); + if (!result) throw BadCastException("RefAnyCast: Failed to convert between Any types"); + return *result; +} + + +template +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*>(operand->content())->_held; +} + + +template +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(const_cast(operand)); +} + + +} // namespace Poco + + +#endif diff --git a/vendor/invn/external/include/Poco/ArchiveStrategy.h b/vendor/invn/external/include/Poco/ArchiveStrategy.h new file mode 100644 index 0000000..6f00e33 --- /dev/null +++ b/vendor/invn/external/include/Poco/ArchiveStrategy.h @@ -0,0 +1,148 @@ +// +// ArchiveStrategy.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ArchiveStrategy.h#1 $ +// +// Library: Foundation +// Package: Logging +// Module: FileChannel +// +// Definition of the ArchiveStrategy class and subclasses. +// +// Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ArchiveStrategy_INCLUDED +#define Foundation_ArchiveStrategy_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/LogFile.h" +#include "Poco/File.h" +#include "Poco/DateTimeFormatter.h" +#include "Poco/NumberFormatter.h" + + +namespace Poco { + + +class ArchiveCompressor; + + +class Foundation_API ArchiveStrategy + /// The ArchiveStrategy is used by FileChannel + /// to rename a rotated log file for archiving. + /// + /// Archived files can be automatically compressed, + /// using the gzip file format. +{ +public: + ArchiveStrategy(); + virtual ~ArchiveStrategy(); + + virtual LogFile* archive(LogFile* pFile) = 0; + /// Renames the given log file for archiving + /// and creates and returns a new log file. + /// The given LogFile object is deleted. + + void compress(bool flag = true); + /// Enables or disables compression of archived files. + +protected: + void moveFile(const std::string& oldName, const std::string& newName); + bool exists(const std::string& name); + +private: + ArchiveStrategy(const ArchiveStrategy&); + ArchiveStrategy& operator = (const ArchiveStrategy&); + + bool _compress; + ArchiveCompressor* _pCompressor; +}; + + +class Foundation_API ArchiveByNumberStrategy: public ArchiveStrategy + /// A monotonic increasing number is appended to the + /// log file name. The most recent archived file + /// always has the number zero. +{ +public: + ArchiveByNumberStrategy(); + ~ArchiveByNumberStrategy(); + LogFile* archive(LogFile* pFile); +}; + + +template +class ArchiveByTimestampStrategy: public ArchiveStrategy + /// A timestamp (YYYYMMDDhhmmssiii) is appended to archived + /// log files. +{ +public: + ArchiveByTimestampStrategy() + { + } + + ~ArchiveByTimestampStrategy() + { + } + + LogFile* archive(LogFile* pFile) + /// Archives the file by appending the current timestamp to the + /// file name. If the new file name exists, additionally a monotonic + /// increasing number is appended to the log file name. + { + std::string path = pFile->path(); + delete pFile; + std::string archPath = path; + archPath.append("."); + DateTimeFormatter::append(archPath, DT().timestamp(), "%Y%m%d%H%M%S%i"); + + if (exists(archPath)) archiveByNumber(archPath); + else moveFile(path, archPath); + + return new LogFile(path); + } + +private: + void archiveByNumber(const std::string& basePath) + /// A monotonic increasing number is appended to the + /// log file name. The most recent archived file + /// always has the number zero. + { + int n = -1; + std::string path; + do + { + path = basePath; + path.append("."); + NumberFormatter::append(path, ++n); + } + while (exists(path)); + + while (n >= 0) + { + std::string oldPath = basePath; + if (n > 0) + { + oldPath.append("."); + NumberFormatter::append(oldPath, n - 1); + } + std::string newPath = basePath; + newPath.append("."); + NumberFormatter::append(newPath, n); + moveFile(oldPath, newPath); + --n; + } + } +}; + + +} // namespace Poco + + +#endif // Foundation_ArchiveStrategy_INCLUDED diff --git a/vendor/invn/external/include/Poco/Array.h b/vendor/invn/external/include/Poco/Array.h new file mode 100644 index 0000000..6dd9b4b --- /dev/null +++ b/vendor/invn/external/include/Poco/Array.h @@ -0,0 +1,251 @@ +// +// Array.h +// +// $Id: //poco/svn/Foundation/include/Poco/Array.h#2 $ +// +// Library: Foundation +// Package: Core +// Module: Array +// +// Definition of the Array class +// +// Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// +// ------------------------------------------------------------------------------ +// (C) Copyright Nicolai M. Josuttis 2001. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. +// ------------------------------------------------------------------------------ + + +#ifndef Foundation_Array_INCLUDED +#define Foundation_Array_INCLUDED + +#include "Poco/Exception.h" +#include "Poco/Bugcheck.h" +#include + +namespace Poco { + +template +class Array + /// STL container like C-style array replacement class. + /// + /// This implementation is based on the idea of Nicolai Josuttis. + /// His original implementation can be found at http://www.josuttis.com/cppcode/array.html . +{ + +public: + + typedef T value_type; + typedef T* iterator; + typedef const T* const_iterator; + typedef T& reference; + typedef const T& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + iterator begin() + { + return elems; + } + + const_iterator begin() const + { + return elems; + } + + iterator end() + { + return elems+N; + } + + const_iterator end() const + { + return elems+N; + } + + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; + + reverse_iterator rbegin() + { + return reverse_iterator(end()); + } + + const_reverse_iterator rbegin() const + { + return const_reverse_iterator(end()); + } + + reverse_iterator rend() + { + return reverse_iterator(begin()); + } + + const_reverse_iterator rend() const + { + return const_reverse_iterator(begin()); + } + + reference operator[](size_type i) + /// Element access without range check. If the index is not small than the given size, the behavior is undefined. + { + poco_assert( i < N && "out of range" ); + return elems[i]; + } + + const_reference operator[](size_type i) const + /// Element access without range check. If the index is not small than the given size, the behavior is undefined. + { + poco_assert( i < N && "out of range" ); + return elems[i]; + } + + reference at(size_type i) + /// Element access with range check. Throws Poco::InvalidArgumentException if the index is over range. + { + if(i>=size()) + throw Poco::InvalidArgumentException("Array::at() range check failed: index is over range"); + return elems[i]; + } + + const_reference at(size_type i) const + /// Element access with range check. Throws Poco::InvalidArgumentException if the index is over range. + { + if(i>=size()) + throw Poco::InvalidArgumentException("Array::at() range check failed: index is over range"); + return elems[i]; + } + + reference front() + { + return elems[0]; + } + + const_reference front() const + { + return elems[0]; + } + + reference back() + { + return elems[N-1]; + } + + const_reference back() const + { + return elems[N-1]; + } + + static size_type size() + { + return N; + } + + static bool empty() + { + return false; + } + + static size_type max_size() + { + return N; + } + + enum { static_size = N }; + + void swap (Array& y) { + std::swap_ranges(begin(),end(),y.begin()); + } + + const T* data() const + /// Direct access to data (read-only) + { + return elems; + } + + T* data() + { + return elems; + } + + T* c_array(){ + /// Use array as C array (direct read/write access to data) + return elems; + } + + template + Array& operator= (const Array& rhs) + /// Assignment with type conversion + { + std::copy(rhs.begin(),rhs.end(), begin()); + return *this; + } + + void assign (const T& value) + /// Assign one value to all elements + { + std::fill_n(begin(),size(),value); + } + +public: + + T elems[N]; + /// Fixed-size array of elements of type T, public specifier used to make this class a aggregate. + +}; + +// comparisons +template +bool operator== (const Array& x, const Array& y) +{ + return std::equal(x.begin(), x.end(), y.begin()); +} + +template +bool operator< (const Array& x, const Array& y) +{ + return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()); +} + +template +bool operator!= (const Array& x, const Array& y) +{ + return !(x==y); +} + +template +bool operator> (const Array& x, const Array& y) +{ + return y +bool operator<= (const Array& x, const Array& y) +{ + return !(y +bool operator>= (const Array& x, const Array& y) +{ + return !(x +inline void swap (Array& x, Array& y) + /// global swap() +{ + x.swap(y); +} + +}// namespace Poco + +#endif // Foundation_Array_INCLUDED + diff --git a/vendor/invn/external/include/Poco/Ascii.h b/vendor/invn/external/include/Poco/Ascii.h new file mode 100644 index 0000000..0eb5d1c --- /dev/null +++ b/vendor/invn/external/include/Poco/Ascii.h @@ -0,0 +1,222 @@ +// +// Ascii.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Ascii.h#1 $ +// +// 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(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 diff --git a/vendor/invn/external/include/Poco/AsyncChannel.h b/vendor/invn/external/include/Poco/AsyncChannel.h new file mode 100644 index 0000000..8d49ca8 --- /dev/null +++ b/vendor/invn/external/include/Poco/AsyncChannel.h @@ -0,0 +1,102 @@ +// +// AsyncChannel.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AsyncChannel.h#2 $ +// +// 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 diff --git a/vendor/invn/external/include/Poco/AtomicCounter.h b/vendor/invn/external/include/Poco/AtomicCounter.h new file mode 100644 index 0000000..0554558 --- /dev/null +++ b/vendor/invn/external/include/Poco/AtomicCounter.h @@ -0,0 +1,358 @@ +// +// AtomicCounter.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AtomicCounter.h#4 $ +// +// 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 + #include +#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" + + +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 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 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 diff --git a/vendor/invn/external/include/Poco/AutoPtr.h b/vendor/invn/external/include/Poco/AutoPtr.h new file mode 100644 index 0000000..f3b2db3 --- /dev/null +++ b/vendor/invn/external/include/Poco/AutoPtr.h @@ -0,0 +1,358 @@ +// +// AutoPtr.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AutoPtr.h#1 $ +// +// 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 + + +namespace Poco { + + +template +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 + AutoPtr(const AutoPtr& ptr): _ptr(const_cast(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 + AutoPtr& assign(const AutoPtr& ptr) + { + if (ptr.get() != _ptr) + { + if (_ptr) _ptr->release(); + _ptr = const_cast(ptr.get()); + if (_ptr) _ptr->duplicate(); + } + return *this; + } + + AutoPtr& operator = (C* ptr) + { + return assign(ptr); + } + + AutoPtr& operator = (const AutoPtr& ptr) + { + return assign(ptr); + } + + template + AutoPtr& operator = (const AutoPtr& ptr) + { + return assign(ptr); + } + + void swap(AutoPtr& ptr) + { + std::swap(_ptr, ptr._ptr); + } + + template + AutoPtr 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(new Sub()); + /// AutoPtr sub = super.cast(); + /// poco_assert (sub.get()); + { + Other* pOther = dynamic_cast(_ptr); + return AutoPtr(pOther, true); + } + + template + AutoPtr unsafeCast() const + /// Casts the AutoPtr via a static cast to the given type. + /// Example: (assume class Sub: public Super) + /// AutoPtr super(new Sub()); + /// AutoPtr sub = super.unsafeCast(); + /// poco_assert (sub.get()); + { + Other* pOther = static_cast(_ptr); + return AutoPtr(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 +inline void swap(AutoPtr& p1, AutoPtr& p2) +{ + p1.swap(p2); +} + + +} // namespace Poco + + +#endif // Foundation_AutoPtr_INCLUDED diff --git a/vendor/invn/external/include/Poco/AutoReleasePool.h b/vendor/invn/external/include/Poco/AutoReleasePool.h new file mode 100644 index 0000000..4506056 --- /dev/null +++ b/vendor/invn/external/include/Poco/AutoReleasePool.h @@ -0,0 +1,88 @@ +// +// AutoReleasePool.h +// +// $Id: //poco/1.4/Foundation/include/Poco/AutoReleasePool.h#1 $ +// +// 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 + + +namespace Poco { + + +template +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 arp; + /// AutoPtr 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 ObjectList; + + ObjectList _list; +}; + + +} // namespace Poco + + +#endif // Foundation_AutoReleasePool_INCLUDED diff --git a/vendor/invn/external/include/Poco/Base32Decoder.h b/vendor/invn/external/include/Poco/Base32Decoder.h new file mode 100644 index 0000000..eaab488 --- /dev/null +++ b/vendor/invn/external/include/Poco/Base32Decoder.h @@ -0,0 +1,106 @@ +// +// Base32Decoder.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Base32Decoder.h#2 $ +// +// Library: Foundation +// Package: Streams +// Module: Base32 +// +// Definition of class Base32Decoder. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Base32Decoder_INCLUDED +#define Foundation_Base32Decoder_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/UnbufferedStreamBuf.h" +#include + + +namespace Poco { + + +class Foundation_API Base32DecoderBuf: public UnbufferedStreamBuf + /// This streambuf base32-decodes all data read + /// from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. +{ +public: + Base32DecoderBuf(std::istream& istr); + ~Base32DecoderBuf(); + +private: + int readFromDevice(); + int readOne(); + + unsigned char _group[8]; + int _groupLength; + int _groupIndex; + std::streambuf& _buf; + + static unsigned char IN_ENCODING[256]; + static bool IN_ENCODING_INIT; + +private: + Base32DecoderBuf(const Base32DecoderBuf&); + Base32DecoderBuf& operator = (const Base32DecoderBuf&); +}; + + +class Foundation_API Base32DecoderIOS: public virtual std::ios + /// The base class for Base32Decoder. + /// + /// This class is needed to ensure the correct initialization + /// order of the stream buffer and base classes. +{ +public: + Base32DecoderIOS(std::istream& istr); + ~Base32DecoderIOS(); + Base32DecoderBuf* rdbuf(); + +protected: + Base32DecoderBuf _buf; + +private: + Base32DecoderIOS(const Base32DecoderIOS&); + Base32DecoderIOS& operator = (const Base32DecoderIOS&); +}; + + +class Foundation_API Base32Decoder: public Base32DecoderIOS, public std::istream + /// This istream base32-decodes all data + /// read from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. +{ +public: + Base32Decoder(std::istream& istr); + ~Base32Decoder(); + +private: + Base32Decoder(const Base32Decoder&); + Base32Decoder& operator = (const Base32Decoder&); +}; + + +} // namespace Poco + + +#endif // Foundation_Base32Decoder_INCLUDED diff --git a/vendor/invn/external/include/Poco/Base32Encoder.h b/vendor/invn/external/include/Poco/Base32Encoder.h new file mode 100644 index 0000000..2f0df9b --- /dev/null +++ b/vendor/invn/external/include/Poco/Base32Encoder.h @@ -0,0 +1,112 @@ +// +// Base32Encoder.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Base32Encoder.h#2 $ +// +// Library: Foundation +// Package: Streams +// Module: Base32 +// +// Definition of class Base32Encoder. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Base32Encoder_INCLUDED +#define Foundation_Base32Encoder_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/UnbufferedStreamBuf.h" +#include + + +namespace Poco { + + +class Foundation_API Base32EncoderBuf: public UnbufferedStreamBuf + /// This streambuf base32-encodes all data written + /// to it and forwards it to a connected + /// ostream. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. +{ +public: + Base32EncoderBuf(std::ostream& ostr, bool padding = true); + ~Base32EncoderBuf(); + + int close(); + /// Closes the stream buffer. + +private: + int writeToDevice(char c); + + unsigned char _group[5]; + int _groupLength; + std::streambuf& _buf; + bool _doPadding; + + static const unsigned char OUT_ENCODING[32]; + + friend class Base32DecoderBuf; + + Base32EncoderBuf(const Base32EncoderBuf&); + Base32EncoderBuf& operator = (const Base32EncoderBuf&); +}; + + +class Foundation_API Base32EncoderIOS: public virtual std::ios + /// The base class for Base32Encoder. + /// + /// This class is needed to ensure the correct initialization + /// order of the stream buffer and base classes. +{ +public: + Base32EncoderIOS(std::ostream& ostr, bool padding = true); + ~Base32EncoderIOS(); + int close(); + Base32EncoderBuf* rdbuf(); + +protected: + Base32EncoderBuf _buf; + +private: + Base32EncoderIOS(const Base32EncoderIOS&); + Base32EncoderIOS& operator = (const Base32EncoderIOS&); +}; + + +class Foundation_API Base32Encoder: public Base32EncoderIOS, public std::ostream + /// This ostream base32-encodes all data + /// written to it and forwards it to + /// a connected ostream. + /// Always call close() when done + /// writing data, to ensure proper + /// completion of the encoding operation. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. +{ +public: + Base32Encoder(std::ostream& ostr, bool padding = true); + ~Base32Encoder(); + +private: + Base32Encoder(const Base32Encoder&); + Base32Encoder& operator = (const Base32Encoder&); +}; + + +} // namespace Poco + + +#endif // Foundation_Base32Encoder_INCLUDED diff --git a/vendor/invn/external/include/Poco/Base64Decoder.h b/vendor/invn/external/include/Poco/Base64Decoder.h new file mode 100644 index 0000000..ad399c6 --- /dev/null +++ b/vendor/invn/external/include/Poco/Base64Decoder.h @@ -0,0 +1,106 @@ +// +// Base64Decoder.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Base64Decoder.h#2 $ +// +// Library: Foundation +// Package: Streams +// Module: Base64 +// +// Definition of class Base64Decoder. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Base64Decoder_INCLUDED +#define Foundation_Base64Decoder_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/UnbufferedStreamBuf.h" +#include + + +namespace Poco { + + +class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf + /// This streambuf base64-decodes all data read + /// from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. +{ +public: + Base64DecoderBuf(std::istream& istr); + ~Base64DecoderBuf(); + +private: + int readFromDevice(); + int readOne(); + + unsigned char _group[3]; + int _groupLength; + int _groupIndex; + std::streambuf& _buf; + + static unsigned char IN_ENCODING[256]; + static bool IN_ENCODING_INIT; + +private: + Base64DecoderBuf(const Base64DecoderBuf&); + Base64DecoderBuf& operator = (const Base64DecoderBuf&); +}; + + +class Foundation_API Base64DecoderIOS: public virtual std::ios + /// The base class for Base64Decoder. + /// + /// This class is needed to ensure the correct initialization + /// order of the stream buffer and base classes. +{ +public: + Base64DecoderIOS(std::istream& istr); + ~Base64DecoderIOS(); + Base64DecoderBuf* rdbuf(); + +protected: + Base64DecoderBuf _buf; + +private: + Base64DecoderIOS(const Base64DecoderIOS&); + Base64DecoderIOS& operator = (const Base64DecoderIOS&); +}; + + +class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream + /// This istream base64-decodes all data + /// read from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. +{ +public: + Base64Decoder(std::istream& istr); + ~Base64Decoder(); + +private: + Base64Decoder(const Base64Decoder&); + Base64Decoder& operator = (const Base64Decoder&); +}; + + +} // namespace Poco + + +#endif // Foundation_Base64Decoder_INCLUDED diff --git a/vendor/invn/external/include/Poco/Base64Encoder.h b/vendor/invn/external/include/Poco/Base64Encoder.h new file mode 100644 index 0000000..6f1241a --- /dev/null +++ b/vendor/invn/external/include/Poco/Base64Encoder.h @@ -0,0 +1,124 @@ +// +// Base64Encoder.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Base64Encoder.h#2 $ +// +// Library: Foundation +// Package: Streams +// Module: Base64 +// +// Definition of class Base64Encoder. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Base64Encoder_INCLUDED +#define Foundation_Base64Encoder_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/UnbufferedStreamBuf.h" +#include + + +namespace Poco { + + +class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf + /// This streambuf base64-encodes all data written + /// to it and forwards it to a connected + /// ostream. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. +{ +public: + Base64EncoderBuf(std::ostream& ostr); + ~Base64EncoderBuf(); + + int close(); + /// Closes the stream buffer. + + void setLineLength(int lineLength); + /// Specify the line length. + /// + /// After the given number of characters have been written, + /// a newline character will be written. + /// + /// Specify 0 for an unlimited line length. + + int getLineLength() const; + /// Returns the currently set line length. + +private: + int writeToDevice(char c); + + unsigned char _group[3]; + int _groupLength; + int _pos; + int _lineLength; + std::streambuf& _buf; + + static const unsigned char OUT_ENCODING[64]; + + friend class Base64DecoderBuf; + + Base64EncoderBuf(const Base64EncoderBuf&); + Base64EncoderBuf& operator = (const Base64EncoderBuf&); +}; + + +class Foundation_API Base64EncoderIOS: public virtual std::ios + /// The base class for Base64Encoder. + /// + /// This class is needed to ensure the correct initialization + /// order of the stream buffer and base classes. +{ +public: + Base64EncoderIOS(std::ostream& ostr); + ~Base64EncoderIOS(); + int close(); + Base64EncoderBuf* rdbuf(); + +protected: + Base64EncoderBuf _buf; + +private: + Base64EncoderIOS(const Base64EncoderIOS&); + Base64EncoderIOS& operator = (const Base64EncoderIOS&); +}; + + +class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream + /// This ostream base64-encodes all data + /// written to it and forwards it to + /// a connected ostream. + /// Always call close() when done + /// writing data, to ensure proper + /// completion of the encoding operation. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. +{ +public: + Base64Encoder(std::ostream& ostr); + ~Base64Encoder(); + +private: + Base64Encoder(const Base64Encoder&); + Base64Encoder& operator = (const Base64Encoder&); +}; + + +} // namespace Poco + + +#endif // Foundation_Base64Encoder_INCLUDED diff --git a/vendor/invn/external/include/Poco/BasicEvent.h b/vendor/invn/external/include/Poco/BasicEvent.h new file mode 100644 index 0000000..366f59e --- /dev/null +++ b/vendor/invn/external/include/Poco/BasicEvent.h @@ -0,0 +1,62 @@ +// +// BasicEvent.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BasicEvent.h#2 $ +// +// 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 BasicEvent: public AbstractEvent < + TArgs, DefaultStrategy >, + AbstractDelegate, + 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 diff --git a/vendor/invn/external/include/Poco/BinaryReader.h b/vendor/invn/external/include/Poco/BinaryReader.h new file mode 100644 index 0000000..cc4c604 --- /dev/null +++ b/vendor/invn/external/include/Poco/BinaryReader.h @@ -0,0 +1,267 @@ +// +// BinaryReader.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BinaryReader.h#3 $ +// +// Library: Foundation +// Package: Streams +// Module: BinaryReaderWriter +// +// Definition of the BinaryReader class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_BinaryReader_INCLUDED +#define Foundation_BinaryReader_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Buffer.h" +#include "Poco/MemoryStream.h" +#include +#include + + +namespace Poco { + + +class TextEncoding; +class TextConverter; + + +class Foundation_API BinaryReader + /// This class reads basic types (and std::vectors thereof) + /// in binary form into an input stream. + /// It provides an extractor-based interface similar to istream. + /// The reader also supports automatic conversion from big-endian + /// (network byte order) to little-endian and vice-versa. + /// Use a BinaryWriter to create a stream suitable for a BinaryReader. +{ +public: + enum StreamByteOrder + { + NATIVE_BYTE_ORDER = 1, /// the host's native byte-order + BIG_ENDIAN_BYTE_ORDER = 2, /// big-endian (network) byte-order + NETWORK_BYTE_ORDER = 2, /// big-endian (network) byte-order + LITTLE_ENDIAN_BYTE_ORDER = 3, /// little-endian byte-order + UNSPECIFIED_BYTE_ORDER = 4 /// unknown, byte-order will be determined by reading the byte-order mark + }; + + BinaryReader(std::istream& istr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryReader. + + BinaryReader(std::istream& istr, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryReader using the given TextEncoding. + /// + /// Strings will be converted from the specified encoding + /// to the currently set global encoding (see Poco::TextEncoding::global()). + + ~BinaryReader(); + /// Destroys the BinaryReader. + + BinaryReader& operator >> (bool& value); + BinaryReader& operator >> (char& value); + BinaryReader& operator >> (unsigned char& value); + BinaryReader& operator >> (signed char& value); + BinaryReader& operator >> (short& value); + BinaryReader& operator >> (unsigned short& value); + BinaryReader& operator >> (int& value); + BinaryReader& operator >> (unsigned int& value); + BinaryReader& operator >> (long& value); + BinaryReader& operator >> (unsigned long& value); + BinaryReader& operator >> (float& value); + BinaryReader& operator >> (double& value); + +#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT) + BinaryReader& operator >> (Int64& value); + BinaryReader& operator >> (UInt64& value); +#endif + + BinaryReader& operator >> (std::string& value); + + template + BinaryReader& operator >> (std::vector& value) + { + Poco::UInt32 size(0); + T elem; + + *this >> size; + if (!good()) return *this; + value.reserve(size); + while (this->good() && size-- > 0) + { + *this >> elem; + value.push_back(elem); + } + return *this; + } + + void read7BitEncoded(UInt32& value); + /// Reads a 32-bit unsigned integer in compressed format. + /// See BinaryWriter::write7BitEncoded() for a description + /// of the compression algorithm. + +#if defined(POCO_HAVE_INT64) + void read7BitEncoded(UInt64& value); + /// Reads a 64-bit unsigned integer in compressed format. + /// See BinaryWriter::write7BitEncoded() for a description + /// of the compression algorithm. +#endif + + void readRaw(std::streamsize length, std::string& value); + /// Reads length bytes of raw data into value. + + void readRaw(char* buffer, std::streamsize length); + /// Reads length bytes of raw data into buffer. + + void readBOM(); + /// Reads a byte-order mark from the stream and configures + /// the reader for the encountered byte order. + /// A byte-order mark is a 16-bit integer with a value of 0xFEFF, + /// written in host byte order. + + bool good(); + /// Returns _istr.good(); + + bool fail(); + /// Returns _istr.fail(); + + bool bad(); + /// Returns _istr.bad(); + + bool eof(); + /// Returns _istr.eof(); + + std::istream& stream() const; + /// Returns the underlying stream. + + StreamByteOrder byteOrder() const; + /// Returns the byte-order used by the reader, which is + /// either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER. + + void setExceptions(std::ios_base::iostate st = (std::istream::failbit | std::istream::badbit)); + /// Sets the stream to throw exception on specified state (default failbit and badbit); + + std::streamsize available() const; + /// Returns the number of available bytes in the stream. + +private: + std::istream& _istr; + bool _flipBytes; + TextConverter* _pTextConverter; +}; + + +template +class BasicMemoryBinaryReader : public BinaryReader + /// A convenient wrapper for using Buffer and MemoryStream with BinaryReader. +{ +public: + BasicMemoryBinaryReader(const Buffer& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER): + BinaryReader(_istr, byteOrder), + _data(data), + _istr(data.begin(), data.capacity()) + { + } + + BasicMemoryBinaryReader(const Buffer& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER): + BinaryReader(_istr, encoding, byteOrder), + _data(data), + _istr(data.begin(), data.capacity()) + { + } + + ~BasicMemoryBinaryReader() + { + } + + const Buffer& data() const + { + return _data; + } + + const MemoryInputStream& stream() const + { + return _istr; + } + + MemoryInputStream& stream() + { + return _istr; + } + +private: + const Buffer& _data; + MemoryInputStream _istr; +}; + + +typedef BasicMemoryBinaryReader MemoryBinaryReader; + + +// +// inlines +// + + +inline bool BinaryReader::good() +{ + return _istr.good(); +} + + +inline bool BinaryReader::fail() +{ + return _istr.fail(); +} + + +inline bool BinaryReader::bad() +{ + return _istr.bad(); +} + + +inline bool BinaryReader::eof() +{ + return _istr.eof(); +} + + +inline std::istream& BinaryReader::stream() const +{ + return _istr; +} + + +inline BinaryReader::StreamByteOrder BinaryReader::byteOrder() const +{ +#if defined(POCO_ARCH_BIG_ENDIAN) + return _flipBytes ? LITTLE_ENDIAN_BYTE_ORDER : BIG_ENDIAN_BYTE_ORDER; +#else + return _flipBytes ? BIG_ENDIAN_BYTE_ORDER : LITTLE_ENDIAN_BYTE_ORDER; +#endif +} + + +inline void BinaryReader::setExceptions(std::ios_base::iostate st) +{ + _istr.exceptions(st); +} + + +inline std::streamsize BinaryReader::available() const +{ + return _istr.rdbuf()->in_avail(); +} + + +} // namespace Poco + + +#endif // Foundation_BinaryReader_INCLUDED diff --git a/vendor/invn/external/include/Poco/BinaryWriter.h b/vendor/invn/external/include/Poco/BinaryWriter.h new file mode 100644 index 0000000..a881eb7 --- /dev/null +++ b/vendor/invn/external/include/Poco/BinaryWriter.h @@ -0,0 +1,271 @@ +// +// BinaryWriter.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BinaryWriter.h#2 $ +// +// Library: Foundation +// Package: Streams +// Module: BinaryReaderWriter +// +// Definition of the BinaryWriter class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_BinaryWriter_INCLUDED +#define Foundation_BinaryWriter_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Buffer.h" +#include "Poco/MemoryStream.h" +#include +#include + + +namespace Poco { + + +class TextEncoding; +class TextConverter; + + +class Foundation_API BinaryWriter + /// This class writes basic types (and std::vectors of these) + /// in binary form into an output stream. + /// It provides an inserter-based interface similar to ostream. + /// The writer also supports automatic conversion from big-endian + /// (network byte order) to little-endian and vice-versa. + /// Use a BinaryReader to read from a stream created by a BinaryWriter. + /// Be careful when exchanging data between systems with different + /// data type sizes (e.g., 32-bit and 64-bit architectures), as the sizes + /// of some of the basic types may be different. For example, writing a + /// long integer on a 64-bit system and reading it on a 32-bit system + /// may yield an incorrent result. Use fixed-size types (Int32, Int64, etc.) + /// in such a case. +{ +public: + enum StreamByteOrder + { + NATIVE_BYTE_ORDER = 1, /// the host's native byte-order + BIG_ENDIAN_BYTE_ORDER = 2, /// big-endian (network) byte-order + NETWORK_BYTE_ORDER = 2, /// big-endian (network) byte-order + LITTLE_ENDIAN_BYTE_ORDER = 3 /// little-endian byte-order + }; + + BinaryWriter(std::ostream& ostr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryWriter. + + BinaryWriter(std::ostream& ostr, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryWriter using the given TextEncoding. + /// + /// Strings will be converted from the currently set global encoding + /// (see Poco::TextEncoding::global()) to the specified encoding. + + ~BinaryWriter(); + /// Destroys the BinaryWriter. + + BinaryWriter& operator << (bool value); + BinaryWriter& operator << (char value); + BinaryWriter& operator << (unsigned char value); + BinaryWriter& operator << (signed char value); + BinaryWriter& operator << (short value); + BinaryWriter& operator << (unsigned short value); + BinaryWriter& operator << (int value); + BinaryWriter& operator << (unsigned int value); + BinaryWriter& operator << (long value); + BinaryWriter& operator << (unsigned long value); + BinaryWriter& operator << (float value); + BinaryWriter& operator << (double value); + +#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT) + BinaryWriter& operator << (Int64 value); + BinaryWriter& operator << (UInt64 value); +#endif + + BinaryWriter& operator << (const std::string& value); + BinaryWriter& operator << (const char* value); + + template + BinaryWriter& operator << (const std::vector& value) + { + Poco::UInt32 size(static_cast(value.size())); + + *this << size; + for (typename std::vector::const_iterator it = value.begin(); it != value.end(); ++it) + { + *this << *it; + } + + return *this; + } + + void write7BitEncoded(UInt32 value); + /// Writes a 32-bit unsigned integer in a compressed format. + /// The value is written out seven bits at a time, starting + /// with the seven least-significant bits. + /// The high bit of a byte indicates whether there are more bytes to be + /// written after this one. + /// If value will fit in seven bits, it takes only one byte of space. + /// If value will not fit in seven bits, the high bit is set on the first byte and + /// written out. value is then shifted by seven bits and the next byte is written. + /// This process is repeated until the entire integer has been written. + +#if defined(POCO_HAVE_INT64) + void write7BitEncoded(UInt64 value); + /// Writes a 64-bit unsigned integer in a compressed format. + /// The value written out seven bits at a time, starting + /// with the seven least-significant bits. + /// The high bit of a byte indicates whether there are more bytes to be + /// written after this one. + /// If value will fit in seven bits, it takes only one byte of space. + /// If value will not fit in seven bits, the high bit is set on the first byte and + /// written out. value is then shifted by seven bits and the next byte is written. + /// This process is repeated until the entire integer has been written. +#endif + + void writeRaw(const std::string& rawData); + /// Writes the string as-is to the stream. + + void writeRaw(const char* buffer, std::streamsize length); + /// Writes length raw bytes from the given buffer to the stream. + + void writeBOM(); + /// Writes a byte-order mark to the stream. A byte order mark is + /// a 16-bit integer with a value of 0xFEFF, written in host byte-order. + /// A BinaryReader uses the byte-order mark to determine the byte-order + /// of the stream. + + void flush(); + /// Flushes the underlying stream. + + bool good(); + /// Returns _ostr.good(); + + bool fail(); + /// Returns _ostr.fail(); + + bool bad(); + /// Returns _ostr.bad(); + + std::ostream& stream() const; + /// Returns the underlying stream. + + StreamByteOrder byteOrder() const; + /// Returns the byte ordering used by the writer, which is + /// either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER. + +private: + std::ostream& _ostr; + bool _flipBytes; + TextConverter* _pTextConverter; +}; + + +template +class BasicMemoryBinaryWriter: public BinaryWriter + /// A convenient wrapper for using Buffer and MemoryStream with BinarWriter. +{ +public: + BasicMemoryBinaryWriter(Buffer& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER): + BinaryWriter(_ostr, byteOrder), + _data(data), + _ostr(data.begin(), data.capacity()) + { + } + + BasicMemoryBinaryWriter(Buffer& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER): + BinaryWriter(_ostr, encoding, byteOrder), + _data(data), + _ostr(data.begin(), data.capacity()) + { + } + + ~BasicMemoryBinaryWriter() + { + try + { + flush(); + } + catch (...) + { + poco_unexpected(); + } + } + + Buffer& data() + { + return _data; + } + + const Buffer& data() const + { + return _data; + } + + const MemoryOutputStream& stream() const + { + return _ostr; + } + + MemoryOutputStream& stream() + { + return _ostr; + } + +private: + Buffer& _data; + MemoryOutputStream _ostr; +}; + + +typedef BasicMemoryBinaryWriter MemoryBinaryWriter; + + +// +// inlines +// + + +inline std::ostream& BinaryWriter::stream() const +{ + return _ostr; +} + + +inline bool BinaryWriter::good() +{ + return _ostr.good(); +} + + +inline bool BinaryWriter::fail() +{ + return _ostr.fail(); +} + + +inline bool BinaryWriter::bad() +{ + return _ostr.bad(); +} + + +inline BinaryWriter::StreamByteOrder BinaryWriter::byteOrder() const +{ +#if defined(POCO_ARCH_BIG_ENDIAN) + return _flipBytes ? LITTLE_ENDIAN_BYTE_ORDER : BIG_ENDIAN_BYTE_ORDER; +#else + return _flipBytes ? BIG_ENDIAN_BYTE_ORDER : LITTLE_ENDIAN_BYTE_ORDER; +#endif +} + + +} // namespace Poco + + +#endif // Foundation_BinaryWriter_INCLUDED diff --git a/vendor/invn/external/include/Poco/Buffer.h b/vendor/invn/external/include/Poco/Buffer.h new file mode 100644 index 0000000..1ee4853 --- /dev/null +++ b/vendor/invn/external/include/Poco/Buffer.h @@ -0,0 +1,331 @@ +// +// Buffer.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Buffer.h#2 $ +// +// 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 +#include + + +namespace Poco { + + +template +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 diff --git a/vendor/invn/external/include/Poco/BufferAllocator.h b/vendor/invn/external/include/Poco/BufferAllocator.h new file mode 100644 index 0000000..46f1ff5 --- /dev/null +++ b/vendor/invn/external/include/Poco/BufferAllocator.h @@ -0,0 +1,54 @@ +// +// BufferAllocator.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BufferAllocator.h#1 $ +// +// 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 +#include + + +namespace Poco { + + +template +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(size)]; + } + + static void deallocate(char_type* ptr, std::streamsize /*size*/) throw() + { + delete [] ptr; + } +}; + + +} // namespace Poco + + +#endif // Foundation_BufferAllocator_INCLUDED diff --git a/vendor/invn/external/include/Poco/BufferedBidirectionalStreamBuf.h b/vendor/invn/external/include/Poco/BufferedBidirectionalStreamBuf.h new file mode 100644 index 0000000..fa0c957 --- /dev/null +++ b/vendor/invn/external/include/Poco/BufferedBidirectionalStreamBuf.h @@ -0,0 +1,176 @@ +// +// BufferedBidirectionalStreamBuf.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h#1 $ +// +// 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 +#include +#include + + +namespace Poco { + + +template > +class BasicBufferedBidirectionalStreamBuf: public std::basic_streambuf + /// 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 Base; + typedef std::basic_ios 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 (c != char_traits::eof()) + { + *this->pptr() = char_traits::to_char_type(c); + this->pbump(1); + } + if (flushBuffer() == std::streamsize(-1)) return char_traits::eof(); + + 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 - 1)); + } + +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 +// +typedef BasicBufferedBidirectionalStreamBuf > BufferedBidirectionalStreamBuf; + + +} // namespace Poco + + +#endif // Foundation_BufferedBidirectionalStreamBuf_INCLUDED diff --git a/vendor/invn/external/include/Poco/BufferedStreamBuf.h b/vendor/invn/external/include/Poco/BufferedStreamBuf.h new file mode 100644 index 0000000..7c9c006 --- /dev/null +++ b/vendor/invn/external/include/Poco/BufferedStreamBuf.h @@ -0,0 +1,168 @@ +// +// BufferedStreamBuf.h +// +// $Id: //poco/1.4/Foundation/include/Poco/BufferedStreamBuf.h#1 $ +// +// 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 +#include +#include + + +namespace Poco { + + +template > +class BasicBufferedStreamBuf: public std::basic_streambuf + /// 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 Base; + typedef std::basic_ios 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 - 1)); + } + + ~BasicBufferedStreamBuf() + { + Allocator::deallocate(_pBuffer, _bufsize); + } + + virtual int_type overflow(int_type c) + { + if (!(_mode & IOS::out)) return char_traits::eof(); + + if (c != char_traits::eof()) + { + *this->pptr() = char_traits::to_char_type(c); + this->pbump(1); + } + if (flushBuffer() == std::streamsize(-1)) return char_traits::eof(); + + 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 +// +typedef BasicBufferedStreamBuf > BufferedStreamBuf; + + +} // namespace Poco + + +#endif // Foundation_BufferedStreamBuf_INCLUDED diff --git a/vendor/invn/external/include/Poco/Bugcheck.h b/vendor/invn/external/include/Poco/Bugcheck.h new file mode 100644 index 0000000..d11b2bb --- /dev/null +++ b/vendor/invn/external/include/Poco/Bugcheck.h @@ -0,0 +1,187 @@ +// +// Bugcheck.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Bugcheck.h#1 $ +// +// 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 +#if defined(_DEBUG) +# include +#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(_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__) + + +#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 +// + + +#if defined(POCO_COMPILER_GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) + GCC_DIAG_OFF(unused-local-typedefs) // supress numerous gcc warnings +#endif // POCO_COMPILER_GCC && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) + + +template +struct POCO_STATIC_ASSERTION_FAILURE; + + +template <> +struct POCO_STATIC_ASSERTION_FAILURE +{ + enum + { + value = 1 + }; +}; + + +template +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)> \ + POCO_JOIN(poco_static_assert_typedef_, __LINE__) +#endif + + +#endif // Foundation_Bugcheck_INCLUDED diff --git a/vendor/invn/external/include/Poco/ByteOrder.h b/vendor/invn/external/include/Poco/ByteOrder.h new file mode 100644 index 0000000..78022f7 --- /dev/null +++ b/vendor/invn/external/include/Poco/ByteOrder.h @@ -0,0 +1,241 @@ +// +// ByteOrder.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ByteOrder.h#5 $ +// +// Library: Foundation +// Package: Core +// Module: ByteOrder +// +// Copyright (c) 2004-2014, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ByteOrder_INCLUDED +#define Foundation_ByteOrder_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Types.h" +#if defined(_MSC_VER) +#include // builtins +#endif + + +namespace Poco { + + +class Foundation_API ByteOrder + /// This class contains a number of static methods + /// to convert between big-endian and little-endian + /// integers of various sizes. +{ +public: + static Int16 flipBytes(Int16 value); + static UInt16 flipBytes(UInt16 value); + static Int32 flipBytes(Int32 value); + static UInt32 flipBytes(UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 flipBytes(Int64 value); + static UInt64 flipBytes(UInt64 value); +#endif + + static Int16 toBigEndian(Int16 value); + static UInt16 toBigEndian (UInt16 value); + static Int32 toBigEndian(Int32 value); + static UInt32 toBigEndian (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 toBigEndian(Int64 value); + static UInt64 toBigEndian (UInt64 value); +#endif + + static Int16 fromBigEndian(Int16 value); + static UInt16 fromBigEndian (UInt16 value); + static Int32 fromBigEndian(Int32 value); + static UInt32 fromBigEndian (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 fromBigEndian(Int64 value); + static UInt64 fromBigEndian (UInt64 value); +#endif + + static Int16 toLittleEndian(Int16 value); + static UInt16 toLittleEndian (UInt16 value); + static Int32 toLittleEndian(Int32 value); + static UInt32 toLittleEndian (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 toLittleEndian(Int64 value); + static UInt64 toLittleEndian (UInt64 value); +#endif + + static Int16 fromLittleEndian(Int16 value); + static UInt16 fromLittleEndian (UInt16 value); + static Int32 fromLittleEndian(Int32 value); + static UInt32 fromLittleEndian (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 fromLittleEndian(Int64 value); + static UInt64 fromLittleEndian (UInt64 value); +#endif + + static Int16 toNetwork(Int16 value); + static UInt16 toNetwork (UInt16 value); + static Int32 toNetwork(Int32 value); + static UInt32 toNetwork (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 toNetwork(Int64 value); + static UInt64 toNetwork (UInt64 value); +#endif + + static Int16 fromNetwork(Int16 value); + static UInt16 fromNetwork (UInt16 value); + static Int32 fromNetwork(Int32 value); + static UInt32 fromNetwork (UInt32 value); +#if defined(POCO_HAVE_INT64) + static Int64 fromNetwork(Int64 value); + static UInt64 fromNetwork (UInt64 value); +#endif +}; + + +#if !defined(POCO_NO_BYTESWAP_BUILTINS) + #if defined(_MSC_VER) + #if (POCO_MSVC_VERSION > 71) + #define POCO_HAVE_MSC_BYTESWAP 1 + #endif + #elif defined(__clang__) + #if __has_builtin(__builtin_bswap32) + #define POCO_HAVE_GCC_BYTESWAP 1 + #endif + #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define POCO_HAVE_GCC_BYTESWAP 1 + #endif +#endif + + +// +// inlines +// +inline UInt16 ByteOrder::flipBytes(UInt16 value) +{ +#if defined(POCO_HAVE_MSC_BYTESWAP) + return _byteswap_ushort(value); +#else + return ((value >> 8) & 0x00FF) | ((value << 8) & 0xFF00); +#endif +} + + +inline Int16 ByteOrder::flipBytes(Int16 value) +{ + return Int16(flipBytes(UInt16(value))); +} + + +inline UInt32 ByteOrder::flipBytes(UInt32 value) +{ +#if defined(POCO_HAVE_MSC_BYTESWAP) + return _byteswap_ulong(value); +#elif defined(POCO_HAVE_GCC_BYTESWAP) + return __builtin_bswap32(value); +#else + return ((value >> 24) & 0x000000FF) | ((value >> 8) & 0x0000FF00) + | ((value << 8) & 0x00FF0000) | ((value << 24) & 0xFF000000); +#endif +} + + +inline Int32 ByteOrder::flipBytes(Int32 value) +{ + return Int32(flipBytes(UInt32(value))); +} + + +#if defined(POCO_HAVE_INT64) +inline UInt64 ByteOrder::flipBytes(UInt64 value) +{ +#if defined(POCO_HAVE_MSC_BYTESWAP) + return _byteswap_uint64(value); +#elif defined(POCO_HAVE_GCC_BYTESWAP) + return __builtin_bswap64(value); +#else + UInt32 hi = UInt32(value >> 32); + UInt32 lo = UInt32(value & 0xFFFFFFFF); + return UInt64(flipBytes(hi)) | (UInt64(flipBytes(lo)) << 32); +#endif +} + + +inline Int64 ByteOrder::flipBytes(Int64 value) +{ + return Int64(flipBytes(UInt64(value))); +} +#endif // POCO_HAVE_INT64 + + +// +// some macro trickery to automate the method implementation +// +#define POCO_IMPLEMENT_BYTEORDER_NOOP_(op, type) \ + inline type ByteOrder::op(type value) \ + { \ + return value; \ + } +#define POCO_IMPLEMENT_BYTEORDER_FLIP_(op, type) \ + inline type ByteOrder::op(type value) \ + { \ + return flipBytes(value); \ + } + + +#if defined(POCO_HAVE_INT64) + #define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int64) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt64) + #define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int64) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt64) +#else + #define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \ + POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32) + #define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \ + POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32) +#endif + + +#if defined(POCO_ARCH_BIG_ENDIAN) + #define POCO_IMPLEMENT_BYTEORDER_BIG POCO_IMPLEMENT_BYTEORDER_NOOP + #define POCO_IMPLEMENT_BYTEORDER_LIT POCO_IMPLEMENT_BYTEORDER_FLIP +#else + #define POCO_IMPLEMENT_BYTEORDER_BIG POCO_IMPLEMENT_BYTEORDER_FLIP + #define POCO_IMPLEMENT_BYTEORDER_LIT POCO_IMPLEMENT_BYTEORDER_NOOP +#endif + + +POCO_IMPLEMENT_BYTEORDER_BIG(toBigEndian) +POCO_IMPLEMENT_BYTEORDER_BIG(fromBigEndian) +POCO_IMPLEMENT_BYTEORDER_BIG(toNetwork) +POCO_IMPLEMENT_BYTEORDER_BIG(fromNetwork) +POCO_IMPLEMENT_BYTEORDER_LIT(toLittleEndian) +POCO_IMPLEMENT_BYTEORDER_LIT(fromLittleEndian) + + +} // namespace Poco + + +#endif // Foundation_ByteOrder_INCLUDED diff --git a/vendor/invn/external/include/Poco/Channel.h b/vendor/invn/external/include/Poco/Channel.h new file mode 100644 index 0000000..e34431b --- /dev/null +++ b/vendor/invn/external/include/Poco/Channel.h @@ -0,0 +1,80 @@ +// +// Channel.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Channel.h#1 $ +// +// Library: Foundation +// Package: Logging +// Module: Channel +// +// Definition of the Channel class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Channel_INCLUDED +#define Foundation_Channel_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Configurable.h" +#include "Poco/Mutex.h" +#include "Poco/RefCountedObject.h" + + +namespace Poco { + + +class Message; + + +class Foundation_API Channel: public Configurable, public RefCountedObject + /// The base class for all Channel classes. + /// + /// Supports reference counting based garbage + /// collection and provides trivial implementations + /// of getProperty() and setProperty(). +{ +public: + Channel(); + /// Creates the channel and initializes + /// the reference count to one. + + virtual void open(); + /// Does whatever is necessary to open the channel. + /// The default implementation does nothing. + + virtual void close(); + /// Does whatever is necessary to close the channel. + /// The default implementation does nothing. + + virtual void log(const Message& msg) = 0; + /// Logs the given message to the channel. Must be + /// overridden by subclasses. + /// + /// If the channel has not been opened yet, the log() + /// method will open it. + + void setProperty(const std::string& name, const std::string& value); + /// Throws a PropertyNotSupportedException. + + std::string getProperty(const std::string& name) const; + /// Throws a PropertyNotSupportedException. + +protected: + virtual ~Channel(); + +private: + Channel(const Channel&); + Channel& operator = (const Channel&); +}; + + +} // namespace Poco + + +#endif // Foundation_Channel_INCLUDED diff --git a/vendor/invn/external/include/Poco/Checksum.h b/vendor/invn/external/include/Poco/Checksum.h new file mode 100644 index 0000000..49b3076 --- /dev/null +++ b/vendor/invn/external/include/Poco/Checksum.h @@ -0,0 +1,110 @@ +// +// Checksum.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Checksum.h#1 $ +// +// 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(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 diff --git a/vendor/invn/external/include/Poco/ClassLibrary.h b/vendor/invn/external/include/Poco/ClassLibrary.h new file mode 100644 index 0000000..30fc98b --- /dev/null +++ b/vendor/invn/external/include/Poco/ClassLibrary.h @@ -0,0 +1,103 @@ +// +// ClassLibrary.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ClassLibrary.h#1 $ +// +// Library: Foundation +// Package: SharedLibrary +// Module: ClassLoader +// +// Definitions for class libraries. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ClassLibrary_INCLUDED +#define Foundation_ClassLibrary_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Manifest.h" +#include + + +#if defined(_WIN32) + #define POCO_LIBRARY_API __declspec(dllexport) +#else + #define POCO_LIBRARY_API +#endif + + +// +// the entry points for every class library +// +extern "C" +{ + bool POCO_LIBRARY_API pocoBuildManifest(Poco::ManifestBase* pManifest); + void POCO_LIBRARY_API pocoInitializeLibrary(); + void POCO_LIBRARY_API pocoUninitializeLibrary(); +} + + +// +// additional support for named manifests +// +#define POCO_DECLARE_NAMED_MANIFEST(name) \ +extern "C" \ +{ \ + bool POCO_LIBRARY_API POCO_JOIN(pocoBuildManifest, name)(Poco::ManifestBase* pManifest); \ +} + + +// +// Macros to automatically implement pocoBuildManifest +// +// usage: +// +// POCO_BEGIN_MANIFEST(MyBaseClass) +// POCO_EXPORT_CLASS(MyFirstClass) +// POCO_EXPORT_CLASS(MySecondClass) +// ... +// POCO_END_MANIFEST +// +#define POCO_BEGIN_MANIFEST_IMPL(fnName, base) \ + bool fnName(Poco::ManifestBase* pManifest_) \ + { \ + typedef base _Base; \ + typedef Poco::Manifest<_Base> _Manifest; \ + std::string requiredType(typeid(_Manifest).name()); \ + std::string actualType(pManifest_->className()); \ + if (requiredType == actualType) \ + { \ + Poco::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_); + + +#define POCO_BEGIN_MANIFEST(base) \ + POCO_BEGIN_MANIFEST_IMPL(pocoBuildManifest, base) + + +#define POCO_BEGIN_NAMED_MANIFEST(name, base) \ + POCO_DECLARE_NAMED_MANIFEST(name) \ + POCO_BEGIN_MANIFEST_IMPL(POCO_JOIN(pocoBuildManifest, name), base) + + +#define POCO_END_MANIFEST \ + return true; \ + } \ + else return false; \ + } + + +#define POCO_EXPORT_CLASS(cls) \ + pManifest->insert(new Poco::MetaObject(#cls)); + + +#define POCO_EXPORT_SINGLETON(cls) \ + pManifest->insert(new Poco::MetaSingleton(#cls)); + + +#endif // Foundation_ClassLibrary_INCLUDED diff --git a/vendor/invn/external/include/Poco/ClassLoader.h b/vendor/invn/external/include/Poco/ClassLoader.h new file mode 100644 index 0000000..1dd63a7 --- /dev/null +++ b/vendor/invn/external/include/Poco/ClassLoader.h @@ -0,0 +1,365 @@ +// +// ClassLoader.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ClassLoader.h#1 $ +// +// Library: Foundation +// Package: SharedLibrary +// Module: ClassLoader +// +// Definition of the ClassLoader class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ClassLoader_INCLUDED +#define Foundation_ClassLoader_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/MetaObject.h" +#include "Poco/Manifest.h" +#include "Poco/SharedLibrary.h" +#include "Poco/Mutex.h" +#include "Poco/Exception.h" +#include + + +namespace Poco { + + +template +class ClassLoader + /// The ClassLoader loads C++ classes from shared libraries + /// at runtime. It must be instantiated with a root class + /// of the loadable classes. + /// For a class to be loadable from a library, the library + /// must provide a Manifest of all the classes it contains. + /// The Manifest for a shared library can be easily built + /// with the help of the macros in the header file + /// "Foundation/ClassLibrary.h". + /// + /// Starting with POCO release 1.3, a class library can + /// export multiple manifests. In addition to the default + /// (unnamed) manifest, multiple named manifests can + /// be exported, each having a different base class. + /// + /// There is one important restriction: one instance of + /// ClassLoader can only load one manifest from a class + /// library. +{ +public: + typedef AbstractMetaObject Meta; + typedef Manifest Manif; + typedef void (*InitializeLibraryFunc)(); + typedef void (*UninitializeLibraryFunc)(); + typedef bool (*BuildManifestFunc)(ManifestBase*); + + struct LibraryInfo + { + SharedLibrary* pLibrary; + const Manif* pManifest; + int refCount; + }; + typedef std::map LibraryMap; + + class Iterator + /// The ClassLoader's very own iterator class. + { + public: + typedef std::pair Pair; + + Iterator(const typename LibraryMap::const_iterator& it) + { + _it = it; + } + Iterator(const Iterator& it) + { + _it = it._it; + } + ~Iterator() + { + } + Iterator& operator = (const Iterator& it) + { + _it = it._it; + return *this; + } + inline bool operator == (const Iterator& it) const + { + return _it == it._it; + } + inline bool operator != (const Iterator& it) const + { + return _it != it._it; + } + Iterator& operator ++ () // prefix + { + ++_it; + return *this; + } + Iterator operator ++ (int) // postfix + { + Iterator result(_it); + ++_it; + return result; + } + inline const Pair* operator * () const + { + _pair.first = _it->first; + _pair.second = _it->second.pManifest; + return &_pair; + } + inline const Pair* operator -> () const + { + _pair.first = _it->first; + _pair.second = _it->second.pManifest; + return &_pair; + } + + private: + typename LibraryMap::const_iterator _it; + mutable Pair _pair; + }; + + ClassLoader() + /// Creates the ClassLoader. + { + } + + virtual ~ClassLoader() + /// Destroys the ClassLoader. + { + for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it) + { + delete it->second.pLibrary; + delete it->second.pManifest; + } + } + + void loadLibrary(const std::string& path, const std::string& manifest) + /// Loads a library from the given path, using the given manifest. + /// Does nothing if the library is already loaded. + /// Throws a LibraryLoadException if the library + /// cannot be loaded or does not have a Manifest. + /// If the library exports a function named "pocoInitializeLibrary", + /// this function is executed. + /// If called multiple times for the same library, + /// the number of calls to unloadLibrary() must be the same + /// for the library to become unloaded. + { + FastMutex::ScopedLock lock(_mutex); + + typename LibraryMap::iterator it = _map.find(path); + if (it == _map.end()) + { + LibraryInfo li; + li.pLibrary = new SharedLibrary(path); + li.pManifest = new Manif(); + li.refCount = 1; + try + { + std::string pocoBuildManifestSymbol("pocoBuildManifest"); + pocoBuildManifestSymbol.append(manifest); + if (li.pLibrary->hasSymbol("pocoInitializeLibrary")) + { + InitializeLibraryFunc initializeLibrary = (InitializeLibraryFunc) li.pLibrary->getSymbol("pocoInitializeLibrary"); + initializeLibrary(); + } + if (li.pLibrary->hasSymbol(pocoBuildManifestSymbol)) + { + BuildManifestFunc buildManifest = (BuildManifestFunc) li.pLibrary->getSymbol(pocoBuildManifestSymbol); + if (buildManifest(const_cast(li.pManifest))) + _map[path] = li; + else + throw LibraryLoadException(std::string("Manifest class mismatch in ") + path, manifest); + } + else throw LibraryLoadException(std::string("No manifest in ") + path, manifest); + } + catch (...) + { + delete li.pLibrary; + delete li.pManifest; + throw; + } + } + else + { + ++it->second.refCount; + } + } + + void loadLibrary(const std::string& path) + /// Loads a library from the given path. Does nothing + /// if the library is already loaded. + /// Throws a LibraryLoadException if the library + /// cannot be loaded or does not have a Manifest. + /// If the library exports a function named "pocoInitializeLibrary", + /// this function is executed. + /// If called multiple times for the same library, + /// the number of calls to unloadLibrary() must be the same + /// for the library to become unloaded. + /// + /// Equivalent to loadLibrary(path, ""). + { + loadLibrary(path, ""); + } + + void unloadLibrary(const std::string& path) + /// Unloads the given library. + /// Be extremely cautious when unloading shared libraries. + /// If objects from the library are still referenced somewhere, + /// a total crash is very likely. + /// If the library exports a function named "pocoUninitializeLibrary", + /// this function is executed before it is unloaded. + /// If loadLibrary() has been called multiple times for the same + /// library, the number of calls to unloadLibrary() must be the same + /// for the library to become unloaded. + { + FastMutex::ScopedLock lock(_mutex); + + typename LibraryMap::iterator it = _map.find(path); + if (it != _map.end()) + { + if (--it->second.refCount == 0) + { + if (it->second.pLibrary->hasSymbol("pocoUninitializeLibrary")) + { + UninitializeLibraryFunc uninitializeLibrary = (UninitializeLibraryFunc) it->second.pLibrary->getSymbol("pocoUninitializeLibrary"); + uninitializeLibrary(); + } + delete it->second.pManifest; + it->second.pLibrary->unload(); + delete it->second.pLibrary; + _map.erase(it); + } + } + else throw NotFoundException(path); + } + + const Meta* findClass(const std::string& className) const + /// Returns a pointer to the MetaObject for the given + /// class, or a null pointer if the class is not known. + { + FastMutex::ScopedLock lock(_mutex); + + for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it) + { + const Manif* pManif = it->second.pManifest; + typename Manif::Iterator itm = pManif->find(className); + if (itm != pManif->end()) + return *itm; + } + return 0; + } + + const Meta& classFor(const std::string& className) const + /// Returns a reference to the MetaObject for the given + /// class. Throws a NotFoundException if the class + /// is not known. + { + const Meta* pMeta = findClass(className); + if (pMeta) + return *pMeta; + else + throw NotFoundException(className); + } + + Base* create(const std::string& className) const + /// Creates an instance of the given class. + /// Throws a NotFoundException if the class + /// is not known. + { + return classFor(className).create(); + } + + Base& instance(const std::string& className) const + /// Returns a reference to the sole instance of + /// the given class. The class must be a singleton, + /// otherwise an InvalidAccessException will be thrown. + /// Throws a NotFoundException if the class + /// is not known. + { + return classFor(className).instance(); + } + + bool canCreate(const std::string& className) const + /// Returns true if create() can create new instances + /// of the class. + { + return classFor(className).canCreate(); + } + + void destroy(const std::string& className, Base* pObject) const + /// Destroys the object pObject points to. + /// Does nothing if object is not found. + { + classFor(className).destroy(pObject); + } + + bool isAutoDelete(const std::string& className, Base* pObject) const + /// Returns true if the object is automatically + /// deleted by its meta object. + { + return classFor(className).isAutoDelete(pObject); + } + + const Manif* findManifest(const std::string& path) const + /// Returns a pointer to the Manifest for the given + /// library, or a null pointer if the library has not been loaded. + { + FastMutex::ScopedLock lock(_mutex); + + typename LibraryMap::const_iterator it = _map.find(path); + if (it != _map.end()) + return it->second.pManifest; + else + return 0; + } + + const Manif& manifestFor(const std::string& path) const + /// Returns a reference to the Manifest for the given library + /// Throws a NotFoundException if the library has not been loaded. + { + const Manif* pManif = findManifest(path); + if (pManif) + return *pManif; + else + throw NotFoundException(path); + } + + bool isLibraryLoaded(const std::string& path) const + /// Returns true if the library with the given name + /// has already been loaded. + { + return findManifest(path) != 0; + } + + Iterator begin() const + { + FastMutex::ScopedLock lock(_mutex); + + return Iterator(_map.begin()); + } + + Iterator end() const + { + FastMutex::ScopedLock lock(_mutex); + + return Iterator(_map.end()); + } + +private: + LibraryMap _map; + mutable FastMutex _mutex; +}; + + +} // namespace Poco + + +#endif // Foundation_ClassLoader_INCLUDED diff --git a/vendor/invn/external/include/Poco/Clock.h b/vendor/invn/external/include/Poco/Clock.h new file mode 100644 index 0000000..f9966e7 --- /dev/null +++ b/vendor/invn/external/include/Poco/Clock.h @@ -0,0 +1,240 @@ +// +// Clock.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Clock.h#2 $ +// +// Library: Foundation +// Package: DateTime +// Module: Clock +// +// Definition of the Clock class. +// +// Copyright (c) 2013, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Clock_INCLUDED +#define Foundation_Clock_INCLUDED + + +#include "Poco/Foundation.h" + + +namespace Poco { + + +class Foundation_API Clock + /// A Clock stores a monotonic* clock value + /// with (theoretical) microseconds resolution. + /// Clocks can be compared with each other + /// and simple arithmetics are supported. + /// + /// [*] Note that Clock values are only monotonic if + /// the operating system provides a monotonic clock. + /// The monotonic() function can be used to check whether + /// the system's clock is monotonic. + /// + /// Monotonic Clock is available on Windows, Linux, OS X + /// and on POSIX platforms supporting clock_gettime() with CLOCK_MONOTONIC. + /// + /// Clock values are relative to a system-dependent epoch time + /// (usually the system's startup time) and have no relation + /// to the time of day. +{ +public: + typedef Int64 ClockVal; + /// Monotonic clock value in microsecond resolution. + + typedef Int64 ClockDiff; + /// Difference between two ClockVal values in microseconds. + + static const ClockVal CLOCKVAL_MIN; /// Minimum clock value. + static const ClockVal CLOCKVAL_MAX; /// Maximum clock value. + + Clock(); + /// Creates a Clock with the current system clock value. + + Clock(ClockVal tv); + /// Creates a Clock from the given clock value. + + Clock(const Clock& other); + /// Copy constructor. + + ~Clock(); + /// Destroys the Clock. + + Clock& operator = (const Clock& other); + Clock& operator = (ClockVal tv); + + void swap(Clock& clock); + /// Swaps the Clock with another one. + + void update(); + /// Updates the Clock with the current system clock. + + bool operator == (const Clock& ts) const; + bool operator != (const Clock& ts) const; + bool operator > (const Clock& ts) const; + bool operator >= (const Clock& ts) const; + bool operator < (const Clock& ts) const; + bool operator <= (const Clock& ts) const; + + Clock operator + (ClockDiff d) const; + Clock operator - (ClockDiff d) const; + ClockDiff operator - (const Clock& ts) const; + Clock& operator += (ClockDiff d); + Clock& operator -= (ClockDiff d); + + ClockVal microseconds() const; + /// Returns the clock value expressed in microseconds + /// since the system-specific epoch time (usually system + /// startup). + + ClockVal raw() const; + /// Returns the clock value expressed in microseconds + /// since the system-specific epoch time (usually system + /// startup). + /// + /// Same as microseconds(). + + ClockDiff elapsed() const; + /// Returns the time elapsed since the time denoted by + /// the Clock instance. Equivalent to Clock() - *this. + + bool isElapsed(ClockDiff interval) const; + /// Returns true iff the given interval has passed + /// since the time denoted by the Clock instance. + + static ClockDiff resolution(); + /// Returns the resolution in units per second. + /// Since the Clock clas has microsecond resolution, + /// the returned value is always 1000000. + + static ClockDiff accuracy(); + /// Returns the system's clock accuracy in microseconds. + + static bool monotonic(); + /// Returns true iff the system's clock is monotonic. + +private: + ClockVal _clock; +}; + + +// +// inlines +// +inline bool Clock::operator == (const Clock& ts) const +{ + return _clock == ts._clock; +} + + +inline bool Clock::operator != (const Clock& ts) const +{ + return _clock != ts._clock; +} + + +inline bool Clock::operator > (const Clock& ts) const +{ + return _clock > ts._clock; +} + + +inline bool Clock::operator >= (const Clock& ts) const +{ + return _clock >= ts._clock; +} + + +inline bool Clock::operator < (const Clock& ts) const +{ + return _clock < ts._clock; +} + + +inline bool Clock::operator <= (const Clock& ts) const +{ + return _clock <= ts._clock; +} + + +inline Clock Clock::operator + (Clock::ClockDiff d) const +{ + return Clock(_clock + d); +} + + +inline Clock Clock::operator - (Clock::ClockDiff d) const +{ + return Clock(_clock - d); +} + + +inline Clock::ClockDiff Clock::operator - (const Clock& ts) const +{ + return _clock - ts._clock; +} + + +inline Clock& Clock::operator += (Clock::ClockDiff d) +{ + _clock += d; + return *this; +} + + +inline Clock& Clock::operator -= (Clock::ClockDiff d) +{ + _clock -= d; + return *this; +} + + +inline Clock::ClockVal Clock::microseconds() const +{ + return _clock; +} + + +inline Clock::ClockDiff Clock::elapsed() const +{ + Clock now; + return now - *this; +} + + +inline bool Clock::isElapsed(Clock::ClockDiff interval) const +{ + Clock now; + Clock::ClockDiff diff = now - *this; + return diff >= interval; +} + + +inline Clock::ClockDiff Clock::resolution() +{ + return 1000000; +} + + +inline void swap(Clock& s1, Clock& s2) +{ + s1.swap(s2); +} + + +inline Clock::ClockVal Clock::raw() const +{ + return _clock; +} + + +} // namespace Poco + + +#endif // Foundation_Clock_INCLUDED diff --git a/vendor/invn/external/include/Poco/Condition.h b/vendor/invn/external/include/Poco/Condition.h new file mode 100644 index 0000000..2ae26e4 --- /dev/null +++ b/vendor/invn/external/include/Poco/Condition.h @@ -0,0 +1,139 @@ +// +// Condition.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Condition.h#1 $ +// +// Library: Foundation +// Package: Threading +// Module: Condition +// +// Definition of the Condition class template. +// +// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Condition_INCLUDED +#define Foundation_Condition_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Mutex.h" +#include "Poco/ScopedUnlock.h" +#include "Poco/Event.h" +#include "Poco/Exception.h" +#include + + +namespace Poco { + + +class Foundation_API Condition + /// A Condition is a synchronization object used to block a thread + /// until a particular condition is met. + /// A Condition object is always used in conjunction with + /// a Mutex (or FastMutex) object. + /// + /// Condition objects are similar to POSIX condition variables, which the + /// difference that Condition is not subject to spurious wakeups. + /// + /// Threads waiting on a Condition are resumed in FIFO order. +{ +public: + Condition(); + /// Creates the Condition. + + ~Condition(); + /// Destroys the Condition. + + template + void wait(Mtx& mutex) + /// Unlocks the mutex (which must be locked upon calling + /// wait()) and waits until the Condition is signalled. + /// + /// The given mutex will be locked again upon + /// leaving the function, even in case of an exception. + { + ScopedUnlock unlock(mutex, false); + Event event; + { + FastMutex::ScopedLock lock(_mutex); + mutex.unlock(); + enqueue(event); + } + event.wait(); + } + + template + void wait(Mtx& mutex, long milliseconds) + /// Unlocks the mutex (which must be locked upon calling + /// wait()) and waits for the given time until the Condition is signalled. + /// + /// The given mutex will be locked again upon successfully leaving the + /// function, even in case of an exception. + /// + /// Throws a TimeoutException if the Condition is not signalled + /// within the given time interval. + { + if (!tryWait(mutex, milliseconds)) + throw TimeoutException(); + } + + template + bool tryWait(Mtx& mutex, long milliseconds) + /// Unlocks the mutex (which must be locked upon calling + /// tryWait()) and waits for the given time until the Condition is signalled. + /// + /// The given mutex will be locked again upon leaving the + /// function, even in case of an exception. + /// + /// Returns true if the Condition has been signalled + /// within the given time interval, otherwise false. + { + ScopedUnlock unlock(mutex, false); + Event event; + { + FastMutex::ScopedLock lock(_mutex); + mutex.unlock(); + enqueue(event); + } + if (!event.tryWait(milliseconds)) + { + FastMutex::ScopedLock lock(_mutex); + dequeue(event); + return false; + } + return true; + } + + void signal(); + /// Signals the Condition and allows one waiting thread + /// to continue execution. + + void broadcast(); + /// Signals the Condition and allows all waiting + /// threads to continue their execution. + +protected: + void enqueue(Event& event); + void dequeue(); + void dequeue(Event& event); + +private: + Condition(const Condition&); + Condition& operator = (const Condition&); + + typedef std::deque WaitQueue; + + FastMutex _mutex; + WaitQueue _waitQueue; +}; + + +} // namespace Poco + + +#endif // Foundation_Condition_INCLUDED diff --git a/vendor/invn/external/include/Poco/Config.h b/vendor/invn/external/include/Poco/Config.h new file mode 100644 index 0000000..01b8779 --- /dev/null +++ b/vendor/invn/external/include/Poco/Config.h @@ -0,0 +1,171 @@ +// +// Config.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Config.h#3 $ +// +// Library: Foundation +// Package: Core +// Module: Foundation +// +// Feature configuration for the POCO libraries. +// +// Copyright (c) 2006-2010, 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 +/* #undef 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). +// +/* #undef POCO_NO_AUTOMATIC_LIB_INIT */ + + +// Define to disable FPEnvironment support +/* #undef POCO_NO_FPENVIRONMENT */ + + +// Define if std::wstring is not available +/* #undef POCO_NO_WSTRING */ + + +// Define to disable shared memory +/* #undef POCO_NO_SHAREDMEMORY */ + + +// Define if no header is available (such as on WinCE) +/* #undef 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()). +/* #undef POCO_THREAD_PRIORITY_MIN */ + + +// Define to override system-provided +// maximum thread priority value on POSIX +// platforms (returned by Poco::Thread::getMaxOSPriority()). +/* #undef POCO_THREAD_PRIORITY_MAX */ + + +// 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. !!! +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// +#define POCO_NO_SOO + + +// 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. +/* #undef 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. +/* #undef POCO_NO_FILECHANNEL */ + + +// No automatic registration of SplitterChannel in +// LoggingFactory - avoids SplitterChannel being +// linked to executable. +/* #undef POCO_NO_SPLITTERCHANNEL */ + + +// No automatic registration of SyslogChannel in +// LoggingFactory - avoids SyslogChannel being +// linked to executable on Unix/Linux systems. +/* #undef POCO_NO_SYSLOGCHANNEL */ + + +// Define to enable MSVC secure warnings +/* #undef POCO_MSVC_SECURE_WARNINGS */ + + +// No support for INI file configurations in +// Poco::Util::Application. +/* #undef POCO_UTIL_NO_INIFILECONFIGURATION */ + + +// No support for JSON configuration in +// Poco::Util::Application. Avoids linking of JSON +// library and saves a few 100 Kbytes. +/* #undef POCO_UTIL_NO_JSONCONFIGURATION */ + + +// No support for XML configuration in +// Poco::Util::Application. Avoids linking of XML +// library and saves a few 100 Kbytes. +/* #undef POCO_UTIL_NO_XMLCONFIGURATION */ + + +// No IPv6 support +// Define to disable IPv6 +/* #undef 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. +/* #undef POCO_LOG_DEBUG */ + +#endif // Foundation_Config_INCLUDED diff --git a/vendor/invn/external/include/Poco/Configurable.h b/vendor/invn/external/include/Poco/Configurable.h new file mode 100644 index 0000000..82def97 --- /dev/null +++ b/vendor/invn/external/include/Poco/Configurable.h @@ -0,0 +1,72 @@ +// +// Configurable.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Configurable.h#1 $ +// +// Library: Foundation +// Package: Logging +// Module: Configurable +// +// Definition of the Configurable class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Configurable_INCLUDED +#define Foundation_Configurable_INCLUDED + + +#include "Poco/Foundation.h" + + +namespace Poco { + + +class Foundation_API Configurable + /// A simple interface that defines + /// getProperty() and setProperty() methods. + /// + /// This interface is implemented by Formatter and + /// Channel and is used to configure arbitrary + /// channels and formatters. + /// + /// A property is basically a name-value pair. For + /// simplicity, both names and values are strings. + /// Every property controls a certain aspect of a + /// Formatter or Channel. For example, the PatternFormatter's + /// formatting pattern is set via a property. + /// + /// NOTE: The following property names are use internally + /// by the logging framework and must not be used by + /// channels or formatters: + /// - class + /// - pattern (Channel) + /// - formatter (Channel) +{ +public: + Configurable(); + /// Creates the Configurable. + + virtual ~Configurable(); + /// Destroys the Configurable. + + virtual void setProperty(const std::string& name, const std::string& value) = 0; + /// Sets the property with the given name to the given value. + /// If a property with the given name is not supported, a + /// PropertyNotSupportedException is thrown. + + virtual std::string getProperty(const std::string& name) const = 0; + /// Returns the value of the property with the given name. + /// If a property with the given name is not supported, a + /// PropertyNotSupportedException is thrown. +}; + + +} // namespace Poco + + +#endif // Foundation_Configurable_INCLUDED diff --git a/vendor/invn/external/include/Poco/ConsoleChannel.h b/vendor/invn/external/include/Poco/ConsoleChannel.h new file mode 100644 index 0000000..21b2d0d --- /dev/null +++ b/vendor/invn/external/include/Poco/ConsoleChannel.h @@ -0,0 +1,189 @@ +// +// ConsoleChannel.h +// +// $Id: //poco/1.4/Foundation/include/Poco/ConsoleChannel.h#2 $ +// +// Library: Foundation +// Package: Logging +// Module: ConsoleChannel +// +// Definition of the ConsoleChannel class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_ConsoleChannel_INCLUDED +#define Foundation_ConsoleChannel_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Channel.h" +#include "Poco/Mutex.h" +#include + + +namespace Poco { + + +class Foundation_API ConsoleChannel: public Channel + /// A channel that writes to an ostream. + /// + /// Only the message's text is written, followed + /// by a newline. + /// + /// Chain this channel to a FormattingChannel with an + /// appropriate Formatter to control what is contained + /// in the text. + /// + /// Similar to StreamChannel, except that a static + /// mutex is used to protect against multiple + /// console channels concurrently writing to the + /// same stream. +{ +public: + ConsoleChannel(); + /// Creates the channel and attaches std::clog. + + ConsoleChannel(std::ostream& str); + /// Creates the channel using the given stream. + + void log(const Message& msg); + /// Logs the given message to the channel's stream. + +protected: + ~ConsoleChannel(); + +private: + std::ostream& _str; + static FastMutex _mutex; +}; + + +class Foundation_API ColorConsoleChannel: public Channel + /// A channel that writes to an ostream. + /// + /// Only the message's text is written, followed + /// by a newline. + /// + /// Messages can be colored depending on priority. + /// The console device must support ANSI escape codes + /// in order to display colored messages. + /// + /// To enable message coloring, set the "enableColors" + /// property to true (default). Furthermore, colors can be + /// configured by setting the following properties + /// (default values are given in parenthesis): + /// + /// * traceColor (gray) + /// * debugColor (gray) + /// * informationColor (default) + /// * noticeColor (default) + /// * warningColor (yellow) + /// * errorColor (lightRed) + /// * criticalColor (lightRed) + /// * fatalColor (lightRed) + /// + /// The following color values are supported: + /// + /// * default + /// * black + /// * red + /// * green + /// * brown + /// * blue + /// * magenta + /// * cyan + /// * gray + /// * darkgray + /// * lightRed + /// * lightGreen + /// * yellow + /// * lightBlue + /// * lightMagenta + /// * lightCyan + /// * white + /// + /// Chain this channel to a FormattingChannel with an + /// appropriate Formatter to control what is contained + /// in the text. + /// + /// Similar to StreamChannel, except that a static + /// mutex is used to protect against multiple + /// console channels concurrently writing to the + /// same stream. +{ +public: + ColorConsoleChannel(); + /// Creates the channel and attaches std::clog. + + ColorConsoleChannel(std::ostream& str); + /// Creates the channel using the given stream. + + void log(const Message& msg); + /// Logs the given message to the channel's stream. + + void setProperty(const std::string& name, const std::string& value); + /// Sets the property with the given name. + /// + /// The following properties are supported: + /// * enableColors: Enable or disable colors. + /// * traceColor: Specify color for trace messages. + /// * debugColor: Specify color for debug messages. + /// * informationColor: Specify color for information messages. + /// * noticeColor: Specify color for notice messages. + /// * warningColor: Specify color for warning messages. + /// * errorColor: Specify color for error messages. + /// * criticalColor: Specify color for critical messages. + /// * fatalColor: Specify color for fatal messages. + /// + /// See the class documentation for a list of supported color values. + + std::string getProperty(const std::string& name) const; + /// Returns the value of the property with the given name. + /// See setProperty() for a description of the supported + /// properties. + +protected: + enum Color + { + CC_DEFAULT = 0x0027, + CC_BLACK = 0x001e, + CC_RED = 0x001f, + CC_GREEN = 0x0020, + CC_BROWN = 0x0021, + CC_BLUE = 0x0022, + CC_MAGENTA = 0x0023, + CC_CYAN = 0x0024, + CC_GRAY = 0x0025, + CC_DARKGRAY = 0x011e, + CC_LIGHTRED = 0x011f, + CC_LIGHTGREEN = 0x0120, + CC_YELLOW = 0x0121, + CC_LIGHTBLUE = 0x0122, + CC_LIGHTMAGENTA = 0x0123, + CC_LIGHTCYAN = 0x0124, + CC_WHITE = 0x0125 + }; + + ~ColorConsoleChannel(); + Color parseColor(const std::string& color) const; + std::string formatColor(Color color) const; + void initColors(); + +private: + std::ostream& _str; + bool _enableColors; + Color _colors[9]; + static FastMutex _mutex; + static const std::string CSI; +}; + + +} // namespace Poco + + +#endif // Foundation_ConsoleChannel_INCLUDED diff --git a/vendor/invn/external/include/Poco/CountingStream.h b/vendor/invn/external/include/Poco/CountingStream.h new file mode 100644 index 0000000..7ddc26c --- /dev/null +++ b/vendor/invn/external/include/Poco/CountingStream.h @@ -0,0 +1,239 @@ +// +// CountingStream.h +// +// $Id: //poco/1.4/Foundation/include/Poco/CountingStream.h#1 $ +// +// Library: Foundation +// Package: Streams +// Module: CountingStream +// +// Definition of the CountingStreamBuf, CountingInputStream and CountingOutputStream classes. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_CountingStream_INCLUDED +#define Foundation_CountingStream_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/UnbufferedStreamBuf.h" +#include +#include + + +namespace Poco { + + +class Foundation_API CountingStreamBuf: public UnbufferedStreamBuf + /// This stream buffer counts all characters and lines + /// going through it. +{ +public: + CountingStreamBuf(); + /// Creates an unconnected CountingStreamBuf. + + CountingStreamBuf(std::istream& istr); + /// Creates the CountingStreamBuf and connects it + /// to the given input stream. + + CountingStreamBuf(std::ostream& ostr); + /// Creates the CountingStreamBuf and connects it + /// to the given output stream. + + ~CountingStreamBuf(); + /// Destroys the CountingStream. + + int chars() const; + /// Returns the total number of characters. + + int lines() const; + /// Returns the total number of lines. + + int pos() const; + /// Returns the number of characters on the current line. + + void reset(); + /// Resets all counters. + + void setCurrentLineNumber(int line); + /// Sets the current line number. + /// + /// This is mainly useful when parsing C/C++ + /// preprocessed source code containing #line directives. + + int getCurrentLineNumber() const; + /// Returns the current line number (same as lines()). + + void addChars(int chars); + /// Add to the total number of characters. + + void addLines(int lines); + /// Add to the total number of lines. + + void addPos(int pos); + /// Add to the number of characters on the current line. + +protected: + int readFromDevice(); + int writeToDevice(char c); + +private: + std::istream* _pIstr; + std::ostream* _pOstr; + int _chars; + int _lines; + int _pos; +}; + + +class Foundation_API CountingIOS: public virtual std::ios + /// The base class for CountingInputStream and CountingOutputStream. + /// + /// This class is needed to ensure the correct initialization + /// order of the stream buffer and base classes. +{ +public: + CountingIOS(); + /// Creates the basic stream and leaves it unconnected. + + CountingIOS(std::istream& istr); + /// Creates the basic stream and connects it + /// to the given input stream. + + CountingIOS(std::ostream& ostr); + /// Creates the basic stream and connects it + /// to the given output stream. + + ~CountingIOS(); + /// Destroys the stream. + + int chars() const; + /// Returns the total number of characters. + + int lines() const; + /// Returns the total number of lines. + + int pos() const; + /// Returns the number of characters on the current line. + + void reset(); + /// Resets all counters. + + void setCurrentLineNumber(int line); + /// Sets the current line number. + /// + /// This is mainly useful when parsing C/C++ + /// preprocessed source code containing #line directives. + + int getCurrentLineNumber() const; + /// Returns the current line number (same as lines()). + + void addChars(int chars); + /// Add to the total number of characters. + + void addLines(int lines); + /// Add to the total number of lines. + + void addPos(int pos); + /// Add to the number of characters on the current line. + + CountingStreamBuf* rdbuf(); + /// Returns a pointer to the underlying streambuf. + +protected: + CountingStreamBuf _buf; +}; + + +class Foundation_API CountingInputStream: public CountingIOS, public std::istream + /// This stream counts all characters and lines + /// going through it. This is useful for lexers and parsers + /// that need to determine the current position in the stream. +{ +public: + CountingInputStream(std::istream& istr); + /// Creates the CountingInputStream and connects it + /// to the given input stream. + + ~CountingInputStream(); + /// Destroys the stream. +}; + + +class Foundation_API CountingOutputStream: public CountingIOS, public std::ostream + /// This stream counts all characters and lines + /// going through it. +{ +public: + CountingOutputStream(); + /// Creates an unconnected CountingOutputStream. + + CountingOutputStream(std::ostream& ostr); + /// Creates the CountingOutputStream and connects it + /// to the given output stream. + + ~CountingOutputStream(); + /// Destroys the CountingOutputStream. +}; + + +// +// inlines +// +inline int CountingStreamBuf::chars() const +{ + return _chars; +} + + +inline int CountingStreamBuf::lines() const +{ + return _lines; +} + + +inline int CountingStreamBuf::pos() const +{ + return _pos; +} + + +inline int CountingStreamBuf::getCurrentLineNumber() const +{ + return _lines; +} + + +inline int CountingIOS::chars() const +{ + return _buf.chars(); +} + + +inline int CountingIOS::lines() const +{ + return _buf.lines(); +} + + +inline int CountingIOS::pos() const +{ + return _buf.pos(); +} + + +inline int CountingIOS::getCurrentLineNumber() const +{ + return _buf.getCurrentLineNumber(); +} + + +} // namespace Poco + + +#endif // Foundation_CountingStream_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Attributes.h b/vendor/invn/external/include/Poco/CppParser/Attributes.h new file mode 100644 index 0000000..83d77f2 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Attributes.h @@ -0,0 +1,125 @@ +// +// Attributes.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Attributes.h#2 $ +// +// Library: CppParser +// Package: Attributes +// Module: Attributes +// +// Definition of the Attributes class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Attributes_INCLUDED +#define CppParser_Attributes_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include + + +namespace Poco { +namespace CppParser { + + +class CppParser_API Attributes + /// This class stores attributes for a symbol table entry. + /// Attributes are simple name-value pairs, where both + /// name and values are strings. +{ +public: + typedef std::map AttrMap; + typedef AttrMap::const_iterator Iterator; + + Attributes(); + /// Creates the Attributes object. + + Attributes(const Attributes& attrs); + /// Creates the Attributes object by copying another one. + + ~Attributes(); + /// Destroys the Attributes object. + + Attributes& operator = (const Attributes& attrs); + /// Assignment operator. + + bool has(const std::string& name) const; + /// Returns true if an attribute with the given name exists. + + std::string getString(const std::string& name) const; + /// Returns the attribute's value as a string. + /// + /// Throws a Poco::NotFoundException if the attribute does not exist. + + std::string getString(const std::string& name, const std::string& defaultValue) const; + /// Returns the attribute's value as a string, if it exists. + /// Returns the defaultValue if the attribute does not exist. + + int getInt(const std::string& name) const; + /// Returns the attribute's value as an integer. + /// + /// Throws a Poco::NotFoundException if the attribute does not exist. + /// Throws a Poco::SyntaxException if the stored value is not an integer. + + int getInt(const std::string& name, int defaultValue) const; + /// Returns the attribute's value as an integer, if it exists. + /// Returns the defaultValue if the attribute does not exist. + /// + /// Throws a Poco::SyntaxException if the stored value is not an integer. + + bool getBool(const std::string& name) const; + /// Returns the attribute's value as a boolean. + /// The returned value is 'true', iff the stored value is not "false". + /// + /// Throws a Poco::NotFoundException if the attribute does not exist. + + bool getBool(const std::string& name, bool defaultValue) const; + /// Returns the attribute's value as a boolean, if it exists. + /// The returned value is 'true', iff the stored value is not "false". + + void set(const std::string& name, const std::string& value); + /// Sets the value of an attribute. + + void remove(const std::string& name); + /// Removes the attribute with the given name. + /// Does nothing if the attribute does not exist. + + const std::string& operator [] (const std::string& name) const; + std::string& operator [] (const std::string& name); + + Iterator begin() const; + Iterator end() const; + + void clear(); + /// Clears all attributes. + +private: + AttrMap _map; +}; + + +// +// inlines +// +inline Attributes::Iterator Attributes::begin() const +{ + return _map.begin(); +} + + +inline Attributes::Iterator Attributes::end() const +{ + return _map.end(); +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Attributes_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/AttributesParser.h b/vendor/invn/external/include/Poco/CppParser/AttributesParser.h new file mode 100644 index 0000000..3ae5f9d --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/AttributesParser.h @@ -0,0 +1,116 @@ +// +// AttributesParser.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/AttributesParser.h#2 $ +// +// Library: CppParser +// Package: Attributes +// Module: AttributesParser +// +// Definition of the AttributesParser class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_AttributesParser_INCLUDED +#define CppParser_AttributesParser_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Tokenizer.h" +#include "Poco/CppParser/Attributes.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API AttributesParser + /// A parser for POCO-style C++ attributes. + /// + /// Using a special comment syntax, C++ declarations for + /// structs/classes, functions, types, etc. can be annotated + /// with attributes. + /// + /// Attributes always come immediately before the symbol that + /// is being annotated, and are written inside special comments + /// with the syntax: + /// //@ [,...] + /// where is + /// [=] + /// is a valid C++ identifier, or two identifiers separated by + /// a period (struct accessor notation). + /// is a string, integer, identifier, bool literal, or a complex value + /// in the form + /// {=[,=...]} +{ +public: + AttributesParser(Attributes& attrs, std::istream& istr); + /// Creates the AttributesParser. + + ~AttributesParser(); + /// Destroys the AttributesParser. + + void parse(); + /// Parses attributes. + +protected: + void setAttribute(const std::string& name, const std::string& value); + const Poco::Token* parseAttributes(const Poco::Token* pNext); + const Poco::Token* parseAttribute(const Poco::Token* pNext); + const Poco::Token* parseComplexAttribute(const Token* pNext, const std::string& id); + const Poco::Token* parseIdentifier(const Poco::Token* pNext, std::string& id); + const Poco::Token* next(); + static bool isIdentifier(const Poco::Token* pToken); + static bool isOperator(const Poco::Token* pToken, int kind); + static bool isLiteral(const Poco::Token* pToken); + static bool isEOF(const Poco::Token* pToken); + +private: + Attributes& _attrs; + Tokenizer _tokenizer; + std::string _id; +}; + + +// +// inlines +// +inline const Poco::Token* AttributesParser::next() +{ + return _tokenizer.next(); +} + + +inline bool AttributesParser::isEOF(const Poco::Token* pToken) +{ + return pToken->is(Token::EOF_TOKEN); +} + + +inline bool AttributesParser::isIdentifier(const Poco::Token* pToken) +{ + return pToken->is(Poco::Token::IDENTIFIER_TOKEN) || pToken->is(Poco::Token::KEYWORD_TOKEN); +} + + +inline bool AttributesParser::isOperator(const Poco::Token* pToken, int kind) +{ + return pToken->is(Poco::Token::OPERATOR_TOKEN) && pToken->asInteger() == kind; +} + + +inline bool AttributesParser::isLiteral(const Poco::Token* pToken) +{ + return pToken->is(Poco::Token::STRING_LITERAL_TOKEN) || pToken->is(Poco::Token::INTEGER_LITERAL_TOKEN); +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_AttributesParser_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/BuiltIn.h b/vendor/invn/external/include/Poco/CppParser/BuiltIn.h new file mode 100644 index 0000000..c360f6a --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/BuiltIn.h @@ -0,0 +1,49 @@ +// +// BuiltIn.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/BuiltIn.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: BuiltIn +// +// Definition of the BuiltIn class. +// +// Copyright (c) 2011, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_BuiltIn_INCLUDED +#define CppParser_BuiltIn_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Symbol.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API BuiltIn: public Symbol + /// A placeholder for a built-in type. +{ +public: + BuiltIn(const std::string& name, NameSpace* pNameSpace); + /// Creates the BuiltIn. + + ~BuiltIn(); + /// Destroys the BuiltIn. + + Symbol::Kind kind() const; + std::string toString() const; +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_BuiltIn_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/CppParser.h b/vendor/invn/external/include/Poco/CppParser/CppParser.h new file mode 100644 index 0000000..4e60b8d --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/CppParser.h @@ -0,0 +1,60 @@ +// +// CppParser.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/CppParser.h#2 $ +// +// Library: CppParser +// Package: CppParser +// Module: CppParser +// +// Basic definitions for the Poco CppParser library. +// This file must be the first file included by every other CppParser +// header file. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_CppParser_INCLUDED +#define CppParser_CppParser_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 CppParser_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 +// CppParser_API functions as being imported from a DLL, wheras this DLL sees symbols +// defined with this macro as being exported. +// +#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(POCO_DLL) + #if defined(CppParser_EXPORTS) + #define CppParser_API __declspec(dllexport) + #else + #define CppParser_API __declspec(dllimport) + #endif +#endif + + +#if !defined(CppParser_API) + #define CppParser_API +#endif + + +// +// Automatically link CppParser library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(CppParser_EXPORTS) + #pragma comment(lib, "PocoCppParser" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // CppParser_CppParser_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/CppToken.h b/vendor/invn/external/include/Poco/CppParser/CppToken.h new file mode 100644 index 0000000..659cd63 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/CppToken.h @@ -0,0 +1,283 @@ +// +// CppToken.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/CppToken.h#2 $ +// +// Library: CppParser +// Package: CppParser +// Module: CppToken +// +// Definition of the CppToken class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_CppToken_INCLUDED +#define CppParser_CppToken_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/Token.h" +#include + + +namespace Poco { +namespace CppParser { + + +class CppParser_API CppToken: public Poco::Token + /// The base class for all C++ tokens. +{ +public: + CppToken(); + ~CppToken(); + +protected: + void syntaxError(const std::string& expected, const std::string& actual); +}; + + +class CppParser_API OperatorToken: public CppToken +{ +public: + enum Tokens + { + OP_OPENBRACKET = 1, // [ + OP_CLOSBRACKET, // ] + OP_OPENPARENT, // ( + OP_CLOSPARENT, // ) + OP_OPENBRACE, // { + OP_CLOSBRACE, // } + OP_LT, // < + OP_LE, // <= + OP_SHL, // << + OP_SHL_ASSIGN, // <<= + OP_GT, // > + OP_GE, // >= + OP_SHR, // >> + OP_SHR_ASSIGN, // >>= + OP_ASSIGN, // = + OP_EQ, // == + OP_NOT, // ! + OP_NE, // != + OP_BITAND, // & + OP_BITAND_ASSIGN, // &= + OP_AND, // && + OP_BITOR, // | + OP_BITOR_ASSIGN, // |= + OP_OR, // || + OP_XOR, // ^ + OP_XOR_ASSIGN, // ^= + OP_COMPL, // ~ + OP_ASTERISK, // * + OP_ASTERISK_ASSIGN, // *= + OP_SLASH, // / + OP_SLASH_ASSIGN, // /= + OP_PLUS, // + + OP_PLUS_ASSIGN, // += + OP_INCR, // ++ + OP_MINUS, // - + OP_MINUS_ASSIGN, // -= + OP_DECR, // -- + OP_ARROW, // -> + OP_MOD, // % + OP_MOD_ASSIGN, // %= + OP_COMMA, // , + OP_PERIOD, // . + OP_TRIPLE_PERIOD, // ... + OP_COLON, // : + OP_DBL_COLON, // :: + OP_SEMICOLON, // ; + OP_QUESTION // ? + }; + + OperatorToken(); + ~OperatorToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + int asInteger() const; + +private: + typedef std::map OpMap; + + OpMap _opMap; +}; + + +class CppParser_API IdentifierToken: public CppToken +{ +public: + enum Keywords + { + KW_ALIGNAS = 1, + KW_ALIGNOF, + KW_AND, + KW_AND_EQ, + KW_ASM, + KW_AUTO, + KW_BITAND, + KW_BITOR, + KW_BOOL, + KW_BREAK, + KW_CASE, + KW_CATCH, + KW_CHAR, + KW_CHAR_16T, + KW_CHAR_32T, + KW_CLASS, + KW_COMPL, + KW_CONST, + KW_CONSTEXPR, + KW_CONST_CAST, + KW_CONTINUE, + KW_DECLTYPE, + KW_DEFAULT, + KW_DELETE, + KW_DO, + KW_DOUBLE, + KW_DYNAMIC_CAST, + KW_ELSE, + KW_ENUM, + KW_EXPLICIT, + KW_EXPORT, + KW_EXTERN, + KW_FALSE, + KW_FLOAT, + KW_FOR, + KW_FRIEND, + KW_GOTO, + KW_IF, + KW_INLINE, + KW_INT, + KW_LONG, + KW_MUTABLE, + KW_NAMESPACE, + KW_NEW, + KW_NOEXCEPT, + KW_NOT, + KW_NOT_EQ, + KW_NULLPTR, + KW_OPERATOR, + KW_OR, + KW_OR_EQ, + KW_PRIVATE, + KW_PROTECTED, + KW_PUBLIC, + KW_REGISTER, + KW_REINTERPRET_CAST, + KW_RETURN, + KW_SHORT, + KW_SIGNED, + KW_SIZEOF, + KW_STATIC, + KW_STATIC_ASSERT, + KW_STATIC_CAST, + KW_STRUCT, + KW_SWITCH, + KW_TEMPLATE, + KW_THIS, + KW_THREAD_LOCAL, + KW_THROW, + KW_TRUE, + KW_TRY, + KW_TYPEDEF, + KW_TYPEID, + KW_TYPENAME, + KW_UNION, + KW_UNSIGNED, + KW_USING, + KW_VIRTUAL, + KW_VOID, + KW_VOLATILE, + KW_WCHAR_T, + KW_WHILE, + KW_XOR, + KW_XOR_EQ + }; + + IdentifierToken(); + ~IdentifierToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + int asInteger() const; + +private: + typedef std::map KWMap; + + KWMap _kwMap; +}; + + +class CppParser_API StringLiteralToken: public CppToken +{ +public: + StringLiteralToken(); + ~StringLiteralToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + std::string asString() const; +}; + + +class CppParser_API CharLiteralToken: public CppToken +{ +public: + CharLiteralToken(); + ~CharLiteralToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + char asChar() const; +}; + + +class CppParser_API NumberLiteralToken: public CppToken +{ +public: + NumberLiteralToken(); + ~NumberLiteralToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + int asInteger() const; + double asFloat() const; + +private: + bool _isFloat; +}; + + +class CppParser_API CommentToken: public CppToken +{ +public: + CommentToken(); + ~CommentToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); + std::string asString() const; +}; + + +class CppParser_API PreprocessorToken: public CppToken +{ +public: + PreprocessorToken(); + ~PreprocessorToken(); + Poco::Token::Class tokenClass() const; + bool start(char c, std::istream& istr); + void finish(std::istream& istr); +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_CppToken_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Decl.h b/vendor/invn/external/include/Poco/CppParser/Decl.h new file mode 100644 index 0000000..f24ed93 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Decl.h @@ -0,0 +1,64 @@ +// +// Decl.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Decl.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Decl +// +// Definition of the Decl class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Decl_INCLUDED +#define CppParser_Decl_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Symbol.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API Decl: public Symbol + /// This class represents a simple declaration in a C++ source file. + /// It is a base class for Function, TypeDef or Variable. +{ +public: + Decl(const std::string& decl, NameSpace* pNameSpace); + /// Creates the Decl. + + ~Decl(); + /// Destroys the Decl. + + const std::string& declaration() const; + /// Returns the declaration. + + std::string toString() const; + +protected: + std::string _decl; +}; + + +// +// inlines +// +inline const std::string& Decl::declaration() const +{ + return _decl; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Decl_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Enum.h b/vendor/invn/external/include/Poco/CppParser/Enum.h new file mode 100644 index 0000000..a78a42b --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Enum.h @@ -0,0 +1,79 @@ +// +// Enum.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Enum.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Enum +// +// Definition of the Enum class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Enum_INCLUDED +#define CppParser_Enum_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Symbol.h" +#include + + +namespace Poco { +namespace CppParser { + + +class EnumValue; + + +class CppParser_API Enum: public Symbol + /// This class represents an enum declaration. + /// + /// An enumeration has an optional name and + /// a collection of EnumValues. +{ +public: + typedef std::vector Values; + typedef Values::const_iterator Iterator; + + Enum(const std::string& name, NameSpace* pNameSpace); + /// Creates the Enum. + /// + /// If name is the empty string, an internal name + /// in the form #AnonEnum (where is a unique integer) + /// will be assigned. + + ~Enum(); + /// Destroys the Enum. + + void addValue(EnumValue* pValue); + /// Adds an enum value. The Enum takes ownership of the value. + + Iterator begin() const; + /// Returns an iterator for iterating over the Enum's EnumValue's. + + Iterator end() const; + /// Returns an iterator for iterating over the Enum's EnumValue's. + + Symbol::Kind kind() const; + std::string toString() const; + +protected: + static std::string processName(const std::string& name); + +private: + Values _values; + static int _count; +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Enum_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/EnumValue.h b/vendor/invn/external/include/Poco/CppParser/EnumValue.h new file mode 100644 index 0000000..d5c4af7 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/EnumValue.h @@ -0,0 +1,68 @@ +// +// EnumValue.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/EnumValue.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: EnumValue +// +// Definition of the EnumValue class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_EnumValue_INCLUDED +#define CppParser_EnumValue_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Symbol.h" + + +namespace Poco { +namespace CppParser { + + +class Enum; + + +class CppParser_API EnumValue: public Symbol + /// This class represents an enumeration value + /// inside an enum declaration. +{ +public: + EnumValue(const std::string& name, const std::string& value, Enum* pEnum); + /// Creates the EnumValue, using the name and a value, which may be empty. + + virtual ~EnumValue(); + /// Destroys the EnumValue. + + const std::string& value() const; + /// Returns the value, which may be empty. + + Symbol::Kind kind() const; + std::string toString() const; + +private: + std::string _value; +}; + + +// +// inlines +// +inline const std::string& EnumValue::value() const +{ + return _value; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_EnumValue_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Function.h b/vendor/invn/external/include/Poco/CppParser/Function.h new file mode 100644 index 0000000..08e6cd5 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Function.h @@ -0,0 +1,168 @@ +// +// Function.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Function.h#2 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Function +// +// Definition of the Function class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Function_INCLUDED +#define CppParser_Function_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Decl.h" +#include + + +namespace Poco { +namespace CppParser { + + +class Parameter; + + +class CppParser_API Function: public Decl + /// This class represents a (member) function declaration. +{ +public: + enum Flags + { + FN_STATIC = 1, /// The function is static. + FN_VIRTUAL = 2, /// The function is virtual. + FN_INLINE = 4, /// The function is inline. + FN_CONST = 8, /// The function is const. + FN_TEMPLATE = 16, /// The function is a template. + FN_PURE_VIRTUAL = 32, /// The function is pure virtual. + FN_FINAL = 64, /// The function is final. + FN_OVERRIDE = 128, /// The function is override. + FN_NOEXCEPT = 256, /// The function is noexcept. + FN_DEFAULT = 512, /// The function is default. + FN_DELETE = 1024 /// The function has been deleted. + }; + + typedef std::vector Parameters; + typedef Parameters::const_iterator Iterator; + + Function(const std::string& decl, NameSpace* pNameSpace); + /// Creates the Function. + + ~Function(); + /// Destroys the Function. + + void addParameter(Parameter* pParam); + /// Adds a parameter to the function. + + const std::string& getReturnParameter() const; + + Iterator begin() const; + /// Returns an iterator for iterating over the Function's Parameter's. + + Iterator end() const; + /// Returns an iterator for iterating over the Function's Parameter's. + + void makeInline(); + /// Sets the FN_INLINE flag. + + void makeConst(); + /// Sets the FN_CONST flag. + + void makePureVirtual(); + /// Sets the FN_PURE_VIRTUAL flag. + + void makeFinal(); + /// Sets the FN_FINAL flag. + + void makeOverride(); + /// Sets the FN_OVERRIDE flag. + + void makeNoexcept(); + /// Sets the FN_NOEXCEPT flag. + + void makeDefault(); + /// Sets the FN_DEFAULT flag. + + void makeDelete(); + /// Sets the FN_DELETE flag. + + int flags() const; + /// Returns the function's flags. + + bool isConstructor() const; + /// Returns true iff the function is a constructor. + + bool isDestructor() const; + /// Returns true iff the function is a destructor. + + bool isMethod() const; + /// Returns true iff the function is a method (it's part of + /// a Struct and it's neither a constructor nor a destructor). + + bool isFunction() const; + /// Returns true iff the function is not a member of a class + /// (a freestanding function). + + bool isConst() const; + /// Returns true iff the method is const. + + int countParameters() const; + /// Returns the number of parameters. + + std::string signature() const; + /// Returns the signature of the function. + + bool isVirtual() const; + /// Returns true if the method is virtual. Also examines base + /// classes to check for a virtual function with the same + /// signature. + + Function* getOverridden() const; + /// If the function is virtual and overrides a function in a + /// base class, the base class function is returned. + /// Otherwise, null is returned. + + Symbol::Kind kind() const; + std::string toString() const; + +private: + Parameters _params; + int _flags; + std::string _retParam; +}; + + +// +// inlines +// +inline int Function::flags() const +{ + return _flags; +} + + +inline const std::string& Function::getReturnParameter() const +{ + return _retParam; +} + + +inline bool Function::isConst() const +{ + return (flags() & FN_CONST) != 0; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Function_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/NameSpace.h b/vendor/invn/external/include/Poco/CppParser/NameSpace.h new file mode 100644 index 0000000..f632ee7 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/NameSpace.h @@ -0,0 +1,140 @@ +// +// NameSpace.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/NameSpace.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: NameSpace +// +// Definition of the NameSpace class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_NameSpace_INCLUDED +#define CppParser_NameSpace_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Symbol.h" +#include +#include +#include + + +namespace Poco { +namespace CppParser { + + +class CppParser_API NameSpace: public Symbol + /// This class represents a namespace. +{ +public: + typedef std::multimap SymbolTable; + typedef SymbolTable::const_iterator Iterator; + typedef std::map AliasMap; + typedef std::vector NameSpaceVec; + + NameSpace(); + /// Creates the NameSpace. + + NameSpace(const std::string& name, NameSpace* pNameSpace = 0); + /// Creates the NameSpace. + + ~NameSpace(); + /// Destroys the NameSpace. + + void addSymbol(Symbol* pSymbol); + /// Adds a symbol to the namespace. + + void importSymbol(const std::string& fullName); + /// Imports a symbol from another namespace (using ). + + void importNameSpace(const std::string& nameSpace); + /// Imports a namespace (using namespace ). + + Iterator begin() const; + /// Returns an iterator for iterating over the NameSpace's Symbol's. + + Iterator end() const; + /// Returns an iterator for iterating over the NameSpace's Symbol's. + + Symbol* lookup(const std::string& name) const; + /// Looks up the given name in the symbol table + /// and returns the corresponsing symbol, or null + /// if no symbol can be found. The name can include + /// a namespace. + + static NameSpace* root(); + /// Returns the root namespace. Never delete this one! + + void nameSpaces(SymbolTable& table) const; + /// Fills the symbol table with all namespaces. + + void typeDefs(SymbolTable& table) const; + /// Fills the symbol table with all type definitions. + + void enums(SymbolTable& table) const; + /// Fills the symbol table with all enums. + + void classes(SymbolTable& table) const; + /// Fills the symbol table with all classes and structs. + + void functions(SymbolTable& table) const; + /// Fills the symbol table with all functions. + + void variables(SymbolTable& table) const; + /// Fills the symbol table with all variables. + + const AliasMap& importedSymbols() const; + /// Returns a const reference to a SymbolTable containing all + /// imported symbols. + + const NameSpaceVec& importedNameSpaces() const; + /// Returns a vector containing all imported namespaces. + + Symbol::Kind kind() const; + std::string toString() const; + +private: + Symbol* lookup(const std::string& name, std::set& alreadyVisited) const; + /// Looks up the given name in the symbol table + /// and returns the corresponsing symbol, or null + /// if no symbol can be found. The name can include + /// a namespace. + +protected: + void extract(Symbol::Kind kind, SymbolTable& table) const; + static void splitName(const std::string& name, std::string& head, std::string& tail); + +private: + SymbolTable _symbols; + AliasMap _importedSymbols; + NameSpaceVec _importedNameSpaces; +}; + + +// +// inlines +// +inline const NameSpace::AliasMap& NameSpace::importedSymbols() const +{ + return _importedSymbols; +} + + +inline const NameSpace::NameSpaceVec& NameSpace::importedNameSpaces() const +{ + return _importedNameSpaces; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_NameSpace_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Parameter.h b/vendor/invn/external/include/Poco/CppParser/Parameter.h new file mode 100644 index 0000000..04713ff --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Parameter.h @@ -0,0 +1,144 @@ +// +// Parameter.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Parameter.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Parameter +// +// Definition of the Parameter class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Parameter_INCLUDED +#define CppParser_Parameter_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Decl.h" + + +namespace Poco { +namespace CppParser { + + +class Function; + + +class CppParser_API Parameter: public Decl + /// This class represents a parameter to a function. +{ +public: + Parameter(const std::string& decl, Function* pFunction); + /// Creates the Parameter. + + ~Parameter(); + /// Destroys the Parameter. + + Symbol::Kind kind() const; + + bool isReference() const; + /// Returns true iff the parameter is a reference. + + bool isPointer() const; + /// Returns true iff the parameter is a pointer. + + bool isConst() const; + /// Returns true iff the parameter is const. + + bool hasDefaultValue() const; + /// Returns true if a defaultvalue was set at this parameter, + /// Example: const std::string& data = std::string("default"). + + const std::string& declType() const; + /// Returns the type of the parameter without const and & if present. + /// + /// Example: a type const std::string& -> std::string, a type const std::string* returns std::string + + const std::string& defaultValue() const; + /// If hasDefaultValue() returns true, this method returns the default value, i.e. all data found between + /// the opening and closing bracket of the init string. + /// + /// Example: for const std::string& data = std::string("default") it will return "default", + /// for = std::string() it will return a zero length string, for = ComplexClass(13,12, "test", 0); + /// it will return 13,12, "test", 0. + + const std::string& defaultDecl() const; + /// If hasDefaultValue() returns true, this method returns the + /// default value declaration. + /// + /// Example: for const std::string& data = std::string("default") it will return std::string("default"). + + static bool vectorType(const std::string& type, NameSpace* pNS); + +private: + std::string handleDecl(const std::string& decl); + /// Removes initialization values, adds param Names if they are missing + +private: + std::string _type; + bool _isRef; + bool _isPointer; + bool _isConst; + bool _hasDefaultValue; + std::string _defaultValue; + std::string _defaultDecl; + static int _count; +}; + + +// +// inlines +// +inline const std::string& Parameter::declType() const +{ + return _type; +} + + +inline bool Parameter::isReference() const +{ + return _isRef; +} + + +inline bool Parameter::isConst() const +{ + return _isConst; +} + + +inline bool Parameter::isPointer() const +{ + return _isPointer; +} + + +inline bool Parameter::hasDefaultValue() const +{ + return _hasDefaultValue; +} + + +inline const std::string& Parameter::defaultValue() const +{ + return _defaultValue; +} + + +inline const std::string& Parameter::defaultDecl() const +{ + return _defaultDecl; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Parameter_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Parser.h b/vendor/invn/external/include/Poco/CppParser/Parser.h new file mode 100644 index 0000000..8ba4b40 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Parser.h @@ -0,0 +1,129 @@ +// +// Parser.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Parser.h#1 $ +// +// Library: CppParser +// Package: CppParser +// Module: Parser +// +// Definition of the Parser class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Parser_INCLUDED +#define CppParser_Parser_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Tokenizer.h" +#include "Poco/CppParser/Symbol.h" +#include "Poco/CppParser/NameSpace.h" +#include "Poco/CountingStream.h" +#include + + +namespace Poco { +namespace CppParser { + + +class Enum; +class Struct; +class Function; + + +class CppParser_API Parser + /// A minimal parser for C++ (header files). + /// + /// The parser reads a (preprocessed) source or header file and + /// builds a symbol table containing as much information as + /// the parser is able to extract from the file. + /// + /// A special comment syntax is used for inline API documentation. + /// + /// A comment starting with three consecutive slashes (///) contains + /// API documentation for a symbol (class, function, typedef, enum, etc.). + /// API documentation comments always come after the declaration, with the + /// exception of structs and classes, where the comments are expected + /// immediately before the opening brace. +{ +public: + Parser(NameSpace::SymbolTable& gst, const std::string& file, std::istream& istr); + /// Creates the Parser. + + ~Parser(); + /// Destroys the Parser. + + void parse(); + /// Parses the file. + +protected: + const Poco::Token* parseFile(const Poco::Token* pNext); + const Poco::Token* parseNameSpace(const Poco::Token* pNext); + const Poco::Token* parseClass(const Poco::Token* pNext); + const Poco::Token* parseClass(const Poco::Token* pNext, std::string& decl); + const Poco::Token* parseTemplate(const Poco::Token* pNext); + const Poco::Token* parseTemplateArgs(const Poco::Token* pNext, std::string& decl); + const Poco::Token* parseVarFunc(const Poco::Token* pNext); + const Poco::Token* parseVarFunc(const Poco::Token* pNext, std::string& decl); + const Poco::Token* parseFriend(const Poco::Token* pNext); + const Poco::Token* parseExtern(const Poco::Token* pNext); + const Poco::Token* parseTypeDef(const Poco::Token* pNext); + const Poco::Token* parseUsing(const Poco::Token* pNext); + const Poco::Token* parseFunc(const Poco::Token* pNext, std::string& decl); + const Poco::Token* parseParameters(const Poco::Token* pNext, Function* pFunc); + const Poco::Token* parseBlock(const Poco::Token* pNext); + const Poco::Token* parseEnum(const Poco::Token* pNext); + const Poco::Token* parseEnumValue(const Poco::Token* pNext, Enum* pEnum); + const Poco::Token* parseBaseClassList(const Poco::Token* pNext, Struct* pClass); + const Poco::Token* parseClassMembers(const Poco::Token* pNext, Struct* pClass); + const Poco::Token* parseAccess(const Poco::Token* pNext); + const Poco::Token* parseIdentifier(const Poco::Token* pNext, std::string& id); + + void addSymbol(Symbol* pSymbol, int lineNumber, bool addGST = true); + void pushNameSpace(NameSpace* pNameSpace, int lineNumber, bool addGST = true); + void popNameSpace(); + NameSpace* currentNameSpace() const; + + static bool isIdentifier(const Poco::Token* pToken); + static bool isOperator(const Poco::Token* pToken, int kind); + static bool isKeyword(const Poco::Token* pToken, int kind); + static bool isEOF(const Poco::Token* pToken); + static void expectOperator(const Poco::Token* pToken, int kind, const std::string& msg); + static void syntaxError(const std::string& msg); + static void append(std::string& decl, const std::string& token); + static void append(std::string& decl, const Poco::Token* pToken); + + const Poco::Token* next(); + const Poco::Token* nextPreprocessed(); + const Poco::Token* nextToken(); + +private: + typedef std::vector NSStack; + + NameSpace::SymbolTable& _gst; + Poco::CountingInputStream _istr; + Tokenizer _tokenizer; + std::string _file; + std::string _path; + std::string _currentPath; + bool _inFile; + std::string _package; + std::string _library; + NSStack _nsStack; + Symbol* _pCurrentSymbol; + Symbol::Access _access; + std::string _doc; + std::string _attrs; +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Parser_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Struct.h b/vendor/invn/external/include/Poco/CppParser/Struct.h new file mode 100644 index 0000000..28c8676 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Struct.h @@ -0,0 +1,207 @@ +// +// Struct.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Struct.h#2 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Struct +// +// Definition of the Struct class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Struct_INCLUDED +#define CppParser_Struct_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/NameSpace.h" +#include +#include + + +namespace Poco { +namespace CppParser { + + +class Function; + + +class CppParser_API Struct: public NameSpace + /// This class represents a struct or class declaration. +{ +public: + enum Flags + { + FN_TEMPLATE = 1, + FN_INLINE = 2, // when the whole class is inlined in a c++ file + FN_TEMPLATE_SPECIALIZATION = 4, + FN_FINAL = 8 + }; + + struct Base + { + Symbol::Access access; + bool isVirtual; + std::string name; + Struct* pClass; + }; + + typedef std::vector BaseClasses; + typedef BaseClasses::const_iterator BaseIterator; + typedef std::vector StructVec; + typedef StructVec::const_iterator DerivedIterator; + typedef std::vector Functions; + typedef std::set FunctionSet; + typedef std::set StructSet; + + Struct(const std::string& decl, bool isClass, NameSpace* pNameSpace); + /// Creates the Struct. + + ~Struct(); + /// Destroys the Struct. + + void addBase(const std::string&, Symbol::Access access, bool isVirtual); + /// Adds a base class. + + BaseIterator baseBegin() const; + /// Returns an iterator for iterating over all base classes. + + BaseIterator baseEnd() const; + /// Returns an iterator for iterating over all base classes. + + void fixupBases(); + /// Adds pointers for all base classes. + + void addDerived(Struct* pClass); + /// Adds a derived class. + + DerivedIterator derivedBegin() const; + /// Returns an iterator for iterating over all derived classes. + + DerivedIterator derivedEnd() const; + /// Returns an iterator for iterating over all derived classes. + + const std::string& declaration() const; + /// Returns the declaration. + + int flags() const; + /// Returns the struct's flags. + + void makeInline(); + /// Changes the class to a inline class, i.e. definition and implementation are hidden in a cpp file. + + void makeFinal(); + /// Makes the class final. + + bool isInline() const; + /// Returns true if the complete class is inlined in a cpp file. + + bool isFinal() const; + /// Returns true if the class is final. + + void constructors(Functions& functions) const; + /// Returns all constructors, sorted by their parameter count. + + Function* destructor() const; + /// Returns the destructor, or NULL if no + /// destructor is defined. + + void methods(Symbol::Access access, Functions& functions) const; + /// Returns all functions with the given access. + + void inheritedMethods(FunctionSet& functions) const; + /// Returns all inherited methods. + + void bases(std::set& bases) const; + /// Returns all base classes. + + void derived(StructSet& derived) const; + /// Returns all derived classes. + + Function* findFunction(const std::string& signature) const; + /// Finds a function with the given signature. + + bool hasVirtualDestructor() const; + /// Returns true if the class CppParser_API or one if its base classes + /// has a virtual destructor. + + bool isClass() const; + /// Returns true iff the struct was declared as class. + + bool isDerived() const; + /// Returns true iff the struct or class is derived from another struct or class. + + Symbol::Kind kind() const; + std::string toString() const; + +private: + std::string _decl; + BaseClasses _bases; + StructVec _derived; + int _flags; + bool _isClass; +}; + + +// +// inlines +// +inline const std::string& Struct::declaration() const +{ + return _decl; +} + + +inline int Struct::flags() const +{ + return _flags; +} + + +inline bool Struct::isClass() const +{ + return _isClass; +} + + +inline void Struct::makeInline() +{ + _flags |= FN_INLINE; +} + + +inline void Struct::makeFinal() +{ + _flags |= FN_FINAL; +} + + +inline bool Struct::isInline() const +{ + return (_flags & FN_INLINE) != 0; +} + + +inline bool Struct::isFinal() const +{ + return (_flags & FN_FINAL) != 0; +} + + +inline bool Struct::isDerived() const +{ + return !_bases.empty(); +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Struct_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Symbol.h b/vendor/invn/external/include/Poco/CppParser/Symbol.h new file mode 100644 index 0000000..1e0c17b --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Symbol.h @@ -0,0 +1,268 @@ +// +// Symbol.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Symbol.h#2 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Symbol +// +// Definition of the Symbol class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Symbol_INCLUDED +#define CppParser_Symbol_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Attributes.h" +#include "Poco/Foundation.h" + + +namespace Poco { +namespace CppParser { + + +class NameSpace; + + +class CppParser_API Symbol + /// This is the base class for all symbols in the symbol table. + /// + /// Every symbol has a unique ID (int) and a namespace (which + /// may be null). +{ +public: + enum Kind + { + SYM_ENUM, /// An enumeration + SYM_ENUM_VALUE, /// An enumeration value + SYM_FUNCTION, /// A (member) function + SYM_NAMESPACE, /// A namespace + SYM_PARAMETER, /// A function parameter + SYM_STRUCT, /// A struct or class + SYM_TYPEDEF, /// A typedef + SYM_BUILTIN, /// A built-in type + SYM_VARIABLE /// A (member) variable + }; + + enum Access + { + ACC_PUBLIC, /// public access + ACC_PROTECTED, /// protected access + ACC_PRIVATE /// private access + }; + + Symbol(); + /// Creates the Symbol and assigns the symbol + /// a unique ID. + + Symbol(const std::string& name, NameSpace* pNameSpace = 0); + /// Creates the Symbol and assigns the symbol + /// a unique ID. + + virtual ~Symbol(); + /// Destroys the Symbol. + + int id() const; + /// Returns the symbol's unique ID. + + const std::string& name() const; + /// Returns the symbol's (local) name. + + NameSpace* nameSpace() const; + /// Returns the symbol's namespace which + /// may be null. + + void setAccess(Access v); + /// Sets the symbol's access. + + Access getAccess() const; + /// Returns the symbol's access. + + void setDocumentation(const std::string& text); + /// Sets the symbol's documentation. + + void addDocumentation(const std::string& text); + /// Adds text to the symbol's documentation. + + const std::string& getDocumentation() const; + /// Returns the symbol's documentation. + + void setFile(const std::string& path); + /// Sets the file where the symbol is declared. + + const std::string& getFile() const; + /// Returns the file where the symbol is defined. + + void setLineNumber(int line); + /// Sets the line number of the symbol's declaration. + + int getLineNumber() const; + /// Returns the line number of the symbol's declaration. + + void setPackage(const std::string& package); + /// Sets the symbol's package. + + const std::string& getPackage() const; + /// Returns the symbol's package. + + void setLibrary(const std::string& library); + /// Sets the symbol's library. + + const std::string& getLibrary() const; + /// Returns the symbol's library. + + const Attributes& attrs() const; + /// Returns the symbol's attributes. + + Attributes& attrs(); + /// Returns the symbol's attributes. + + const Attributes& getAttributes() const; + /// Returns the symbol's attributes. + + void setAttributes(const Attributes& attrs); + /// Sets the symbol's attributes. + + std::string fullName() const; + /// Returns the symbol's fully qualified name. + + static std::string extractName(const std::string& decl); + /// Extracts the name from the declaration. + + virtual Kind kind() const = 0; + /// Returns the symbol's kind. + + virtual std::string toString() const = 0; + /// Returns a string representation of the symbol. + + bool isPublic() const; + /// Returns true iff the symbol is public. + + bool isProtected() const; + /// Returns true iff the symbol is public. + + bool isPrivate() const; + /// Returns true iff the symbol is public. + +protected: + static bool isIdent(char c); + static bool hasAttr(const std::string& decl, const std::string& attr); + +private: + Symbol(const Symbol&); + Symbol& operator = (const Symbol&); + + int _id; + std::string _name; + NameSpace* _pNameSpace; + Access _access; + std::string _documentation; + std::string _file; + int _line; + std::string _package; + std::string _library; + Attributes _attrs; + + static int _nextId; +}; + + +// +// inlines +// +inline int Symbol::id() const +{ + return _id; +} + + +inline const std::string& Symbol::name() const +{ + return _name; +} + + +inline const std::string& Symbol::getDocumentation() const +{ + return _documentation; +} + + +inline Symbol::Access Symbol::getAccess() const +{ + return _access; +} + + +inline NameSpace* Symbol::nameSpace() const +{ + return _pNameSpace; +} + + +inline const std::string& Symbol::getFile() const +{ + return _file; +} + + +inline int Symbol::getLineNumber() const +{ + return _line; +} + + +inline const std::string& Symbol::getPackage() const +{ + return _package; +} + + +inline const std::string& Symbol::getLibrary() const +{ + return _library; +} + + +inline const Attributes& Symbol::attrs() const +{ + return _attrs; +} + + +inline Attributes& Symbol::attrs() +{ + return _attrs; +} + + +inline bool Symbol::isPublic() const +{ + return _access == ACC_PUBLIC; +} + + +inline bool Symbol::isProtected() const +{ + return _access == ACC_PROTECTED; +} + + +inline bool Symbol::isPrivate() const +{ + return _access == ACC_PRIVATE; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Symbol_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Tokenizer.h b/vendor/invn/external/include/Poco/CppParser/Tokenizer.h new file mode 100644 index 0000000..4fa23f6 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Tokenizer.h @@ -0,0 +1,46 @@ +// +// Tokenizer.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Tokenizer.h#1 $ +// +// Library: CppParser +// Package: CppParser +// Module: Tokenizer +// +// Definition of the Tokenizer class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Tokenizer_INCLUDED +#define CppParser_Tokenizer_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/StreamTokenizer.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API Tokenizer: public Poco::StreamTokenizer + /// A Tokenizer for C++. +{ +public: + Tokenizer(std::istream& istr); + /// Creates the Tokenizer. + + ~Tokenizer(); + /// Destroys the Tokenizer. +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Tokenizer_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/TypeDef.h b/vendor/invn/external/include/Poco/CppParser/TypeDef.h new file mode 100644 index 0000000..564ad3a --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/TypeDef.h @@ -0,0 +1,51 @@ +// +// TypeDef.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/TypeDef.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: TypeDef +// +// Definition of the TypeDef class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_TypeDef_INCLUDED +#define CppParser_TypeDef_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Decl.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API TypeDef: public Decl + /// This class represents a type definition (typedef). +{ +public: + TypeDef(const std::string& decl, NameSpace* pNameSpace); + /// Creates the TypeDef. + + ~TypeDef(); + /// Destroys the TypeDef. + + Symbol::Kind kind() const; + + std::string baseType() const; + /// Returns the underlying base type. +}; + + +} } // namespace Poco::CppParser + + +#endif // CppParser_TypeDef_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Utility.h b/vendor/invn/external/include/Poco/CppParser/Utility.h new file mode 100644 index 0000000..7c2ba74 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Utility.h @@ -0,0 +1,87 @@ +// +// Utility.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Utility.h#1 $ +// +// Library: CppParser +// Package: CppParser +// Module: Utility +// +// Definition of the Utility class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Utility_INCLUDED +#define CppParser_Utility_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/NameSpace.h" +#include +#include + + +namespace Poco { +namespace CppParser { + + +class CppParser_API Utility + /// Various helpers for parsing and analyzing C++ header files. +{ +public: + class CppParser_API FwdDeclBlock + { + public: + std::string beginNameSpaceDecl; // contains either $(NS)_BEGIN or the namespace x { decl + std::string endNameSpaceDecl; // contains either $(NS)_END or the closing brackets } + std::vector classDecls; // contains strings of the form "class X;" + }; + + static void parse(const std::string& file, NameSpace::SymbolTable& st, const std::string& exec, const std::string& options, const std::string& path); + /// Preprocesses and parses the file. The resulting symboltable has base class references already fixed, + + static void parseDir(const std::vector & includePattern, const std::vector & excludePattern, NameSpace::SymbolTable& st, const std::string& exec, const std::string& options, const std::string& path); + /// Preprocesses and parses all files specified by the include pattern (e.g.: p:/poco/Foundation/include/*/*.h) minus the ones defined in the exclude pattern + + static void fixup(NameSpace::SymbolTable& st); + /// Fixes all base pointers in the symbol table + + static void detectPrefixAndIncludes(const std::string& origHFile, std::vector& lines, std::string& prefix); + /// This method is poco coding style specific! It looks for a $(PREFIX)_BEGIN and extracts from it a prefix, also include files and fwd declarations are extracted from the h file. + + static void removeFile(const std::string& preprocessedfile); + /// Tries to remove the file. If it fails, the error is silently ignored. + +protected: + static std::string preprocessFile(const std::string& file, const std::string& exec, const std::string& options, const std::string& path); + /// Preprocess the include file with name file. Parameter exec must contain the name of the preprocessor binary (e.g.: "cl" for Visual Studio). + /// Parameter options contains the flag for the preprocessor, and parameter path sets the environment PATH settings during preprocessing. + /// Returns the name of the created file or throws an exception. + + static void parseOnly(const std::string& file, NameSpace::SymbolTable& st, const std::string& preprocessedFile, bool removePreprocessedFile = true); + /// Parses the file, throws an exception if anything goes wrong. + + static void buildFileList(std::set& files, const std::vector& includePattern, const std::vector& excludePattern); + /// Searches all files that match the defined patterns and inserts them into files. +private: + Utility(); + ~Utility(); + Utility(const Utility&); + Utility& operator=(const Utility&); + +}; + + +std::string CppParser_API replace(const std::string& input, const std::string& oldToken, const std::string& newToken); + /// Replaces in character input all oldTokens with the newToken + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Utility_INCLUDED diff --git a/vendor/invn/external/include/Poco/CppParser/Variable.h b/vendor/invn/external/include/Poco/CppParser/Variable.h new file mode 100644 index 0000000..4482076 --- /dev/null +++ b/vendor/invn/external/include/Poco/CppParser/Variable.h @@ -0,0 +1,94 @@ +// +// Variable.h +// +// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Variable.h#1 $ +// +// Library: CppParser +// Package: SymbolTable +// Module: Variable +// +// Definition of the Variable class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CppParser_Variable_INCLUDED +#define CppParser_Variable_INCLUDED + + +#include "Poco/CppParser/CppParser.h" +#include "Poco/CppParser/Decl.h" + + +namespace Poco { +namespace CppParser { + + +class CppParser_API Variable: public Decl + /// This class represents (member) variable declaration. +{ +public: + enum Flags + { + VAR_STATIC = 1, /// The variable is static. + VAR_MUTABLE = 2, /// The variable is mutable. + VAR_VOLATILE = 4, /// The variable is volatile. + VAR_CONST = 8 /// The variable is const. + }; + + Variable(const std::string& decl, NameSpace* pNameSpace); + /// Creates the Variable. + + ~Variable(); + /// Destroys the Variable. + + int flags() const; + /// Returns the variable's flags. + + bool isPointer() const; + /// Returns true iff the variable holds a pointer. + + Symbol::Kind kind() const; + + const std::string& declType() const; + /// Returns the type of the parameter without const and & if present. + /// + /// Example: a type const std::string& -> std::string, a type const std::string* returns std::string + + +private: + int _flags; + bool _isPointer; + std::string _type; +}; + + +// +// inlines +// +inline int Variable::flags() const +{ + return _flags; +} + + +inline bool Variable::isPointer() const +{ + return _isPointer; +} + + +inline const std::string& Variable::declType() const +{ + return _type; +} + + +} } // namespace Poco::CppParser + + +#endif // CppParser_Variable_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/Cipher.h b/vendor/invn/external/include/Poco/Crypto/Cipher.h new file mode 100644 index 0000000..30d17f3 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/Cipher.h @@ -0,0 +1,140 @@ +// +// Cipher.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/Cipher.h#3 $ +// +// 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 +#include +#include + + +namespace Poco { +namespace Crypto { + + +class CryptoTransform; + + +class Crypto_API Cipher: public Poco::RefCountedObject + /// Represents the abstract base class from which all implementations of + /// symmetric/assymetric 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 arbitary 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 Ptr; + typedef std::vector 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 encrytor 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 diff --git a/vendor/invn/external/include/Poco/Crypto/CipherFactory.h b/vendor/invn/external/include/Poco/Crypto/CipherFactory.h new file mode 100644 index 0000000..7cfd73e --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CipherFactory.h @@ -0,0 +1,77 @@ +// +// CipherFactory.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CipherFactory.h#1 $ +// +// 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 diff --git a/vendor/invn/external/include/Poco/Crypto/CipherImpl.h b/vendor/invn/external/include/Poco/Crypto/CipherImpl.h new file mode 100644 index 0000000..1a1f10b --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CipherImpl.h @@ -0,0 +1,71 @@ +// +// CipherImpl.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CipherImpl.h#2 $ +// +// 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 + + +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 encrytor object. + + CryptoTransform* createDecryptor(); + /// Creates a decrytor object. + +private: + CipherKey _key; + OpenSSLInitializer _openSSLInitializer; +}; + + +// +// Inlines +// +inline const std::string& CipherImpl::name() const +{ + return _key.name(); +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_CipherImpl_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/CipherKey.h b/vendor/invn/external/include/Poco/Crypto/CipherKey.h new file mode 100644 index 0000000..792de73 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CipherKey.h @@ -0,0 +1,184 @@ +// +// CipherKey.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CipherKey.h#1 $ +// +// 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); + /// +{ +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); + /// Creates a new CipherKeyImpl object using the given + /// cipher name, passphrase, salt value and iteration count. + + 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. + + 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. + + 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 diff --git a/vendor/invn/external/include/Poco/Crypto/CipherKeyImpl.h b/vendor/invn/external/include/Poco/Crypto/CipherKeyImpl.h new file mode 100644 index 0000000..3b9e7bf --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CipherKeyImpl.h @@ -0,0 +1,172 @@ +// +// CipherKeyImpl.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CipherKeyImpl.h#3 $ +// +// 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 + + +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 ByteVec; + typedef Poco::AutoPtr 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 + }; + + CipherKeyImpl(const std::string& name, + const std::string& passphrase, + const std::string& salt, + int iterationCount); + /// 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; + 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(keySize())); + _key = key; +} + + +inline const CipherKeyImpl::ByteVec& CipherKeyImpl::getIV() const +{ + return _iv; +} + + +inline void CipherKeyImpl::setIV(const ByteVec& iv) +{ + poco_assert(iv.size() == static_cast(ivSize())); + _iv = iv; +} + + +inline const EVP_CIPHER* CipherKeyImpl::cipher() +{ + return _pCipher; +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_CipherKeyImpl_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/Crypto.h b/vendor/invn/external/include/Poco/Crypto/Crypto.h new file mode 100644 index 0000000..fcfb20e --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/Crypto.h @@ -0,0 +1,119 @@ +// +// Crypto.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/Crypto.h#3 $ +// +// 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 + + +#if defined(__APPLE__) +// OS X 10.7 deprecates some OpenSSL functions +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + +#include "Poco/Foundation.h" + + +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, wheras this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(Crypto_EXPORTS) + #define Crypto_API __declspec(dllexport) + #else + #define Crypto_API __declspec(dllimport) + #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 library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Crypto_EXPORTS) + #pragma comment(lib, "PocoCrypto" POCO_LIB_SUFFIX) + #endif +#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 diff --git a/vendor/invn/external/include/Poco/Crypto/CryptoStream.h b/vendor/invn/external/include/Poco/Crypto/CryptoStream.h new file mode 100644 index 0000000..469b05c --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CryptoStream.h @@ -0,0 +1,194 @@ +// +// CryptoStream.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CryptoStream.h#2 $ +// +// 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 + + +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 _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 diff --git a/vendor/invn/external/include/Poco/Crypto/CryptoTransform.h b/vendor/invn/external/include/Poco/Crypto/CryptoTransform.h new file mode 100644 index 0000000..1bae01f --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/CryptoTransform.h @@ -0,0 +1,78 @@ +// +// CryptoTransform.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CryptoTransform.h#2 $ +// +// 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 + + +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::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 diff --git a/vendor/invn/external/include/Poco/Crypto/DigestEngine.h b/vendor/invn/external/include/Poco/Crypto/DigestEngine.h new file mode 100644 index 0000000..5de7539 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/DigestEngine.h @@ -0,0 +1,82 @@ +// +// DigestEngine.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/DigestEngine.h#1 $ +// +// 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 + + +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* _ctx; + Poco::DigestEngine::Digest _digest; + OpenSSLInitializer _openSSLInitializer; +}; + + +// +// inlines +// +inline const std::string& DigestEngine::algorithm() const +{ + return _name; +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_DigestEngine_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/OpenSSLInitializer.h b/vendor/invn/external/include/Poco/Crypto/OpenSSLInitializer.h new file mode 100644 index 0000000..8685300 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/OpenSSLInitializer.h @@ -0,0 +1,117 @@ +// +// OpenSSLInitializer.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/OpenSSLInitializer.h#1 $ +// +// 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 +#include +#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_NUMBER < 0x010001000L +#include +#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 diff --git a/vendor/invn/external/include/Poco/Crypto/RSACipherImpl.h b/vendor/invn/external/include/Poco/Crypto/RSACipherImpl.h new file mode 100644 index 0000000..6d433ed --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/RSACipherImpl.h @@ -0,0 +1,79 @@ +// +// RSACipherImpl.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/RSACipherImpl.h#2 $ +// +// 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 + + +namespace Poco { +namespace Crypto { + + +class RSACipherImpl: public Cipher + /// An implementation of the Cipher class for + /// assymetric (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 encrytor object. + + CryptoTransform* createDecryptor(); + /// Creates a decrytor 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 diff --git a/vendor/invn/external/include/Poco/Crypto/RSADigestEngine.h b/vendor/invn/external/include/Poco/Crypto/RSADigestEngine.h new file mode 100644 index 0000000..e4e8479 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/RSADigestEngine.h @@ -0,0 +1,113 @@ +// +// RSADigestEngine.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/RSADigestEngine.h#1 $ +// +// 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 +#include + + +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 (teh 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 diff --git a/vendor/invn/external/include/Poco/Crypto/RSAKey.h b/vendor/invn/external/include/Poco/Crypto/RSAKey.h new file mode 100644 index 0000000..a6a6bc2 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/RSAKey.h @@ -0,0 +1,133 @@ +// +// RSAKey.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/RSAKey.h#2 $ +// +// 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/RSAKeyImpl.h" + + +namespace Poco { +namespace Crypto { + + +class X509Certificate; + + +class Crypto_API RSAKey + /// 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 + }; + + explicit RSAKey(const X509Certificate& cert); + /// Extracts the RSA public 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. + + int size() const; + /// Returns the RSA modulus size. + + 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. + + void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = ""); + /// 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 = ""); + /// 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. + + RSAKeyImpl::Ptr impl() const; + /// Returns the impl object. + + const std::string& name() const; + /// Returns "rsa" + +private: + RSAKeyImpl::Ptr _pImpl; +}; + + +// +// inlines +// +inline RSAKeyImpl::Ptr RSAKey::impl() const +{ + return _pImpl; +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_RSAKey_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/RSAKeyImpl.h b/vendor/invn/external/include/Poco/Crypto/RSAKeyImpl.h new file mode 100644 index 0000000..f439a3d --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/RSAKeyImpl.h @@ -0,0 +1,131 @@ +// +// RSAKeyImpl.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/RSAKeyImpl.h#3 $ +// +// 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/OpenSSLInitializer.h" +#include "Poco/RefCountedObject.h" +#include "Poco/AutoPtr.h" +#include +#include +#include + + +struct bignum_st; +struct rsa_st; +typedef struct bignum_st BIGNUM; +typedef struct rsa_st RSA; + + +namespace Poco { +namespace Crypto { + + +class X509Certificate; + + +class RSAKeyImpl: public Poco::RefCountedObject + /// class RSAKeyImpl +{ +public: + typedef Poco::AutoPtr Ptr; + typedef std::vector ByteVec; + + explicit RSAKeyImpl(const X509Certificate& cert); + /// Extracts the RSA public 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 = ""); + /// 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 = ""); + /// 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: + void freeRSA(); + + static ByteVec convertToByteVec(const BIGNUM* bn); + +private: + RSA* _pRSA; + OpenSSLInitializer _openSSLInitializer; +}; + + +// +// inlines +// +inline RSA* RSAKeyImpl::getRSA() +{ + return _pRSA; +} + + +inline const RSA* RSAKeyImpl::getRSA() const +{ + return _pRSA; +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_RSAKeyImplImpl_INCLUDED diff --git a/vendor/invn/external/include/Poco/Crypto/X509Certificate.h b/vendor/invn/external/include/Poco/Crypto/X509Certificate.h new file mode 100644 index 0000000..472c537 --- /dev/null +++ b/vendor/invn/external/include/Poco/Crypto/X509Certificate.h @@ -0,0 +1,185 @@ +// +// X509Certificate.h +// +// $Id: //poco/1.4/Crypto/include/Poco/Crypto/X509Certificate.h#2 $ +// +// 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 +#include +#include + + +namespace Poco { +namespace Crypto { + + +class Crypto_API X509Certificate + /// This class represents a X509 Certificate. +{ +public: + 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 + }; + + 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. + + 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& 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 successfull, false otherwise. + + const X509* certificate() const; + /// Returns the underlying OpenSSL certificate. + +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; + X509* _pCert; + OpenSSLInitializer _openSSLInitializer; +}; + + +// +// inlines +// +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; +} + + +} } // namespace Poco::Crypto + + +#endif // Crypto_X509Certificate_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/AbstractContainerNode.h b/vendor/invn/external/include/Poco/DOM/AbstractContainerNode.h new file mode 100644 index 0000000..77dcb86 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/AbstractContainerNode.h @@ -0,0 +1,78 @@ +// +// AbstractContainerNode.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/AbstractContainerNode.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the AbstractContainerNode class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_AbstractContainerNode_INCLUDED +#define DOM_AbstractContainerNode_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" + + +namespace Poco { +namespace XML { + + +class XML_API AbstractContainerNode: public AbstractNode + /// AbstractContainerNode is an implementation of Node + /// that stores and manages child nodes. + /// + /// Child nodes are organized in a single linked list. +{ +public: + // Node + Node* firstChild() const; + Node* lastChild() const; + Node* insertBefore(Node* newChild, Node* refChild); + Node* replaceChild(Node* newChild, Node* oldChild); + Node* removeChild(Node* oldChild); + Node* appendChild(Node* newChild); + bool hasChildNodes() const; + bool hasAttributes() const; + Node* getNodeByPath(const XMLString& path) const; + Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const; + +protected: + AbstractContainerNode(Document* pOwnerDocument); + AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node); + ~AbstractContainerNode(); + + void dispatchNodeRemovedFromDocument(); + void dispatchNodeInsertedIntoDocument(); + + static const Node* findNode(XMLString::const_iterator& it, const XMLString::const_iterator& end, const Node* pNode, const NSMap* pNSMap); + static const Node* findElement(const XMLString& name, const Node* pNode, const NSMap* pNSMap); + static const Node* findElement(int index, const Node* pNode, const NSMap* pNSMap); + static const Node* findElement(const XMLString& attr, const XMLString& value, const Node* pNode, const NSMap* pNSMap); + static const Attr* findAttribute(const XMLString& name, const Node* pNode, const NSMap* pNSMap); + bool hasAttributeValue(const XMLString& name, const XMLString& value, const NSMap* pNSMap) const; + static bool namesAreEqual(const Node* pNode1, const Node* pNode2, const NSMap* pNSMap); + static bool namesAreEqual(const Node* pNode, const XMLString& name, const NSMap* pNSMap); + +private: + AbstractNode* _pFirstChild; + + friend class AbstractNode; + friend class NodeAppender; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_AbstractContainerNode_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/AbstractNode.h b/vendor/invn/external/include/Poco/DOM/AbstractNode.h new file mode 100644 index 0000000..a737941 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/AbstractNode.h @@ -0,0 +1,127 @@ +// +// AbstractNode.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/AbstractNode.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the AbstractNode class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_AbstractNode_INCLUDED +#define DOM_AbstractNode_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/Node.h" +#include "Poco/DOM/MutationEvent.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class AbstractContainerNode; +class Attr; +class EventDispatcher; + + +class XML_API AbstractNode: public Node + /// AbstractNode provides a basic implementation + /// of the Node interface for all types of nodes + /// that do not contain other nodes. +{ +public: + // Node + const XMLString& nodeName() const; + const XMLString& getNodeValue() const; + void setNodeValue(const XMLString& value); + Node* parentNode() const; + NodeList* childNodes() const; + Node* firstChild() const; + Node* lastChild() const; + Node* previousSibling() const; + Node* nextSibling() const; + NamedNodeMap* attributes() const; + Document* ownerDocument() const; + Node* insertBefore(Node* newChild, Node* refChild); + Node* replaceChild(Node* newChild, Node* oldChild); + Node* removeChild(Node* oldChild); + Node* appendChild(Node* newChild); + bool hasChildNodes() const; + Node* cloneNode(bool deep) const; + void normalize(); + bool isSupported(const XMLString& feature, const XMLString& version) const; + const XMLString& namespaceURI() const; + XMLString prefix() const; + const XMLString& localName() const; + bool hasAttributes() const; + + // EventTarget + void addEventListener(const XMLString& type, EventListener* listener, bool useCapture); + void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture); + bool dispatchEvent(Event* evt); + + // Extensions + XMLString innerText() const; + Node* getNodeByPath(const XMLString& path) const; + Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const; + + virtual void autoRelease(); + +protected: + AbstractNode(Document* pOwnerDocument); + AbstractNode(Document* pOwnerDocument, const AbstractNode& node); + ~AbstractNode(); + + virtual Node* copyNode(bool deep, Document* pOwnerDocument) const = 0; + + virtual bool events() const; + virtual bool eventsSuspended() const; + void captureEvent(Event* evt); + void bubbleEvent(Event* evt); + void dispatchSubtreeModified(); + void dispatchNodeInserted(); + void dispatchNodeRemoved(); + virtual void dispatchNodeRemovedFromDocument(); + virtual void dispatchNodeInsertedIntoDocument(); + void dispatchAttrModified(Attr* pAttr, MutationEvent::AttrChangeType changeType, const XMLString& prevValue, const XMLString& newValue); + void dispatchCharacterDataModified(const XMLString& prevValue, const XMLString& newValue); + void setOwnerDocument(Document* pOwnerDocument); + + static const XMLString EMPTY_STRING; + +private: + AbstractNode(); + + AbstractContainerNode* _pParent; + AbstractNode* _pNext; + Document* _pOwner; + EventDispatcher* _pEventDispatcher; + + static const XMLString NODE_NAME; + + friend class AbstractContainerNode; + friend class Document; + friend class DocumentFragment; + friend class Element; + friend class Attr; + friend class CharacterData; + friend class DOMBuilder; + friend class NodeAppender; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_AbstractNode_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Attr.h b/vendor/invn/external/include/Poco/DOM/Attr.h new file mode 100644 index 0000000..3b878d1 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Attr.h @@ -0,0 +1,182 @@ +// +// Attr.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Attr.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Attr class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Attr_INCLUDED +#define DOM_Attr_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" +#include "Poco/DOM/Element.h" +#include "Poco/XML/Name.h" + + +namespace Poco { +namespace XML { + + +class XML_API Attr: public AbstractNode + /// The Attr interface represents an attribute in an Element object. Typically + /// the allowable values for the attribute are defined in a document type definition. + /// + /// Attr objects inherit the Node interface, but since they are not actually + /// child nodes of the element they describe, the DOM does not consider them + /// part of the document tree. Thus, the Node attributes parentNode, previousSibling, + /// and nextSibling have a null value for Attr objects. The DOM takes the view + /// that attributes are properties of elements rather than having a separate + /// identity from the elements they are associated with; this should make it + /// more efficient to implement such features as default attributes associated + /// with all elements of a given type. Furthermore, Attr nodes may not be immediate + /// children of a DocumentFragment. However, they can be associated with Element + /// nodes contained within a DocumentFragment. In short, users and implementors + /// of the DOM need to be aware that Attr nodes have some things in common with + /// other objects inheriting the Node interface, but they also are quite distinct. + /// + /// The attribute's effective value is determined as follows: if this attribute + /// has been explicitly assigned any value, that value is the attribute's effective + /// value; otherwise, if there is a declaration for this attribute, and that + /// declaration includes a default value, then that default value is the attribute's + /// effective value; otherwise, the attribute does not exist on this element + /// in the structure model until it has been explicitly added. Note that the + /// nodeValue attribute on the Attr instance can also be used to retrieve the + /// string version of the attribute's value(s). + /// + /// In XML, where the value of an attribute can contain entity references, the + /// child nodes of the Attr node provide a representation in which entity references + /// are not expanded. These child nodes may be either Text or EntityReference + /// nodes. Because the attribute type may be unknown, there are no tokenized + /// attribute values. +{ +public: + const XMLString& name() const; + /// Returns the name of this attribute. + + bool specified() const; + /// If this attribute was explicitly given a value in the original document, + /// this is true; otherwise, it is false. Note that the implementation is in + /// charge of this attribute, not the user. If the user changes the value of + /// the attribute (even if it ends up having the same value as the default value) + /// then the specified flag is automatically flipped to true. To re-specify + /// the attribute as the default value from the DTD, the user must delete the + /// attribute. The implementation will then make a new attribute available with + /// specified set to false and the default value (if one exists). + /// In summary: + /// + /// * If the attribute has an assigned value in the document then specified + /// is true, and the value is the assigned value. + /// * If the attribute has no assigned value in the document and has a default + /// value in the DTD, then specified is false, and the value is the default + /// value in the DTD. + /// * If the attribute has no assigned value in the document and has a value + /// of #IMPLIED in the DTD, then the attribute does not appear in the structure + /// model of the document. + /// * If the attribute is not associated to any element (i.e. because it + /// was just created or was obtained from some removal or cloning operation) + /// specified is true. + + const XMLString& value() const; + /// Returns the value of the attribute as a string. Character + /// and general entity references are replaced with their values. See also the + /// method getAttribute on the Element interface. + + const XMLString& getValue() const; + /// Returns the value of the attribute as a string. Character + /// and general entity references are replaced with their values. See also the + /// method getAttribute on the Element interface. + + void setValue(const XMLString& value); + /// Sets the value of the attribute as a string. + /// This creates a Text node with the unparsed contents of the string. + /// I.e. any characters that an XML processor would recognize as markup are + /// instead treated as literal text. See also the method setAttribute on the + /// Element interface. + + // DOM Level 2 + Element* ownerElement() const; + /// The Element node this attribute is attached to or null + /// if this attribute is not in use. + + // Node + Node* parentNode() const; + const XMLString& nodeName() const; + const XMLString& getNodeValue() const; + void setNodeValue(const XMLString& value); + unsigned short nodeType() const; + Node* previousSibling() const; + const XMLString& namespaceURI() const; + XMLString prefix() const; + const XMLString& localName() const; + + // Non-standard extensions + XMLString innerText() const; + +protected: + Attr(Document* pOwnerDocument, Element* pOwnerElement, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& value, bool specified = true); + Attr(Document* pOwnerDocument, const Attr& attr); + ~Attr(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + const Name& _name; + XMLString _value; + bool _specified; + + friend class Document; + friend class Element; + friend class DOMBuilder; +}; + + +// +// inlines +// +inline const XMLString& Attr::name() const +{ + return _name.qname(); +} + + +inline const XMLString& Attr::value() const +{ + return _value; +} + + +inline const XMLString& Attr::getValue() const +{ + return _value; +} + + +inline bool Attr::specified() const +{ + return _specified; +} + + +inline Element* Attr::ownerElement() const +{ + return static_cast(_pParent); +} + + +} } // namespace Poco::XML + + +#endif // DOM_Attr_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/AttrMap.h b/vendor/invn/external/include/Poco/DOM/AttrMap.h new file mode 100644 index 0000000..524f26c --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/AttrMap.h @@ -0,0 +1,67 @@ +// +// AttrMap.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/AttrMap.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the AttrMap class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_AttrMap_INCLUDED +#define DOM_AttrMap_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/NamedNodeMap.h" + + +namespace Poco { +namespace XML { + + +class Element; + + +class XML_API AttrMap: public NamedNodeMap + // This implementation of NamedNodeMap is + // returned by Element::attributes() +{ +public: + Node* getNamedItem(const XMLString& name) const; + Node* setNamedItem(Node* arg); + Node* removeNamedItem(const XMLString& name); + Node* item(unsigned long index) const; + unsigned long length() const; + + Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const; + Node* setNamedItemNS(Node* arg); + Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName); + + void autoRelease(); + +protected: + AttrMap(Element* pElement); + ~AttrMap(); + +private: + AttrMap(); + + Element* _pElement; + + friend class Element; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_AttrMap_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/AutoPtr.h b/vendor/invn/external/include/Poco/DOM/AutoPtr.h new file mode 100644 index 0000000..5349de8 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/AutoPtr.h @@ -0,0 +1,37 @@ +// +// AutoPtr.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/AutoPtr.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Import Poco::AutoPtr into the XML namespace. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMAutoPtr_INCLUDED +#define DOM_DOMAutoPtr_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/AutoPtr.h" + + +namespace Poco { +namespace XML { + + +using Poco::AutoPtr; + + +} } // namespace Poco::XML + + +#endif // DOM_DOMAutoPtr_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/CDATASection.h b/vendor/invn/external/include/Poco/DOM/CDATASection.h new file mode 100644 index 0000000..e79d698 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/CDATASection.h @@ -0,0 +1,86 @@ +// +// CDATASection.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/CDATASection.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM CDATASection class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_CDATASection_INCLUDED +#define DOM_CDATASection_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/Text.h" + + +namespace Poco { +namespace XML { + + +class XML_API CDATASection: public Text + /// CDATA sections are used to escape blocks of text containing characters that + /// would otherwise be regarded as markup. The only delimiter that is recognized + /// in a CDATA section is the "]]>" string that ends the CDATA section. CDATA + /// sections cannot be nested. Their primary purpose is for including material + /// such as XML fragments, without needing to escape all the delimiters. + /// + /// The DOMString attribute of the Text node holds the text that is contained + /// by the CDATA section. Note that this may contain characters that need to + /// be escaped outside of CDATA sections and that, depending on the character + /// encoding ("charset") chosen for serialization, it may be impossible to write + /// out some characters as part of a CDATA section. + /// + /// The CDATASection interface inherits from the CharacterData interface through + /// the Text interface. Adjacent CDATASection nodes are not merged by use of + /// the normalize method on the Element interface. + /// + /// Note: Because no markup is recognized within a CDATASection, character numeric + /// references cannot be used as an escape mechanism when serializing. Therefore, + /// action needs to be taken when serializing a CDATASection with a character + /// encoding where some of the contained characters cannot be represented. Failure + /// to do so would not produce well-formed XML. + /// One potential solution in the serialization process is to end the CDATA + /// section before the character, output the character using a character reference + /// or entity reference, and open a new CDATA section for any further characters + /// in the text node. Note, however, that some code conversion libraries at + /// the time of writing do not return an error or exception when a character + /// is missing from the encoding, making the task of ensuring that data is not + /// corrupted on serialization more difficult. +{ +public: + // Text + Text* splitText(unsigned long offset); + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + CDATASection(Document* pOwnerDocument, const XMLString& data); + CDATASection(Document* pOwnerDocument, const CDATASection& sec); + ~CDATASection(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + static const XMLString NODE_NAME; + + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_CDATASection_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/CharacterData.h b/vendor/invn/external/include/Poco/DOM/CharacterData.h new file mode 100644 index 0000000..2036712 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/CharacterData.h @@ -0,0 +1,125 @@ +// +// CharacterData.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/CharacterData.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM CharacterData class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_CharacterData_INCLUDED +#define DOM_CharacterData_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API CharacterData: public AbstractNode + /// The CharacterData interface extends Node with a set of attributes and methods + /// for accessing character data in the DOM. For clarity this set is defined + /// here rather than on each object that uses these attributes and methods. + /// No DOM objects correspond directly to CharacterData, though Text and others + /// do inherit the interface from it. All offsets in this interface start from 0. + /// + /// Text strings in the DOM are represented in either UTF-8 (if XML_UNICODE_WCHAR_T is + /// not defined) or in UTF-16 (if XML_UNICODE_WCHAR_T is defined). + /// Indexing on character data is done in XMLChar units. +{ +public: + const XMLString& data() const; + /// Returns the character data of the node that + /// implements the interface. + + const XMLString& getData() const; + /// Returns the character data of the node that + /// implements the interface. + + void setData(const XMLString& data); + /// Sets the character data of the node that + /// implements the interface. + + unsigned long length() const; + /// Returns the number of XMLChars that are available + /// through getData and substringData. This may have the + /// value zero. + + XMLString substringData(unsigned long offset, unsigned long count) const; + /// Extracts a range of data from the node. + /// If offset and count exceeds the length, then all + /// the characters to the end of the data are returned. + + void appendData(const XMLString& arg); + /// Append the string to the end of the character data + /// of the node. + + void insertData(unsigned long offset, const XMLString& arg); + /// Insert a string at the specified character offset. + + void deleteData(unsigned long offset, unsigned long count); + /// Remove a range of characters from the node. + + void replaceData(unsigned long offset, unsigned long count, const XMLString& arg); + /// Replace the characters starting at the specified character + /// offset with the specified string. + + // Non-standard extensions + XMLString trimmedData() const; + /// Returns the character data of that node with + /// all surrounding whitespace removed. + /// + /// This method is an extension to the W3C Document Object Model. + + // Node + const XMLString& getNodeValue() const; + void setNodeValue(const XMLString& value); + +protected: + CharacterData(Document* pOwnerDocument, const XMLString& data); + CharacterData(Document* pOwnerDocument, const CharacterData& data); + ~CharacterData(); + +private: + XMLString _data; +}; + + +// +// inlines +// +inline const XMLString& CharacterData::data() const +{ + return _data; +} + + +inline const XMLString& CharacterData::getData() const +{ + return _data; +} + + +inline unsigned long CharacterData::length() const +{ + return (unsigned long) _data.length(); +} + + +} } // namespace Poco::XML + + +#endif // DOM_CharacterData_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/ChildNodesList.h b/vendor/invn/external/include/Poco/DOM/ChildNodesList.h new file mode 100644 index 0000000..9cf1ebd --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/ChildNodesList.h @@ -0,0 +1,57 @@ +// +// ChildNodesList.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/ChildNodesList.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the ChildNodesList class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_ChildNodesList_INCLUDED +#define DOM_ChildNodesList_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/NodeList.h" + + +namespace Poco { +namespace XML { + + +class XML_API ChildNodesList: public NodeList + // This implementation of NodeList is returned + // by Node::getChildNodes(). +{ +public: + Node* item(unsigned long index) const; + unsigned long length() const; + + void autoRelease(); + +protected: + ChildNodesList(const Node* pParent); + ~ChildNodesList(); + +private: + ChildNodesList(); + + const Node* _pParent; + + friend class AbstractNode; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_ChildNodesList_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Comment.h b/vendor/invn/external/include/Poco/DOM/Comment.h new file mode 100644 index 0000000..7a8edaa --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Comment.h @@ -0,0 +1,60 @@ +// +// Comment.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Comment.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Comment class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Comment_INCLUDED +#define DOM_Comment_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/CharacterData.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API Comment: public CharacterData + /// This interface inherits from CharacterData and represents the content of + /// a comment, i.e., all the characters between the starting ''. Note that this is the definition of a comment in XML, and, in practice, + /// HTML, although some HTML tools may implement the full SGML comment structure. +{ +public: + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + Comment(Document* pOwnerDocument, const XMLString& data); + Comment(Document* pOwnerDocument, const Comment& comment); + ~Comment(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + static const XMLString NODE_NAME; + + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_Comment_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMBuilder.h b/vendor/invn/external/include/Poco/DOM/DOMBuilder.h new file mode 100644 index 0000000..fa282c1 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMBuilder.h @@ -0,0 +1,114 @@ +// +// DOMBuilder.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMBuilder.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMBuilder +// +// Definition of the DOMBuilder class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMBuilder_INCLUDED +#define DOM_DOMBuilder_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/SAX/ContentHandler.h" +#include "Poco/SAX/LexicalHandler.h" +#include "Poco/SAX/DTDHandler.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XMLReader; +class Document; +class InputSource; +class AbstractNode; +class AbstractContainerNode; +class NamePool; + + +class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protected LexicalHandler + /// This class builds a tree representation of an + /// XML document, according to the W3C Document Object Model, Level 1 and 2 + /// specifications. + /// + /// The actual XML parsing is done by an XMLReader, which + /// must be supplied to the DOMBuilder. +{ +public: + DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0); + /// Creates a DOMBuilder using the given XMLReader. + /// If a NamePool is given, it becomes the Document's NamePool. + + virtual ~DOMBuilder(); + /// Destroys the DOMBuilder. + + virtual Document* parse(const XMLString& uri); + /// Parse an XML document from a location identified by an URI. + + virtual Document* parse(InputSource* pInputSource); + /// Parse an XML document from a location identified by an InputSource. + + virtual Document* parseMemoryNP(const char* xml, std::size_t size); + /// Parses an XML document from memory. + +protected: + // DTDHandler + void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId); + void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName); + + // ContentHandler + void setDocumentLocator(const Locator* loc); + void startDocument(); + void endDocument(); + void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes); + void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname); + void characters(const XMLChar ch[], int start, int length); + void ignorableWhitespace(const XMLChar ch[], int start, int length); + void processingInstruction(const XMLString& target, const XMLString& data); + void startPrefixMapping(const XMLString& prefix, const XMLString& uri); + void endPrefixMapping(const XMLString& prefix); + void skippedEntity(const XMLString& name); + + // LexicalHandler + void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId); + void endDTD(); + void startEntity(const XMLString& name); + void endEntity(const XMLString& name); + void startCDATA(); + void endCDATA(); + void comment(const XMLChar ch[], int start, int length); + + void appendNode(AbstractNode* pNode); + + void setupParse(); + +private: + static const XMLString EMPTY_STRING; + + XMLReader& _xmlReader; + NamePool* _pNamePool; + Document* _pDocument; + AbstractContainerNode* _pParent; + AbstractNode* _pPrevious; + bool _inCDATA; + bool _namespaces; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DOMBuilder_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMException.h b/vendor/invn/external/include/Poco/DOM/DOMException.h new file mode 100644 index 0000000..ae1dce5 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMException.h @@ -0,0 +1,114 @@ +// +// DOMException.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMException.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM DOMException class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMException_INCLUDED +#define DOM_DOMException_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLException.h" + + +namespace Poco { +namespace XML { + + +class XML_API DOMException: public XMLException + /// DOM operations only raise exceptions in "exceptional" circumstances, i.e., + /// when an operation is impossible to perform (either for logical reasons, + /// because data is lost, or because the implementation has become unstable). + /// In general, DOM methods return specific error values in ordinary processing + /// situations, such as out-of-bound errors when using NodeList. + /// + /// Implementations should raise other exceptions under other circumstances. + /// For example, implementations should raise an implementation-dependent exception + /// if a null argument is passed when null was not expected. +{ +public: + enum + { + INDEX_SIZE_ERR = 1, /// index or size is negative or greater than allowed value + DOMSTRING_SIZE_ERR, /// the specified range of text does not fit into a DOMString (not used) + HIERARCHY_REQUEST_ERR, /// a node is inserted somewhere it doesn't belong + WRONG_DOCUMENT_ERR, /// a node is used in a different document than the one that created it + INVALID_CHARACTER_ERR, /// an invalid character is specified (not used) + NO_DATA_ALLOWED_ERR, /// data is specified for a node which does not support data + NO_MODIFICATION_ALLOWED_ERR, /// an attempt is made to modify an object where modifications are not allowed + NOT_FOUND_ERR, /// an attempt was made to reference a node in a context where it does not exist + NOT_SUPPORTED_ERR, /// the implementation does not support the type of object requested + INUSE_ATTRIBUTE_ERR, /// an attempt is made to add an attribute that is already in use elsewhere + INVALID_STATE_ERR, /// a parameter or an operation is not supported by the underlying object + SYNTAX_ERR, /// an invalid or illegal string is specified + INVALID_MODIFICATION_ERR, /// an attempt is made to modify the type of the underlying object + NAMESPACE_ERR, /// an attempt is made to create or change an object in a way which is incorrect with regard to namespaces + INVALID_ACCESS_ERR, /// an attempt is made to use an object that is not, or is no longer, usable + + _NUMBER_OF_MESSAGES + }; + + DOMException(unsigned short code); + /// Creates a DOMException with the given error code. + + DOMException(const DOMException& exc); + /// Creates a DOMException by copying another one. + + ~DOMException() throw(); + /// Destroys the DOMException. + + DOMException& operator = (const DOMException& exc); + + const char* name() const throw(); + /// Returns a static string describing the exception. + + const char* className() const throw(); + /// Returns the name of the exception class. + + Poco::Exception* clone() const; + /// Creates an exact copy of the exception. + + void rethrow() const; + /// (Re)Throws the exception. + + unsigned short code() const; + /// Returns the DOM exception code. + +protected: + static const std::string& message(unsigned short code); + +private: + DOMException(); + + unsigned short _code; + + static const std::string MESSAGES[_NUMBER_OF_MESSAGES]; +}; + + +// +// inlines +// +inline unsigned short DOMException::code() const +{ + return _code; +} + + +} } // namespace Poco::XML + + +#endif // DOM_DOMException_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMImplementation.h b/vendor/invn/external/include/Poco/DOM/DOMImplementation.h new file mode 100644 index 0000000..75447f9 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMImplementation.h @@ -0,0 +1,84 @@ +// +// DOMImplementation.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMImplementation.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM DOMImplementation class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMImplementation_INCLUDED +#define DOM_DOMImplementation_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class DocumentType; +class Document; +class NamePool; + + +class XML_API DOMImplementation + /// The DOMImplementation interface provides a number of methods for + /// performing operations that are independent of any particular instance + /// of the document object model. + /// In this implementation, DOMImplementation is implemented as a singleton. +{ +public: + DOMImplementation(); + /// Creates the DOMImplementation. + + ~DOMImplementation(); + /// Destroys the DOMImplementation. + + bool hasFeature(const XMLString& feature, const XMLString& version) const; + /// Tests if the DOM implementation implements a specific feature. + /// + /// The only supported features are "XML", version "1.0" and "Core", + /// "Events", "MutationEvents" and "Traversal", version "2.0". + + // DOM Level 2 + DocumentType* createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const; + /// Creates an empty DocumentType node. Entity declarations and notations + /// are not made available. Entity reference expansions and default attribute + /// additions do not occur. + + Document* createDocument(const XMLString& namespaceURI, const XMLString& qualifiedName, DocumentType* doctype) const; + /// Creates an XML Document object of the specified type with its document element. + /// + /// Note: You can also create a Document directly using the new operator. + + static const DOMImplementation& instance(); + /// Returns a reference to the default DOMImplementation + /// object. + +private: + static const XMLString FEATURE_XML; + static const XMLString FEATURE_CORE; + static const XMLString FEATURE_EVENTS; + static const XMLString FEATURE_MUTATIONEVENTS; + static const XMLString FEATURE_TRAVERSAL; + static const XMLString VERSION_1_0; + static const XMLString VERSION_2_0; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DOMImplementation_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMObject.h b/vendor/invn/external/include/Poco/DOM/DOMObject.h new file mode 100644 index 0000000..a48e82d --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMObject.h @@ -0,0 +1,105 @@ +// +// DOMObject.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMObject.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOMObject class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMObject_INCLUDED +#define DOM_DOMObject_INCLUDED + + +#include "Poco/XML/XML.h" + + +namespace Poco { +namespace XML { + + +class XML_API DOMObject + /// The base class for all objects in the Document Object Model. + /// + /// DOMObject defines the rules for memory management + /// in this implementation of the DOM. Violation of these + /// rules, which are outlined in the following, results + /// in memory leaks or dangling pointers. + /// + /// Every object created by new or by a factory + /// method (for example, Document::create*) must be released + /// with a call to release() or autoRelease() when it + /// is no longer needed. + /// + /// Every object created by cloning or importing another + /// object must be released. + /// For every call to duplicate() there must be a matching + /// call to release(). + /// An object obtained via any other way must not be + /// released, except ownership of it has been explicitely + /// taken with a call to duplicate(). + /// + /// While DOMObjects are safe for use in multithreaded programs, + /// a DOMObject or one of its subclasses must not be accessed + /// from multiple threads simultaneously. +{ +public: + DOMObject(); + /// Creates the DOMObject. + /// The object's reference count is initialized to one. + + void duplicate() const; + /// Increases the object's reference count. + + void release() const; + /// Decreases the object's reference count. + /// If the reference count reaches zero, + /// the object is deleted. + + virtual void autoRelease() = 0; + /// Adds the object to an appropriate + /// AutoReleasePool, which is usually the + /// AutoReleasePool managed by the Document + /// to which this object belongs. + +protected: + virtual ~DOMObject(); + /// Destroys the DOMObject. + +private: + DOMObject(const DOMObject&); + DOMObject& operator = (const DOMObject&); + + mutable int _rc; +}; + + +// +// inlines +// +inline void DOMObject::duplicate() const +{ + ++_rc; +} + + +inline void DOMObject::release() const +{ + if (--_rc == 0) + delete this; +} + + +} } // namespace Poco::XML + + +#endif // DOM_DOMObject_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMParser.h b/vendor/invn/external/include/Poco/DOM/DOMParser.h new file mode 100644 index 0000000..440b605 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMParser.h @@ -0,0 +1,109 @@ +// +// DOMParser.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMParser.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMParser +// +// Definition of the DOMParser class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMParser_INCLUDED +#define DOM_DOMParser_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/SAX/SAXParser.h" + + +namespace Poco { +namespace XML { + + +class NamePool; +class Document; +class InputSource; +class EntityResolver; + + +class XML_API DOMParser + /// This is a convenience class that combines a + /// DOMBuilder with a SAXParser, with the optional + /// support of a WhitespaceFilter. +{ +public: + DOMParser(NamePool* pNamePool = 0); + /// Creates a new DOMParser. + /// If a NamePool is given, it becomes the Document's NamePool. + + ~DOMParser(); + /// Destroys the DOMParser. + + void setEncoding(const XMLString& encoding); + /// Sets the encoding used by the parser if no + /// encoding is specified in the XML document. + + const XMLString& getEncoding() const; + /// Returns the name of the encoding used by + /// the parser if no encoding is specified in + /// the XML document. + + void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding); + /// Adds an encoding to the parser. + + void setFeature(const XMLString& name, bool state); + /// Set the state of a feature. + /// + /// If a feature is not recognized by the DOMParser, it is + /// passed on to the underlying XMLReader. + /// + /// The only currently supported feature is + /// http://www.appinf.com/features/no-whitespace-in-element-content + /// which, when activated, causes the WhitespaceFilter to + /// be used. + + bool getFeature(const XMLString& name) const; + /// Look up the value of a feature. + /// + /// If a feature is not recognized by the DOMParser, the + /// DOMParser queries the underlying SAXParser for the feature. + + Document* parse(const XMLString& uri); + /// Parse an XML document from a location identified by an URI. + + Document* parse(InputSource* pInputSource); + /// Parse an XML document from a location identified by an InputSource. + + Document* parseString(const std::string& xml); + /// Parse an XML document from a string. + + Document* parseMemory(const char* xml, std::size_t size); + /// Parse an XML document from memory. + + EntityResolver* getEntityResolver() const; + /// Returns the entity resolver used by the underlying SAXParser. + + void setEntityResolver(EntityResolver* pEntityResolver); + /// Sets the entity resolver on the underlying SAXParser. + + static const XMLString FEATURE_FILTER_WHITESPACE; + +private: + SAXParser _saxParser; + NamePool* _pNamePool; + bool _filterWhitespace; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DOMParser_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMSerializer.h b/vendor/invn/external/include/Poco/DOM/DOMSerializer.h new file mode 100644 index 0000000..fe18319 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMSerializer.h @@ -0,0 +1,124 @@ +// +// DOMSerializer.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMSerializer.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMSerializer +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMSerializer_INCLUDED +#define DOM_DOMSerializer_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/SAX/XMLReader.h" + + +namespace Poco { +namespace XML { + + +class Node; +class Element; +class Text; +class Comment; +class ProcessingInstruction; +class Entity; +class CDATASection; +class Notation; +class Document; +class DocumentType; +class DocumentFragment; +class DeclHandler; +class LexicalHandler; + + +class XML_API DOMSerializer: public XMLReader + /// The DOMSerializer serializes a DOM document + /// into a sequence of SAX events which are + /// reported to the registered SAX event + /// handlers. + /// + /// The DOMWriter uses a DOMSerializer with an + /// XMLWriter to serialize a DOM document into + /// textual XML. +{ +public: + DOMSerializer(); + /// Creates the DOMSerializer. + + ~DOMSerializer(); + /// Destroys the DOMSerializer. + + void serialize(const Node* pNode); + /// Serializes a DOM node and its children + /// into a sequence of SAX events, which are + /// reported to the registered SAX event + /// handlers. + + // XMLReader + void setEntityResolver(EntityResolver* pResolver); + EntityResolver* getEntityResolver() const; + void setDTDHandler(DTDHandler* pDTDHandler); + DTDHandler* getDTDHandler() const; + void setContentHandler(ContentHandler* pContentHandler); + ContentHandler* getContentHandler() const; + void setErrorHandler(ErrorHandler* pErrorHandler); + ErrorHandler* getErrorHandler() const; + + void setFeature(const XMLString& featureId, bool state); + bool getFeature(const XMLString& featureId) const; + void setProperty(const XMLString& propertyId, const XMLString& value); + void setProperty(const XMLString& propertyId, void* value); + void* getProperty(const XMLString& propertyId) const; + +protected: + void parse(InputSource* pSource); + /// The DOMSerializer cannot parse an InputSource, + /// so this method simply throws an XMLException when invoked. + + void parse(const XMLString& systemId); + /// The DOMSerializer cannot parse from a system identifier, + /// so this method simply throws an XMLException when invoked. + + void parseMemoryNP(const char* xml, std::size_t size); + /// The DOMSerializer cannot parse from a system identifier, + /// so this method simply throws an XMLException when invoked. + + void iterate(const Node* pNode) const; + void handleNode(const Node* pNode) const; + void handleElement(const Element* pElement) const; + void handleCharacterData(const Text* pText) const; + void handleComment(const Comment* pComment) const; + void handlePI(const ProcessingInstruction* pPI) const; + void handleCDATASection(const CDATASection* pCDATA) const; + void handleDocument(const Document* pDocument) const; + void handleDocumentType(const DocumentType* pDocumentType) const; + void handleFragment(const DocumentFragment* pFragment) const; + void handleNotation(const Notation* pNotation) const; + void handleEntity(const Entity* pEntity) const; + +private: + EntityResolver* _pEntityResolver; + DTDHandler* _pDTDHandler; + ContentHandler* _pContentHandler; + ErrorHandler* _pErrorHandler; + DeclHandler* _pDeclHandler; + LexicalHandler* _pLexicalHandler; + + static const XMLString CDATA; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DOMSerializer_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DOMWriter.h b/vendor/invn/external/include/Poco/DOM/DOMWriter.h new file mode 100644 index 0000000..ceae43d --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DOMWriter.h @@ -0,0 +1,129 @@ +// +// DOMWriter.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DOMWriter.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMWriter +// +// Definition of class DOMWriter. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DOMWriter_INCLUDED +#define DOM_DOMWriter_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" +#include "Poco/XML/XMLStream.h" +#include "Poco/TextEncoding.h" + + +namespace Poco { +namespace XML { + + +class Node; +class Document; + + +class XML_API DOMWriter + /// The DOMWriter uses a DOMSerializer with an + /// XMLWriter to serialize a DOM document into + /// textual XML. +{ +public: + DOMWriter(); + /// Creates a DOMWriter. + + ~DOMWriter(); + /// Destroys a DOMWriter. + + void setEncoding(const std::string& encodingName, Poco::TextEncoding& textEncoding); + /// Sets the encoding, which will be reflected in the written XML declaration. + + const std::string& getEncoding() const; + /// Returns the encoding name set with setEncoding. + + void setOptions(int options); + /// Sets options for the internal XMLWriter. + /// + /// See class XMLWriter for available options. + + int getOptions() const; + /// Returns the options for the internal XMLWriter. + + void setNewLine(const std::string& newLine); + /// Sets the line ending characters for the internal + /// XMLWriter. See XMLWriter::setNewLine() for a list + /// of supported values. + + const std::string& getNewLine() const; + /// Returns the line ending characters used by the + /// internal XMLWriter. + + void setIndent(const std::string& indent); + /// Sets the string used for one indentation step. + /// + /// The default is a single TAB character. + /// The given string should only contain TAB or SPACE + /// characters (e.g., a single TAB character, or + /// two to four SPACE characters). + + const std::string& getIndent() const; + /// Returns the string used for one indentation step. + + void writeNode(XMLByteOutputStream& ostr, const Node* pNode); + /// Writes the XML for the given node to the specified stream. + + void writeNode(const std::string& systemId, const Node* pNode); + /// Writes the XML for the given node to the file specified in systemId, + /// using a standard file output stream (Poco::FileOutputStream). + +private: + std::string _encodingName; + Poco::TextEncoding* _pTextEncoding; + int _options; + std::string _newLine; + std::string _indent; +}; + + +// +// inlines +// +inline const std::string& DOMWriter::getEncoding() const +{ + return _encodingName; +} + + +inline int DOMWriter::getOptions() const +{ + return _options; +} + + +inline const std::string& DOMWriter::getNewLine() const +{ + return _newLine; +} + + +inline const std::string& DOMWriter::getIndent() const +{ + return _indent; +} + + +} } // namespace Poco::XML + + +#endif // DOM_DOMWriter_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DTDMap.h b/vendor/invn/external/include/Poco/DOM/DTDMap.h new file mode 100644 index 0000000..a3a925f --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DTDMap.h @@ -0,0 +1,69 @@ +// +// DTDMap.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DTDMap.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DTDMap class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DTDMap_INCLUDED +#define DOM_DTDMap_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/NamedNodeMap.h" + + +namespace Poco { +namespace XML { + + +class DocumentType; + + +class XML_API DTDMap: public NamedNodeMap + /// This implementation of NamedNodeMap + /// is returned by DocumentType::entities() + /// and DocumentType::notations(). +{ +public: + Node* getNamedItem(const XMLString& name) const; + Node* setNamedItem(Node* arg); + Node* removeNamedItem(const XMLString& name); + Node* item(unsigned long index) const; + unsigned long length() const; + + Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const; + Node* setNamedItemNS(Node* arg); + Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName); + + void autoRelease(); + +protected: + DTDMap(const DocumentType* pDocumentType, unsigned short type); + ~DTDMap(); + +private: + DTDMap(); + + const DocumentType* _pDocumentType; + unsigned short _type; + + friend class DocumentType; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DTDMap_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Document.h b/vendor/invn/external/include/Poco/DOM/Document.h new file mode 100644 index 0000000..407b372 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Document.h @@ -0,0 +1,279 @@ +// +// Document.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Document.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Document class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Document_INCLUDED +#define DOM_Document_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractContainerNode.h" +#include "Poco/DOM/DocumentEvent.h" +#include "Poco/DOM/Element.h" +#include "Poco/XML/XMLString.h" +#include "Poco/XML/NamePool.h" +#include "Poco/AutoReleasePool.h" + + +namespace Poco { +namespace XML { + + +class NamePool; +class DocumentType; +class DOMImplementation; +class DocumentFragment; +class Text; +class Comment; +class CDATASection; +class ProcessingInstruction; +class Attr; +class EntityReference; +class NodeList; +class Entity; +class Notation; + + +class XML_API Document: public AbstractContainerNode, public DocumentEvent + /// The Document interface represents the entire HTML or XML document. Conceptually, + /// it is the root of the document tree, and provides the primary access to the + /// document's data. + /// + /// Since elements, text nodes, comments, processing instructions, etc. cannot exist + /// outside the context of a Document, the Document interface also contains the + /// factory methods needed to create these objects. The Node objects created have a + /// ownerDocument attribute which associates them with the Document within whose + /// context they were created. +{ +public: + typedef Poco::AutoReleasePool AutoReleasePool; + + Document(NamePool* pNamePool = 0); + /// Creates a new document. If pNamePool == 0, the document + /// creates its own name pool, otherwise it uses the given name pool. + /// Sharing a name pool makes sense for documents containing instances + /// of the same schema, thus reducing memory usage. + + Document(DocumentType* pDocumentType, NamePool* pNamePool = 0); + /// Creates a new document. If pNamePool == 0, the document + /// creates its own name pool, otherwise it uses the given name pool. + /// Sharing a name pool makes sense for documents containing instances + /// of the same schema, thus reducing memory usage. + + NamePool& namePool(); + /// Returns a pointer to the documents Name Pool. + + AutoReleasePool& autoReleasePool(); + /// Returns a pointer to the documents Auto Release Pool. + + void collectGarbage(); + /// Releases all objects in the Auto Release Pool. + + void suspendEvents(); + /// Suspends all events until resumeEvents() is called. + + void resumeEvents(); + /// Resumes all events suspended with suspendEvent(); + + bool eventsSuspended() const; + /// Returns true if events are suspeded. + + bool events() const; + /// Returns true if events are not suspeded. + + const DocumentType* doctype() const; + /// The Document Type Declaration (see DocumentType) associated with this document. + /// For HTML documents as well as XML documents without a document type declaration + /// this returns null. The DOM Level 1 does not support editing the Document + /// Type Declaration. docType cannot be altered in any way, including through + /// the use of methods inherited from the Node interface, such as insertNode + /// or removeNode. + + const DOMImplementation& implementation() const; + /// The DOMImplementation object that handles this document. A DOM application + /// may use objects from multiple implementations. + + Element* documentElement() const; + /// This is a convenience attribute that allows direct access to the child node + /// that is the root element of the document. For HTML documents, this is the + /// element with the tagName "HTML". + + Element* createElement(const XMLString& tagName) const; + /// Creates an element of the type specified. Note that the instance returned + /// implements the Element interface, so attributes can be specified directly + /// on the returned object. + /// + /// In addition, if there are known attributes with default values, Attr nodes + /// representing them are automatically created and attached to the element. + + DocumentFragment* createDocumentFragment() const; + /// Creates an empty DocumentFragment object. + + Text* createTextNode(const XMLString& data) const; + /// Creates a text node given the specified string. + + Comment* createComment(const XMLString& data) const; + /// Creates a comment node given the specified string. + + CDATASection* createCDATASection(const XMLString& data) const; + /// Creates a CDATASection node whose value is the specified string. + + ProcessingInstruction* createProcessingInstruction(const XMLString& target, const XMLString& data) const; + /// Creates a ProcessingInstruction node given the specified target and data strings. + + Attr* createAttribute(const XMLString& name) const; + /// Creates an Attr of the given name. Note that the Attr instance can then + /// be set on an Element using the setAttributeNode method. + + EntityReference* createEntityReference(const XMLString& name) const; + /// Creates an EntityReference object. In addition, if the referenced entity + /// is known, the child list of the EntityReference node is made the same as + /// that of the corresponding Entity node. + + NodeList* getElementsByTagName(const XMLString& name) const; + /// Returns a NodeList of all Elements with a given tag name in the order + /// in which they would be encountered in a preorder traversal of the + /// document tree. + /// + /// The returned NodeList must be released with a call to release() + /// when no longer needed. + + // DOM Level 2 + Node* importNode(Node* importedNode, bool deep); + /// Imports a node from another document to this document. The returned node + /// has no parent; (parentNode is null). The source node is not altered or removed + /// from the original document; this method creates a new copy of the source + /// node. + /// For all nodes, importing a node creates a node object owned by the importing + /// document, with attribute values identical to the source node's nodeName + /// and nodeType, plus the attributes related to namespaces (prefix, localName, + /// and namespaceURI). As in the cloneNode operation on a Node, the source node + /// is not altered. + /// Additional information is copied as appropriate to the nodeType, attempting + /// to mirror the behavior expected if a fragment of XML or HTML source was + /// copied from one document to another, recognizing that the two documents + /// may have different DTDs in the XML case. + + Element* createElementNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const; + /// Creates an element of the given qualified name and namespace URI. + + Attr* createAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const; + /// Creates an attribute of the given qualified name and namespace URI. + + NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Returns a NodeList of all the Elements with a given local name and + /// namespace URI in the order in which they are encountered in a + /// preorder traversal of the Document tree. + + Element* getElementById(const XMLString& elementId) const; + /// Returns the Element whose ID is given by elementId. If no such + /// element exists, returns null. Behavior is not defined if more + /// than one element has this ID. + /// + /// Note: The DOM implementation must have information that says + /// which attributes are of type ID. Attributes with the name "ID" + /// are not of type ID unless so defined. Implementations that do + /// not know whether attributes are of type ID or not are expected to + /// return null. This implementation therefore returns null. + /// + /// See also the non-standard two argument variant of getElementById() + /// and getElementByIdNS(). + + // DocumentEvent + Event* createEvent(const XMLString& eventType) const; + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + + // EventTarget + bool dispatchEvent(Event* evt); + + // Extensions + Entity* createEntity(const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName) const; + /// Creates an Entity with the given name, publicId, systemId and notationName. + /// + /// This method is not part of the W3C Document Object Model. + + Notation* createNotation(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const; + /// Creates a Notation with the given name, publicId and systemId. + /// + /// This method is not part of the W3C Document Object Model. + + Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const; + /// Returns the first Element whose ID attribute (given in idAttribute) + /// has the given elementId. If no such element exists, returns null. + /// + /// This method is an extension to the W3C Document Object Model. + + Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const; + /// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName) + /// has the given elementId. If no such element exists, returns null. + /// + /// This method is an extension to the W3C Document Object Model. + +protected: + ~Document(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + + DocumentType* getDoctype(); + void setDoctype(DocumentType* pDoctype); + +private: + DocumentType* _pDocumentType; + NamePool* _pNamePool; + AutoReleasePool _autoReleasePool; + int _eventSuspendLevel; + + static const XMLString NODE_NAME; + + friend class DOMBuilder; +}; + + +// +// inlines +// +inline NamePool& Document::namePool() +{ + return *_pNamePool; +} + + +inline Document::AutoReleasePool& Document::autoReleasePool() +{ + return _autoReleasePool; +} + + +inline const DocumentType* Document::doctype() const +{ + return _pDocumentType; +} + + +inline DocumentType* Document::getDoctype() +{ + return _pDocumentType; +} + + +} } // namespace Poco::XML + + +#endif // DOM_Document_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DocumentEvent.h b/vendor/invn/external/include/Poco/DOM/DocumentEvent.h new file mode 100644 index 0000000..fd03cd0 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DocumentEvent.h @@ -0,0 +1,67 @@ +// +// DocumentEvent.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DocumentEvent.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM DocumentEvent interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DocumentEvent_INCLUDED +#define DOM_DocumentEvent_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class Event; + + +class XML_API DocumentEvent + /// The DocumentEvent interface provides a mechanism by which the user can create + /// an Event of a type supported by the implementation. It is expected that + /// the DocumentEvent interface will be implemented on the same object which + /// implements the Document interface in an implementation which supports the + /// Event model. +{ +public: + virtual Event* createEvent(const XMLString& eventType) const = 0; + /// Creates an event of the specified type. + /// + /// The eventType parameter specifies the type of Event interface to be created. + /// If the Event interface specified is supported by the implementation this + /// method will return a new Event of the interface type requested. If the Event + /// is to be dispatched via the dispatchEvent method the appropriate event init + /// method must be called after creation in order to initialize the Event's + /// values. As an example, a user wishing to synthesize some kind of UIEvent + /// would call createEvent with the parameter "UIEvents". The initUIEvent method + /// could then be called on the newly created UIEvent to set the specific type + /// of UIEvent to be dispatched and set its context information. + /// The createEvent method is used in creating Events when it is either inconvenient + /// or unnecessary for the user to create an Event themselves. In cases where + /// the implementation provided Event is insufficient, users may supply their + /// own Event implementations for use with the dispatchEvent method. + +protected: + virtual ~DocumentEvent(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DocumentEvent_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DocumentFragment.h b/vendor/invn/external/include/Poco/DOM/DocumentFragment.h new file mode 100644 index 0000000..27cbc4c --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DocumentFragment.h @@ -0,0 +1,86 @@ +// +// DocumentFragment.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DocumentFragment.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM DocumentFragment class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DocumentFragment_INCLUDED +#define DOM_DocumentFragment_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractContainerNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API DocumentFragment: public AbstractContainerNode + /// DocumentFragment is a "lightweight" or "minimal" Document object. It is + /// very common to want to be able to extract a portion of a document's tree + /// or to create a new fragment of a document. Imagine implementing a user command + /// like cut or rearranging a document by moving fragments around. It is desirable + /// to have an object which can hold such fragments and it is quite natural + /// to use a Node for this purpose. While it is true that a Document object + /// could fulfill this role, a Document object can potentially be a heavyweight + /// object, depending on the underlying implementation. What is really needed + /// for this is a very lightweight object. DocumentFragment is such an object. + /// + /// Furthermore, various operations -- such as inserting nodes as children of + /// another Node -- may take DocumentFragment objects as arguments; this results + /// in all the child nodes of the DocumentFragment being moved to the child + /// list of this node. + /// + /// The children of a DocumentFragment node are zero or more nodes representing + /// the tops of any sub-trees defining the structure of the document. DocumentFragment + /// nodes do not need to be well-formed XML documents (although they do need + /// to follow the rules imposed upon well-formed XML parsed entities, which + /// can have multiple top nodes). For example, a DocumentFragment might have + /// only one child and that child node could be a Text node. Such a structure + /// model represents neither an HTML document nor a well-formed XML document. + /// + /// When a DocumentFragment is inserted into a Document (or indeed any other + /// Node that may take children) the children of the DocumentFragment and not + /// the DocumentFragment itself are inserted into the Node. This makes the DocumentFragment + /// very useful when the user wishes to create nodes that are siblings; the + /// DocumentFragment acts as the parent of these nodes so that the user can + /// use the standard methods from the Node interface, such as insertBefore and + /// appendChild. +{ +public: + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + DocumentFragment(Document* pOwnerDocument); + DocumentFragment(Document* pOwnerDocument, const DocumentFragment& fragment); + ~DocumentFragment(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + static const XMLString NODE_NAME; + + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_DocumentFragment_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/DocumentType.h b/vendor/invn/external/include/Poco/DOM/DocumentType.h new file mode 100644 index 0000000..35ef46a --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/DocumentType.h @@ -0,0 +1,127 @@ +// +// DocumentType.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/DocumentType.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM DocumentType class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_DocumentType_INCLUDED +#define DOM_DocumentType_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractContainerNode.h" + + +namespace Poco { +namespace XML { + + +class NamedNodeMap; + + +class XML_API DocumentType: public AbstractContainerNode + /// Each Document has a doctype attribute whose value is either null or a DocumentType + /// object. The DocumentType interface in the DOM Level 1 Core provides an + /// interface to the list of entities that are defined for the document, and + /// little else because the effect of namespaces and the various XML scheme + /// efforts on DTD representation are not clearly understood as of this writing. + /// + /// The DOM Level 1 doesn't support editing DocumentType nodes. +{ +public: + const XMLString& name() const; + /// The name of the DTD; i.e., the name immediately following the + /// DOCTYPE keyword. + + NamedNodeMap* entities() const; + /// A NamedNodeMap containing the general entities, + /// both external and internal, declared in the DTD. + /// Duplicates are discarded. + /// + /// Note: In this implementation, only the + /// external entities are reported. + /// Every node in this map also implements the + /// Entity interface. + /// + /// The returned NamedNodeMap must be released with a call + /// to release() when no longer needed. + + NamedNodeMap* notations() const; + /// A NamedNodeMap containing the notations declared in the DTD. Duplicates + /// are discarded. Every node in this map also implements the Notation interface. + /// The DOM Level 1 does not support editing notations, therefore notations + /// cannot be altered in any way. + /// + /// The returned NamedNodeMap must be released with a call + /// to release() when no longer needed. + + // DOM Level 2 + const XMLString& publicId() const; + /// Returns the public identifier of the external DTD subset. + + const XMLString& systemId() const; + /// Returns the system identifier of the external DTD subset. + + const XMLString& internalSubset() const; + /// Returns the internal DTD subset. This implementation + /// returns an empty string. + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId); + DocumentType(Document* pOwner, const DocumentType& dt); + ~DocumentType(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + XMLString _name; + XMLString _publicId; + XMLString _systemId; + + friend class DOMImplementation; + friend class Document; + friend class DOMBuilder; +}; + + +// +// inlines +// +inline const XMLString& DocumentType::name() const +{ + return _name; +} + + +inline const XMLString& DocumentType::publicId() const +{ + return _publicId; +} + + +inline const XMLString& DocumentType::systemId() const +{ + return _systemId; +} + + +} } // namespace Poco::XML + + +#endif // DOM_DocumentType_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Element.h b/vendor/invn/external/include/Poco/DOM/Element.h new file mode 100644 index 0000000..ca1b480 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Element.h @@ -0,0 +1,221 @@ +// +// Element.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Element.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Element class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Element_INCLUDED +#define DOM_Element_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractContainerNode.h" +#include "Poco/XML/Name.h" + + +namespace Poco { +namespace XML { + + +class Attr; +class NodeList; +class Document; + + +class XML_API Element: public AbstractContainerNode + /// The Element interface represents an element in an XML document. + /// Elements may have attributes associated with them; since the Element interface + /// inherits from Node, the generic Node interface attribute attributes may + /// be used to retrieve the set of all attributes for an element. There are + /// methods on the Element interface to retrieve either an Attr object by name + /// or an attribute value by name. In XML, where an attribute value may contain + /// entity references, an Attr object should be retrieved to examine the possibly + /// fairly complex sub-tree representing the attribute value. +{ +public: + const XMLString& tagName() const; + /// Returns the name of the element. + /// + /// For example, in + /// + /// + /// ... + /// + /// + /// tagName has the value "elementExample". Note that this is case-preserving in XML, + /// as are all of the operations of the DOM. + + const XMLString& getAttribute(const XMLString& name) const; + /// Retrieves an attribute value by name. + /// + /// Returns the attribute's value, if the attribute + /// exists, or an empty string otherwise. + + void setAttribute(const XMLString& name, const XMLString& value); + /// Adds a new attribute. If an attribute with that name is already present + /// in the element, its value is changed to be that of the value parameter. + /// This value is a simple string; it is not parsed as it is being set. So any + /// markup (such as syntax to be recognized as an entity reference) is treated + /// as literal text, and needs to be appropriately escaped by the implementation + /// when it is written out. + + void removeAttribute(const XMLString& name); + /// Removes an attribute by name. + + Attr* getAttributeNode(const XMLString& name) const; + /// Retrieves an Attr node by name. + + Attr* setAttributeNode(Attr* newAttr); + /// Adds a new attribute. If an attribute with that name is already + /// present in the element, it is replaced by the new one. + + Attr* addAttributeNodeNP(Attr* oldAttr, Attr* newAttr); + /// For internal use only. + /// Adds a new attribute after oldAttr. + /// If oldAttr is 0, newAttr is set as first attribute. + /// Returns newAttr. + /// Does not fire any events. + + Attr* removeAttributeNode(Attr* oldAttr); + /// Removes the specified attribute. + + NodeList* getElementsByTagName(const XMLString& name) const; + /// Returns a NodeList of all descendant elements with a given tag + /// name, in the order in which they would be encountered in a + /// preorder traversal of the Element tree. + /// + /// The special name "*" matches all tags. + /// + /// The returned NodeList must be released with a call + /// to release() when no longer needed. + + void normalize(); + /// Puts all Text nodes in the full depth of the sub-tree underneath this Element, + /// including attribute nodes, into a "normal" form where only markup (e.g., + /// tags, comments, processing instructions, CDATA sections, and entity references) + /// separates Text nodes, i.e., there are no adjacent Text nodes. This can be + /// used to ensure that the DOM view of a document is the same as if it were + /// saved and re-loaded, and is useful when operations (such as XPointer + /// lookups) that depend on a particular document tree structure are to be used. + /// + /// Note: In cases where the document contains CDATASections, the normalize + /// operation alone may not be sufficient, since XPointers do not differentiate + /// between Text nodes and CDATASection nodes. + + // DOM Level 2 + const XMLString& getAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Retrieves an attribute value by name. + /// + /// Returns the attribute's value, if the attribute + /// exists, or an empty string otherwise. + + void setAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName, const XMLString& value); + /// Adds a new attribute. If an attribute with that name + /// is already present in the element, its value is changed + /// to be that of the value parameter. + + void removeAttributeNS(const XMLString& namespaceURI, const XMLString& localName); + /// Removes an attribute by name. + + Attr* getAttributeNodeNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Retrieves an Attr node by name. + + Attr* setAttributeNodeNS(Attr* newAttr); + /// Adds a new attribute. If an attribute with that name is already + /// present in the element, it is replaced by the new one. + + bool hasAttribute(const XMLString& name) const; + /// Returns true if and only if the element has the specified attribute. + + bool hasAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Returns true if and only if the element has the specified attribute. + + NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Returns a NodeList of all the descendant Elements with a given local name and namespace URI + /// in the order in which they are encountered in a preorder traversal of this Element tree. + /// + /// The special value "*" matches all namespaces, or local names respectively. + /// + /// The returned NodeList must be released with a call + /// to release() when no longer needed. + + const XMLString& namespaceURI() const; + XMLString prefix() const; + const XMLString& localName() const; + bool hasAttributes() const; + XMLString innerText() const; + + Element* getChildElement(const XMLString& name) const; + /// Returns the first child element with the given name, or null + /// if such an element does not exist. + /// + /// This method is an extension to the W3C Document Object Model. + + Element* getChildElementNS(const XMLString& namespaceURI, const XMLString& localName) const; + /// Returns the first child element with the given namespaceURI and localName, + /// or null if such an element does not exist. + /// + /// This method is an extension to the W3C Document Object Model. + + Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const; + /// Returns the first Element whose ID attribute (given in idAttribute) + /// has the given elementId. If no such element exists, returns null. + /// + /// This method is an extension to the W3C Document Object Model. + + Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const; + /// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName) + /// has the given elementId. If no such element exists, returns null. + /// + /// This method is an extension to the W3C Document Object Model. + + // Node + const XMLString& nodeName() const; + NamedNodeMap* attributes() const; + unsigned short nodeType() const; + +protected: + Element(Document* pOwnerDocument, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname); + Element(Document* pOwnerDocument, const Element& elem); + ~Element(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + + void dispatchNodeRemovedFromDocument(); + void dispatchNodeInsertedIntoDocument(); + +private: + const Name& _name; + Attr* _pFirstAttr; + + friend class Attr; + friend class Document; + friend class AttrMap; +}; + + +// +// inlines +// +inline const XMLString& Element::tagName() const +{ + return _name.qname(); +} + + +} } // namespace Poco::XML + + +#endif // DOM_Element_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/ElementsByTagNameList.h b/vendor/invn/external/include/Poco/DOM/ElementsByTagNameList.h new file mode 100644 index 0000000..885293e --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/ElementsByTagNameList.h @@ -0,0 +1,88 @@ +// +// ElementsByTagNameList.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/ElementsByTagNameList.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the ElementsByTagNameList and ElementsByTagNameListNS classes. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_ElementsByTagNameList_INCLUDED +#define DOM_ElementsByTagNameList_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/NodeList.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API ElementsByTagNameList: public NodeList + // This implementation of NodeList is returned + // by Document::getElementsByTagName() and + // Element::getElementsByTagName(). +{ +public: + Node* item(unsigned long index) const; + unsigned long length() const; + void autoRelease(); + +protected: + ElementsByTagNameList(const Node* pParent, const XMLString& name); + ~ElementsByTagNameList(); + + Node* find(const Node* pParent, unsigned long index) const; + + const Node* _pParent; + XMLString _name; + mutable unsigned long _count; + + friend class AbstractContainerNode; + friend class Element; + friend class Document; +}; + + +class XML_API ElementsByTagNameListNS: public NodeList + // This implementation of NodeList is returned + // by Document::getElementsByTagNameNS() and + // Element::getElementsByTagNameNS(). +{ +public: + virtual Node* item(unsigned long index) const; + virtual unsigned long length() const; + virtual void autoRelease(); + +protected: + ElementsByTagNameListNS(const Node* pParent, const XMLString& namespaceURI, const XMLString& localName); + ~ElementsByTagNameListNS(); + + Node* find(const Node* pParent, unsigned long index) const; + + const Node* _pParent; + XMLString _localName; + XMLString _namespaceURI; + mutable unsigned long _count; + + friend class AbstractContainerNode; + friend class Element; + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_ElementsByTagNameList_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Entity.h b/vendor/invn/external/include/Poco/DOM/Entity.h new file mode 100644 index 0000000..9ade38e --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Entity.h @@ -0,0 +1,128 @@ +// +// Entity.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Entity.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Entity class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Entity_INCLUDED +#define DOM_Entity_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractContainerNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API Entity: public AbstractContainerNode + /// This interface represents an entity, either parsed or unparsed, in an XML + /// document. Note that this models the entity itself not the entity declaration. + /// Entity declaration modeling has been left for a later Level of the DOM + /// specification. + /// + /// The nodeName attribute that is inherited from Node contains the name of + /// the entity. + /// + /// An XML processor may choose to completely expand entities before the structure + /// model is passed to the DOM; in this case there will be no EntityReference + /// nodes in the document tree. + /// + /// XML does not mandate that a non-validating XML processor read and process + /// entity declarations made in the external subset or declared in external + /// parameter entities. This means that parsed entities declared in the external + /// subset need not be expanded by some classes of applications, and that the + /// replacement value of the entity may not be available. When the replacement + /// value is available, the corresponding Entity node's child list represents + /// the structure of that replacement text. Otherwise, the child list is empty. + /// + /// The resolution of the children of the Entity (the replacement value) may + /// be lazily evaluated; actions by the user (such as calling the childNodes + /// method on the Entity Node) are assumed to trigger the evaluation. + /// + /// The DOM Level 1 does not support editing Entity nodes; if a user wants to + /// make changes to the contents of an Entity, every related EntityReference + /// node has to be replaced in the structure model by a clone of the Entity's + /// contents, and then the desired changes must be made to each of those clones + /// instead. Entity nodes and all their descendants are readonly. + /// + /// An Entity node does not have any parent. +{ +public: + const XMLString& publicId() const; + /// Returns the public identifier associated with + /// the entity, if specified. If the public identifier + /// was not specified, this is the empty string. + + const XMLString& systemId() const; + /// Returns the system identifier associated with + /// the entity, if specified. If the system identifier + /// was not specified, this is the empty string. + + const XMLString& notationName() const; + /// Returns, for unparsed entities, the name of the + /// notation for the entity. For parsed entities, this + /// is the empty string. + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName); + Entity(Document* pOwnerDocument, const Entity& entity); + ~Entity(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + static const XMLString NODE_NAME; + + XMLString _name; + XMLString _publicId; + XMLString _systemId; + XMLString _notationName; + + friend class Document; +}; + + +// +// inlines +// +inline const XMLString& Entity::publicId() const +{ + return _publicId; +} + + +inline const XMLString& Entity::systemId() const +{ + return _systemId; +} + + +inline const XMLString& Entity::notationName() const +{ + return _notationName; +} + + +} } // namespace Poco::XML + + +#endif // DOM_Entity_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/EntityReference.h b/vendor/invn/external/include/Poco/DOM/EntityReference.h new file mode 100644 index 0000000..32ef17d --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/EntityReference.h @@ -0,0 +1,75 @@ +// +// EntityReference.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/EntityReference.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM EntityReference class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_EntityReference_INCLUDED +#define DOM_EntityReference_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API EntityReference: public AbstractNode + /// EntityReference objects may be inserted into the structure model when an + /// entity reference is in the source document, or when the user wishes to insert + /// an entity reference. Note that character references and references to predefined + /// entities are considered to be expanded by the HTML or XML processor so that + /// characters are represented by their Unicode equivalent rather than by an + /// entity reference. Moreover, the XML processor may completely expand references + /// to entities while building the structure model, instead of providing EntityReference + /// objects. If it does provide such objects, then for a given EntityReference + /// node, it may be that there is no Entity node representing the referenced + /// entity. If such an Entity exists, then the child list of the EntityReference + /// node is the same as that of the Entity node. + /// + /// As for Entity nodes, EntityReference nodes and all their descendants are + /// readonly. + /// + /// The resolution of the children of the EntityReference (the replacement value + /// of the referenced Entity) may be lazily evaluated; actions by the user (such + /// as calling the childNodes method on the EntityReference node) are assumed + /// to trigger the evaluation. +{ +public: + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + EntityReference(Document* pOwnerDocument, const XMLString& name); + EntityReference(Document* pOwnerDocument, const EntityReference& ref); + ~EntityReference(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + XMLString _name; + + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_EntityReference_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Event.h b/vendor/invn/external/include/Poco/DOM/Event.h new file mode 100644 index 0000000..a437ebc --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Event.h @@ -0,0 +1,211 @@ +// +// Event.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Event.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the DOM Event class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Event_INCLUDED +#define DOM_Event_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" +#include "Poco/DOM/DOMObject.h" + + +namespace Poco { +namespace XML { + + +class EventTarget; +class Document; + + +class XML_API Event: public DOMObject + /// The Event interface is used to provide contextual information about an event + /// to the handler processing the event. An object which implements the Event + /// interface is generally passed as the first parameter to an event handler. + /// More specific context information is passed to event handlers by deriving + /// additional interfaces from Event which contain information directly relating + /// to the type of event they accompany. These derived interfaces are also implemented + /// by the object passed to the event listener. +{ +public: + enum PhaseType + { + CAPTURING_PHASE = 1, /// The event is currently being evaluated at the target EventTarget. + AT_TARGET = 2, /// The current event phase is the bubbling phase. + BUBBLING_PHASE = 3 /// The current event phase is the capturing phase. + }; + + const XMLString& type() const; + /// The name of the event (case-insensitive). The name must be an XML name. + + EventTarget* target() const; + /// Used to indicate the EventTarget to which the event was originally dispatched. + + EventTarget* currentTarget() const; + /// Used to indicate the EventTarget whose EventListeners are currently being + /// processed. This is particularly useful during capturing and bubbling. + + PhaseType eventPhase() const; + /// Used to indicate which phase of event flow is currently being evaluated. + + bool bubbles() const; + /// Used to indicate whether or not an event is a bubbling event. + /// If the event can bubble the value is true, else the value is false. + + bool cancelable() const; + /// Used to indicate whether or not an event can have its default action + /// prevented. If the default action can be prevented the value is + /// true, else the value is false. + + Poco::UInt64 timeStamp() const; + /// Used to specify the time (in milliseconds relative to the epoch) at + /// which the event was created. Due to the fact that some + /// systems may not provide this information the value of timeStamp may + /// be not available for all events. When not available, a + /// value of 0 will be returned. Examples of epoch time are the time of the + /// system start or 0:0:0 UTC 1st January 1970. + /// This implementation always returns 0. + + void stopPropagation(); + /// The stopPropagation method is used prevent further propagation of an + /// event during event flow. If this method is called by + /// any EventListener the event will cease propagating through the tree. + /// The event will complete dispatch to all listeners on the + /// current EventTarget before event flow stops. This method may be used + /// during any stage of event flow. + + void preventDefault(); + /// If an event is cancelable, the preventDefault method is used to signify + /// that the event is to be canceled, meaning any default + /// action normally taken by the implementation as a result of + /// the event will not occur. If, during any stage of event flow, the + /// preventDefault method is called the event is canceled. Any default + /// action associated with the event will not occur. Calling + /// this method for a non-cancelable event has no effect. Once + /// preventDefault has been called it will remain in effect throughout + /// the remainder of the event's propagation. This method may be + /// used during any stage of event flow. + + void initEvent(const XMLString& eventType, bool canBubble, bool isCancelable); + /// The initEvent method is used to initialize the value of an + /// Event created through the DocumentEvent interface. This method + /// may only be called before the Event has been dispatched via the + /// dispatchEvent method, though it may be called multiple + /// times during that phase if necessary. If called multiple + /// times the final invocation takes precedence. If called from + /// a subclass of Event interface only the values specified in the + /// initEvent method are modified, all other attributes are left unchanged. + + void autoRelease(); + +protected: + Event(Document* pOwnerDocument, const XMLString& type); + Event(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool isCancelable); + ~Event(); + + bool isCanceled() const; + /// returns true if and only if the event has been cancelled. + + bool isStopped() const; + /// returns true if and only if propagation of the event has been stopped. + + void setTarget(EventTarget* pTarget); + /// sets the target + + void setCurrentPhase(PhaseType phase); + /// sets the current phase + + void setCurrentTarget(EventTarget* pTarget); + /// sets the current target + +private: + Document* _pOwner; + XMLString _type; + EventTarget* _pTarget; + EventTarget* _pCurrentTarget; + PhaseType _currentPhase; + bool _bubbles; + bool _cancelable; + bool _canceled; + bool _stopped; + + friend class AbstractNode; +}; + + +// +// inlines +// +inline const XMLString& Event::type() const +{ + return _type; +} + + +inline EventTarget* Event::target() const +{ + return _pTarget; +} + + +inline EventTarget* Event::currentTarget() const +{ + return _pCurrentTarget; +} + + +inline Event::PhaseType Event::eventPhase() const +{ + return _currentPhase; +} + + +inline bool Event::bubbles() const +{ + return _bubbles; +} + + +inline bool Event::cancelable() const +{ + return _cancelable; +} + + +inline Poco::UInt64 Event::timeStamp() const +{ + return 0; +} + + +inline bool Event::isCanceled() const +{ + return _canceled; +} + + +inline bool Event::isStopped() const +{ + return _stopped; +} + + +} } // namespace Poco::XML + + +#endif // DOM_Event_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/EventDispatcher.h b/vendor/invn/external/include/Poco/DOM/EventDispatcher.h new file mode 100644 index 0000000..f0c2570 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/EventDispatcher.h @@ -0,0 +1,99 @@ +// +// EventDispatcher.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/EventDispatcher.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the EventDispatcher class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_EventDispatcher_INCLUDED +#define DOM_EventDispatcher_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" +#include + + +namespace Poco { +namespace XML { + + +class Event; +class EventListener; + + +class XML_API EventDispatcher + /// This helper class manages event listener subscriptions + /// and event dispatching for AbstractNode. + /// + /// The EventListener list is managed in such a way that + /// event listeners can be added and removed even + /// from within an EventListener, while events are being + /// dispatched. +{ +public: + EventDispatcher(); + /// Creates the EventDispatcher. + + ~EventDispatcher(); + /// Destroys the EventDispatcher. + + void addEventListener(const XMLString& type, EventListener* listener, bool useCapture); + /// Adds an EventListener to the internal list. + + void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture); + /// Removes an EventListener from the internal list. + /// + /// If a dispatch is currently in progress, the list + /// entry is only marked for deletion. + /// If no dispatch is currently in progress, all EventListeners + /// marked for deletion are removed from the list. + + void dispatchEvent(Event* evt); + /// Dispatches the event. + /// + /// Also removes all EventListeners marked for deletion from the + /// event dispatcher list. + + void captureEvent(Event* evt); + /// Dispatches the event in its capturing phase. + /// + /// Also removes all EventListeners marked for deletion from the + /// event dispatcher list. + + void bubbleEvent(Event* evt); + /// Dispatches the event in its bubbling phase. + /// + /// Also removes all EventListeners marked for deletion from the + /// event dispatcher list. + +private: + struct EventListenerItem + { + XMLString type; + EventListener* pListener; + bool useCapture; + }; + + typedef std::list EventListenerList; + + int _inDispatch; + EventListenerList _listeners; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_EventDispatcher_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/EventException.h b/vendor/invn/external/include/Poco/DOM/EventException.h new file mode 100644 index 0000000..05d0a74 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/EventException.h @@ -0,0 +1,83 @@ +// +// EventException.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/EventException.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the DOM EventException class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_EventException_INCLUDED +#define DOM_EventException_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLException.h" + + +namespace Poco { +namespace XML { + + +class XML_API EventException: public XMLException + /// Event operations may throw an EventException as + /// specified in their method descriptions. +{ +public: + enum + { + UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the + /// event before the method was called. Specification of the Event's + /// type as null or an empty string will also trigger this exception. + }; + + EventException(int code); + /// Creates an EventException with the given error code. + + EventException(const EventException& exc); + /// Creates an EventException by copying another one. + + ~EventException() throw(); + /// Destroys the EventException. + + EventException& operator = (const EventException& exc); + + const char* name() const throw(); + /// Returns a static string describing the exception. + + const char* className() const throw(); + /// Returns the name of the exception class. + + unsigned short code() const; + /// Returns the Event exception code. + +protected: + Poco::Exception* clone() const; + +private: + EventException(); +}; + + +// +// inlines +// +inline unsigned short EventException::code() const +{ + return UNSPECIFIED_EVENT_TYPE_ERR; +} + + +} } // namespace Poco::XML + + +#endif // DOM_EventException_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/EventListener.h b/vendor/invn/external/include/Poco/DOM/EventListener.h new file mode 100644 index 0000000..3ca7c5f --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/EventListener.h @@ -0,0 +1,59 @@ +// +// EventListener.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/EventListener.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the DOM EventListener interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_EventListener_INCLUDED +#define DOM_EventListener_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class Event; + + +class XML_API EventListener + /// The EventListener interface is the primary method for handling events. Users + /// implement the EventListener interface and register their listener on an + /// EventTarget using the AddEventListener method. The users should also remove + /// their EventListener from its EventTarget after they have completed using + /// the listener. + /// + /// When a Node is copied using the cloneNode method the EventListeners attached + /// to the source Node are not attached to the copied Node. If the user wishes + /// the same EventListeners to be added to the newly created copy the user must + /// add them manually. +{ +public: + virtual void handleEvent(Event* evt) = 0; + /// This method is called whenever an event occurs of the + /// type for which the EventListener interface was registered. + +protected: + virtual ~EventListener(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_EventListener_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/EventTarget.h b/vendor/invn/external/include/Poco/DOM/EventTarget.h new file mode 100644 index 0000000..0be97e2 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/EventTarget.h @@ -0,0 +1,78 @@ +// +// EventTarget.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/EventTarget.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the DOM EventTarget interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_EventTarget_INCLUDED +#define DOM_EventTarget_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/DOMObject.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class EventListener; +class Event; + + +class XML_API EventTarget: public DOMObject + /// The EventTarget interface is implemented by all Nodes in an implementation + /// which supports the DOM Event Model. Therefore, this interface can be obtained + /// by using binding-specific casting methods on an instance of the Node interface. + /// The interface allows registration and removal of EventListeners on an EventTarget + /// and dispatch of events to that EventTarget. +{ +public: + virtual void addEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0; + /// This method allows the registration of event listeners on + /// the event target. If an EventListener is added to an + /// EventTarget while it is processing an event, it will not + /// be triggered by the current actions but may be triggered + /// during a later stage of event flow, such as the bubbling phase. + /// If multiple identical EventListeners are registered on the same + /// EventTarget with the same parameters the duplicate instances are + /// discarded. They do not cause the EventListener to be called twice and since they are + /// discarded they do not need to be removed with the removeEventListener method. + + virtual void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0; + /// This method allows the removal of event listeners from the event + /// target. If an EventListener is removed from an EventTarget while it is + /// processing an event, it will not be triggered by the current actions. + /// EventListeners can never be invoked after being removed. + /// Calling removeEventListener with arguments which do not identify + /// any currently registered EventListener on the EventTarget has no effect. + + virtual bool dispatchEvent(Event* evt) = 0; + /// This method allows the dispatch of events into the implementations + /// event model. Events dispatched in this manner will have the same capturing and + /// bubbling behavior as events dispatched directly by the + /// implementation. The target of the event is the EventTarget on + /// which dispatchEvent is called. + +protected: + virtual ~EventTarget(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_EventTarget_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/MutationEvent.h b/vendor/invn/external/include/Poco/DOM/MutationEvent.h new file mode 100644 index 0000000..5eebb0d --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/MutationEvent.h @@ -0,0 +1,145 @@ +// +// MutationEvent.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/MutationEvent.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOMEvents +// +// Definition of the DOM MutationEvent class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_MutationEvent_INCLUDED +#define DOM_MutationEvent_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/Event.h" + + +namespace Poco { +namespace XML { + + +class Node; + + +class XML_API MutationEvent: public Event + /// The MutationEvent interface provides specific contextual + /// information associated with Mutation events. +{ +public: + enum AttrChangeType + { + MODIFICATION = 1, /// The Attr was modified in place. + ADDITION = 2, /// The Attr was just added. + REMOVAL = 3 /// The Attr was just removed. + }; + + Node* relatedNode() const; + /// relatedNode is used to identify a secondary node related to a mutation + /// event. For example, if a mutation event is dispatched + /// to a node indicating that its parent has changed, the relatedNode is the + /// changed parent. If an event is instead dispatched to a + /// subtree indicating a node was changed within it, the relatedNode is + /// the changed node. In the case of the DOMAttrModified + /// event it indicates the Attr node which was modified, added, or removed. + + const XMLString& prevValue() const; + /// prevValue indicates the previous value of the Attr node in DOMAttrModified + /// events, and of the CharacterData node in DOMCharDataModified events. + + const XMLString& newValue() const; + /// newValue indicates the new value of the Attr node in DOMAttrModified + /// events, and of the CharacterData node in DOMCharDataModified events. + + const XMLString& attrName() const; + /// attrName indicates the name of the changed Attr node in a DOMAttrModified event. + + AttrChangeType attrChange() const; + /// attrChange indicates the type of change which triggered the + /// DOMAttrModified event. The values can be MODIFICATION, + /// ADDITION, or REMOVAL. + + void initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode, + const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change); + /// The initMutationEvent method is used to initialize the value of a + /// MutationEvent created through the DocumentEvent + /// interface. This method may only be called before the MutationEvent + /// has been dispatched via the dispatchEvent method, + /// though it may be called multiple times during that phase if + /// necessary. If called multiple times, the final invocation takes + /// precedence. + + // Event Types + static const XMLString DOMSubtreeModified; + static const XMLString DOMNodeInserted; + static const XMLString DOMNodeRemoved; + static const XMLString DOMNodeRemovedFromDocument; + static const XMLString DOMNodeInsertedIntoDocument; + static const XMLString DOMAttrModified; + static const XMLString DOMCharacterDataModified; + +protected: + MutationEvent(Document* pOwnerDocument, const XMLString& type); + MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode); + MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode, + const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change); + ~MutationEvent(); + +private: + XMLString _prevValue; + XMLString _newValue; + XMLString _attrName; + AttrChangeType _change; + Node* _pRelatedNode; + + friend class AbstractNode; + friend class Document; +}; + + +// +// inlines +// +inline Node* MutationEvent::relatedNode() const +{ + return _pRelatedNode; +} + + +inline const XMLString& MutationEvent::prevValue() const +{ + return _prevValue; +} + + +inline const XMLString& MutationEvent::newValue() const +{ + return _newValue; +} + + +inline const XMLString& MutationEvent::attrName() const +{ + return _attrName; +} + + +inline MutationEvent::AttrChangeType MutationEvent::attrChange() const +{ + return _change; +} + + +} } // namespace Poco::XML + + +#endif // DOM_MutationEvent_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/NamedNodeMap.h b/vendor/invn/external/include/Poco/DOM/NamedNodeMap.h new file mode 100644 index 0000000..6f1f5ca --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/NamedNodeMap.h @@ -0,0 +1,95 @@ +// +// NamedNodeMap.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/NamedNodeMap.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM NamedNodeMap interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_NamedNodeMap_INCLUDED +#define DOM_NamedNodeMap_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/DOMObject.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class Node; + + +class XML_API NamedNodeMap: public DOMObject + /// Objects implementing the NamedNodeMap interface are used to represent collections + /// of nodes that can be accessed by name. Note that NamedNodeMap does not inherit + /// from NodeList; NamedNodeMaps are not maintained in any particular order. + /// Objects contained in an object implementing NamedNodeMap may also be accessed + /// by an ordinal index, but this is simply to allow convenient enumeration + /// of the contents of a NamedNodeMap, and does not imply that the DOM specifies + /// an order to these Nodes. + /// + /// NamedNodeMap objects in the DOM are live. + /// + /// A NamedNodeMap returned from a method must be released with a call to + /// release() when no longer needed. +{ +public: + virtual Node* getNamedItem(const XMLString& name) const = 0; + /// Retrieves a node specified by name. + + virtual Node* setNamedItem(Node* arg) = 0; + /// Adds a node using its nodeName attribute. If a node with that name is already + /// present in this map, it is replaced by the new one. + /// As the nodeName attribute is used to derive the name which the node must + /// be stored under, multiple nodes of certain types (those that have a "special" + /// string value) cannot be stored as the names would clash. This is seen as + /// preferable to allowing nodes to be aliased. + + virtual Node* removeNamedItem(const XMLString& name) = 0; + /// Removes a node specified by name. When this map contains the attributes + /// attached to an element, if the removed attribute is known to have a default + /// value, an attribute immediately appears containing the default value. + + virtual Node* item(unsigned long index) const = 0; + /// Returns the index'th item in the map. If index is greater + /// than or equal to the number of nodes in the map, this + /// returns null. + + virtual unsigned long length() const = 0; + /// Returns the number of nodes in the map. The range of valid + /// child node indices is 0 to length - 1 inclusive. + + // DOM Level 2 + virtual Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const = 0; + /// Retrieves a node specified by name. + + virtual Node* setNamedItemNS(Node* arg) = 0; + /// Adds a node using its nodeName attribute. + /// If a node with that namespace URI and that local name is already + /// present in this map, it is replaced by the new one. + + virtual Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) = 0; + /// Removes a node specified by name. + +protected: + virtual ~NamedNodeMap(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_NamedNodeMap_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Node.h b/vendor/invn/external/include/Poco/DOM/Node.h new file mode 100644 index 0000000..964b410 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Node.h @@ -0,0 +1,287 @@ +// +// Node.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Node.h#2 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Node interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Node_INCLUDED +#define DOM_Node_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/EventTarget.h" +#include "Poco/XML/XMLString.h" +#include "Poco/SAX/NamespaceSupport.h" + + +namespace Poco { +namespace XML { + + +class NamedNodeMap; +class Document; +class NodeList; + + +class XML_API Node: public EventTarget + /// The Node interface is the primary datatype for the entire Document Object + /// Model. It represents a single node in the document tree. While all objects + /// implementing the Node interface expose methods for dealing with children, + /// not all objects implementing the Node interface may have children. For + /// example, Text nodes may not have children, and adding children to such + /// nodes results in a DOMException being raised. + /// + /// The attributes nodeName, nodeValue and attributes are included as a mechanism + /// to get at node information without casting down to the specific derived + /// interface. In cases where there is no obvious mapping of these attributes + /// for a specific nodeType (e.g., nodeValue for an Element or attributes for + /// a Comment), this returns null. Note that the specialized interfaces may + /// contain additional and more convenient mechanisms to get and set the relevant + /// information. + /// + /// This implementation differs in some ways from the W3C DOM recommendations. + /// For example, the DOM specifies that some methods can return null strings. + /// Instead of null strings, this implementation always returns empty strings. +{ +public: + enum + { + ELEMENT_NODE = 1, /// The node is an Element. + ATTRIBUTE_NODE, /// The node is an Attr. + TEXT_NODE, /// The node is a Text node. + CDATA_SECTION_NODE, /// The node is a CDATASection. + ENTITY_REFERENCE_NODE, /// The node is an EntityReference. + ENTITY_NODE, /// The node is an Entity. + PROCESSING_INSTRUCTION_NODE, /// The node is a ProcessingInstruction. + COMMENT_NODE, /// The node is a Comment. + DOCUMENT_NODE, /// The node is a Document. + DOCUMENT_TYPE_NODE, /// The node is a DocumentType. + DOCUMENT_FRAGMENT_NODE, /// The node is a DocumentFragment. + NOTATION_NODE /// The node is a Notation. + }; + + virtual const XMLString& nodeName() const = 0; + /// Returns the name of this node, depending on its type. + + const XMLString& nodeValue() const; + /// Returns the value of this node, depending on its type. + + virtual const XMLString& getNodeValue() const = 0; + /// Returns the value of this node, depending on its type. + + virtual void setNodeValue(const XMLString& value) = 0; + /// Sets the value of this node. Throws an exception + /// if the node is read-only. + + virtual unsigned short nodeType() const = 0; + /// Returns a code representing the type of the underlying object. + + virtual Node* parentNode() const = 0; + /// The parent of this node. All nodes, except Attr, Document, DocumentFragment, + /// Entity, and Notation may have a parent. However, if a node has just been + /// created and not yet added to the tree, or if it has been removed from the + /// tree, this is null. + + virtual NodeList* childNodes() const = 0; + /// Returns a NodeList containing all children of this node. + /// + /// The returned NodeList must be released with a call + /// to release() when no longer needed. + + virtual Node* firstChild() const = 0; + /// Returns the first child of this node. If there is no such + /// node, this returns null. + + virtual Node* lastChild() const = 0; + /// Returns the last child of this node. If there is no such + /// node, this returns null. + + virtual Node* previousSibling() const = 0; + /// Returns the node immediately preceding this node. If there + /// is no such node, this returns null. + + virtual Node* nextSibling() const = 0; + /// Returns the node immediately following this node. If there + /// is no such node, this returns null. + + virtual NamedNodeMap* attributes() const = 0; + /// Returns a NamedNodeMap containing the attributes of this + /// node (if it is an Element) or null otherwise. + /// + /// The returned NamedNodeMap must be released with a call + /// to release() when no longer needed. + + virtual Document* ownerDocument() const = 0; + /// Returns the Document object associated with this node. + /// This is also the Document object used to create new nodes. + /// When this node is a Document, this is null. + + virtual Node* insertBefore(Node* newChild, Node* refChild) = 0; + /// Inserts the node newChild before the existing child node refChild. + /// + /// If refChild is null, insert newChild at the end of the list of children. + /// If newChild is a DocumentFragment object, all of its children are + /// inserted in the same order, before refChild. If the newChild is already + /// in the tree, it is first removed. + + virtual Node* replaceChild(Node* newChild, Node* oldChild) = 0; + /// Replaces the child node oldChild with newChild in the list of children, + /// and returns the oldChild node. + /// If newChild is a DocumentFragment object, oldChild is replaced by all of + /// the DocumentFragment children, which are inserted in the same order. If + /// the newChild is already in the tree, it is first removed. + + virtual Node* removeChild(Node* oldChild) = 0; + /// Removes the child node indicated by oldChild from the list of children + /// and returns it. + + virtual Node* appendChild(Node* newChild) = 0; + /// Appends the node newChild to the end of the list of children of this node. + /// If newChild is already in the tree, it is first removed. + + virtual bool hasChildNodes() const = 0; + /// This is a convenience method to allow easy determination of whether a + /// node has any children. + /// Returns true if the node has any children, false otherwise. + + virtual Node* cloneNode(bool deep) const = 0; + /// Returns a duplicate of this node, i.e., serves as a generic copy constructor + /// for nodes. The duplicate node has no parent; (parentNode is null.). + /// Cloning an Element copies all attributes and their values, including those + /// generated by the XML processor to represent defaulted attributes, but this + /// method does not copy any text it contains unless it is a deep clone, since + /// the text is contained in a child Text node. Cloning an Attribute directly, + /// as opposed to be cloned as part of an Element cloning operation, returns + /// a specified attribute (specified is true). Cloning any other type of node + /// simply returns a copy of this node. + /// Note that cloning an immutable subtree results in a mutable copy, but the + /// children of an EntityReference clone are readonly. In addition, clones of + /// unspecified Attr nodes are specified. And, cloning Document, DocumentType, + /// Entity, and Notation nodes is implementation dependent. + + // DOM Level 2 + virtual void normalize() = 0; + /// Puts all Text nodes in the full depth of the sub-tree underneath this Node, + /// including attribute nodes, into a "normal" form where only structure (e.g., + /// elements, comments, processing instructions, CDATA sections, and entity + /// references) separates Text nodes, i.e., there are neither adjacent Text + /// nodes nor empty Text nodes. This can be used to ensure that the DOM view + /// of a document is the same as if it were saved and re-loaded, and is useful + /// when operations (such as XPointer lookups) that depend on a particular + /// document tree structure are to be used. + /// + /// Note: In cases where the document contains CDATASections, the normalize + /// operation alone may not be sufficient, since XPointers do not differentiate + /// between Text nodes and CDATASection nodes. + + virtual bool isSupported(const XMLString& feature, const XMLString& version) const = 0; + /// Tests whether the DOM implementation implements a specific + /// feature and that feature is supported by this node. + + virtual const XMLString& namespaceURI() const = 0; + /// Returns the namespace URI of the node. + /// This is not a computed value that is the result of a namespace lookup based on an + /// examination of the namespace declarations in scope. It is merely the namespace URI + /// given at creation time. + /// + /// For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a + /// DOM Level 1 method, such as createElement from the Document interface, this is always the + /// empty string. + + virtual XMLString prefix() const = 0; + /// Returns the namespace prefix from the qualified name of the node. + + virtual const XMLString& localName() const = 0; + /// Returns the local name of the node. + + virtual bool hasAttributes() const = 0; + /// Returns whether this node (if it is an element) has any attributes. + + // Extensions + typedef Poco::XML::NamespaceSupport NSMap; + + virtual XMLString innerText() const = 0; + /// Returns a string containing the concatenated values of the node + /// and all its child nodes. + /// + /// This method is not part of the W3C Document Object Model. + + virtual Node* getNodeByPath(const XMLString& path) const = 0; + /// Searches a node (element or attribute) based on a simplified XPath + /// expression. + /// + /// Only simple XPath expressions are supported. These are the slash + /// notation for specifying paths to elements, and the square bracket + /// expression for finding elements by their index, by attribute value, + /// or finding attributes by names. + /// + /// The slash at the beginning is optional, the evaluation always starts + /// at this element. A double-slash at the beginning recursively searches + /// the entire subtree for the first element. + /// + /// Examples: + /// elem1/elem2/elem3 + /// /elem1/elem2/elem3 + /// /elem1/elem2[1] + /// /elem1/elem2[@attr1] + /// /elem1/elem2[@attr1='value'] + /// //elem2[@attr1='value'] + /// //[@attr1='value'] + /// + /// This method is an extension to the W3C Document Object Model. + + virtual Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const = 0; + /// Searches a node (element or attribute) based on a simplified XPath + /// expression. The given NSMap must contain mappings from namespace + /// prefixes to namespace URIs for all namespace prefixes used in + /// the path expression. + /// + /// Only simple XPath expressions are supported. These are the slash + /// notation for specifying paths to elements, and the square bracket + /// expression for finding elements by their index, by attribute value, + /// or finding attributes by names. + /// + /// The slash at the beginning is optional, the evaluation always starts + /// at this element. A double-slash at the beginning recursively searches + /// the entire subtree for the first element. + /// + /// Examples: + /// /ns1:elem1/ns2:elem2/ns2:elem3 + /// /ns1:elem1/ns2:elem2[1] + /// /ns1:elem1/ns2:elem2[@attr1] + /// /ns1:elem1/ns2:elem2[@attr1='value'] + /// //ns2:elem2[@ns1:attr1='value'] + /// //[@ns1:attr1='value'] + /// + /// This method is an extension to the W3C Document Object Model. + +protected: + virtual ~Node(); +}; + + +// +// inlines +// +inline const XMLString& Node::nodeValue() const +{ + return getNodeValue(); +} + + +} } // namespace Poco::XML + + +#endif // DOM_Node_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/NodeAppender.h b/vendor/invn/external/include/Poco/DOM/NodeAppender.h new file mode 100644 index 0000000..2279343 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/NodeAppender.h @@ -0,0 +1,83 @@ +// +// NodeAppender.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/NodeAppender.h#1 $ +// +// Library: XML +// Package: DOM +// Module: NodeAppender +// +// Definition of the NodeAppender class. +// +// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_NodeAppender_INCLUDED +#define DOM_NodeAppender_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/Node.h" + + +namespace Poco { +namespace XML { + + +class AbstractNode; +class Element; + + +class XML_API NodeAppender + /// The NodeAppender class provides a very fast way to + /// build larger DOM documents. + /// + /// In the DOM, child nodes are usually appended to a parent + /// node using the appendChild() method. For nodes containing + /// more than a few children, this method can be quite slow, + /// due to the way it's implemented, and because of the + /// requirements of the DOM specification. + /// + /// While the NodeAppender is being used on an Element, no + /// children-modifying methods of that Element must be used. + /// + /// This class is not part of the DOM specification. +{ +public: + NodeAppender(Element* parent); + /// Creates the NodeAppender for the given parent node, + /// which must be an Element. + + ~NodeAppender(); + /// Destroys the NodeAppender. + + void appendChild(Node* newChild); + /// Appends the node newChild to the end of the list of children of + /// the parent node specified in the constructor. + /// If the newChild is already in the tree, it is first removed. + /// + /// NewChild can be a DocumentFragment. In this case, all children + /// of the fragment become children of the parent element. + /// + /// In order to speed up the function, no DOM events + /// are fired. + +private: + NodeAppender(); + NodeAppender(const NodeAppender&); + NodeAppender& operator = (const NodeAppender&); + + Element* _pParent; + AbstractNode* _pLast; +}; + + +} } // namespace Poco::XML + + +#endif // #include "Poco/XML/XML.h" + diff --git a/vendor/invn/external/include/Poco/DOM/NodeFilter.h b/vendor/invn/external/include/Poco/DOM/NodeFilter.h new file mode 100644 index 0000000..b6c4da4 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/NodeFilter.h @@ -0,0 +1,148 @@ +// +// NodeFilter.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/NodeFilter.h#1 $ +// +// Library: XML +// Package: DOM +// Module: NodeFilter +// +// Definition of the DOM NodeFilter interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_NodeFilter_INCLUDED +#define DOM_NodeFilter_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class Node; + + +class XML_API NodeFilter + /// Filters are objects that know how to "filter out" nodes. If a NodeIterator + /// or TreeWalker is given a NodeFilter, it applies the filter before it returns + /// the next node. If the filter says to accept the node, the traversal logic + /// returns it; otherwise, traversal looks for the next node and pretends that + /// the node that was rejected was not there. + /// + /// The DOM does not provide any filters. NodeFilter is just an interface that + /// users can implement to provide their own filters. + /// + /// NodeFilters do not need to know how to traverse from node to node, nor do + /// they need to know anything about the data structure that is being traversed. + /// This makes it very easy to write filters, since the only thing they have + /// to know how to do is evaluate a single node. One filter may be used with + /// a number of different kinds of traversals, encouraging code reuse. +{ +public: + enum + { + FILTER_ACCEPT = 1, + /// Accept the node. Navigation methods defined for NodeIterator or TreeWalker will return this node. + + FILTER_REJECT = 2, + /// Reject the node. Navigation methods defined for NodeIterator or TreeWalker + /// will not return this node. For TreeWalker, the children of this node will + /// also be rejected. NodeIterators treat this as a synonym for FILTER_SKIP. + + FILTER_SKIP = 3 + /// Skip this single node. Navigation methods defined for NodeIterator or TreeWalker + /// will not return this node. For both NodeIterator and TreeWalker, the children + /// of this node will still be considered. + }; + + enum WhatToShow + /// These are the available values for the whatToShow parameter used in TreeWalkers + /// and NodeIterators. They are the same as the set of possible types for Node, + /// and their values are derived by using a bit position corresponding to the + /// value of nodeType for the equivalent node type. If a bit in whatToShow is + /// set false, that will be taken as a request to skip over this type of node; + /// the behavior in that case is similar to that of FILTER_SKIP. + /// + /// Note that if node types greater than 32 are ever introduced, they may not + /// be individually testable via whatToShow. If that need should arise, it can + /// be handled by selecting SHOW_ALL together with an appropriate NodeFilter. + { + SHOW_ALL = 0xFFFFFFFF, + /// Show all Nodes. + + SHOW_ELEMENT = 0x00000001, + /// Show Element nodes. + + SHOW_ATTRIBUTE = 0x00000002, + /// Show Attr nodes. This is meaningful only when creating an iterator or tree-walker + /// with an attribute node as its root; in this case, it means that the attribute + /// node will appear in the first position of the iteration or traversal. Since + /// attributes are never children of other nodes, they do not appear when traversing + /// over the document tree. + + SHOW_TEXT = 0x00000004, + /// Show Text nodes. + + SHOW_CDATA_SECTION = 0x00000008, + /// Show CDATASection nodes. + + SHOW_ENTITY_REFERENCE = 0x00000010, + /// Show EntityReference nodes. + + SHOW_ENTITY = 0x00000020, + /// Show Entity nodes. This is meaningful only when creating an iterator or + /// tree-walker with an Entity node as its root; in this case, it means that + /// the Entity node will appear in the first position of the traversal. Since + /// entities are not part of the document tree, they do not appear when traversing + /// over the document tree. + + SHOW_PROCESSING_INSTRUCTION = 0x00000040, + /// Show ProcessingInstruction nodes. + + SHOW_COMMENT = 0x00000080, + /// Show Comment nodes. + + SHOW_DOCUMENT = 0x00000100, + /// Show Document nodes. + + SHOW_DOCUMENT_TYPE = 0x00000200, + /// Show DocumentType nodes. + + SHOW_DOCUMENT_FRAGMENT = 0x00000400, + /// Show DocumentFragment nodes. + + SHOW_NOTATION = 0x00000800 + /// Show Notation nodes. This is meaningful only when creating an iterator or + /// tree-walker with a Notation node as its root; in this case, it means that + /// the Notation node will appear in the first position of the traversal. Since + /// notations are not part of the document tree, they do not appear when traversing + /// over the document tree. + }; + + virtual short acceptNode(Node* node) = 0; + /// Test whether a specified node is visible in the logical view of a TreeWalker + /// or NodeIterator. This function will be called by the implementation of TreeWalker + /// and NodeIterator; it is not normally called directly from user code. (Though + /// you could do so if you wanted to use the same filter to guide your own application + /// logic.) + /// + /// Returns FILTER_ACCEPT, FILTER_REJECT or FILTER_SKIP. + +protected: + virtual ~NodeFilter(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_NodeFilter_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/NodeIterator.h b/vendor/invn/external/include/Poco/DOM/NodeIterator.h new file mode 100644 index 0000000..a9a4d01 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/NodeIterator.h @@ -0,0 +1,169 @@ +// +// NodeIterator.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/NodeIterator.h#1 $ +// +// Library: XML +// Package: DOM +// Module: NodeIterator +// +// Definition of the DOM NodeIterator class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_NodeIterator_INCLUDED +#define DOM_NodeIterator_INCLUDED + + +#include "Poco/XML/XML.h" + + +namespace Poco { +namespace XML { + + +class Node; +class NodeFilter; + + +class XML_API NodeIterator + /// Iterators are used to step through a set of nodes, e.g. the set of nodes + /// in a NodeList, the document subtree governed by a particular Node, the results + /// of a query, or any other set of nodes. The set of nodes to be iterated is + /// determined by the implementation of the NodeIterator. DOM Level 2 specifies + /// a single NodeIterator implementation for document-order traversal of a document + /// subtree. + /// + /// A NodeIterator can be directly instantiated using one of its constructors - + /// the DocumentTraversal interface is not needed and therefore not implemented. + /// Unlike most other DOM classes, NodeIterator supports value semantics. + /// + /// If the NodeIterator's current node is removed from the document, the + /// result of calling any of the movement methods is undefined. This behavior does + /// not conform to the DOM Level 2 Traversal specification. +{ +public: + NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0); + /// Creates a NodeIterator over the subtree rooted at the specified node. + + NodeIterator(const NodeIterator& iterator); + /// Creates a NodeIterator by copying another NodeIterator. + + NodeIterator& operator = (const NodeIterator& iterator); + /// Assignment operator. + + ~NodeIterator(); + /// Destroys the NodeIterator. + + Node* root() const; + /// The root node of the NodeIterator, as specified when it was created. + + unsigned long whatToShow() const; + /// This attribute determines which node types are presented via the iterator. + /// The available set of constants is defined in the NodeFilter interface. + /// Nodes not accepted by whatToShow will be skipped, but their children may + /// still be considered. Note that this skip takes precedence over the filter, + /// if any. + + NodeFilter* filter() const; + /// The NodeFilter used to screen nodes. + + bool expandEntityReferences() const; + /// The value of this flag determines whether the children of entity reference + /// nodes are visible to the iterator. If false, they and their descendants + /// will be rejected. Note that this rejection takes precedence over whatToShow + /// and the filter. Also note that this is currently the only situation where + /// NodeIterators may reject a complete subtree rather than skipping individual + /// nodes. + /// + /// To produce a view of the document that has entity references expanded and + /// does not expose the entity reference node itself, use the whatToShow flags + /// to hide the entity reference node and set expandEntityReferences to true + /// when creating the iterator. To produce a view of the document that has entity + /// reference nodes but no entity expansion, use the whatToShow flags to show + /// the entity reference node and set expandEntityReferences to false. + /// + /// This implementation does not support entity reference expansion and + /// thus always returns false. + + Node* nextNode(); + /// Returns the next node in the set and advances the position of the iterator + /// in the set. After a NodeIterator is created, the first call to nextNode() + /// returns the first node in the set. + + Node* previousNode(); + /// Returns the previous node in the set and moves the position of the NodeIterator + /// backwards in the set. + + Node* currentNodeNP() const; + /// Returns the current node in the set. + /// + /// Leaves the NodeIterator unchanged. + /// + /// Warning: This is a proprietary extension to the DOM Level 2 NodeIterator + /// interface. + + void detach(); + /// Detaches the NodeIterator from the set which it iterated over, releasing + /// any computational resources and placing the iterator in the INVALID state. + /// After detach has been invoked, calls to nextNode or previousNode will raise + /// the exception INVALID_STATE_ERR. + +protected: + bool accept(Node* pNode) const; + Node* next() const; + Node* previous() const; + Node* last(); + +private: + NodeIterator(); + + Node* _pRoot; + unsigned long _whatToShow; + NodeFilter* _pFilter; + Node* _pCurrent; +}; + + +// +// inlines +// +inline Node* NodeIterator::root() const +{ + return _pRoot; +} + + +inline Node* NodeIterator::currentNodeNP() const +{ + return _pCurrent; +} + + +inline unsigned long NodeIterator::whatToShow() const +{ + return _whatToShow; +} + + +inline NodeFilter* NodeIterator::filter() const +{ + return _pFilter; +} + + +inline bool NodeIterator::expandEntityReferences() const +{ + return false; +} + + +} } // namespace Poco::XML + + +#endif // DOM_NodeIterator_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/NodeList.h b/vendor/invn/external/include/Poco/DOM/NodeList.h new file mode 100644 index 0000000..59ca0a8 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/NodeList.h @@ -0,0 +1,63 @@ +// +// NodeList.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/NodeList.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM NodeList interface. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_NodeList_INCLUDED +#define DOM_NodeList_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/DOMObject.h" + + +namespace Poco { +namespace XML { + + +class Node; + + +class XML_API NodeList: public DOMObject + /// The NodeList interface provides the abstraction of an ordered + /// collection of nodes, without defining or constraining how this + /// collection is implemented. + /// + /// The items in the NodeList are accessible via an integral index, + /// starting from 0. + /// + /// A NodeList returned from a method must be released with a call to + /// release() when no longer needed. +{ +public: + virtual Node* item(unsigned long index) const = 0; + /// Returns the index'th item in the collection. If index is + /// greater than or equal to the number of nodes in the list, + /// this returns null. + + virtual unsigned long length() const = 0; + /// Returns the number of nodes in the list. The range of valid + /// node indices is 0 to length - 1 inclusive. + +protected: + virtual ~NodeList(); +}; + + +} } // namespace Poco::XML + + +#endif // DOM_NodeList_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Notation.h b/vendor/invn/external/include/Poco/DOM/Notation.h new file mode 100644 index 0000000..990208c --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Notation.h @@ -0,0 +1,95 @@ +// +// Notation.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Notation.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Notation class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Notation_INCLUDED +#define DOM_Notation_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API Notation: public AbstractNode + /// This interface represents a notation declared in the DTD. A notation either + /// declares, by name, the format of an unparsed entity (see section 4.7 of + /// the XML 1.0 specification ), + /// or is used for formal declaration of processing + /// instruction targets (see section 2.6 of the XML 1.0 specification). + /// The nodeName attribute inherited from Node is set to the declared name of + /// the notation. + /// + /// The DOM Level 1 does not support editing Notation nodes; they are therefore + /// readonly. + /// + /// A Notation node does not have any parent. +{ +public: + const XMLString& publicId() const; + /// Returns the public identifier of this notation. + /// If not specified, this is an empty string (and not null, + /// as in the DOM specification). + + const XMLString& systemId() const; + /// Returns the system identifier of this notation. + /// If not specified, this is an empty string (and not null, + /// as in the DOM specification). + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + +protected: + Notation(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId); + Notation(Document* pOwnerDocument, const Notation& notation); + ~Notation(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + XMLString _name; + XMLString _publicId; + XMLString _systemId; + + friend class Document; +}; + + +// +// inlines +// +inline const XMLString& Notation::publicId() const +{ + return _publicId; +} + + +inline const XMLString& Notation::systemId() const +{ + return _systemId; +} + + +} } // namespace Poco::XML + + +#endif // DOM_Notation_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/ProcessingInstruction.h b/vendor/invn/external/include/Poco/DOM/ProcessingInstruction.h new file mode 100644 index 0000000..f0f5c62 --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/ProcessingInstruction.h @@ -0,0 +1,101 @@ +// +// ProcessingInstruction.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/ProcessingInstruction.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM ProcessingInstruction class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_ProcessingInstruction_INCLUDED +#define DOM_ProcessingInstruction_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/AbstractNode.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API ProcessingInstruction: public AbstractNode + /// The ProcessingInstruction interface represents a "processing instruction", + /// used in XML as a way to keep processor-specific information in the text + /// of the document. +{ +public: + const XMLString& target() const; + /// Returns the target of this processing instruction. + /// XML defines this as being the first token following + /// the markup that begins the processing instruction. + + const XMLString& data() const; + /// Returns the content of this processing instruction. This is from the first non + /// white space character after the target to the character immediately preceding + /// the ?>. + + const XMLString& getData() const; + /// Returns the content of this processing instruction. This is from the first non + /// white space character after the target to the character immediately preceding + /// the ?>. + + void setData(const XMLString& data); + /// Sets the content of this processing instruction. + + // Node + const XMLString& nodeName() const; + const XMLString& getNodeValue() const; + void setNodeValue(const XMLString& data); + unsigned short nodeType() const; + +protected: + ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data); + ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction); + ~ProcessingInstruction(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + XMLString _target; + XMLString _data; + + friend class Document; +}; + + +// +// inlines +// +inline const XMLString& ProcessingInstruction::target() const +{ + return _target; +} + + +inline const XMLString& ProcessingInstruction::data() const +{ + return _data; +} + + +inline const XMLString& ProcessingInstruction::getData() const +{ + return _data; +} + + +} } // namespace Poco::XML + + +#endif // DOM_ProcessingInstruction_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/Text.h b/vendor/invn/external/include/Poco/DOM/Text.h new file mode 100644 index 0000000..ebc90bc --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/Text.h @@ -0,0 +1,81 @@ +// +// Text.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/Text.h#1 $ +// +// Library: XML +// Package: DOM +// Module: DOM +// +// Definition of the DOM Text class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_Text_INCLUDED +#define DOM_Text_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/DOM/CharacterData.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class XML_API Text: public CharacterData + /// The Text interface inherits from CharacterData and represents the textual + /// content (termed character data in XML) of an Element or Attr. If there is + /// no markup inside an element's content, the text is contained in a single + /// object implementing the Text interface that is the only child of the element. + /// If there is markup, it is parsed into the information items (elements, comments, + /// etc.) and Text nodes that form the list of children of the element. + /// + /// When a document is first made available via the DOM, there is only one Text + /// node for each block of text. Users may create adjacent Text nodes that represent + /// the contents of a given element without any intervening markup, but should + /// be aware that there is no way to represent the separations between these + /// nodes in XML or HTML, so they will not (in general) persist between DOM + /// editing sessions. The normalize() method on Element merges any such adjacent + /// Text objects into a single node for each block of text. +{ +public: + Text* splitText(unsigned long offset); + /// Breaks this node into two nodes at the specified offset, keeping both in + /// the tree as siblings. This node then only contains all the content up to + /// the offset point. A new node of the same type, which is inserted as the + /// next sibling of this node, contains all the content at and after the offset + /// point. When the offset is equal to the length of this node, the new node + /// has no data. + + // Node + const XMLString& nodeName() const; + unsigned short nodeType() const; + + // Non-standard extensions + XMLString innerText() const; + +protected: + Text(Document* pOwnerDocument, const XMLString& data); + Text(Document* pOwnerDocument, const Text& text); + ~Text(); + + Node* copyNode(bool deep, Document* pOwnerDocument) const; + +private: + static const XMLString NODE_NAME; + + friend class Document; +}; + + +} } // namespace Poco::XML + + +#endif // DOM_Text_INCLUDED diff --git a/vendor/invn/external/include/Poco/DOM/TreeWalker.h b/vendor/invn/external/include/Poco/DOM/TreeWalker.h new file mode 100644 index 0000000..bdb579b --- /dev/null +++ b/vendor/invn/external/include/Poco/DOM/TreeWalker.h @@ -0,0 +1,213 @@ +// +// TreeWalker.h +// +// $Id: //poco/1.4/XML/include/Poco/DOM/TreeWalker.h#1 $ +// +// Library: XML +// Package: DOM +// Module: TreeWalker +// +// Definition of the DOM TreeWalker class. +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef DOM_TreeWalker_INCLUDED +#define DOM_TreeWalker_INCLUDED + + +#include "Poco/XML/XML.h" +#include "Poco/XML/XMLString.h" + + +namespace Poco { +namespace XML { + + +class Node; +class NodeFilter; + + +class XML_API TreeWalker + /// TreeWalker objects are used to navigate a document tree or subtree using + /// the view of the document defined by their whatToShow flags and filter (if + /// any). Any function which performs navigation using a TreeWalker will automatically + /// support any view defined by a TreeWalker. + /// + /// Omitting nodes from the logical view of a subtree can result in a structure + /// that is substantially different from the same subtree in the complete, unfiltered + /// document. Nodes that are siblings in the TreeWalker view may be children + /// of different, widely separated nodes in the original view. For instance, + /// consider a NodeFilter that skips all nodes except for Text nodes and the + /// root node of a document. In the logical view that results, all text nodes + /// will be siblings and appear as direct children of the root node, no matter + /// how deeply nested the structure of the original document. + /// + /// A TreeWalker can be directly instantiated using one of its constructors - + /// the DocumentTraversal interface is not needed and therefore not implemented. + /// Unlike most other DOM classes, TreeWalker supports value semantics. + /// + /// If the TreeWalker's current node is removed from the document, the + /// result of calling any of the movement methods is undefined. This behavior + /// does not conform to the DOM Level 2 Traversal specification. +{ +public: + TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0); + /// Creates a TreeWalker over the subtree rooted at the specified node. + + TreeWalker(const TreeWalker& walker); + /// Creates a TreeWalker by copying another TreeWalker. + + TreeWalker& operator = (const TreeWalker& walker); + /// Assignment operator. + + ~TreeWalker(); + /// Destroys the TreeWalker. + + Node* root() const; + /// The root node of the TreeWalker, as specified when it was created. + + unsigned long whatToShow() const; + /// This attribute determines which node types are presented via the TreeWalker. + /// The available set of constants is defined in the NodeFilter interface. Nodes + /// not accepted by whatToShow will be skipped, but their children may still + /// be considered. Note that this skip takes precedence over the filter, if + /// any. + + NodeFilter* filter() const; + /// The NodeFilter used to screen nodes. + + bool expandEntityReferences() const; + /// The value of this flag determines whether the children of entity reference + /// nodes are visible to the iterator. If false, they and their descendants + /// will be rejected. Note that this rejection takes precedence over whatToShow + /// and the filter. Also note that this is currently the only situation where + /// NodeIterators may reject a complete subtree rather than skipping individual + /// nodes. + /// + /// To produce a view of the document that has entity references expanded and + /// does not expose the entity reference node itself, use the whatToShow flags + /// to hide the entity reference node and set expandEntityReferences to true + /// when creating the iterator. To produce a view of the document that has entity + /// reference nodes but no entity expansion, use the whatToShow flags to show + /// the entity reference node and set expandEntityReferences to false. + /// + /// This implementation does not support entity reference expansion and + /// thus always returns false. + + Node* currentNode() const; + /// The node at which the TreeWalker is currently positioned. + /// Alterations to the DOM tree may cause the current node to no longer be accepted + /// by the TreeWalker's associated filter. currentNode may also be explicitly + /// set to any node, whether or not it is within the subtree specified by the + /// root node or would be accepted by the filter and whatToShow flags. Further + /// traversal occurs relative to currentNode even if it is not part of the current + /// view, by applying the filters in the requested direction; if no traversal + /// is possible, currentNode is not changed. + + Node* getCurrentNode() const; + /// See currentNode(). + + void setCurrentNode(Node* pNode); + /// Sets the current node. + + Node* parentNode(); + /// Moves to and returns the closest visible ancestor node of the current node. + /// If the search for parentNode attempts to step upward from the TreeWalker's + /// root node, or if it fails to find a visible ancestor node, this method retains + /// the current position and returns null. + + Node* firstChild(); + /// Moves the TreeWalker to the first visible child of the current node, and + /// returns the new node. If the current node has no visible children, returns + /// null, and retains the current node. + + Node* lastChild(); + /// Moves the TreeWalker to the last visible child of the current node, and + /// returns the new node. If the current node has no visible children, returns + /// null, and retains the current node. + + Node* previousSibling(); + /// Moves the TreeWalker to the previous sibling of the current node, and returns + /// the new node. If the current node has no visible previous sibling, returns + /// null, and retains the current node. + + Node* nextSibling(); + /// Moves the TreeWalker to the next sibling of the current node, and returns + /// the new node. If the current node has no visible next sibling, returns null, + /// and retains the current node. + + Node* previousNode(); + /// Moves the TreeWalker to the previous visible node in document order relative + /// to the current node, and returns the new node. If the current node has no + /// previous node, or if the search for previousNode attempts to step upward + /// from the TreeWalker's root node, returns null, and retains the current node. + + Node* nextNode(); + /// Moves the TreeWalker to the next visible node in document order relative + /// to the current node, and returns the new node. If the current node has no + /// next node, or if the search for nextNode attempts to step upward from the + /// TreeWalker's root node, returns null, and retains the current node. + +protected: + int accept(Node* pNode) const; + Node* next(Node* pNode) const; + Node* previous(Node* pNode) const; + +private: + TreeWalker(); + + Node* _pRoot; + unsigned long _whatToShow; + NodeFilter* _pFilter; + Node* _pCurrent; +}; + + +// +// inlines +// +inline Node* TreeWalker::root() const +{ + return _pRoot; +} + + +inline unsigned long TreeWalker::whatToShow() const +{ + return _whatToShow; +} + + +inline NodeFilter* TreeWalker::filter() const +{ + return _pFilter; +} + + +inline bool TreeWalker::expandEntityReferences() const +{ + return false; +} + + +inline Node* TreeWalker::currentNode() const +{ + return _pCurrent; +} + + +inline Node* TreeWalker::getCurrentNode() const +{ + return _pCurrent; +} + + +} } // namespace Poco::XML + + +#endif // DOM_TreeWalker_INCLUDED diff --git a/vendor/invn/external/include/Poco/Data/AbstractBinder.h b/vendor/invn/external/include/Poco/Data/AbstractBinder.h new file mode 100644 index 0000000..2eca131 --- /dev/null +++ b/vendor/invn/external/include/Poco/Data/AbstractBinder.h @@ -0,0 +1,375 @@ +// +// AbstractBinder.h +// +// $Id: //poco/Main/Data/include/Poco/Data/AbstractBinder.h#12 $ +// +// 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 +#include +#include +#include + + +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 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& val, Direction dir = PD_IN); + /// Binds an Int8 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an Int8 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an UInt8 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an UInt8 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an Int16 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an Int16 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an UInt16 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an UInt16 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an Int32 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an Int32 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an UInt32 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an UInt32 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an Int64 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an Int64 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds an UInt64 vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds an UInt64 deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a long vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a long deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a boolean vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a boolean deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a float vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a float deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a double vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a double deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a character vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a character deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a string vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a string deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a UTF-16 Unicode string vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a UTF-16 Unicode string deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a BLOB vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a BLOB deque. + + virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); + /// Binds a BLOB list. + + virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); + /// Binds a CLOB vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a CLOB deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a DateTime vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a DateTime deque. + + virtual void bind(std::size_t pos, const std::list& 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& val, Direction dir = PD_IN); + /// Binds a Date vector. + + virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); + /// Binds a Date deque. + + virtual void bind(std::size_t pos, const std::list& 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