zeroc-ice 3.6b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ICE_LICENSE +54 -0
- data/LICENSE +339 -0
- data/bin/slice2rb +17 -0
- data/ext/Communicator.cpp +596 -0
- data/ext/Communicator.h +25 -0
- data/ext/Config.h +111 -0
- data/ext/Connection.cpp +381 -0
- data/ext/Connection.h +26 -0
- data/ext/Endpoint.cpp +311 -0
- data/ext/Endpoint.h +27 -0
- data/ext/ImplicitContext.cpp +152 -0
- data/ext/ImplicitContext.h +25 -0
- data/ext/Init.cpp +52 -0
- data/ext/Logger.cpp +151 -0
- data/ext/Logger.h +28 -0
- data/ext/ObjectFactory.cpp +140 -0
- data/ext/ObjectFactory.h +50 -0
- data/ext/Operation.cpp +676 -0
- data/ext/Operation.h +36 -0
- data/ext/Properties.cpp +369 -0
- data/ext/Properties.h +25 -0
- data/ext/Proxy.cpp +1354 -0
- data/ext/Proxy.h +27 -0
- data/ext/Slice.cpp +223 -0
- data/ext/Slice.h +22 -0
- data/ext/Types.cpp +3160 -0
- data/ext/Types.h +545 -0
- data/ext/Util.cpp +792 -0
- data/ext/Util.h +511 -0
- data/ext/extconf.rb +118 -0
- data/ext/ice/BZIP_LICENSE +42 -0
- data/ext/ice/MCPP_LICENSE +36 -0
- data/ext/ice/bzip2/blocksort.c +1094 -0
- data/ext/ice/bzip2/bzlib.c +1572 -0
- data/ext/ice/bzip2/bzlib.h +282 -0
- data/ext/ice/bzip2/bzlib_private.h +509 -0
- data/ext/ice/bzip2/compress.c +672 -0
- data/ext/ice/bzip2/crctable.c +104 -0
- data/ext/ice/bzip2/decompress.c +646 -0
- data/ext/ice/bzip2/huffman.c +205 -0
- data/ext/ice/bzip2/randtable.c +84 -0
- data/ext/ice/cpp/include/Ice/ACMF.h +30 -0
- data/ext/ice/cpp/include/Ice/Application.h +156 -0
- data/ext/ice/cpp/include/Ice/AsyncResult.h +363 -0
- data/ext/ice/cpp/include/Ice/AsyncResultF.h +26 -0
- data/ext/ice/cpp/include/Ice/BasicStream.h +1315 -0
- data/ext/ice/cpp/include/Ice/Buffer.h +159 -0
- data/ext/ice/cpp/include/Ice/BuiltinSequences.h +74 -0
- data/ext/ice/cpp/include/Ice/Communicator.h +194 -0
- data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +115 -0
- data/ext/ice/cpp/include/Ice/CommunicatorF.h +60 -0
- data/ext/ice/cpp/include/Ice/Config.h +97 -0
- data/ext/ice/cpp/include/Ice/Connection.h +495 -0
- data/ext/ice/cpp/include/Ice/ConnectionAsync.h +115 -0
- data/ext/ice/cpp/include/Ice/ConnectionF.h +72 -0
- data/ext/ice/cpp/include/Ice/ConnectionFactoryF.h +30 -0
- data/ext/ice/cpp/include/Ice/ConnectionIF.h +37 -0
- data/ext/ice/cpp/include/Ice/Current.h +94 -0
- data/ext/ice/cpp/include/Ice/DefaultObjectFactory.h +48 -0
- data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +62 -0
- data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +33 -0
- data/ext/ice/cpp/include/Ice/Dispatcher.h +51 -0
- data/ext/ice/cpp/include/Ice/DynamicLibrary.h +105 -0
- data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +29 -0
- data/ext/ice/cpp/include/Ice/Endpoint.h +350 -0
- data/ext/ice/cpp/include/Ice/EndpointF.h +97 -0
- data/ext/ice/cpp/include/Ice/EndpointTypes.h +74 -0
- data/ext/ice/cpp/include/Ice/Exception.h +114 -0
- data/ext/ice/cpp/include/Ice/FacetMap.h +56 -0
- data/ext/ice/cpp/include/Ice/FactoryTable.h +69 -0
- data/ext/ice/cpp/include/Ice/FactoryTableInit.h +87 -0
- data/ext/ice/cpp/include/Ice/Format.h +39 -0
- data/ext/ice/cpp/include/Ice/Functional.h +138 -0
- data/ext/ice/cpp/include/Ice/GCObject.h +73 -0
- data/ext/ice/cpp/include/Ice/Handle.h +192 -0
- data/ext/ice/cpp/include/Ice/Ice.h +54 -0
- data/ext/ice/cpp/include/Ice/Identity.h +160 -0
- data/ext/ice/cpp/include/Ice/ImplicitContext.h +96 -0
- data/ext/ice/cpp/include/Ice/ImplicitContextF.h +60 -0
- data/ext/ice/cpp/include/Ice/Incoming.h +131 -0
- data/ext/ice/cpp/include/Ice/IncomingAsync.h +108 -0
- data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +35 -0
- data/ext/ice/cpp/include/Ice/Initialize.h +141 -0
- data/ext/ice/cpp/include/Ice/InstanceF.h +26 -0
- data/ext/ice/cpp/include/Ice/Instrumentation.h +377 -0
- data/ext/ice/cpp/include/Ice/InstrumentationF.h +71 -0
- data/ext/ice/cpp/include/Ice/LocalException.h +1022 -0
- data/ext/ice/cpp/include/Ice/LocalObject.h +36 -0
- data/ext/ice/cpp/include/Ice/LocalObjectF.h +26 -0
- data/ext/ice/cpp/include/Ice/Locator.h +2191 -0
- data/ext/ice/cpp/include/Ice/LocatorF.h +89 -0
- data/ext/ice/cpp/include/Ice/Logger.h +94 -0
- data/ext/ice/cpp/include/Ice/LoggerF.h +60 -0
- data/ext/ice/cpp/include/Ice/LoggerUtil.h +153 -0
- data/ext/ice/cpp/include/Ice/Makefile +26 -0
- data/ext/ice/cpp/include/Ice/Metrics.h +2989 -0
- data/ext/ice/cpp/include/Ice/MetricsAdminI.h +662 -0
- data/ext/ice/cpp/include/Ice/MetricsFunctional.h +144 -0
- data/ext/ice/cpp/include/Ice/MetricsObserverI.h +576 -0
- data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +55 -0
- data/ext/ice/cpp/include/Ice/Object.h +165 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapter.h +162 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +60 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapterFactoryF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObjectF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObjectFactory.h +86 -0
- data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +60 -0
- data/ext/ice/cpp/include/Ice/ObjectFactoryManagerF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObserverHelper.h +177 -0
- data/ext/ice/cpp/include/Ice/Outgoing.h +197 -0
- data/ext/ice/cpp/include/Ice/OutgoingAsync.h +264 -0
- data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +38 -0
- data/ext/ice/cpp/include/Ice/Plugin.h +121 -0
- data/ext/ice/cpp/include/Ice/PluginF.h +66 -0
- data/ext/ice/cpp/include/Ice/Process.h +568 -0
- data/ext/ice/cpp/include/Ice/ProcessF.h +77 -0
- data/ext/ice/cpp/include/Ice/Properties.h +130 -0
- data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +824 -0
- data/ext/ice/cpp/include/Ice/PropertiesF.h +83 -0
- data/ext/ice/cpp/include/Ice/Protocol.h +242 -0
- data/ext/ice/cpp/include/Ice/Proxy.h +2448 -0
- data/ext/ice/cpp/include/Ice/ProxyF.h +78 -0
- data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +26 -0
- data/ext/ice/cpp/include/Ice/ProxyHandle.h +330 -0
- data/ext/ice/cpp/include/Ice/ReferenceF.h +34 -0
- data/ext/ice/cpp/include/Ice/RemoteLogger.h +1496 -0
- data/ext/ice/cpp/include/Ice/RequestHandlerF.h +29 -0
- data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +25 -0
- data/ext/ice/cpp/include/Ice/Router.h +1155 -0
- data/ext/ice/cpp/include/Ice/RouterF.h +77 -0
- data/ext/ice/cpp/include/Ice/ServantLocator.h +90 -0
- data/ext/ice/cpp/include/Ice/ServantLocatorF.h +60 -0
- data/ext/ice/cpp/include/Ice/ServantManagerF.h +26 -0
- data/ext/ice/cpp/include/Ice/Service.h +260 -0
- data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +56 -0
- data/ext/ice/cpp/include/Ice/SliceChecksums.h +34 -0
- data/ext/ice/cpp/include/Ice/SlicedData.h +103 -0
- data/ext/ice/cpp/include/Ice/SlicedDataF.h +34 -0
- data/ext/ice/cpp/include/Ice/Stream.h +449 -0
- data/ext/ice/cpp/include/Ice/StreamF.h +30 -0
- data/ext/ice/cpp/include/Ice/StreamHelpers.h +877 -0
- data/ext/ice/cpp/include/Ice/ThreadPoolF.h +28 -0
- data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +56 -0
- data/ext/ice/cpp/include/Ice/Version.h +254 -0
- data/ext/ice/cpp/include/IceSSL/Config.h +23 -0
- data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +119 -0
- data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +101 -0
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +22 -0
- data/ext/ice/cpp/include/IceSSL/Makefile +26 -0
- data/ext/ice/cpp/include/IceSSL/Plugin.h +558 -0
- data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +119 -0
- data/ext/ice/cpp/include/IceUtil/Cache.h +362 -0
- data/ext/ice/cpp/include/IceUtil/Cond.h +323 -0
- data/ext/ice/cpp/include/IceUtil/Config.h +234 -0
- data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +50 -0
- data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +70 -0
- data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +45 -0
- data/ext/ice/cpp/include/IceUtil/Exception.h +184 -0
- data/ext/ice/cpp/include/IceUtil/Functional.h +389 -0
- data/ext/ice/cpp/include/IceUtil/Handle.h +266 -0
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +51 -0
- data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +302 -0
- data/ext/ice/cpp/include/IceUtil/InputUtil.h +47 -0
- data/ext/ice/cpp/include/IceUtil/Iterator.h +36 -0
- data/ext/ice/cpp/include/IceUtil/Lock.h +135 -0
- data/ext/ice/cpp/include/IceUtil/Makefile +26 -0
- data/ext/ice/cpp/include/IceUtil/Monitor.h +249 -0
- data/ext/ice/cpp/include/IceUtil/Mutex.h +357 -0
- data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +28 -0
- data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +83 -0
- data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +82 -0
- data/ext/ice/cpp/include/IceUtil/Optional.h +322 -0
- data/ext/ice/cpp/include/IceUtil/Options.h +141 -0
- data/ext/ice/cpp/include/IceUtil/OutputUtil.h +362 -0
- data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +19 -0
- data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +26 -0
- data/ext/ice/cpp/include/IceUtil/Random.h +24 -0
- data/ext/ice/cpp/include/IceUtil/RecMutex.h +113 -0
- data/ext/ice/cpp/include/IceUtil/SHA1.h +65 -0
- data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +44 -0
- data/ext/ice/cpp/include/IceUtil/ScopedArray.h +97 -0
- data/ext/ice/cpp/include/IceUtil/Shared.h +168 -0
- data/ext/ice/cpp/include/IceUtil/StringConverter.h +175 -0
- data/ext/ice/cpp/include/IceUtil/StringUtil.h +91 -0
- data/ext/ice/cpp/include/IceUtil/Thread.h +181 -0
- data/ext/ice/cpp/include/IceUtil/ThreadException.h +108 -0
- data/ext/ice/cpp/include/IceUtil/Time.h +209 -0
- data/ext/ice/cpp/include/IceUtil/Timer.h +143 -0
- data/ext/ice/cpp/include/IceUtil/UUID.h +22 -0
- data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +42 -0
- data/ext/ice/cpp/include/IceUtil/UniquePtr.h +101 -0
- data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +64 -0
- data/ext/ice/cpp/include/Slice/Checksum.h +26 -0
- data/ext/ice/cpp/include/Slice/CsUtil.h +92 -0
- data/ext/ice/cpp/include/Slice/DotNetNames.h +34 -0
- data/ext/ice/cpp/include/Slice/FileTracker.h +71 -0
- data/ext/ice/cpp/include/Slice/JavaUtil.h +277 -0
- data/ext/ice/cpp/include/Slice/Makefile +26 -0
- data/ext/ice/cpp/include/Slice/PHPUtil.h +50 -0
- data/ext/ice/cpp/include/Slice/Parser.h +1116 -0
- data/ext/ice/cpp/include/Slice/Preprocessor.h +68 -0
- data/ext/ice/cpp/include/Slice/PythonUtil.h +64 -0
- data/ext/ice/cpp/include/Slice/RubyUtil.h +54 -0
- data/ext/ice/cpp/include/Slice/Util.h +33 -0
- data/ext/ice/cpp/src/Ice/ACM.cpp +343 -0
- data/ext/ice/cpp/src/Ice/ACM.h +117 -0
- data/ext/ice/cpp/src/Ice/Acceptor.cpp +16 -0
- data/ext/ice/cpp/src/Ice/Acceptor.h +41 -0
- data/ext/ice/cpp/src/Ice/AcceptorF.h +30 -0
- data/ext/ice/cpp/src/Ice/Application.cpp +760 -0
- data/ext/ice/cpp/src/Ice/AsyncResult.cpp +599 -0
- data/ext/ice/cpp/src/Ice/Base64.cpp +269 -0
- data/ext/ice/cpp/src/Ice/Base64.h +36 -0
- data/ext/ice/cpp/src/Ice/BasicStream.cpp +3393 -0
- data/ext/ice/cpp/src/Ice/Buffer.cpp +98 -0
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +34 -0
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +718 -0
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +106 -0
- data/ext/ice/cpp/src/Ice/Communicator.cpp +45 -0
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +386 -0
- data/ext/ice/cpp/src/Ice/CommunicatorI.h +112 -0
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +546 -0
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +97 -0
- data/ext/ice/cpp/src/Ice/Connection.cpp +58 -0
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +1639 -0
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +236 -0
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +3876 -0
- data/ext/ice/cpp/src/Ice/ConnectionI.h +364 -0
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +115 -0
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +50 -0
- data/ext/ice/cpp/src/Ice/Connector.cpp +16 -0
- data/ext/ice/cpp/src/Ice/Connector.h +36 -0
- data/ext/ice/cpp/src/Ice/ConnectorF.h +26 -0
- data/ext/ice/cpp/src/Ice/Current.cpp +38 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +168 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +57 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +26 -0
- data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +60 -0
- data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +49 -0
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +281 -0
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +53 -0
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +25 -0
- data/ext/ice/cpp/src/Ice/EndpointFactory.h +44 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +26 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +208 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +46 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +26 -0
- data/ext/ice/cpp/src/Ice/EndpointI.cpp +87 -0
- data/ext/ice/cpp/src/Ice/EndpointI.h +165 -0
- data/ext/ice/cpp/src/Ice/EndpointIF.h +41 -0
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +38 -0
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +35 -0
- data/ext/ice/cpp/src/Ice/EventHandler.h +78 -0
- data/ext/ice/cpp/src/Ice/EventHandlerF.h +26 -0
- data/ext/ice/cpp/src/Ice/EventLoggerMsg.h +53 -0
- data/ext/ice/cpp/src/Ice/Exception.cpp +832 -0
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +34 -0
- data/ext/ice/cpp/src/Ice/FactoryTable.cpp +158 -0
- data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +95 -0
- data/ext/ice/cpp/src/Ice/GCObject.cpp +444 -0
- data/ext/ice/cpp/src/Ice/HashUtil.h +59 -0
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +680 -0
- data/ext/ice/cpp/src/Ice/HttpParser.h +124 -0
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +733 -0
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +157 -0
- data/ext/ice/cpp/src/Ice/IPEndpointIF.h +29 -0
- data/ext/ice/cpp/src/Ice/Identity.cpp +42 -0
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +639 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextI.h +51 -0
- data/ext/ice/cpp/src/Ice/Incoming.cpp +757 -0
- data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +340 -0
- data/ext/ice/cpp/src/Ice/IncomingRequest.h +37 -0
- data/ext/ice/cpp/src/Ice/Initialize.cpp +401 -0
- data/ext/ice/cpp/src/Ice/Instance.cpp +1928 -0
- data/ext/ice/cpp/src/Ice/Instance.h +198 -0
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +68 -0
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +43 -0
- data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1083 -0
- data/ext/ice/cpp/src/Ice/InstrumentationI.h +262 -0
- data/ext/ice/cpp/src/Ice/LocalException.cpp +2091 -0
- data/ext/ice/cpp/src/Ice/LocalObject.cpp +29 -0
- data/ext/ice/cpp/src/Ice/Locator.cpp +1946 -0
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +917 -0
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +193 -0
- data/ext/ice/cpp/src/Ice/LocatorInfoF.h +34 -0
- data/ext/ice/cpp/src/Ice/Logger.cpp +40 -0
- data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +862 -0
- data/ext/ice/cpp/src/Ice/LoggerAdminI.h +46 -0
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +199 -0
- data/ext/ice/cpp/src/Ice/LoggerI.h +57 -0
- data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +107 -0
- data/ext/ice/cpp/src/Ice/Makefile +190 -0
- data/ext/ice/cpp/src/Ice/Metrics.cpp +2159 -0
- data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +669 -0
- data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +14 -0
- data/ext/ice/cpp/src/Ice/Network.cpp +2694 -0
- data/ext/ice/cpp/src/Ice/Network.h +291 -0
- data/ext/ice/cpp/src/Ice/NetworkF.h +28 -0
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +325 -0
- data/ext/ice/cpp/src/Ice/NetworkProxy.h +74 -0
- data/ext/ice/cpp/src/Ice/NetworkProxyF.h +26 -0
- data/ext/ice/cpp/src/Ice/Object.cpp +440 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +241 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +52 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +1498 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +155 -0
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +140 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +43 -0
- data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +84 -0
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +407 -0
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +70 -0
- data/ext/ice/cpp/src/Ice/Outgoing.cpp +737 -0
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +874 -0
- data/ext/ice/cpp/src/Ice/Plugin.cpp +43 -0
- data/ext/ice/cpp/src/Ice/PluginF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +503 -0
- data/ext/ice/cpp/src/Ice/PluginManagerI.h +67 -0
- data/ext/ice/cpp/src/Ice/Process.cpp +299 -0
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/Properties.cpp +45 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +555 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +207 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +45 -0
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +759 -0
- data/ext/ice/cpp/src/Ice/PropertiesI.h +78 -0
- data/ext/ice/cpp/src/Ice/PropertyNames.cpp +1293 -0
- data/ext/ice/cpp/src/Ice/PropertyNames.h +81 -0
- data/ext/ice/cpp/src/Ice/Protocol.cpp +137 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +98 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstance.h +91 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +26 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +51 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +67 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +26 -0
- data/ext/ice/cpp/src/Ice/Proxy.cpp +1810 -0
- data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +305 -0
- data/ext/ice/cpp/src/Ice/ProxyFactory.h +57 -0
- data/ext/ice/cpp/src/Ice/Reference.cpp +1947 -0
- data/ext/ice/cpp/src/Ice/Reference.h +305 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +937 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactory.h +81 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +24 -0
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +958 -0
- data/ext/ice/cpp/src/Ice/ReplyStatus.h +29 -0
- data/ext/ice/cpp/src/Ice/RequestHandler.cpp +40 -0
- data/ext/ice/cpp/src/Ice/RequestHandler.h +90 -0
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +70 -0
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +41 -0
- data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +20 -0
- data/ext/ice/cpp/src/Ice/ResponseHandler.h +39 -0
- data/ext/ice/cpp/src/Ice/RetryQueue.cpp +154 -0
- data/ext/ice/cpp/src/Ice/RetryQueue.h +69 -0
- data/ext/ice/cpp/src/Ice/RetryQueueF.h +24 -0
- data/ext/ice/cpp/src/Ice/Router.cpp +849 -0
- data/ext/ice/cpp/src/Ice/RouterF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/RouterInfo.cpp +381 -0
- data/ext/ice/cpp/src/Ice/RouterInfo.h +148 -0
- data/ext/ice/cpp/src/Ice/RouterInfoF.h +30 -0
- data/ext/ice/cpp/src/Ice/Selector.cpp +926 -0
- data/ext/ice/cpp/src/Ice/Selector.h +231 -0
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ServantManager.cpp +495 -0
- data/ext/ice/cpp/src/Ice/ServantManager.h +74 -0
- data/ext/ice/cpp/src/Ice/Service.cpp +1897 -0
- data/ext/ice/cpp/src/Ice/SharedContext.h +51 -0
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +34 -0
- data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +80 -0
- data/ext/ice/cpp/src/Ice/SlicedData.cpp +80 -0
- data/ext/ice/cpp/src/Ice/Stream.cpp +53 -0
- data/ext/ice/cpp/src/Ice/StreamI.cpp +832 -0
- data/ext/ice/cpp/src/Ice/StreamI.h +198 -0
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +521 -0
- data/ext/ice/cpp/src/Ice/StreamSocket.h +85 -0
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +145 -0
- data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +167 -0
- data/ext/ice/cpp/src/Ice/SysLoggerI.h +43 -0
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +235 -0
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +67 -0
- data/ext/ice/cpp/src/Ice/TcpConnector.cpp +133 -0
- data/ext/ice/cpp/src/Ice/TcpConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +397 -0
- data/ext/ice/cpp/src/Ice/TcpEndpointI.h +93 -0
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +127 -0
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +61 -0
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +1357 -0
- data/ext/ice/cpp/src/Ice/ThreadPool.h +399 -0
- data/ext/ice/cpp/src/Ice/TraceLevels.cpp +43 -0
- data/ext/ice/cpp/src/Ice/TraceLevels.h +50 -0
- data/ext/ice/cpp/src/Ice/TraceLevelsF.h +26 -0
- data/ext/ice/cpp/src/Ice/TraceUtil.cpp +452 -0
- data/ext/ice/cpp/src/Ice/TraceUtil.h +28 -0
- data/ext/ice/cpp/src/Ice/Transceiver.cpp +24 -0
- data/ext/ice/cpp/src/Ice/Transceiver.h +52 -0
- data/ext/ice/cpp/src/Ice/TransceiverF.h +38 -0
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +144 -0
- data/ext/ice/cpp/src/Ice/UdpConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +483 -0
- data/ext/ice/cpp/src/Ice/UdpEndpointI.h +95 -0
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +1156 -0
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +123 -0
- data/ext/ice/cpp/src/Ice/Version.cpp +46 -0
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +103 -0
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +61 -0
- data/ext/ice/cpp/src/Ice/WSConnector.cpp +113 -0
- data/ext/ice/cpp/src/Ice/WSConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +441 -0
- data/ext/ice/cpp/src/Ice/WSEndpoint.h +97 -0
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +1728 -0
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +149 -0
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +594 -0
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +1035 -0
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +208 -0
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +78 -0
- data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +308 -0
- data/ext/ice/cpp/src/IceDiscovery/LookupI.h +183 -0
- data/ext/ice/cpp/src/IceDiscovery/Makefile +61 -0
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +148 -0
- data/ext/ice/cpp/src/IceDiscovery/PluginI.h +39 -0
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +258 -0
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +66 -0
- data/ext/ice/cpp/src/IceSSL/Certificate.cpp +1334 -0
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +42 -0
- data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +151 -0
- data/ext/ice/cpp/src/IceSSL/ConnectorI.h +56 -0
- data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +397 -0
- data/ext/ice/cpp/src/IceSSL/EndpointI.h +96 -0
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +41 -0
- data/ext/ice/cpp/src/IceSSL/Instance.cpp +38 -0
- data/ext/ice/cpp/src/IceSSL/Instance.h +42 -0
- data/ext/ice/cpp/src/IceSSL/InstanceF.h +34 -0
- data/ext/ice/cpp/src/IceSSL/Makefile +82 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +1001 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +607 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +75 -0
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +102 -0
- data/ext/ice/cpp/src/IceSSL/PluginI.h +56 -0
- data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +541 -0
- data/ext/ice/cpp/src/IceSSL/RFC2253.h +67 -0
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +729 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +1062 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +130 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +291 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngine.h +264 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +41 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +1514 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +609 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +91 -0
- data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +246 -0
- data/ext/ice/cpp/src/IceSSL/TrustManager.h +51 -0
- data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +26 -0
- data/ext/ice/cpp/src/IceSSL/Util.cpp +1423 -0
- data/ext/ice/cpp/src/IceSSL/Util.h +136 -0
- data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +65 -0
- data/ext/ice/cpp/src/IceUtil/ArgVector.h +41 -0
- data/ext/ice/cpp/src/IceUtil/Cond.cpp +386 -0
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +477 -0
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +144 -0
- data/ext/ice/cpp/src/IceUtil/CountDownLatch.cpp +184 -0
- data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +273 -0
- data/ext/ice/cpp/src/IceUtil/Exception.cpp +782 -0
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +532 -0
- data/ext/ice/cpp/src/IceUtil/FileUtil.h +159 -0
- data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +41 -0
- data/ext/ice/cpp/src/IceUtil/Makefile +68 -0
- data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +24 -0
- data/ext/ice/cpp/src/IceUtil/Options.cpp +1049 -0
- data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +591 -0
- data/ext/ice/cpp/src/IceUtil/Random.cpp +185 -0
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +257 -0
- data/ext/ice/cpp/src/IceUtil/SHA1.cpp +126 -0
- data/ext/ice/cpp/src/IceUtil/Shared.cpp +200 -0
- data/ext/ice/cpp/src/IceUtil/StopWatch.h +54 -0
- data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +450 -0
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +842 -0
- data/ext/ice/cpp/src/IceUtil/Thread.cpp +809 -0
- data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +172 -0
- data/ext/ice/cpp/src/IceUtil/Time.cpp +306 -0
- data/ext/ice/cpp/src/IceUtil/Timer.cpp +251 -0
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +174 -0
- data/ext/ice/cpp/src/IceUtil/Unicode.cpp +131 -0
- data/ext/ice/cpp/src/IceUtil/Unicode.h +49 -0
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +1139 -0
- data/ext/ice/cpp/src/Slice/Checksum.cpp +452 -0
- data/ext/ice/cpp/src/Slice/CsUtil.cpp +2650 -0
- data/ext/ice/cpp/src/Slice/DotNetNames.cpp +146 -0
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +203 -0
- data/ext/ice/cpp/src/Slice/Grammar.cpp +4755 -0
- data/ext/ice/cpp/src/Slice/Grammar.h +98 -0
- data/ext/ice/cpp/src/Slice/GrammarUtil.h +234 -0
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +4376 -0
- data/ext/ice/cpp/src/Slice/MD5.cpp +57 -0
- data/ext/ice/cpp/src/Slice/MD5.h +44 -0
- data/ext/ice/cpp/src/Slice/MD5I.cpp +385 -0
- data/ext/ice/cpp/src/Slice/MD5I.h +91 -0
- data/ext/ice/cpp/src/Slice/Makefile +65 -0
- data/ext/ice/cpp/src/Slice/PHPUtil.cpp +156 -0
- data/ext/ice/cpp/src/Slice/Parser.cpp +6386 -0
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +686 -0
- data/ext/ice/cpp/src/Slice/Python.cpp +675 -0
- data/ext/ice/cpp/src/Slice/PythonUtil.cpp +2614 -0
- data/ext/ice/cpp/src/Slice/Ruby.cpp +317 -0
- data/ext/ice/cpp/src/Slice/RubyUtil.cpp +1774 -0
- data/ext/ice/cpp/src/Slice/Scanner.cpp +2426 -0
- data/ext/ice/cpp/src/Slice/Util.cpp +325 -0
- data/ext/ice/mcpp/config.h.Darwin +227 -0
- data/ext/ice/mcpp/config.h.Linux +227 -0
- data/ext/ice/mcpp/config.h.MINGW +7 -0
- data/ext/ice/mcpp/configed.H +382 -0
- data/ext/ice/mcpp/directive.c +1699 -0
- data/ext/ice/mcpp/eval.c +1673 -0
- data/ext/ice/mcpp/expand.c +2980 -0
- data/ext/ice/mcpp/internal.H +564 -0
- data/ext/ice/mcpp/main.c +1131 -0
- data/ext/ice/mcpp/mbchar.c +869 -0
- data/ext/ice/mcpp/mcpp_lib.h +31 -0
- data/ext/ice/mcpp/mcpp_out.h +13 -0
- data/ext/ice/mcpp/support.c +2811 -0
- data/ext/ice/mcpp/system.H +396 -0
- data/ext/ice/mcpp/system.c +4940 -0
- data/ice.gemspec +41 -0
- data/lib/Glacier2.rb +12 -0
- data/lib/Glacier2/Metrics.rb +99 -0
- data/lib/Glacier2/PermissionsVerifier.rb +168 -0
- data/lib/Glacier2/PermissionsVerifierF.rb +34 -0
- data/lib/Glacier2/Router.rb +141 -0
- data/lib/Glacier2/RouterF.rb +29 -0
- data/lib/Glacier2/SSLInfo.rb +79 -0
- data/lib/Glacier2/Session.rb +470 -0
- data/lib/Ice.rb +659 -0
- data/lib/Ice/BuiltinSequences.rb +64 -0
- data/lib/Ice/Communicator.rb +93 -0
- data/lib/Ice/CommunicatorF.rb +28 -0
- data/lib/Ice/Connection.rb +414 -0
- data/lib/Ice/ConnectionF.rb +36 -0
- data/lib/Ice/Current.rb +152 -0
- data/lib/Ice/Endpoint.rb +265 -0
- data/lib/Ice/EndpointF.rb +52 -0
- data/lib/Ice/EndpointTypes.rb +77 -0
- data/lib/Ice/FacetMap.rb +28 -0
- data/lib/Ice/Identity.rb +70 -0
- data/lib/Ice/ImplicitContext.rb +59 -0
- data/lib/Ice/ImplicitContextF.rb +28 -0
- data/lib/Ice/Instrumentation.rb +425 -0
- data/lib/Ice/InstrumentationF.rb +35 -0
- data/lib/Ice/LocalException.rb +1081 -0
- data/lib/Ice/Locator.rb +314 -0
- data/lib/Ice/LocatorF.rb +34 -0
- data/lib/Ice/Logger.rb +57 -0
- data/lib/Ice/LoggerF.rb +28 -0
- data/lib/Ice/Metrics.rb +696 -0
- data/lib/Ice/ObjectAdapterF.rb +28 -0
- data/lib/Ice/ObjectFactory.rb +53 -0
- data/lib/Ice/ObjectFactoryF.rb +28 -0
- data/lib/Ice/Plugin.rb +87 -0
- data/lib/Ice/PluginF.rb +32 -0
- data/lib/Ice/Process.rb +93 -0
- data/lib/Ice/ProcessF.rb +29 -0
- data/lib/Ice/Properties.rb +65 -0
- data/lib/Ice/PropertiesAdmin.rb +104 -0
- data/lib/Ice/PropertiesF.rb +33 -0
- data/lib/Ice/Router.rb +163 -0
- data/lib/Ice/RouterF.rb +29 -0
- data/lib/Ice/SliceChecksumDict.rb +28 -0
- data/lib/Ice/Version.rb +100 -0
- data/lib/IceBox.rb +10 -0
- data/lib/IceBox/IceBox.rb +272 -0
- data/lib/IceGrid.rb +17 -0
- data/lib/IceGrid/Admin.rb +1076 -0
- data/lib/IceGrid/Descriptor.rb +1505 -0
- data/lib/IceGrid/Exception.rb +401 -0
- data/lib/IceGrid/FileParser.rb +105 -0
- data/lib/IceGrid/Locator.rb +105 -0
- data/lib/IceGrid/Observer.rb +571 -0
- data/lib/IceGrid/Query.rb +168 -0
- data/lib/IceGrid/Registry.rb +120 -0
- data/lib/IceGrid/Session.rb +114 -0
- data/lib/IceGrid/UserAccountMapper.rb +101 -0
- data/lib/IcePatch2.rb +10 -0
- data/lib/IcePatch2/FileInfo.rb +75 -0
- data/lib/IcePatch2/FileServer.rb +141 -0
- data/lib/IceStorm.rb +11 -0
- data/lib/IceStorm/IceStorm.rb +463 -0
- data/lib/IceStorm/Metrics.rb +155 -0
- data/slice/Freeze/BackgroundSaveEvictor.ice +111 -0
- data/slice/Freeze/CatalogData.ice +49 -0
- data/slice/Freeze/Connection.ice +111 -0
- data/slice/Freeze/ConnectionF.ice +20 -0
- data/slice/Freeze/DB.ice +37 -0
- data/slice/Freeze/Evictor.ice +339 -0
- data/slice/Freeze/EvictorF.ice +22 -0
- data/slice/Freeze/EvictorStorage.ice +72 -0
- data/slice/Freeze/Exception.ice +100 -0
- data/slice/Freeze/Transaction.ice +57 -0
- data/slice/Freeze/TransactionalEvictor.ice +50 -0
- data/slice/Glacier2/Metrics.ice +77 -0
- data/slice/Glacier2/PermissionsVerifier.ice +105 -0
- data/slice/Glacier2/PermissionsVerifierF.ice +21 -0
- data/slice/Glacier2/Router.ice +178 -0
- data/slice/Glacier2/RouterF.ice +20 -0
- data/slice/Glacier2/SSLInfo.ice +50 -0
- data/slice/Glacier2/Session.ice +273 -0
- data/slice/Ice/BuiltinSequences.ice +48 -0
- data/slice/Ice/Communicator.ice +567 -0
- data/slice/Ice/CommunicatorF.ice +20 -0
- data/slice/Ice/Connection.ice +323 -0
- data/slice/Ice/ConnectionF.ice +22 -0
- data/slice/Ice/Current.ice +160 -0
- data/slice/Ice/Endpoint.ice +227 -0
- data/slice/Ice/EndpointF.ice +32 -0
- data/slice/Ice/EndpointTypes.ice +38 -0
- data/slice/Ice/FacetMap.ice +25 -0
- data/slice/Ice/Identity.ice +59 -0
- data/slice/Ice/ImplicitContext.ice +109 -0
- data/slice/Ice/ImplicitContextF.ice +20 -0
- data/slice/Ice/Instrumentation.ice +499 -0
- data/slice/Ice/InstrumentationF.ice +26 -0
- data/slice/Ice/LocalException.ice +1015 -0
- data/slice/Ice/Locator.ice +227 -0
- data/slice/Ice/LocatorF.ice +21 -0
- data/slice/Ice/Logger.ice +86 -0
- data/slice/Ice/LoggerF.ice +20 -0
- data/slice/Ice/Metrics.ice +422 -0
- data/slice/Ice/ObjectAdapter.ice +673 -0
- data/slice/Ice/ObjectAdapterF.ice +20 -0
- data/slice/Ice/ObjectFactory.ice +60 -0
- data/slice/Ice/ObjectFactoryF.ice +20 -0
- data/slice/Ice/Plugin.ice +117 -0
- data/slice/Ice/PluginF.ice +21 -0
- data/slice/Ice/Process.ice +54 -0
- data/slice/Ice/ProcessF.ice +20 -0
- data/slice/Ice/Properties.ice +228 -0
- data/slice/Ice/PropertiesAdmin.ice +75 -0
- data/slice/Ice/PropertiesF.ice +21 -0
- data/slice/Ice/RemoteLogger.ice +232 -0
- data/slice/Ice/Router.ice +83 -0
- data/slice/Ice/RouterF.ice +20 -0
- data/slice/Ice/ServantLocator.ice +117 -0
- data/slice/Ice/ServantLocatorF.ice +20 -0
- data/slice/Ice/SliceChecksumDict.ice +25 -0
- data/slice/Ice/Version.ice +39 -0
- data/slice/IceBox/IceBox.ice +194 -0
- data/slice/IceDiscovery/IceDiscovery.ice +32 -0
- data/slice/IceGrid/Admin.ice +1578 -0
- data/slice/IceGrid/Descriptor.ice +1079 -0
- data/slice/IceGrid/Discovery.ice +73 -0
- data/slice/IceGrid/Exception.ice +383 -0
- data/slice/IceGrid/FileParser.ice +61 -0
- data/slice/IceGrid/Locator.ice +56 -0
- data/slice/IceGrid/Observer.ice +394 -0
- data/slice/IceGrid/PluginFacade.ice +316 -0
- data/slice/IceGrid/Query.ice +130 -0
- data/slice/IceGrid/Registry.ice +138 -0
- data/slice/IceGrid/Session.ice +124 -0
- data/slice/IceGrid/UserAccountMapper.ice +58 -0
- data/slice/IcePatch2/FileInfo.ice +49 -0
- data/slice/IcePatch2/FileServer.ice +129 -0
- data/slice/IceSSL/ConnectionInfo.ice +34 -0
- data/slice/IceSSL/EndpointInfo.ice +41 -0
- data/slice/IceStorm/IceStorm.ice +405 -0
- data/slice/IceStorm/Metrics.ice +71 -0
- metadata +737 -0
@@ -0,0 +1,159 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#ifndef ICE_FILE_UTIL_H
|
11
|
+
#define ICE_FILE_UTIL_H
|
12
|
+
|
13
|
+
#include <IceUtil/Config.h>
|
14
|
+
#include <IceUtil/Shared.h>
|
15
|
+
#include <IceUtil/Handle.h>
|
16
|
+
|
17
|
+
#include <sys/stat.h>
|
18
|
+
#include <fcntl.h>
|
19
|
+
#include <stdio.h>
|
20
|
+
#include <fstream>
|
21
|
+
|
22
|
+
namespace IceUtilInternal
|
23
|
+
{
|
24
|
+
|
25
|
+
extern const ICE_UTIL_API std::string pathsep;
|
26
|
+
extern const ICE_UTIL_API std::string separator;
|
27
|
+
|
28
|
+
//
|
29
|
+
// Detemine if path is an absolute path.
|
30
|
+
//
|
31
|
+
ICE_UTIL_API bool isAbsolutePath(const std::string&);
|
32
|
+
|
33
|
+
//
|
34
|
+
// Determine if a file exists.
|
35
|
+
//
|
36
|
+
ICE_UTIL_API bool fileExists(const std::string&);
|
37
|
+
|
38
|
+
//
|
39
|
+
// Determine if a directory exists.
|
40
|
+
//
|
41
|
+
ICE_UTIL_API bool directoryExists(const std::string&);
|
42
|
+
|
43
|
+
#ifdef _WIN32
|
44
|
+
|
45
|
+
#if defined(__MINGW32__)
|
46
|
+
typedef struct _stat structstat;
|
47
|
+
#else
|
48
|
+
typedef struct _stat64i32 structstat;
|
49
|
+
#endif
|
50
|
+
|
51
|
+
#ifdef _MSC_VER
|
52
|
+
# define O_RDONLY _O_RDONLY
|
53
|
+
# define O_BINARY _O_BINARY
|
54
|
+
|
55
|
+
# define S_ISDIR(mode) ((mode) & _S_IFDIR)
|
56
|
+
# define S_ISREG(mode) ((mode) & _S_IFREG)
|
57
|
+
#endif
|
58
|
+
|
59
|
+
#else
|
60
|
+
|
61
|
+
typedef struct stat structstat;
|
62
|
+
# define O_BINARY 0
|
63
|
+
|
64
|
+
#endif
|
65
|
+
|
66
|
+
//
|
67
|
+
// OS stat
|
68
|
+
//
|
69
|
+
ICE_UTIL_API int stat(const std::string&, structstat*);
|
70
|
+
ICE_UTIL_API int remove(const std::string&);
|
71
|
+
ICE_UTIL_API int rename(const std::string&, const std::string&);
|
72
|
+
ICE_UTIL_API int rmdir(const std::string&);
|
73
|
+
|
74
|
+
ICE_UTIL_API int mkdir(const std::string&, int);
|
75
|
+
ICE_UTIL_API FILE* fopen(const std::string&, const std::string&);
|
76
|
+
ICE_UTIL_API FILE* freopen(const std::string&, const std::string&, FILE*);
|
77
|
+
ICE_UTIL_API int open(const std::string&, int);
|
78
|
+
|
79
|
+
#ifndef ICE_OS_WINRT
|
80
|
+
ICE_UTIL_API int getcwd(std::string&);
|
81
|
+
#endif
|
82
|
+
|
83
|
+
ICE_UTIL_API int unlink(const std::string&);
|
84
|
+
ICE_UTIL_API int close(int);
|
85
|
+
|
86
|
+
//
|
87
|
+
// This class is used to implement process file locking. This class
|
88
|
+
// is not intended to do file locking within the same process.
|
89
|
+
//
|
90
|
+
class ICE_UTIL_API FileLock : public IceUtil::Shared, public IceUtil::noncopyable
|
91
|
+
{
|
92
|
+
public:
|
93
|
+
//
|
94
|
+
// The constructor opens the given file (eventually creating it)
|
95
|
+
// and acquires a lock on the file or throws FileLockException if
|
96
|
+
// the file couldn't be locked.
|
97
|
+
//
|
98
|
+
// If the lock can be acquired, the process pid is written to the
|
99
|
+
// file.
|
100
|
+
//
|
101
|
+
FileLock(const std::string&);
|
102
|
+
|
103
|
+
//
|
104
|
+
// The destructor releases the lock and removes the file.
|
105
|
+
//
|
106
|
+
virtual ~FileLock();
|
107
|
+
|
108
|
+
private:
|
109
|
+
|
110
|
+
#ifdef _WIN32
|
111
|
+
HANDLE _fd;
|
112
|
+
#else
|
113
|
+
int _fd;
|
114
|
+
#endif
|
115
|
+
std::string _path;
|
116
|
+
};
|
117
|
+
|
118
|
+
typedef IceUtil::Handle<FileLock> FileLockPtr;
|
119
|
+
|
120
|
+
class ICE_UTIL_API ifstream : public std::ifstream
|
121
|
+
{
|
122
|
+
public:
|
123
|
+
|
124
|
+
ifstream();
|
125
|
+
ifstream(const std::string&, std::ios_base::openmode mode = std::ios_base::in);
|
126
|
+
void open(const std::string&, std::ios_base::openmode mode = std::ios_base::in);
|
127
|
+
|
128
|
+
#ifdef __SUNPRO_CC
|
129
|
+
using std::ifstream::open;
|
130
|
+
#endif
|
131
|
+
|
132
|
+
private:
|
133
|
+
|
134
|
+
// Hide const char* definitions since they shouldn't be used.
|
135
|
+
ifstream(const char*);
|
136
|
+
void open(const char*, std::ios_base::openmode mode = std::ios_base::in);
|
137
|
+
};
|
138
|
+
|
139
|
+
class ICE_UTIL_API ofstream : public std::ofstream
|
140
|
+
{
|
141
|
+
public:
|
142
|
+
|
143
|
+
ofstream();
|
144
|
+
ofstream(const std::string&, std::ios_base::openmode mode = std::ios_base::out);
|
145
|
+
void open(const std::string&, std::ios_base::openmode mode = std::ios_base::out);
|
146
|
+
|
147
|
+
#ifdef __SUNPRO_CC
|
148
|
+
using std::ofstream::open;
|
149
|
+
#endif
|
150
|
+
|
151
|
+
private:
|
152
|
+
|
153
|
+
// Hide const char* definitions since they shouldn't be used.
|
154
|
+
ofstream(const char*);
|
155
|
+
void open(const char*, std::ios_base::openmode mode = std::ios_base::out);
|
156
|
+
};
|
157
|
+
|
158
|
+
}
|
159
|
+
#endif
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#include <IceUtil/InputUtil.h>
|
11
|
+
#include <stdlib.h>
|
12
|
+
|
13
|
+
using namespace std;
|
14
|
+
using namespace IceUtil;
|
15
|
+
|
16
|
+
namespace IceUtilInternal
|
17
|
+
{
|
18
|
+
|
19
|
+
Int64
|
20
|
+
strToInt64(const char* s, char** endptr, int base)
|
21
|
+
{
|
22
|
+
#if defined(_WIN32) && defined(_MSC_VER)
|
23
|
+
return _strtoi64(s, endptr, base);
|
24
|
+
#elif defined(ICE_64) && !defined(_WIN32)
|
25
|
+
return strtol(s, endptr, base);
|
26
|
+
#else
|
27
|
+
return strtoll(s, endptr, base);
|
28
|
+
#endif
|
29
|
+
}
|
30
|
+
|
31
|
+
bool
|
32
|
+
stringToInt64(const string& s, Int64& result)
|
33
|
+
{
|
34
|
+
const char* start = s.c_str();
|
35
|
+
char* end = 0;
|
36
|
+
errno = 0;
|
37
|
+
result = strToInt64(start, &end, 0);
|
38
|
+
return (errno == 0 && start != end);
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# **********************************************************************
|
2
|
+
#
|
3
|
+
# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
#
|
5
|
+
# This copy of Ice is licensed to you under the terms described in the
|
6
|
+
# ICE_LICENSE file included in this distribution.
|
7
|
+
#
|
8
|
+
# **********************************************************************
|
9
|
+
|
10
|
+
top_srcdir = ../..
|
11
|
+
|
12
|
+
LIBFILENAME = $(call mklibfilename,IceUtil,$(VERSION))
|
13
|
+
SONAME = $(call mksoname,IceUtil,$(SOVERSION))
|
14
|
+
LIBNAME = $(call mklibname,IceUtil)
|
15
|
+
TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)$(cpp11libdirsuffix)/$(LIBNAME))
|
16
|
+
|
17
|
+
OBJS = ArgVector.o \
|
18
|
+
Cond.o \
|
19
|
+
ConvertUTF.o \
|
20
|
+
CountDownLatch.o \
|
21
|
+
CtrlCHandler.o \
|
22
|
+
Exception.o \
|
23
|
+
FileUtil.o \
|
24
|
+
InputUtil.o \
|
25
|
+
MutexProtocol.o \
|
26
|
+
Options.o \
|
27
|
+
OutputUtil.o \
|
28
|
+
Random.o \
|
29
|
+
RecMutex.o \
|
30
|
+
SHA1.o \
|
31
|
+
Shared.o \
|
32
|
+
StringConverter.o \
|
33
|
+
StringUtil.o \
|
34
|
+
Thread.o \
|
35
|
+
ThreadException.o \
|
36
|
+
Time.o \
|
37
|
+
Timer.o \
|
38
|
+
Unicode.o \
|
39
|
+
UUID.o
|
40
|
+
|
41
|
+
include $(top_srcdir)/config/Make.rules
|
42
|
+
|
43
|
+
CPPFLAGS := $(CPPFLAGS) $(ICEUTIL_FLAGS) -DICE_UTIL_API_EXPORTS -I..
|
44
|
+
LINKWITH := $(ICEUTIL_OS_LIBS)
|
45
|
+
|
46
|
+
ifeq ($(STATICLIBS),yes)
|
47
|
+
$(libdir)/$(LIBNAME): $(OBJS)
|
48
|
+
@mkdir -p $(dir $@)
|
49
|
+
rm -f $@
|
50
|
+
$(call mklib,$@,$(OBJS))
|
51
|
+
else
|
52
|
+
$(libdir)/$(LIBFILENAME): $(OBJS)
|
53
|
+
@mkdir -p $(dir $@)
|
54
|
+
rm -f $@
|
55
|
+
$(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH))
|
56
|
+
|
57
|
+
$(libdir)/$(SONAME): $(libdir)/$(LIBFILENAME)
|
58
|
+
rm -f $@
|
59
|
+
ln -s $(LIBFILENAME) $@
|
60
|
+
|
61
|
+
$(libdir)$(cpp11libdirsuffix)/$(LIBNAME): $(libdir)/$(SONAME)
|
62
|
+
@mkdir -p $(libdir)$(cpp11libdirsuffix)
|
63
|
+
rm -f $@
|
64
|
+
ln -s $(cpp11sonamedir)$(SONAME) $@
|
65
|
+
endif
|
66
|
+
|
67
|
+
install:: all
|
68
|
+
$(call installlib,$(DESTDIR)$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#include <IceUtil/MutexProtocol.h>
|
11
|
+
|
12
|
+
IceUtil::MutexProtocol
|
13
|
+
IceUtil::getDefaultMutexProtocol()
|
14
|
+
{
|
15
|
+
#ifdef _WIN32
|
16
|
+
return PrioNone;
|
17
|
+
#else
|
18
|
+
# if defined(ICE_PRIO_INHERIT) && defined(_POSIX_THREAD_PRIO_INHERIT) && _POSIX_THREAD_PRIO_INHERIT > 0
|
19
|
+
return PrioInherit;
|
20
|
+
# else
|
21
|
+
return PrioNone;
|
22
|
+
# endif
|
23
|
+
#endif
|
24
|
+
}
|
@@ -0,0 +1,1049 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#include <IceUtil/Options.h>
|
11
|
+
#include <IceUtil/StringUtil.h>
|
12
|
+
#include <iostream>
|
13
|
+
#include <set>
|
14
|
+
|
15
|
+
using namespace std;
|
16
|
+
using namespace IceUtil;
|
17
|
+
|
18
|
+
IceUtilInternal::APIException::APIException(const char* file, int line, const string& r)
|
19
|
+
: IceUtil::Exception(file, line), reason(r)
|
20
|
+
{
|
21
|
+
}
|
22
|
+
|
23
|
+
IceUtilInternal::APIException::~APIException() throw()
|
24
|
+
{
|
25
|
+
}
|
26
|
+
|
27
|
+
const char* IceUtilInternal::APIException::_name = "IceUtilInternal::APIException";
|
28
|
+
|
29
|
+
string
|
30
|
+
IceUtilInternal::APIException::ice_name() const
|
31
|
+
{
|
32
|
+
return _name;
|
33
|
+
}
|
34
|
+
|
35
|
+
void
|
36
|
+
IceUtilInternal::APIException::ice_print(ostream& out) const
|
37
|
+
{
|
38
|
+
Exception::ice_print(out);
|
39
|
+
if(!reason.empty())
|
40
|
+
{
|
41
|
+
out << ": " << reason;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
IceUtilInternal::APIException*
|
46
|
+
IceUtilInternal::APIException::ice_clone() const
|
47
|
+
{
|
48
|
+
return new APIException(*this);
|
49
|
+
}
|
50
|
+
|
51
|
+
void
|
52
|
+
IceUtilInternal::APIException::ice_throw() const
|
53
|
+
{
|
54
|
+
throw *this;
|
55
|
+
}
|
56
|
+
|
57
|
+
ostream&
|
58
|
+
IceUtilInternal::operator<<(ostream& out, const IceUtilInternal::APIException& ex)
|
59
|
+
{
|
60
|
+
ex.ice_print(out);
|
61
|
+
return out;
|
62
|
+
}
|
63
|
+
|
64
|
+
IceUtilInternal::BadOptException::BadOptException(const char* file, int line, const string& r)
|
65
|
+
: IceUtil::Exception(file, line), reason(r)
|
66
|
+
{
|
67
|
+
}
|
68
|
+
|
69
|
+
IceUtilInternal::BadOptException::~BadOptException() throw()
|
70
|
+
{
|
71
|
+
}
|
72
|
+
|
73
|
+
const char* IceUtilInternal::BadOptException::_name = "IceUtilInternal::BadOptException";
|
74
|
+
|
75
|
+
string
|
76
|
+
IceUtilInternal::BadOptException::ice_name() const
|
77
|
+
{
|
78
|
+
return _name;
|
79
|
+
}
|
80
|
+
|
81
|
+
void
|
82
|
+
IceUtilInternal::BadOptException::ice_print(ostream& out) const
|
83
|
+
{
|
84
|
+
Exception::ice_print(out);
|
85
|
+
if(!reason.empty())
|
86
|
+
{
|
87
|
+
out << ": " << reason;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
IceUtilInternal::BadOptException*
|
92
|
+
IceUtilInternal::BadOptException::ice_clone() const
|
93
|
+
{
|
94
|
+
return new BadOptException(*this);
|
95
|
+
}
|
96
|
+
|
97
|
+
void
|
98
|
+
IceUtilInternal::BadOptException::ice_throw() const
|
99
|
+
{
|
100
|
+
throw *this;
|
101
|
+
}
|
102
|
+
|
103
|
+
ostream&
|
104
|
+
IceUtilInternal::operator<<(ostream& out, const IceUtilInternal::BadOptException& ex)
|
105
|
+
{
|
106
|
+
ex.ice_print(out);
|
107
|
+
return out;
|
108
|
+
}
|
109
|
+
|
110
|
+
IceUtilInternal::Options::Options()
|
111
|
+
: parseCalled(false)
|
112
|
+
{
|
113
|
+
}
|
114
|
+
|
115
|
+
void
|
116
|
+
IceUtilInternal::Options::checkArgs(const string& shortOpt, const string& longOpt, bool needArg, const string& dflt)
|
117
|
+
{
|
118
|
+
if(shortOpt.empty() && longOpt.empty())
|
119
|
+
{
|
120
|
+
throw IllegalArgumentException(__FILE__, __LINE__, "short and long option cannot both be empty");
|
121
|
+
}
|
122
|
+
|
123
|
+
if(!shortOpt.empty())
|
124
|
+
{
|
125
|
+
if(shortOpt.size() != 1)
|
126
|
+
{
|
127
|
+
string err = "`";
|
128
|
+
err += shortOpt;
|
129
|
+
err += "': a short option cannot specify more than one option";
|
130
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
131
|
+
}
|
132
|
+
if(shortOpt.find_first_of(" \t\n\r\f\v") != string::npos)
|
133
|
+
{
|
134
|
+
string err = "`";
|
135
|
+
err += shortOpt;
|
136
|
+
err += "': a short option cannot be whitespace";
|
137
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
138
|
+
}
|
139
|
+
if(shortOpt[0] == '-')
|
140
|
+
{
|
141
|
+
string err = "`";
|
142
|
+
err += shortOpt;
|
143
|
+
err += "': a short option cannot be `-'";
|
144
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
if(!longOpt.empty())
|
149
|
+
{
|
150
|
+
if(longOpt.find_first_of(" \t\n\r\f\v") != string::npos)
|
151
|
+
{
|
152
|
+
string err = "`";
|
153
|
+
err += longOpt;
|
154
|
+
err += "': a long option cannot contain whitespace";
|
155
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
156
|
+
}
|
157
|
+
if(longOpt[0] == '-')
|
158
|
+
{
|
159
|
+
string err = "`";
|
160
|
+
err += longOpt;
|
161
|
+
err += "': a long option must not contain a leading `-'";
|
162
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
if(!needArg && !dflt.empty())
|
167
|
+
{
|
168
|
+
throw IllegalArgumentException(__FILE__, __LINE__,
|
169
|
+
"a default value can be specified only for options requiring an argument");
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
void
|
174
|
+
IceUtilInternal::Options::addOpt(const string& shortOpt, const string& longOpt, ArgType at, string dflt, RepeatType rt)
|
175
|
+
{
|
176
|
+
RecMutex::Lock sync(_m);
|
177
|
+
|
178
|
+
if(parseCalled)
|
179
|
+
{
|
180
|
+
throw APIException(__FILE__, __LINE__, "cannot add options after parse() was called");
|
181
|
+
}
|
182
|
+
|
183
|
+
checkArgs(shortOpt, longOpt, at == NeedArg, dflt);
|
184
|
+
|
185
|
+
addValidOpt(shortOpt, longOpt, at, dflt, rt);
|
186
|
+
}
|
187
|
+
|
188
|
+
//
|
189
|
+
// Split a command line into argv-style arguments, applying
|
190
|
+
// bash quoting rules. The return value is the arguments
|
191
|
+
// in the command line, with all shell escapes applied, and
|
192
|
+
// quotes removed.
|
193
|
+
//
|
194
|
+
|
195
|
+
IceUtilInternal::Options::StringVector
|
196
|
+
IceUtilInternal::Options::split(const string& line)
|
197
|
+
{
|
198
|
+
const string IFS = " \t\n"; // Internal Field Separator.
|
199
|
+
|
200
|
+
//
|
201
|
+
// Strip leading and trailing whitespace.
|
202
|
+
//
|
203
|
+
string::size_type start = line.find_first_not_of(IFS);
|
204
|
+
if(start == string::npos)
|
205
|
+
{
|
206
|
+
return StringVector();
|
207
|
+
}
|
208
|
+
string::size_type end = line.find_last_not_of(IFS);
|
209
|
+
assert(end != string::npos);
|
210
|
+
|
211
|
+
string l(line, start, end - start + 1);
|
212
|
+
|
213
|
+
StringVector vec;
|
214
|
+
|
215
|
+
enum ParseState { Normal, DoubleQuote, SingleQuote, ANSIQuote };
|
216
|
+
ParseState state = Normal;
|
217
|
+
|
218
|
+
string arg;
|
219
|
+
|
220
|
+
for(string::size_type i = 0; i < l.size(); ++i)
|
221
|
+
{
|
222
|
+
char c = l[i];
|
223
|
+
switch(state)
|
224
|
+
{
|
225
|
+
case Normal:
|
226
|
+
{
|
227
|
+
switch(c)
|
228
|
+
{
|
229
|
+
case '\\':
|
230
|
+
{
|
231
|
+
//
|
232
|
+
// Ignore a backslash at the end of the string,
|
233
|
+
// and strip backslash-newline pairs. If a
|
234
|
+
// backslash is followed by a space, single quote,
|
235
|
+
// double quote, or dollar sign, we drop the backslash
|
236
|
+
// and write the space, single quote, double quote,
|
237
|
+
// or dollar sign. This is necessary to allow quotes
|
238
|
+
// to be escaped. Dropping the backslash preceding a
|
239
|
+
// space deviates from bash quoting rules, but is
|
240
|
+
// necessary so we don't drop backslashes from Windows
|
241
|
+
// path names.)
|
242
|
+
//
|
243
|
+
if(i < l.size() - 1 && l[++i] != '\n')
|
244
|
+
{
|
245
|
+
switch(l[i])
|
246
|
+
{
|
247
|
+
case ' ':
|
248
|
+
case '$':
|
249
|
+
case '\'':
|
250
|
+
case '"':
|
251
|
+
{
|
252
|
+
arg.push_back(l[i]);
|
253
|
+
break;
|
254
|
+
}
|
255
|
+
default:
|
256
|
+
{
|
257
|
+
arg.push_back('\\');
|
258
|
+
arg.push_back(l[i]);
|
259
|
+
break;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
}
|
263
|
+
break;
|
264
|
+
}
|
265
|
+
case '\'':
|
266
|
+
{
|
267
|
+
state = SingleQuote;
|
268
|
+
break;
|
269
|
+
}
|
270
|
+
case '"':
|
271
|
+
{
|
272
|
+
state = DoubleQuote;
|
273
|
+
break;
|
274
|
+
}
|
275
|
+
case '$':
|
276
|
+
{
|
277
|
+
if(i < l.size() - 1 && l[i + 1] == '\'')
|
278
|
+
{
|
279
|
+
state = ANSIQuote; // Bash uses $'<text>' to allow ANSI escape sequences within <text>.
|
280
|
+
++i;
|
281
|
+
}
|
282
|
+
else
|
283
|
+
{
|
284
|
+
arg.push_back('$');
|
285
|
+
}
|
286
|
+
break;
|
287
|
+
}
|
288
|
+
default:
|
289
|
+
{
|
290
|
+
if(IFS.find(l[i]) != string::npos)
|
291
|
+
{
|
292
|
+
vec.push_back(arg);
|
293
|
+
arg.clear();
|
294
|
+
|
295
|
+
//
|
296
|
+
// Move to start of next argument.
|
297
|
+
//
|
298
|
+
while(++i < l.size() && IFS.find(l[i]) != string::npos)
|
299
|
+
{
|
300
|
+
;
|
301
|
+
}
|
302
|
+
--i;
|
303
|
+
}
|
304
|
+
else
|
305
|
+
{
|
306
|
+
arg.push_back(l[i]);
|
307
|
+
}
|
308
|
+
break;
|
309
|
+
}
|
310
|
+
}
|
311
|
+
break;
|
312
|
+
}
|
313
|
+
case DoubleQuote:
|
314
|
+
{
|
315
|
+
//
|
316
|
+
// Within double quotes, only backslash retains its special
|
317
|
+
// meaning, and only if followed by double quote, backslash,
|
318
|
+
// or newline. If not followed by one of these characters,
|
319
|
+
// both the backslash and the character are preserved.
|
320
|
+
//
|
321
|
+
if(c == '\\' && i < l.size() - 1)
|
322
|
+
{
|
323
|
+
switch(c = l[++i])
|
324
|
+
{
|
325
|
+
case '"':
|
326
|
+
case '\\':
|
327
|
+
case '\n':
|
328
|
+
{
|
329
|
+
arg.push_back(c);
|
330
|
+
break;
|
331
|
+
}
|
332
|
+
default:
|
333
|
+
{
|
334
|
+
arg.push_back('\\');
|
335
|
+
arg.push_back(c);
|
336
|
+
break;
|
337
|
+
}
|
338
|
+
}
|
339
|
+
}
|
340
|
+
else if(c == '"') // End of double-quote mode.
|
341
|
+
{
|
342
|
+
state = Normal;
|
343
|
+
}
|
344
|
+
else
|
345
|
+
{
|
346
|
+
arg.push_back(c); // Everything else is taken literally.
|
347
|
+
}
|
348
|
+
break;
|
349
|
+
}
|
350
|
+
case SingleQuote:
|
351
|
+
{
|
352
|
+
if(c == '\'') // End of single-quote mode.
|
353
|
+
{
|
354
|
+
state = Normal;
|
355
|
+
}
|
356
|
+
else
|
357
|
+
{
|
358
|
+
arg.push_back(c); // Everything else is taken literally.
|
359
|
+
}
|
360
|
+
break;
|
361
|
+
}
|
362
|
+
case ANSIQuote:
|
363
|
+
{
|
364
|
+
switch(c)
|
365
|
+
{
|
366
|
+
case '\\':
|
367
|
+
{
|
368
|
+
if(i == l.size() - 1)
|
369
|
+
{
|
370
|
+
break;
|
371
|
+
}
|
372
|
+
switch(c = l[++i])
|
373
|
+
{
|
374
|
+
//
|
375
|
+
// Single-letter escape sequences.
|
376
|
+
//
|
377
|
+
case 'a':
|
378
|
+
{
|
379
|
+
arg.push_back('\a');
|
380
|
+
break;
|
381
|
+
}
|
382
|
+
case 'b':
|
383
|
+
{
|
384
|
+
arg.push_back('\b');
|
385
|
+
break;
|
386
|
+
}
|
387
|
+
case 'f':
|
388
|
+
{
|
389
|
+
arg.push_back('\f');
|
390
|
+
break;
|
391
|
+
}
|
392
|
+
case 'n':
|
393
|
+
{
|
394
|
+
arg.push_back('\n');
|
395
|
+
break;
|
396
|
+
}
|
397
|
+
case 'r':
|
398
|
+
{
|
399
|
+
arg.push_back('\r');
|
400
|
+
break;
|
401
|
+
}
|
402
|
+
case 't':
|
403
|
+
{
|
404
|
+
arg.push_back('\t');
|
405
|
+
break;
|
406
|
+
}
|
407
|
+
case 'v':
|
408
|
+
{
|
409
|
+
arg.push_back('\v');
|
410
|
+
break;
|
411
|
+
}
|
412
|
+
case '\\':
|
413
|
+
{
|
414
|
+
arg.push_back('\\');
|
415
|
+
break;
|
416
|
+
}
|
417
|
+
case '\'':
|
418
|
+
{
|
419
|
+
arg.push_back('\'');
|
420
|
+
break;
|
421
|
+
}
|
422
|
+
case 'e': // Not ANSI-C, but used by bash.
|
423
|
+
{
|
424
|
+
arg.push_back('\033');
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
|
428
|
+
//
|
429
|
+
// Process up to three octal digits.
|
430
|
+
//
|
431
|
+
case '0':
|
432
|
+
case '1':
|
433
|
+
case '2':
|
434
|
+
case '3':
|
435
|
+
case '4':
|
436
|
+
case '5':
|
437
|
+
case '6':
|
438
|
+
case '7':
|
439
|
+
{
|
440
|
+
static const string octalDigits = "01234567";
|
441
|
+
unsigned short us = 0;
|
442
|
+
string::size_type j;
|
443
|
+
for(j = i;
|
444
|
+
j < i + 3 && j < l.size() && octalDigits.find_first_of(c = l[j]) != string::npos;
|
445
|
+
++j)
|
446
|
+
{
|
447
|
+
us = us * 8 + c - '0';
|
448
|
+
}
|
449
|
+
i = j - 1;
|
450
|
+
arg.push_back(static_cast<char>(us));
|
451
|
+
break;
|
452
|
+
}
|
453
|
+
|
454
|
+
//
|
455
|
+
// Process up to two hex digits.
|
456
|
+
//
|
457
|
+
case 'x':
|
458
|
+
{
|
459
|
+
if(i < l.size() - 1 && !isxdigit(static_cast<unsigned char>(l[i + 1])))
|
460
|
+
{
|
461
|
+
arg.push_back('\\');
|
462
|
+
arg.push_back('x');
|
463
|
+
break;
|
464
|
+
}
|
465
|
+
|
466
|
+
Int64 ull = 0;
|
467
|
+
string::size_type j;
|
468
|
+
for(j = i + 1; j < i + 3 && j < l.size() &&
|
469
|
+
isxdigit(static_cast<unsigned char>(c = l[j])); ++j)
|
470
|
+
{
|
471
|
+
ull *= 16;
|
472
|
+
if(isdigit(static_cast<unsigned char>(c)))
|
473
|
+
{
|
474
|
+
ull += c - '0';
|
475
|
+
}
|
476
|
+
else if(islower(static_cast<unsigned char>(c)))
|
477
|
+
{
|
478
|
+
ull += c - 'a' + 10;
|
479
|
+
}
|
480
|
+
else
|
481
|
+
{
|
482
|
+
ull += c - 'A' + 10;
|
483
|
+
}
|
484
|
+
}
|
485
|
+
i = j - 1;
|
486
|
+
arg.push_back(static_cast<char>(ull));
|
487
|
+
break;
|
488
|
+
}
|
489
|
+
|
490
|
+
//
|
491
|
+
// Process control-chars.
|
492
|
+
//
|
493
|
+
case 'c':
|
494
|
+
{
|
495
|
+
c = l[++i];
|
496
|
+
if(IceUtilInternal::isAlpha(c) || c == '@' || (c >= '[' && c <= '_'))
|
497
|
+
{
|
498
|
+
arg.push_back(static_cast<char>(toupper(static_cast<unsigned char>(c)) - '@'));
|
499
|
+
}
|
500
|
+
else
|
501
|
+
{
|
502
|
+
//
|
503
|
+
// Bash does not define what should happen if a \c
|
504
|
+
// is not followed by a recognized control character.
|
505
|
+
// We simply treat this case like other unrecognized
|
506
|
+
// escape sequences, that is, we preserve the escape
|
507
|
+
// sequence unchanged.
|
508
|
+
//
|
509
|
+
arg.push_back('\\');
|
510
|
+
arg.push_back('c');
|
511
|
+
arg.push_back(c);
|
512
|
+
}
|
513
|
+
break;
|
514
|
+
}
|
515
|
+
|
516
|
+
//
|
517
|
+
// If inside an ANSI-quoted string, a backslash isn't followed by
|
518
|
+
// one of the recognized characters, both the backslash and the
|
519
|
+
// character are preserved.
|
520
|
+
//
|
521
|
+
default:
|
522
|
+
{
|
523
|
+
arg.push_back('\\');
|
524
|
+
arg.push_back(c);
|
525
|
+
break;
|
526
|
+
}
|
527
|
+
}
|
528
|
+
break;
|
529
|
+
}
|
530
|
+
case '\'': // End of ANSI-quote mode.
|
531
|
+
{
|
532
|
+
state = Normal;
|
533
|
+
break;
|
534
|
+
}
|
535
|
+
default:
|
536
|
+
{
|
537
|
+
arg.push_back(c); // Everything else is taken literally.
|
538
|
+
break;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
break;
|
542
|
+
}
|
543
|
+
default:
|
544
|
+
{
|
545
|
+
assert(!"Impossible parse state");
|
546
|
+
break;
|
547
|
+
}
|
548
|
+
}
|
549
|
+
}
|
550
|
+
|
551
|
+
switch(state)
|
552
|
+
{
|
553
|
+
case Normal:
|
554
|
+
{
|
555
|
+
vec.push_back(arg);
|
556
|
+
break;
|
557
|
+
}
|
558
|
+
case SingleQuote:
|
559
|
+
{
|
560
|
+
throw BadOptException(__FILE__, __LINE__, "missing closing single quote");
|
561
|
+
break;
|
562
|
+
}
|
563
|
+
case DoubleQuote:
|
564
|
+
{
|
565
|
+
throw BadOptException(__FILE__, __LINE__, "missing closing double quote");
|
566
|
+
break;
|
567
|
+
}
|
568
|
+
case ANSIQuote:
|
569
|
+
{
|
570
|
+
throw BadOptException(__FILE__, __LINE__, "unterminated $' quote");
|
571
|
+
break;
|
572
|
+
}
|
573
|
+
default:
|
574
|
+
{
|
575
|
+
assert(!"Impossible parse state");
|
576
|
+
break;
|
577
|
+
}
|
578
|
+
}
|
579
|
+
|
580
|
+
return vec;
|
581
|
+
}
|
582
|
+
|
583
|
+
//
|
584
|
+
// Parse a vector of arguments and return the non-option
|
585
|
+
// arguments as the return value. Throw BadOptException if any of the
|
586
|
+
// options are invalid.
|
587
|
+
// Note that args[0] is ignored because that is the name
|
588
|
+
// of the executable.
|
589
|
+
//
|
590
|
+
|
591
|
+
IceUtilInternal::Options::StringVector
|
592
|
+
IceUtilInternal::Options::parse(const StringVector& args)
|
593
|
+
{
|
594
|
+
RecMutex::Lock sync(_m);
|
595
|
+
|
596
|
+
if(parseCalled)
|
597
|
+
{
|
598
|
+
throw APIException(__FILE__, __LINE__, "cannot call parse() more than once on the same Option instance");
|
599
|
+
}
|
600
|
+
parseCalled = true;
|
601
|
+
|
602
|
+
set<string> seenNonRepeatableOpts; // To catch repeated non-repeatable options.
|
603
|
+
|
604
|
+
StringVector result;
|
605
|
+
|
606
|
+
string::size_type i;
|
607
|
+
for(i = 1; i < args.size(); ++i)
|
608
|
+
{
|
609
|
+
if(args[i] == "-" || args[i] == "--")
|
610
|
+
{
|
611
|
+
++i;
|
612
|
+
break; // "-" and "--" indicate end of options.
|
613
|
+
}
|
614
|
+
|
615
|
+
string opt;
|
616
|
+
ValidOpts::iterator pos;
|
617
|
+
bool argDone = false;
|
618
|
+
|
619
|
+
if(args[i].compare(0, 2, "--") == 0)
|
620
|
+
{
|
621
|
+
//
|
622
|
+
// Long option. If the option has an argument, it can either be separated by '='
|
623
|
+
// or appear as a separate argument. For example, "--name value" is the same
|
624
|
+
// as "--name=value".
|
625
|
+
//
|
626
|
+
string::size_type p = args[i].find('=', 2);
|
627
|
+
if(p != string::npos)
|
628
|
+
{
|
629
|
+
opt = args[i].substr(2, p - 2);
|
630
|
+
}
|
631
|
+
else
|
632
|
+
{
|
633
|
+
opt = args[i].substr(2);
|
634
|
+
}
|
635
|
+
|
636
|
+
pos = checkOpt(opt, LongOpt);
|
637
|
+
|
638
|
+
if(pos->second->repeat == NoRepeat)
|
639
|
+
{
|
640
|
+
set<string>::iterator seenPos = seenNonRepeatableOpts.find(opt);
|
641
|
+
if(seenPos != seenNonRepeatableOpts.end())
|
642
|
+
{
|
643
|
+
string err = "`--";
|
644
|
+
err += opt + ":' option cannot be repeated";
|
645
|
+
throw BadOptException(__FILE__, __LINE__, err);
|
646
|
+
}
|
647
|
+
seenNonRepeatableOpts.insert(seenPos, opt);
|
648
|
+
string synonym = getSynonym(opt);
|
649
|
+
if(!synonym.empty())
|
650
|
+
{
|
651
|
+
seenNonRepeatableOpts.insert(synonym);
|
652
|
+
}
|
653
|
+
}
|
654
|
+
|
655
|
+
if(p != string::npos)
|
656
|
+
{
|
657
|
+
if(pos->second->arg == NoArg && p != args[i].size() - 1)
|
658
|
+
{
|
659
|
+
string err = "`";
|
660
|
+
err += args[i];
|
661
|
+
err += "': option does not take an argument";
|
662
|
+
throw BadOptException(__FILE__, __LINE__, err);
|
663
|
+
}
|
664
|
+
setOpt(opt, "", args[i].substr(p + 1), pos->second->repeat);
|
665
|
+
argDone = true;
|
666
|
+
}
|
667
|
+
}
|
668
|
+
else if(!args[i].empty() && args[i][0] == '-')
|
669
|
+
{
|
670
|
+
//
|
671
|
+
// Short option.
|
672
|
+
//
|
673
|
+
for(string::size_type p = 1; p < args[i].size(); ++p)
|
674
|
+
{
|
675
|
+
opt.clear();
|
676
|
+
opt.push_back(args[i][p]);
|
677
|
+
pos = checkOpt(opt, ShortOpt);
|
678
|
+
|
679
|
+
if(pos->second->repeat == NoRepeat)
|
680
|
+
{
|
681
|
+
set<string>::iterator seenPos = seenNonRepeatableOpts.find(opt);
|
682
|
+
if(seenPos != seenNonRepeatableOpts.end())
|
683
|
+
{
|
684
|
+
string err = "`-";
|
685
|
+
err += opt + ":' option cannot be repeated";
|
686
|
+
throw BadOptException(__FILE__, __LINE__, err);
|
687
|
+
}
|
688
|
+
seenNonRepeatableOpts.insert(seenPos, opt);
|
689
|
+
string synonym = getSynonym(opt);
|
690
|
+
if(!synonym.empty())
|
691
|
+
{
|
692
|
+
seenNonRepeatableOpts.insert(synonym);
|
693
|
+
}
|
694
|
+
}
|
695
|
+
|
696
|
+
if(pos->second->arg == NeedArg && p != args[i].size() - 1)
|
697
|
+
{
|
698
|
+
string optArg = args[i].substr(p + 1);
|
699
|
+
setOpt(opt, "", optArg, pos->second->repeat);
|
700
|
+
argDone = true;
|
701
|
+
break;
|
702
|
+
}
|
703
|
+
}
|
704
|
+
}
|
705
|
+
else
|
706
|
+
{
|
707
|
+
//
|
708
|
+
// Not an option or option argument.
|
709
|
+
//
|
710
|
+
result.push_back(args[i]);
|
711
|
+
argDone = true;
|
712
|
+
}
|
713
|
+
|
714
|
+
if(!argDone)
|
715
|
+
{
|
716
|
+
if(pos->second->arg == NeedArg) // Need an argument that is separated by whitespace.
|
717
|
+
{
|
718
|
+
if(i == args.size() - 1)
|
719
|
+
{
|
720
|
+
string err = "`-";
|
721
|
+
if(opt.size() != 1)
|
722
|
+
{
|
723
|
+
err += "-";
|
724
|
+
}
|
725
|
+
err += opt;
|
726
|
+
err += "' option requires an argument";
|
727
|
+
throw BadOptException(__FILE__, __LINE__, err);
|
728
|
+
}
|
729
|
+
setOpt(opt, "", args[++i], pos->second->repeat);
|
730
|
+
}
|
731
|
+
else
|
732
|
+
{
|
733
|
+
setOpt(opt, "", "1", pos->second->repeat);
|
734
|
+
}
|
735
|
+
}
|
736
|
+
}
|
737
|
+
|
738
|
+
_synonyms.clear(); // Don't need the contents anymore.
|
739
|
+
|
740
|
+
while(i < args.size())
|
741
|
+
{
|
742
|
+
result.push_back(args[i++]);
|
743
|
+
}
|
744
|
+
|
745
|
+
return result;
|
746
|
+
}
|
747
|
+
|
748
|
+
//
|
749
|
+
// Parse a normal argc/argv pair and return the non-option
|
750
|
+
// arguments as the return value.
|
751
|
+
//
|
752
|
+
|
753
|
+
IceUtilInternal::Options::StringVector
|
754
|
+
IceUtilInternal::Options::parse(int argc, const char* const argv[])
|
755
|
+
{
|
756
|
+
StringVector vec;
|
757
|
+
for(int i = 0; i < argc; ++i)
|
758
|
+
{
|
759
|
+
vec.push_back(argv[i]);
|
760
|
+
}
|
761
|
+
return parse(vec);
|
762
|
+
}
|
763
|
+
|
764
|
+
bool
|
765
|
+
IceUtilInternal::Options::isSet(const string& opt) const
|
766
|
+
{
|
767
|
+
RecMutex::Lock sync(_m);
|
768
|
+
|
769
|
+
if(!parseCalled)
|
770
|
+
{
|
771
|
+
throw APIException(__FILE__, __LINE__, "cannot lookup options before calling parse()");
|
772
|
+
}
|
773
|
+
|
774
|
+
ValidOpts::const_iterator pos = checkOptIsValid(opt);
|
775
|
+
return pos->second->repeat == NoRepeat ? _opts.find(opt) != _opts.end() : _ropts.find(opt) != _ropts.end();
|
776
|
+
}
|
777
|
+
|
778
|
+
string
|
779
|
+
IceUtilInternal::Options::optArg(const string& opt) const
|
780
|
+
{
|
781
|
+
RecMutex::Lock sync(_m);
|
782
|
+
|
783
|
+
if(!parseCalled)
|
784
|
+
{
|
785
|
+
throw APIException(__FILE__, __LINE__, "cannot lookup options before calling parse()");
|
786
|
+
}
|
787
|
+
|
788
|
+
ValidOpts::const_iterator pos = checkOptHasArg(opt);
|
789
|
+
|
790
|
+
if(pos->second->repeat == Repeat)
|
791
|
+
{
|
792
|
+
string err = "`-";
|
793
|
+
if(pos->second->length == LongOpt)
|
794
|
+
{
|
795
|
+
err.push_back('-');
|
796
|
+
}
|
797
|
+
err += opt;
|
798
|
+
err += "': is a repeating option -- use argVec() to get its arguments";
|
799
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
800
|
+
}
|
801
|
+
|
802
|
+
Opts::const_iterator p = _opts.find(opt);
|
803
|
+
if(p == _opts.end())
|
804
|
+
{
|
805
|
+
return "";
|
806
|
+
}
|
807
|
+
return p->second->val;
|
808
|
+
}
|
809
|
+
|
810
|
+
IceUtilInternal::Options::StringVector
|
811
|
+
IceUtilInternal::Options::argVec(const string& opt) const
|
812
|
+
{
|
813
|
+
RecMutex::Lock sync(_m);
|
814
|
+
|
815
|
+
if(!parseCalled)
|
816
|
+
{
|
817
|
+
throw APIException(__FILE__, __LINE__, "cannot lookup options before calling parse()");
|
818
|
+
}
|
819
|
+
|
820
|
+
ValidOpts::const_iterator pos = checkOptHasArg(opt);
|
821
|
+
|
822
|
+
if(pos->second->repeat == NoRepeat)
|
823
|
+
{
|
824
|
+
string err = "`-";
|
825
|
+
if(pos->second->length == LongOpt)
|
826
|
+
{
|
827
|
+
err.push_back('-');
|
828
|
+
}
|
829
|
+
err += opt + "': is a non-repeating option -- use optArg() to get its argument";
|
830
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
831
|
+
}
|
832
|
+
|
833
|
+
ROpts::const_iterator p = _ropts.find(opt);
|
834
|
+
return p == _ropts.end() ? StringVector() : p->second->vals;
|
835
|
+
}
|
836
|
+
|
837
|
+
void
|
838
|
+
IceUtilInternal::Options::addValidOpt(const string& shortOpt, const string& longOpt,
|
839
|
+
ArgType at, const string& dflt, RepeatType rt)
|
840
|
+
{
|
841
|
+
if(!shortOpt.empty() && _validOpts.find(shortOpt) != _validOpts.end())
|
842
|
+
{
|
843
|
+
string err = "`";
|
844
|
+
err += shortOpt;
|
845
|
+
err += "': duplicate option";
|
846
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
847
|
+
}
|
848
|
+
if(!longOpt.empty() && _validOpts.find(longOpt) != _validOpts.end())
|
849
|
+
{
|
850
|
+
string err = "`";
|
851
|
+
err += longOpt;
|
852
|
+
err += "': duplicate option";
|
853
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
854
|
+
}
|
855
|
+
|
856
|
+
ODPtr odp = new OptionDetails;
|
857
|
+
odp->arg = at;
|
858
|
+
odp->repeat = rt;
|
859
|
+
odp->hasDefault = !dflt.empty();
|
860
|
+
|
861
|
+
if(!shortOpt.empty())
|
862
|
+
{
|
863
|
+
odp->length = ShortOpt;
|
864
|
+
_validOpts[shortOpt] = odp;
|
865
|
+
}
|
866
|
+
if(!longOpt.empty())
|
867
|
+
{
|
868
|
+
odp->length = LongOpt;
|
869
|
+
_validOpts[longOpt] = odp;
|
870
|
+
}
|
871
|
+
|
872
|
+
updateSynonyms(shortOpt, longOpt);
|
873
|
+
|
874
|
+
if(at == NeedArg && !dflt.empty())
|
875
|
+
{
|
876
|
+
setOpt(shortOpt, longOpt, dflt, rt);
|
877
|
+
}
|
878
|
+
}
|
879
|
+
|
880
|
+
IceUtilInternal::Options::ValidOpts::iterator
|
881
|
+
IceUtilInternal::Options::checkOpt(const string& opt, LengthType lt)
|
882
|
+
{
|
883
|
+
ValidOpts::iterator pos = _validOpts.find(opt);
|
884
|
+
if(pos == _validOpts.end())
|
885
|
+
{
|
886
|
+
string err = "invalid option: `-";
|
887
|
+
if(lt == LongOpt)
|
888
|
+
{
|
889
|
+
err.push_back('-');
|
890
|
+
}
|
891
|
+
err += opt;
|
892
|
+
err.push_back('\'');
|
893
|
+
throw BadOptException(__FILE__, __LINE__, err);
|
894
|
+
}
|
895
|
+
return pos;
|
896
|
+
}
|
897
|
+
|
898
|
+
void
|
899
|
+
IceUtilInternal::Options::setOpt(const string& opt1, const string& opt2, const string& val, RepeatType rt)
|
900
|
+
{
|
901
|
+
//
|
902
|
+
// opt1 and opt2 (short and long opt) can't both be empty.
|
903
|
+
//
|
904
|
+
assert(!(opt1.empty() && opt2.empty()));
|
905
|
+
|
906
|
+
if(rt == NoRepeat)
|
907
|
+
{
|
908
|
+
setNonRepeatingOpt(opt1, val);
|
909
|
+
setNonRepeatingOpt(opt2, val);
|
910
|
+
}
|
911
|
+
else
|
912
|
+
{
|
913
|
+
setRepeatingOpt(opt1, val);
|
914
|
+
setRepeatingOpt(opt2, val);
|
915
|
+
}
|
916
|
+
}
|
917
|
+
|
918
|
+
void
|
919
|
+
IceUtilInternal::Options::setNonRepeatingOpt(const string& opt, const string& val)
|
920
|
+
{
|
921
|
+
if(opt.empty())
|
922
|
+
{
|
923
|
+
return;
|
924
|
+
}
|
925
|
+
|
926
|
+
//
|
927
|
+
// The option must not have been set before or, if it was set, it must have
|
928
|
+
// been because of a default value.
|
929
|
+
//
|
930
|
+
assert(_opts.find(opt) == _opts.end() || _validOpts.find(opt)->second->hasDefault);
|
931
|
+
|
932
|
+
OValPtr ovp = new OptionValue;
|
933
|
+
ovp->val = val;
|
934
|
+
_opts[opt] = ovp;
|
935
|
+
|
936
|
+
const string synonym = getSynonym(opt);
|
937
|
+
if(!synonym.empty())
|
938
|
+
{
|
939
|
+
_opts[synonym] = ovp;
|
940
|
+
}
|
941
|
+
}
|
942
|
+
|
943
|
+
void
|
944
|
+
IceUtilInternal::Options::setRepeatingOpt(const string& opt, const string& val)
|
945
|
+
{
|
946
|
+
if(opt.empty())
|
947
|
+
{
|
948
|
+
return;
|
949
|
+
}
|
950
|
+
|
951
|
+
ValidOpts::const_iterator vpos = _validOpts.find(opt);
|
952
|
+
assert(vpos != _validOpts.end());
|
953
|
+
|
954
|
+
ROpts::iterator pos = _ropts.find(opt);
|
955
|
+
const string synonym = getSynonym(opt);
|
956
|
+
ROpts::iterator spos = _ropts.find(synonym);
|
957
|
+
|
958
|
+
if(pos != _ropts.end())
|
959
|
+
{
|
960
|
+
assert(_validOpts.find(opt) != _validOpts.end());
|
961
|
+
assert(vpos->second->repeat == Repeat);
|
962
|
+
|
963
|
+
_ropts[opt] = pos->second;
|
964
|
+
if(vpos->second->hasDefault && pos->second->vals.size() == 1)
|
965
|
+
{
|
966
|
+
pos->second->vals[0] = val;
|
967
|
+
vpos->second->hasDefault = false;
|
968
|
+
}
|
969
|
+
else
|
970
|
+
{
|
971
|
+
pos->second->vals.push_back(val);
|
972
|
+
}
|
973
|
+
}
|
974
|
+
else if(spos != _ropts.end())
|
975
|
+
{
|
976
|
+
assert(_validOpts.find(synonym) != _validOpts.end());
|
977
|
+
assert(_validOpts.find(synonym)->second->repeat == Repeat);
|
978
|
+
|
979
|
+
_ropts[synonym] = spos->second;
|
980
|
+
if(vpos->second->hasDefault && spos->second->vals.size() == 1)
|
981
|
+
{
|
982
|
+
spos->second->vals[0] = val;
|
983
|
+
vpos->second->hasDefault = false;
|
984
|
+
}
|
985
|
+
else
|
986
|
+
{
|
987
|
+
spos->second->vals.push_back(val);
|
988
|
+
}
|
989
|
+
}
|
990
|
+
else
|
991
|
+
{
|
992
|
+
OVecPtr ovp = new OptionValueVector;
|
993
|
+
ovp->vals.push_back(val);
|
994
|
+
_ropts[opt] = ovp;
|
995
|
+
if(!synonym.empty())
|
996
|
+
{
|
997
|
+
_ropts[synonym] = ovp;
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
IceUtilInternal::Options::ValidOpts::const_iterator
|
1003
|
+
IceUtilInternal::Options::checkOptIsValid(const string& opt) const
|
1004
|
+
{
|
1005
|
+
ValidOpts::const_iterator pos = _validOpts.find(opt);
|
1006
|
+
if(pos == _validOpts.end())
|
1007
|
+
{
|
1008
|
+
string err = "`";
|
1009
|
+
err += opt;
|
1010
|
+
err += "': invalid option";
|
1011
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
1012
|
+
}
|
1013
|
+
return pos;
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
IceUtilInternal::Options::ValidOpts::const_iterator
|
1017
|
+
IceUtilInternal::Options::checkOptHasArg(const string& opt) const
|
1018
|
+
{
|
1019
|
+
ValidOpts::const_iterator pos = checkOptIsValid(opt);
|
1020
|
+
if(pos->second->arg == NoArg)
|
1021
|
+
{
|
1022
|
+
string err = "`-";
|
1023
|
+
if(pos->second->length == LongOpt)
|
1024
|
+
{
|
1025
|
+
err.push_back('-');
|
1026
|
+
}
|
1027
|
+
err += opt;
|
1028
|
+
err += "': option does not take arguments";
|
1029
|
+
throw IllegalArgumentException(__FILE__, __LINE__, err);
|
1030
|
+
}
|
1031
|
+
return pos;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
void
|
1035
|
+
IceUtilInternal::Options::updateSynonyms(const ::std::string& shortOpt, const ::std::string& longOpt)
|
1036
|
+
{
|
1037
|
+
if(!shortOpt.empty() && !longOpt.empty())
|
1038
|
+
{
|
1039
|
+
_synonyms[shortOpt] = longOpt;
|
1040
|
+
_synonyms[longOpt] = shortOpt;
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
string
|
1045
|
+
IceUtilInternal::Options::getSynonym(const ::std::string& optName) const
|
1046
|
+
{
|
1047
|
+
Synonyms::const_iterator pos = _synonyms.find(optName);
|
1048
|
+
return pos != _synonyms.end() ? pos->second : string("");
|
1049
|
+
}
|