From 7de31c8075750c2c9c20c82caa35f808ff8cc4a9 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Wed, 26 Jun 2024 09:39:23 -0400 Subject: [PATCH] Remove IceUtil namespace in C++ (#2346) --- ...reTransportClientAuthenticationOptions.cpp | 2 +- ...reTransportServerAuthenticationOptions.cpp | 2 +- cpp/include/Ice/Communicator.h | 2 +- cpp/include/Ice/Config.h | 60 +++++- cpp/include/Ice/CtrlCHandler.h | 58 +++++- cpp/include/Ice/IconvStringConverter.h | 10 +- cpp/include/Ice/Initialize.h | 31 +-- cpp/include/Ice/MetricsObserverI.h | 33 +++- cpp/include/Ice/OutgoingAsync.h | 4 +- .../{IceUtil => Ice}/PopDisableWarnings.h | 0 .../{IceUtil => Ice}/PushDisableWarnings.h | 0 cpp/include/Ice/StringConverter.h | 183 ++++++++++++++---- cpp/include/{IceUtil => Ice}/StringUtil.h | 35 +++- cpp/include/{IceUtil => Ice}/Timer.h | 8 +- cpp/include/Ice/UUID.h | 10 +- cpp/include/IceUtil/Config.h | 68 ------- cpp/include/IceUtil/CtrlCHandler.h | 68 ------- cpp/include/IceUtil/StopWatch.h | 44 ----- cpp/include/IceUtil/StringConverter.h | 175 ----------------- cpp/include/IceUtil/UUID.h | 20 -- cpp/src/Glacier2/FilterManager.cpp | 4 +- cpp/src/Glacier2/Glacier2Router.cpp | 6 +- cpp/src/Glacier2/Glacier2Router.rc | 2 +- cpp/src/Glacier2/ProxyVerifier.cpp | 3 +- .../CryptPermissionsVerifier.rc | 2 +- .../CryptPermissionsVerifierI.cpp | 8 +- cpp/src/Glacier2Lib/Glacier2.rc | 2 +- cpp/src/Ice/ConnectionFactory.cpp | 4 +- cpp/src/Ice/ConnectionI.cpp | 12 +- cpp/src/Ice/ConnectionI.h | 10 +- cpp/src/Ice/ConsoleUtil.h | 21 -- cpp/src/{IceUtil => Ice}/CtrlCHandler.cpp | 4 +- cpp/src/Ice/DynamicLibrary.cpp | 6 +- cpp/src/Ice/EndpointFactoryManager.cpp | 4 +- cpp/src/Ice/HttpParser.cpp | 14 +- cpp/src/Ice/IPEndpointI.h | 2 +- cpp/src/Ice/Ice.rc | 2 +- cpp/src/Ice/IconvStringConverter.cpp | 2 +- .../Ice/IdleTimeoutTransceiverDecorator.cpp | 4 +- cpp/src/Ice/IdleTimeoutTransceiverDecorator.h | 10 +- cpp/src/Ice/Initialize.cpp | 4 +- cpp/src/Ice/InputStream.cpp | 2 +- cpp/src/Ice/Instance.cpp | 23 +-- cpp/src/Ice/Instance.h | 12 +- cpp/src/Ice/LocalException.cpp | 9 +- cpp/src/Ice/LocatorInfo.cpp | 2 +- cpp/src/Ice/LoggerI.cpp | 12 +- cpp/src/Ice/LoggerMiddleware.cpp | 2 +- cpp/src/Ice/Makefile.mk | 2 +- cpp/src/Ice/MetricsAdminI.cpp | 8 +- cpp/src/Ice/Network.cpp | 8 +- cpp/src/Ice/ObjectAdapterI.cpp | 3 +- cpp/src/Ice/OutputStream.cpp | 2 +- cpp/src/Ice/PluginManagerI.cpp | 2 +- cpp/src/Ice/Properties.cpp | 27 ++- cpp/src/Ice/ProtocolPluginFacade.h | 2 +- cpp/src/Ice/Reference.cpp | 5 +- cpp/src/Ice/ReferenceFactory.cpp | 10 +- cpp/src/Ice/RetryQueue.h | 6 +- cpp/src/Ice/SSL/OpenSSLEngine.cpp | 4 +- cpp/src/Ice/SSL/RFC2253.cpp | 14 +- cpp/src/Ice/SSL/SSLEngine.cpp | 4 +- cpp/src/Ice/SSL/SSLUtil.cpp | 25 ++- cpp/src/Ice/SSL/SchannelEngine.cpp | 34 ++-- cpp/src/Ice/SSL/SchannelTransceiverI.cpp | 18 +- cpp/src/Ice/SSL/SecureTransportEngine.cpp | 12 +- .../Ice/SSL/SecureTransportTransceiverI.cpp | 2 +- cpp/src/Ice/SSL/SecureTransportUtil.cpp | 6 +- cpp/src/Ice/Selector.cpp | 16 +- cpp/src/Ice/Selector.h | 2 +- cpp/src/Ice/ServantManager.cpp | 2 +- cpp/src/Ice/Service.cpp | 17 +- cpp/src/{IceUtil => Ice}/StringConverter.cpp | 54 +++--- cpp/src/Ice/StringConverterPlugin.cpp | 4 +- cpp/src/{IceUtil => Ice}/StringUtil.cpp | 39 ++-- cpp/src/Ice/StringUtil.h | 27 --- cpp/src/Ice/TcpAcceptor.cpp | 4 +- cpp/src/Ice/TcpEndpointI.h | 2 +- cpp/src/Ice/Timer.cpp | 13 +- cpp/src/Ice/TraceUtil.cpp | 2 +- cpp/src/{IceUtil => Ice}/UUID.cpp | 6 +- cpp/src/Ice/UdpEndpointI.h | 2 +- cpp/src/Ice/UdpTransceiver.cpp | 4 +- cpp/src/{IceUtil => Ice}/UtilException.cpp | 14 +- cpp/src/Ice/WSTransceiver.cpp | 8 +- cpp/src/Ice/ios/StreamAcceptor.cpp | 4 +- cpp/src/Ice/ios/StreamEndpointI.cpp | 2 +- cpp/src/Ice/msbuild/ice/ice.vcxproj | 10 +- cpp/src/Ice/msbuild/ice/ice.vcxproj.filters | 10 +- cpp/src/IceBT/AcceptorI.cpp | 6 +- cpp/src/IceBT/EndpointI.cpp | 4 +- cpp/src/IceBT/Engine.cpp | 18 +- cpp/src/IceBT/TransceiverI.cpp | 2 +- cpp/src/IceBT/Util.cpp | 4 +- cpp/src/IceBox/Admin.cpp | 5 +- cpp/src/IceBox/IceBox.rc | 2 +- cpp/src/IceBox/IceBoxAdmin.rc | 2 +- cpp/src/IceBox/IceBoxExe.rc | 2 +- cpp/src/IceBox/IceBoxService.cpp | 2 +- cpp/src/IceBox/ServiceManagerI.cpp | 8 +- cpp/src/IceBridge/IceBridge.cpp | 2 +- cpp/src/IceBridge/IceBridge.rc | 2 +- cpp/src/IceDB/IceDB.h | 4 +- cpp/src/IceDB/IceDB.rc | 2 +- cpp/src/IceDiscovery/IceDiscovery.rc | 2 +- cpp/src/IceDiscovery/LocatorI.cpp | 2 +- cpp/src/IceDiscovery/LookupI.h | 8 +- cpp/src/IceGrid/Activator.cpp | 12 +- cpp/src/IceGrid/AdapterCache.cpp | 2 +- cpp/src/IceGrid/Allocatable.h | 4 +- cpp/src/IceGrid/AllocatableObjectCache.cpp | 2 +- cpp/src/IceGrid/Client.cpp | 17 +- cpp/src/IceGrid/Database.cpp | 10 +- cpp/src/IceGrid/Database.h | 2 +- cpp/src/IceGrid/DescriptorHelper.cpp | 6 +- cpp/src/IceGrid/DescriptorHelper.h | 2 +- cpp/src/IceGrid/FileCache.cpp | 2 +- cpp/src/IceGrid/FileUserAccountMapperI.cpp | 6 +- cpp/src/IceGrid/IceGridAdmin.rc | 2 +- cpp/src/IceGrid/IceGridNode.cpp | 17 +- cpp/src/IceGrid/IceGridNode.rc | 2 +- cpp/src/IceGrid/IceGridRegistry.cpp | 4 +- cpp/src/IceGrid/IceGridRegistry.rc | 2 +- cpp/src/IceGrid/InternalRegistryI.cpp | 2 +- cpp/src/IceGrid/NodeI.cpp | 8 +- cpp/src/IceGrid/NodeI.h | 8 +- cpp/src/IceGrid/ObjectCache.cpp | 4 +- cpp/src/IceGrid/Parser.cpp | 9 +- cpp/src/IceGrid/PlatformInfo.cpp | 10 +- cpp/src/IceGrid/RegistryI.cpp | 4 +- cpp/src/IceGrid/RegistryI.h | 4 +- cpp/src/IceGrid/Scanner.cpp | 2 +- cpp/src/IceGrid/Scanner.l | 2 +- cpp/src/IceGrid/ServerCache.cpp | 2 +- cpp/src/IceGrid/ServerI.cpp | 22 +-- cpp/src/IceGrid/ServerI.h | 12 +- cpp/src/IceGrid/SessionI.cpp | 4 +- cpp/src/IceGrid/SessionI.h | 12 +- cpp/src/IceGrid/Util.cpp | 32 +-- cpp/src/IceGrid/Util.h | 6 +- cpp/src/IceGridLib/IceGrid.rc | 2 +- .../IceLocatorDiscovery.rc | 2 +- cpp/src/IceLocatorDiscovery/PluginI.cpp | 4 +- cpp/src/IceStorm/Admin.cpp | 5 +- cpp/src/IceStorm/IceStormAdmin.rc | 2 +- cpp/src/IceStorm/IceStormDB.cpp | 15 +- cpp/src/IceStorm/IceStormDB.rc | 2 +- cpp/src/IceStorm/IceStormService.rc | 2 +- cpp/src/IceStorm/Instance.cpp | 6 +- cpp/src/IceStorm/Instance.h | 4 +- cpp/src/IceStorm/NodeI.cpp | 8 +- cpp/src/IceStorm/NodeI.h | 12 +- cpp/src/IceStorm/Parser.cpp | 5 +- cpp/src/IceStorm/Scanner.cpp | 2 +- cpp/src/IceStorm/Scanner.l | 2 +- cpp/src/IceStorm/Service.cpp | 8 +- cpp/src/IceStorm/Subscriber.cpp | 6 +- cpp/src/IceStormLib/IceStorm.rc | 2 +- cpp/src/IceUtil/ConsoleUtil.cpp | 6 +- cpp/{include => src}/IceUtil/ConsoleUtil.h | 8 +- .../IceUtil/DisableWarnings.h | 0 cpp/{include => src}/IceUtil/Exception.h | 2 +- cpp/src/IceUtil/FileUtil.cpp | 37 ++-- cpp/{include => src}/IceUtil/FileUtil.h | 6 +- cpp/src/IceUtil/Makefile.mk | 4 +- cpp/src/IceUtil/Options.cpp | 6 +- cpp/{include => src}/IceUtil/Options.h | 2 +- cpp/src/IceUtil/OutputUtil.cpp | 4 +- cpp/{include => src}/IceUtil/OutputUtil.h | 2 +- cpp/src/IceUtil/Random.cpp | 2 +- cpp/{include => src}/IceUtil/Random.h | 3 +- cpp/{include => src}/IceUtil/ResourceConfig.h | 0 cpp/{include => src}/IceUtil/ScannerConfig.h | 2 +- cpp/{include => src}/IceUtil/UndefSysMacros.h | 0 .../IceUtil/msbuild/iceutil/iceutil.vcxproj | 45 ++--- .../msbuild/iceutil/iceutil.vcxproj.filters | 60 ++---- cpp/src/IceXML/IceXML.rc | 2 +- cpp/src/IceXML/Parser.cpp | 2 +- cpp/src/Slice/FileTracker.cpp | 4 +- cpp/src/Slice/Grammar.cpp | 24 +-- cpp/src/Slice/Grammar.y | 24 +-- cpp/src/Slice/Parser.cpp | 34 ++-- cpp/src/Slice/Preprocessor.cpp | 27 +-- cpp/src/Slice/Scanner.cpp | 2 +- cpp/src/Slice/Scanner.l | 2 +- cpp/src/Slice/SliceUtil.cpp | 12 +- cpp/src/Slice/StringLiteralUtil.cpp | 5 +- cpp/src/Slice/Util.h | 2 +- cpp/src/ice2slice/Gen.h | 2 +- cpp/src/ice2slice/Ice2Slice.rc | 2 +- cpp/src/ice2slice/Main.cpp | 8 +- cpp/src/icegriddb/IceGridDB.cpp | 17 +- cpp/src/icegriddb/IceGridDB.rc | 2 +- .../iceserviceinstall/IceServiceInstall.rc | 2 +- cpp/src/iceserviceinstall/Install.cpp | 5 +- .../iceserviceinstall/ServiceInstaller.cpp | 62 +++--- cpp/src/slice2cpp/CPlusPlusUtil.h | 2 +- cpp/src/slice2cpp/Gen.cpp | 15 +- cpp/src/slice2cpp/Gen.h | 2 +- cpp/src/slice2cpp/Main.cpp | 8 +- cpp/src/slice2cpp/Slice2Cpp.rc | 2 +- cpp/src/slice2cs/CsUtil.cpp | 4 +- cpp/src/slice2cs/CsUtil.h | 2 +- cpp/src/slice2cs/Gen.cpp | 11 +- cpp/src/slice2cs/Main.cpp | 8 +- cpp/src/slice2cs/Slice2Cs.rc | 2 +- cpp/src/slice2java/Gen.cpp | 8 +- cpp/src/slice2java/JavaUtil.cpp | 8 +- cpp/src/slice2java/JavaUtil.h | 2 +- cpp/src/slice2java/Main.cpp | 8 +- cpp/src/slice2java/Slice2Java.rc | 2 +- cpp/src/slice2js/Gen.cpp | 12 +- cpp/src/slice2js/JsUtil.cpp | 3 +- cpp/src/slice2js/JsUtil.h | 2 +- cpp/src/slice2js/Main.cpp | 8 +- cpp/src/slice2js/Slice2Js.rc | 2 +- cpp/src/slice2matlab/Main.cpp | 24 +-- cpp/src/slice2matlab/Slice2Matlab.rc | 2 +- cpp/src/slice2php/Main.cpp | 14 +- cpp/src/slice2php/PHPUtil.h | 2 +- cpp/src/slice2php/Slice2PHP.rc | 2 +- cpp/src/slice2py/Main.cpp | 2 +- cpp/src/slice2py/Python.cpp | 28 +-- cpp/src/slice2py/PythonUtil.cpp | 5 +- cpp/src/slice2py/PythonUtil.h | 2 +- cpp/src/slice2py/Slice2Py.rc | 2 +- cpp/src/slice2rb/Main.cpp | 2 +- cpp/src/slice2rb/Ruby.cpp | 12 +- cpp/src/slice2rb/RubyUtil.cpp | 2 +- cpp/src/slice2rb/RubyUtil.h | 2 +- cpp/src/slice2rb/Slice2Rb.rc | 2 +- cpp/src/slice2swift/Gen.cpp | 6 +- cpp/src/slice2swift/Main.cpp | 8 +- cpp/src/slice2swift/Slice2Swift.rc | 2 +- cpp/src/slice2swift/SwiftUtil.cpp | 12 +- cpp/src/slice2swift/SwiftUtil.h | 2 +- cpp/test/Common/TestHelper.cpp | 6 +- cpp/test/Ice/ami/AllTests.cpp | 2 +- cpp/test/Ice/background/AllTests.cpp | 2 +- cpp/test/Ice/binding/AllTests.cpp | 2 +- cpp/test/Ice/custom/CustomMap.h | 2 +- cpp/test/Ice/executor/AllTests.cpp | 2 +- cpp/test/Ice/hash/Client.cpp | 2 +- cpp/test/Ice/hold/AllTests.cpp | 2 +- cpp/test/Ice/hold/Server.cpp | 2 +- cpp/test/Ice/hold/TestI.cpp | 6 +- cpp/test/Ice/hold/TestI.h | 4 +- cpp/test/Ice/invoke/Server.cpp | 2 +- cpp/test/Ice/optional/CustomMap.h | 2 +- cpp/test/Ice/optional/TestAMDI.cpp | 2 +- cpp/test/Ice/optional/TestI.cpp | 2 +- cpp/test/IceGrid/deployer/Server.cpp | 2 +- cpp/test/IceStorm/federation2/Publisher.cpp | 2 +- cpp/test/IceStorm/rep1/Publisher.cpp | 2 +- cpp/test/IceStorm/rep1/Sub.cpp | 2 +- cpp/test/IceStorm/rep1/Subscriber.cpp | 2 +- cpp/test/IceStorm/stress/Publisher.cpp | 2 +- cpp/test/IceStorm/stress/Subscriber.cpp | 2 +- cpp/test/IceUtil/ctrlCHandler/Client.cpp | 4 +- cpp/test/IceUtil/stacktrace/Client.cpp | 6 +- cpp/test/IceUtil/timer/Client.cpp | 20 +- cpp/test/IceUtil/unicode/Client.cpp | 12 +- cpp/test/IceUtil/uuid/Client.cpp | 6 +- cpp/test/include/TestHelper.h | 4 +- matlab/src/ice.h | 2 +- matlab/src/ice.rc | 2 +- php/src/Communicator.cpp | 6 +- php/src/Types.cpp | 2 +- python/modules/IcePy/IcePy.rc | 2 +- python/modules/IcePy/Types.cpp | 2 +- ruby/src/IceRuby/Types.cpp | 2 +- scripts/Component.py | 2 +- swift/src/IceImpl/IceUtil.mm | 2 +- 273 files changed, 1221 insertions(+), 1418 deletions(-) rename cpp/include/{IceUtil => Ice}/PopDisableWarnings.h (100%) rename cpp/include/{IceUtil => Ice}/PushDisableWarnings.h (100%) rename cpp/include/{IceUtil => Ice}/StringUtil.h (67%) rename cpp/include/{IceUtil => Ice}/Timer.h (97%) delete mode 100644 cpp/include/IceUtil/Config.h delete mode 100644 cpp/include/IceUtil/CtrlCHandler.h delete mode 100644 cpp/include/IceUtil/StopWatch.h delete mode 100644 cpp/include/IceUtil/StringConverter.h delete mode 100644 cpp/include/IceUtil/UUID.h delete mode 100644 cpp/src/Ice/ConsoleUtil.h rename cpp/src/{IceUtil => Ice}/CtrlCHandler.cpp (98%) rename cpp/src/{IceUtil => Ice}/StringConverter.cpp (89%) rename cpp/src/{IceUtil => Ice}/StringUtil.cpp (96%) delete mode 100644 cpp/src/Ice/StringUtil.h rename cpp/src/{IceUtil => Ice}/UUID.cpp (96%) rename cpp/src/{IceUtil => Ice}/UtilException.cpp (97%) rename cpp/{include => src}/IceUtil/ConsoleUtil.h (91%) rename cpp/{include => src}/IceUtil/DisableWarnings.h (100%) rename cpp/{include => src}/IceUtil/Exception.h (93%) rename cpp/{include => src}/IceUtil/FileUtil.h (97%) rename cpp/{include => src}/IceUtil/Options.h (99%) rename cpp/{include => src}/IceUtil/OutputUtil.h (99%) rename cpp/{include => src}/IceUtil/Random.h (95%) rename cpp/{include => src}/IceUtil/ResourceConfig.h (100%) rename cpp/{include => src}/IceUtil/ScannerConfig.h (95%) rename cpp/{include => src}/IceUtil/UndefSysMacros.h (100%) diff --git a/cpp/doxygen/examples/Ice/SSL/SecureTransportClientAuthenticationOptions.cpp b/cpp/doxygen/examples/Ice/SSL/SecureTransportClientAuthenticationOptions.cpp index 0c90a454a38..3454d9064d8 100644 --- a/cpp/doxygen/examples/Ice/SSL/SecureTransportClientAuthenticationOptions.cpp +++ b/cpp/doxygen/examples/Ice/SSL/SecureTransportClientAuthenticationOptions.cpp @@ -4,7 +4,7 @@ #include // Disable deprecation warnings from SecureTransport APIs -#include "IceUtil/DisableWarnings.h" +#include "../../src/IceUtil/DisableWarnings.h" #if defined(ICE_USE_SECURE_TRANSPORT) diff --git a/cpp/doxygen/examples/Ice/SSL/SecureTransportServerAuthenticationOptions.cpp b/cpp/doxygen/examples/Ice/SSL/SecureTransportServerAuthenticationOptions.cpp index fde3822f9f6..af98afb0ef0 100644 --- a/cpp/doxygen/examples/Ice/SSL/SecureTransportServerAuthenticationOptions.cpp +++ b/cpp/doxygen/examples/Ice/SSL/SecureTransportServerAuthenticationOptions.cpp @@ -4,7 +4,7 @@ #include // Disable deprecation warnings from SecureTransport APIs -#include "IceUtil/DisableWarnings.h" +#include "../../src/IceUtil/DisableWarnings.h" #if defined(ICE_USE_SECURE_TRANSPORT) void diff --git a/cpp/include/Ice/Communicator.h b/cpp/include/Ice/Communicator.h index fe9df9f3eca..85c082dad0d 100644 --- a/cpp/include/Ice/Communicator.h +++ b/cpp/include/Ice/Communicator.h @@ -395,7 +395,7 @@ namespace Ice friend ICE_API CommunicatorPtr initialize(StringSeq&, const InitializationData&, std::int32_t); friend ICE_API CommunicatorPtr initialize(const InitializationData&, std::int32_t); friend ICE_API IceInternal::InstancePtr IceInternal::getInstance(const Ice::CommunicatorPtr&); - friend ICE_API ::IceUtil::TimerPtr IceInternal::getInstanceTimer(const Ice::CommunicatorPtr&); + friend ICE_API ::Ice::TimerPtr IceInternal::getInstanceTimer(const Ice::CommunicatorPtr&); const IceInternal::InstancePtr _instance; }; diff --git a/cpp/include/Ice/Config.h b/cpp/include/Ice/Config.h index e0f3a714ef2..aa2400984ba 100644 --- a/cpp/include/Ice/Config.h +++ b/cpp/include/Ice/Config.h @@ -5,6 +5,64 @@ #ifndef ICE_CONFIG_H #define ICE_CONFIG_H -#include "IceUtil/Config.h" +// Compiler extensions to export and import symbols: see the documentation for Visual Studio, Clang and GCC. +#if defined(_MSC_VER) +# define ICE_DECLSPEC_EXPORT __declspec(dllexport) +# define ICE_DECLSPEC_IMPORT __declspec(dllimport) +// With Visual Studio, we can import/export member functions without importing/exporting the whole class. +# define ICE_MEMBER_IMPORT_EXPORT +#elif defined(__GNUC__) || defined(__clang__) +# define ICE_DECLSPEC_EXPORT __attribute__((visibility("default"))) +# define ICE_DECLSPEC_IMPORT __attribute__((visibility("default"))) +#else +# define ICE_DECLSPEC_EXPORT /**/ +# define ICE_DECLSPEC_IMPORT /**/ +#endif + +#ifdef ICE_MEMBER_IMPORT_EXPORT +# define ICE_CLASS(API) /**/ +# define ICE_MEMBER(API) API +#else +# define ICE_CLASS(API) API +# define ICE_MEMBER(API) /**/ +#endif + +#ifndef ICE_API +# if defined(ICE_STATIC_LIBS) +# define ICE_API /**/ +# elif defined(ICE_API_EXPORTS) +# define ICE_API ICE_DECLSPEC_EXPORT +# else +# define ICE_API ICE_DECLSPEC_IMPORT +# endif +#endif + +#ifdef __APPLE__ +# include +#endif + +// The Ice version. +#define ICE_STRING_VERSION "3.8.0-alpha.0" // "A.B.C", with A=major, B=minor, C=patch +#define ICE_INT_VERSION 30850 // AABBCC, with AA=major, BB=minor, CC=patch +#define ICE_SO_VERSION "38a0" // "ABC", with A=major, B=minor, C=patch + +#if !defined(ICE_BUILDING_ICE) && defined(ICE_API_EXPORTS) +# define ICE_BUILDING_ICE +#endif + +#if defined(_MSC_VER) +# if !defined(ICE_STATIC_LIBS) && (!defined(_DLL) || !defined(_MT)) +# error "Only multi-threaded DLL libraries can be used with Ice!" +# endif +# if defined(_DEBUG) +# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION "D.lib" +# else +# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION ".lib" +# endif +// Automatically link with Ice[D].lib when using MSVC +# if !defined(ICE_BUILDING_ICE) && !defined(ICE_BUILDING_SLICE_COMPILERS) +# pragma comment(lib, ICE_LIBNAME("Ice")) +# endif +#endif #endif diff --git a/cpp/include/Ice/CtrlCHandler.h b/cpp/include/Ice/CtrlCHandler.h index 0a2eff1d95f..0a737a011d2 100644 --- a/cpp/include/Ice/CtrlCHandler.h +++ b/cpp/include/Ice/CtrlCHandler.h @@ -5,12 +5,64 @@ #ifndef ICE_CTRL_C_HANDLER_H #define ICE_CTRL_C_HANDLER_H -#include "IceUtil/CtrlCHandler.h" +#include "Config.h" +#include namespace Ice { - using CtrlCHandlerCallback = IceUtil::CtrlCHandlerCallback; - using CtrlCHandler = IceUtil::CtrlCHandler; + /** + * Invoked when a signal occurs. The callback must not raise exceptions. + * On Linux and macOS, the callback is NOT a signal handler and can call + * functions that are not async-signal safe. + * @param sig The signal number that occurred. + */ + using CtrlCHandlerCallback = std::function; + + /** + * Provides a portable way to handle Ctrl-C and Ctrl-C like signals. + * On Linux and macOS, the CtrlCHandler handles SIGHUP, SIGINT and SIGTERM. + * On Windows, it is essentially a wrapper for SetConsoleCtrlHandler(). + * + * \headerfile Ice/Ice.h + */ + class ICE_API CtrlCHandler + { + public: + /** + * Registers a callback function that handles Ctrl-C like signals. + * On Linux and macOS, this constructor masks the SIGHUP, SIGINT and SIGTERM + * signals and then creates a thread that waits for these signals using sigwait. + * On Windows, this constructor calls SetConsoleCtrlCHandler to register a handler + * routine that calls the supplied callback function. + * Only a single CtrlCHandler object can exist in a process at a give time. + * @param cb The callback function to invoke when a signal is received. + */ + explicit CtrlCHandler(CtrlCHandlerCallback cb = nullptr); + + /** + * Unregisters the callback function. + * On Linux and macOS, this destructor joins and terminates the thread created + * by the constructor but does not "unmask" SIGHUP, SIGINT and SIGTERM. As a result, + * these signals are ignored after this destructor completes. + * On Windows, this destructor unregisters the SetConsoleCtrlHandler handler + * routine, and as a result a Ctrl-C or similar signal will terminate the application + * after this destructor completes. + */ + ~CtrlCHandler(); + + /** + * Replaces the signal callback. + * @param cb The new callback. + * @return The old callback, or nil if no callback is currently set. + */ + CtrlCHandlerCallback setCallback(CtrlCHandlerCallback cb); + + /** + * Obtains the signal callback. + * @return The callback. + */ + CtrlCHandlerCallback getCallback() const; + }; } #endif diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 5238f963e5b..cbcbd671c54 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -11,8 +11,8 @@ #ifndef _WIN32 # include "Config.h" # include "Exception.h" -# include "IceUtil/StringUtil.h" # include "StringConverter.h" +# include "StringUtil.h" # include # include @@ -71,7 +71,7 @@ namespace IceInternal // opening / closing iconv_t objects all the time. // // - template class IconvStringConverter final : public IceUtil::BasicStringConverter + template class IconvStringConverter final : public Ice::BasicStringConverter { public: IconvStringConverter(const std::string&); @@ -196,7 +196,7 @@ namespace IceInternal throw Ice::IllegalConversionException( __FILE__, __LINE__, - errno == 0 ? "Unknown error" : IceUtilInternal::errorToString(errno)); + errno == 0 ? "Unknown error" : IceInternal::errorToString(errno)); } return outbuf; } @@ -256,7 +256,7 @@ namespace IceInternal throw Ice::IllegalConversionException( __FILE__, __LINE__, - errno == 0 ? "Unknown error" : IceUtilInternal::errorToString(errno)); + errno == 0 ? "Unknown error" : IceInternal::errorToString(errno)); } target.resize(target.size() - (outbytesleft / sizeof(charT))); @@ -272,7 +272,7 @@ namespace Ice * @throws IconvInitializationException If the code is not supported. */ template - std::shared_ptr> + std::shared_ptr> createIconvStringConverter(const std::string& internalCodeWithDefault = "") { std::string internalCode = internalCodeWithDefault; diff --git a/cpp/include/Ice/Initialize.h b/cpp/include/Ice/Initialize.h index 5c09d550826..4e6bd4695bc 100644 --- a/cpp/include/Ice/Initialize.h +++ b/cpp/include/Ice/Initialize.h @@ -9,13 +9,14 @@ #include "CommunicatorF.h" #include "Connection.h" #include "Ice/BuiltinSequences.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "InstanceF.h" #include "Instrumentation.h" #include "Logger.h" #include "Plugin.h" #include "PropertiesF.h" #include "SSL/ClientAuthenticationOptions.h" +#include "StringUtil.h" #include "ValueFactory.h" namespace Ice @@ -678,32 +679,6 @@ namespace Ice CommunicatorPtr _communicator; }; - /** - * The output mode for xxxToString method such as identityToString and proxyToString. The actual encoding format for - * the string is the same for all modes: you don't need to specify an encoding format or mode when reading such a - * string. - */ - enum class ToStringMode : std::uint8_t - { - /** - * Characters with ordinal values greater than 127 are kept as-is in the resulting string. Non-printable ASCII - * characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. - */ - Unicode, - /** - * Characters with ordinal values greater than 127 are encoded as universal character names in the resulting - * string: \\unnnn for BMP characters and \\Unnnnnnnn for non-BMP characters. Non-printable ASCII characters - * with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. - */ - ASCII, - /** - * Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal escapes. - * Characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or an octal escape. Use this mode - * to generate strings compatible with Ice 3.6 and earlier. - */ - Compat - }; - /** * Converts a stringified identity into an Identity. * @param str The stringified identity. @@ -728,7 +703,7 @@ namespace IceInternal // to be used by modules such as Freeze. // ICE_API InstancePtr getInstance(const Ice::CommunicatorPtr&); - ICE_API IceUtil::TimerPtr getInstanceTimer(const Ice::CommunicatorPtr&); + ICE_API Ice::TimerPtr getInstanceTimer(const Ice::CommunicatorPtr&); } #endif diff --git a/cpp/include/Ice/MetricsObserverI.h b/cpp/include/Ice/MetricsObserverI.h index 67d0bae924e..923d55ceca1 100644 --- a/cpp/include/Ice/MetricsObserverI.h +++ b/cpp/include/Ice/MetricsObserverI.h @@ -8,7 +8,6 @@ #include "Connection.h" #include "Endpoint.h" #include "Ice/Metrics.h" -#include "IceUtil/StopWatch.h" #include "Instrumentation.h" #include "MetricsAdminI.h" #include "MetricsFunctional.h" @@ -17,6 +16,36 @@ #include #include +namespace IceInternal +{ + class StopWatch + { + public: + StopWatch() {} + + void start() { _start = std::chrono::steady_clock::now(); } + + std::chrono::microseconds stop() + { + assert(isStarted()); + auto duration = + std::chrono::duration_cast(std::chrono::steady_clock::now() - _start); + _start = std::chrono::steady_clock::time_point(); + return duration; + } + + bool isStarted() const { return _start != std::chrono::steady_clock::time_point(); } + + std::chrono::microseconds delay() + { + return std::chrono::duration_cast(std::chrono::steady_clock::now() - _start); + } + + private: + std::chrono::steady_clock::time_point _start; + }; +} + namespace IceMX { /// \cond INTERNAL @@ -400,7 +429,7 @@ namespace IceMX private: EntrySeqType _objects; - IceUtilInternal::StopWatch _watch; + IceInternal::StopWatch _watch; std::chrono::microseconds _previousDelay; }; diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index a271205e7e1..e79b4e983f3 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -8,7 +8,7 @@ #include "CommunicatorF.h" #include "ConnectionF.h" #include "ConnectionIF.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "InputStream.h" #include "LocalException.h" #include "ObjectAdapterF.h" @@ -138,7 +138,7 @@ namespace IceInternal // correct notified of failures and make sure the retry task is // correctly canceled when the invocation completes. // - class ICE_API ProxyOutgoingAsyncBase : public OutgoingAsyncBase, public IceUtil::TimerTask + class ICE_API ProxyOutgoingAsyncBase : public OutgoingAsyncBase, public Ice::TimerTask { public: virtual AsyncStatus invokeRemote(const Ice::ConnectionIPtr&, bool, bool) = 0; diff --git a/cpp/include/IceUtil/PopDisableWarnings.h b/cpp/include/Ice/PopDisableWarnings.h similarity index 100% rename from cpp/include/IceUtil/PopDisableWarnings.h rename to cpp/include/Ice/PopDisableWarnings.h diff --git a/cpp/include/IceUtil/PushDisableWarnings.h b/cpp/include/Ice/PushDisableWarnings.h similarity index 100% rename from cpp/include/IceUtil/PushDisableWarnings.h rename to cpp/include/Ice/PushDisableWarnings.h diff --git a/cpp/include/Ice/StringConverter.h b/cpp/include/Ice/StringConverter.h index cc9615fe249..1c04e0fb87a 100644 --- a/cpp/include/Ice/StringConverter.h +++ b/cpp/include/Ice/StringConverter.h @@ -5,65 +5,174 @@ #ifndef ICE_STRING_CONVERTER_H #define ICE_STRING_CONVERTER_H -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/StringConverter.h" +#include "Config.h" + +#include +#include +#include +#include namespace Ice { - /** Encapsulates bytes in the UTF-8 encoding. */ - using UTF8Buffer = IceUtil::UTF8Buffer; + /** + * Provides bytes to toUTF8. Can raise std::bad_alloc or Ice::MemoryLimitException + * when too many bytes are requested. + * \headerfile Ice/Ice.h + */ + class ICE_API UTF8Buffer + { + public: + /** + * Obtains more bytes. + * @param howMany The number of bytes requested. + * @param firstUnused A pointer to the first unused byte. + * @return A pointer to the beginning of the buffer. + */ + virtual std::byte* getMoreBytes(size_t howMany, std::byte* firstUnused) = 0; + + virtual ~UTF8Buffer(); + }; - /** Narrow string converter. */ - using StringConverter = IceUtil::StringConverter; - using StringConverterPtr = IceUtil::StringConverterPtr; + /** + * A StringConverter converts narrow or wide-strings to and from UTF-8 byte sequences. + * It's used by the communicator during marshaling (toUTF8) and unmarshaling (fromUTF8). + * It report errors by raising IllegalConversionException or an exception raised + * by UTF8Buffer. + * \headerfile Ice/Ice.h + */ + template class BasicStringConverter + { + public: + /** + * Returns a pointer to byte after the last written byte (which may be + * past the last byte returned by getMoreBytes). + */ + virtual std::byte* toUTF8(const charT* sourceStart, const charT* sourceEnd, UTF8Buffer& buf) const = 0; + + /** + * Unmarshals a UTF-8 sequence into a basic_string. + */ + virtual void + fromUTF8(const std::byte* sourceStart, const std::byte* sourceEnd, std::basic_string& target) const = 0; + + virtual ~BasicStringConverter() {} + }; + +#if defined(__clang__) && !defined(ICE_STATIC_LIBS) + // + // Explicit template instantiation so that dynamic_cast of derived exported + // classes works well with clang, see ICE-7473. + // + template class ICE_API BasicStringConverter; + template class ICE_API BasicStringConverter; +#endif - /** Wide string converter. */ - using WstringConverter = IceUtil::WstringConverter; - using WstringConverterPtr = IceUtil::WstringConverterPtr; + /** A narrow string converter. */ + using StringConverter = BasicStringConverter; + using StringConverterPtr = std::shared_ptr; - /** Base class for a string converter. */ - template using BasicStringConverter = IceUtil::BasicStringConverter; + /** A wide string converter. */ + using WstringConverter = BasicStringConverter; + using WstringConverterPtr = std::shared_ptr; -#ifdef _WIN32 /** - * Creates a string converter that converts between multi-byte and UTF-8 strings and uses MultiByteToWideChar - * and WideCharToMultiByte for its implementation. + * Creates a WstringConverter that converts to and from UTF-16 or UTF-32 depending on sizeof(wchar_t). + * @return The string converter. */ - using IceUtil::createWindowsStringConverter; -#endif + ICE_API WstringConverterPtr createUnicodeWstringConverter(); - /** Creates a string converter that converts between Unicode wide strings and UTF-8 strings. */ - using IceUtil::createUnicodeWstringConverter; + /** + * Retrieves the per-process narrow string converter. + * @return The string converter. + */ + ICE_API StringConverterPtr getProcessStringConverter(); - /** Installs a default narrow string converter for the process. */ - using IceUtil::setProcessStringConverter; + /** + * Sets the per-process narrow string converter. + * @param c The string converter. + */ + ICE_API void setProcessStringConverter(const StringConverterPtr& c); - /** Obtains the default narrow string converter for the process. */ - using IceUtil::getProcessStringConverter; + /** + * Retrieves the per-process wide string converter. + * @return The string converter. + */ + ICE_API WstringConverterPtr getProcessWstringConverter(); - /** Installs a default wide string converter for the process. */ - using IceUtil::setProcessWstringConverter; + /** + * Sets the per process wide string converter. + * @param c The string converter. + */ + ICE_API void setProcessWstringConverter(const WstringConverterPtr& c); - /** Obtains the default wide string converter for the process. */ - using IceUtil::getProcessWstringConverter; + /** + * Converts the given wide string to a narrow string. + * @param str A wide string. + * @param nc The narrow string converter. If null, the result's narrow string encoding is UTF-8. + * @param wc The wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 + * depending on the size of wchar_t. + * @return A narrow string. + */ + ICE_API std::string wstringToString( + const std::wstring& str, + const StringConverterPtr& nc = nullptr, + const WstringConverterPtr& wc = nullptr); - /** Converts a wide string to a narrow string. */ - using IceUtil::wstringToString; + /** + * Converts the given narrow string to a wide string. + * @param str A narrow string. + * @param nc The narrow string converter. If null, the result's narrow string encoding is UTF-8. + * @param wc The wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 + * depending on the size of wchar_t. + * @return A wide string. + */ + ICE_API std::wstring stringToWstring( + const std::string& str, + const StringConverterPtr& nc = nullptr, + const WstringConverterPtr& wc = nullptr); - /** Converts a narrow string to a wide string. */ - using IceUtil::stringToWstring; + /** + * Converts the given string from the native narrow string encoding to + * UTF-8 using the given converter. + * @param str The native narrow string. + * @param nc The narrow string converter. If null, the native string is returned. + * @return A UTF-8 string. + */ + ICE_API std::string nativeToUTF8(const std::string& str, const StringConverterPtr& nc); /** - * Converts a narrow string to a UTF-8 encoded string using a string converter. - * No conversion is performed if the string converter is nil. + * Converts the given string from UTF-8 to the native narrow string + * encoding using the given converter. + * @param str The UTF-8 string. + * @param nc The narrow string converter. If null, the UTF-8 string is returned. + * @return A native narrow string. */ - using IceUtil::nativeToUTF8; + ICE_API std::string UTF8ToNative(const std::string& str, const StringConverterPtr& nc); + +#ifdef _WIN32 /** - * Converts a UTF-8 encoded string to a narrow string using a string converter. - * No conversion is performed if the string converter is nil. + * Creates a StringConverter that converts to and from narrow chars + * in the given code page, using MultiByteToWideChar and WideCharToMultiByte. + * @param page The code page. + * @return The string converter. */ - using IceUtil::UTF8ToNative; + ICE_API StringConverterPtr createWindowsStringConverter(unsigned int page); +#endif +} + +namespace IceInternal +{ + // + // Convert from UTF-8 to UTF-16/32 + // + ICE_API std::vector toUTF16(const std::vector&); + ICE_API std::vector toUTF32(const std::vector&); + + // + // Convert from UTF-32 to UTF-8 + // + ICE_API std::vector fromUTF32(const std::vector&); } #endif diff --git a/cpp/include/IceUtil/StringUtil.h b/cpp/include/Ice/StringUtil.h similarity index 67% rename from cpp/include/IceUtil/StringUtil.h rename to cpp/include/Ice/StringUtil.h index 0dc896731c9..cce63e64fe9 100644 --- a/cpp/include/IceUtil/StringUtil.h +++ b/cpp/include/Ice/StringUtil.h @@ -2,32 +2,51 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#ifndef ICE_UTIL_STRING_UTIL_H -#define ICE_UTIL_STRING_UTIL_H +#ifndef ICE_STRING_UTIL_H +#define ICE_STRING_UTIL_H -#include "Config.h" +#include "Ice/Config.h" #include #include -namespace IceUtilInternal +namespace Ice { - // - // Must be kept in sync with Ice::ToStringMode - // + /** + * The output mode for xxxToString method such as identityToString and proxyToString. The actual encoding format for + * the string is the same for all modes: you don't need to specify an encoding format or mode when reading such a + * string. + */ enum class ToStringMode : std::uint8_t { + /** + * Characters with ordinal values greater than 127 are kept as-is in the resulting string. Non-printable ASCII + * characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. + */ Unicode, + /** + * Characters with ordinal values greater than 127 are encoded as universal character names in the resulting + * string: \\unnnn for BMP characters and \\Unnnnnnnn for non-BMP characters. Non-printable ASCII characters + * with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. + */ ASCII, + /** + * Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal escapes. + * Characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or an octal escape. Use this mode + * to generate strings compatible with Ice 3.6 and earlier. + */ Compat }; +} +namespace IceInternal +{ // // Add escape sequences (like "\n", or "\123") to the input string // (first parameter). // The second parameter adds characters to escape, and can be empty. // - ICE_API std::string escapeString(const std::string&, const std::string&, ToStringMode); + ICE_API std::string escapeString(const std::string&, const std::string&, Ice::ToStringMode); // // Remove escape sequences added by escapeString. Throws std::invalid_argument diff --git a/cpp/include/IceUtil/Timer.h b/cpp/include/Ice/Timer.h similarity index 97% rename from cpp/include/IceUtil/Timer.h rename to cpp/include/Ice/Timer.h index 4da6abf8de0..a6f7f35ce38 100644 --- a/cpp/include/IceUtil/Timer.h +++ b/cpp/include/Ice/Timer.h @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#ifndef ICE_UTIL_TIMER_H -#define ICE_UTIL_TIMER_H +#ifndef ICE_TIMER_H +#define ICE_TIMER_H #include "Config.h" @@ -18,7 +18,7 @@ #include #include -namespace IceUtil +namespace Ice { class Timer; using TimerPtr = std::shared_ptr; @@ -160,7 +160,7 @@ namespace IceUtil bool isScheduled(const TimerTaskPtr&); protected: - virtual void runTimerTask(const IceUtil::TimerTaskPtr&); + virtual void runTimerTask(const TimerTaskPtr&); private: struct Token diff --git a/cpp/include/Ice/UUID.h b/cpp/include/Ice/UUID.h index b06783b1f29..b284e9e5325 100644 --- a/cpp/include/Ice/UUID.h +++ b/cpp/include/Ice/UUID.h @@ -5,12 +5,16 @@ #ifndef ICE_UUID_H #define ICE_UUID_H -#include "IceUtil/UUID.h" +#include "Config.h" +#include namespace Ice { - /** Generates a UUID. */ - using IceUtil::generateUUID; + /** + * Generates a universally unique identifier (UUID). + * @return The UUID. + */ + ICE_API std::string generateUUID(); } #endif diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h deleted file mode 100644 index cc0719d8be9..00000000000 --- a/cpp/include/IceUtil/Config.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_UTIL_CONFIG_H -#define ICE_UTIL_CONFIG_H - -// Compiler extensions to export and import symbols: see the documentation for Visual Studio, Clang and GCC. -#if defined(_MSC_VER) -# define ICE_DECLSPEC_EXPORT __declspec(dllexport) -# define ICE_DECLSPEC_IMPORT __declspec(dllimport) -// With Visual Studio, we can import/export member functions without importing/exporting the whole class. -# define ICE_MEMBER_IMPORT_EXPORT -#elif defined(__GNUC__) || defined(__clang__) -# define ICE_DECLSPEC_EXPORT __attribute__((visibility("default"))) -# define ICE_DECLSPEC_IMPORT __attribute__((visibility("default"))) -#else -# define ICE_DECLSPEC_EXPORT /**/ -# define ICE_DECLSPEC_IMPORT /**/ -#endif - -#ifdef ICE_MEMBER_IMPORT_EXPORT -# define ICE_CLASS(API) /**/ -# define ICE_MEMBER(API) API -#else -# define ICE_CLASS(API) API -# define ICE_MEMBER(API) /**/ -#endif - -#ifndef ICE_API -# if defined(ICE_STATIC_LIBS) -# define ICE_API /**/ -# elif defined(ICE_API_EXPORTS) -# define ICE_API ICE_DECLSPEC_EXPORT -# else -# define ICE_API ICE_DECLSPEC_IMPORT -# endif -#endif - -#ifdef __APPLE__ -# include -#endif - -// The Ice version. -#define ICE_STRING_VERSION "3.8.0-alpha.0" // "A.B.C", with A=major, B=minor, C=patch -#define ICE_INT_VERSION 30850 // AABBCC, with AA=major, BB=minor, CC=patch -#define ICE_SO_VERSION "38a0" // "ABC", with A=major, B=minor, C=patch - -#if !defined(ICE_BUILDING_ICE) && defined(ICE_API_EXPORTS) -# define ICE_BUILDING_ICE -#endif - -#if defined(_MSC_VER) -# if !defined(ICE_STATIC_LIBS) && (!defined(_DLL) || !defined(_MT)) -# error "Only multi-threaded DLL libraries can be used with Ice!" -# endif -# if defined(_DEBUG) -# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION "D.lib" -# else -# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION ".lib" -# endif -// Automatically link with Ice[D].lib when using MSVC -# if !defined(ICE_BUILDING_ICE) && !defined(ICE_BUILDING_SLICE_COMPILERS) -# pragma comment(lib, ICE_LIBNAME("Ice")) -# endif -#endif - -#endif diff --git a/cpp/include/IceUtil/CtrlCHandler.h b/cpp/include/IceUtil/CtrlCHandler.h deleted file mode 100644 index e4c156a9004..00000000000 --- a/cpp/include/IceUtil/CtrlCHandler.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_UTIL_CTRL_C_HANDLER_H -#define ICE_UTIL_CTRL_C_HANDLER_H - -#include "Config.h" - -#include - -namespace IceUtil -{ - /** - * Invoked when a signal occurs. The callback must not raise exceptions. - * On Linux and macOS, the callback is NOT a signal handler and can call - * functions that are not async-signal safe. - * @param sig The signal number that occurred. - */ - using CtrlCHandlerCallback = std::function; - - /** - * Provides a portable way to handle Ctrl-C and Ctrl-C like signals. - * On Linux and macOS, the CtrlCHandler handles SIGHUP, SIGINT and SIGTERM. - * On Windows, it is essentially a wrapper for SetConsoleCtrlHandler(). - * - * \headerfile Ice/Ice.h - */ - class ICE_API CtrlCHandler - { - public: - /** - * Registers a callback function that handles Ctrl-C like signals. - * On Linux and macOS, this constructor masks the SIGHUP, SIGINT and SIGTERM - * signals and then creates a thread that waits for these signals using sigwait. - * On Windows, this constructor calls SetConsoleCtrlCHandler to register a handler - * routine that calls the supplied callback function. - * Only a single CtrlCHandler object can exist in a process at a give time. - * @param cb The callback function to invoke when a signal is received. - */ - explicit CtrlCHandler(CtrlCHandlerCallback cb = nullptr); - - /** - * Unregisters the callback function. - * On Linux and macOS, this destructor joins and terminates the thread created - * by the constructor but does not "unmask" SIGHUP, SIGINT and SIGTERM. As a result, - * these signals are ignored after this destructor completes. - * On Windows, this destructor unregisters the SetConsoleCtrlHandler handler - * routine, and as a result a Ctrl-C or similar signal will terminate the application - * after this destructor completes. - */ - ~CtrlCHandler(); - - /** - * Replaces the signal callback. - * @param cb The new callback. - * @return The old callback, or nil if no callback is currently set. - */ - CtrlCHandlerCallback setCallback(CtrlCHandlerCallback cb); - - /** - * Obtains the signal callback. - * @return The callback. - */ - CtrlCHandlerCallback getCallback() const; - }; -} -#endif diff --git a/cpp/include/IceUtil/StopWatch.h b/cpp/include/IceUtil/StopWatch.h deleted file mode 100644 index 560775f8f49..00000000000 --- a/cpp/include/IceUtil/StopWatch.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_UTIL_STOPWATCH_H -#define ICE_UTIL_STOPWATCH_H - -#include "Config.h" - -#include -#include - -namespace IceUtilInternal -{ - class StopWatch - { - public: - StopWatch() {} - - void start() { _start = std::chrono::steady_clock::now(); } - - std::chrono::microseconds stop() - { - assert(isStarted()); - auto duration = - std::chrono::duration_cast(std::chrono::steady_clock::now() - _start); - _start = std::chrono::steady_clock::time_point(); - return duration; - } - - bool isStarted() const { return _start != std::chrono::steady_clock::time_point(); } - - std::chrono::microseconds delay() - { - return std::chrono::duration_cast(std::chrono::steady_clock::now() - _start); - } - - private: - std::chrono::steady_clock::time_point _start; - }; - -} // End namespace IceUtilInternal - -#endif diff --git a/cpp/include/IceUtil/StringConverter.h b/cpp/include/IceUtil/StringConverter.h deleted file mode 100644 index 535830cbad9..00000000000 --- a/cpp/include/IceUtil/StringConverter.h +++ /dev/null @@ -1,175 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_UTIL_STRING_CONVERTER_H -#define ICE_UTIL_STRING_CONVERTER_H - -#include "Config.h" - -#include -#include -#include - -namespace IceUtil -{ - /** - * Provides bytes to toUTF8. Can raise std::bad_alloc or Ice::MemoryLimitException - * when too many bytes are requested. - * \headerfile Ice/Ice.h - */ - class ICE_API UTF8Buffer - { - public: - /** - * Obtains more bytes. - * @param howMany The number of bytes requested. - * @param firstUnused A pointer to the first unused byte. - * @return A pointer to the beginning of the buffer. - */ - virtual std::byte* getMoreBytes(size_t howMany, std::byte* firstUnused) = 0; - - virtual ~UTF8Buffer(); - }; - - /** - * A StringConverter converts narrow or wide-strings to and from UTF-8 byte sequences. - * It's used by the communicator during marshaling (toUTF8) and unmarshaling (fromUTF8). - * It report errors by raising IllegalConversionException or an exception raised - * by UTF8Buffer. - * \headerfile Ice/Ice.h - */ - template class BasicStringConverter - { - public: - /** - * Returns a pointer to byte after the last written byte (which may be - * past the last byte returned by getMoreBytes). - */ - virtual std::byte* toUTF8(const charT* sourceStart, const charT* sourceEnd, UTF8Buffer& buf) const = 0; - - /** - * Unmarshals a UTF-8 sequence into a basic_string. - */ - virtual void - fromUTF8(const std::byte* sourceStart, const std::byte* sourceEnd, std::basic_string& target) const = 0; - - virtual ~BasicStringConverter() {} - }; - -#if defined(__clang__) && !defined(ICE_STATIC_LIBS) - // - // Explicit template instantiation so that dynamic_cast of derived exported - // classes works well with clang, see ICE-7473. - // - template class ICE_API BasicStringConverter; - template class ICE_API BasicStringConverter; -#endif - - /** A narrow string converter. */ - using StringConverter = BasicStringConverter; - using StringConverterPtr = std::shared_ptr; - - /** A wide string converter. */ - using WstringConverter = BasicStringConverter; - using WstringConverterPtr = std::shared_ptr; - - /** - * Creates a WstringConverter that converts to and from UTF-16 or UTF-32 depending on sizeof(wchar_t). - * @return The string converter. - */ - ICE_API WstringConverterPtr createUnicodeWstringConverter(); - - /** - * Retrieves the per-process narrow string converter. - * @return The string converter. - */ - ICE_API StringConverterPtr getProcessStringConverter(); - - /** - * Sets the per-process narrow string converter. - * @param c The string converter. - */ - ICE_API void setProcessStringConverter(const StringConverterPtr& c); - - /** - * Retrieves the per-process wide string converter. - * @return The string converter. - */ - ICE_API WstringConverterPtr getProcessWstringConverter(); - - /** - * Sets the per process wide string converter. - * @param c The string converter. - */ - ICE_API void setProcessWstringConverter(const WstringConverterPtr& c); - - /** - * Converts the given wide string to a narrow string. - * @param str A wide string. - * @param nc The narrow string converter. If null, the result's narrow string encoding is UTF-8. - * @param wc The wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 - * depending on the size of wchar_t. - * @return A narrow string. - */ - ICE_API std::string - wstringToString(const std::wstring& str, const StringConverterPtr& nc = 0, const WstringConverterPtr& wc = 0); - - /** - * Converts the given narrow string to a wide string. - * @param str A narrow string. - * @param nc The narrow string converter. If null, the result's narrow string encoding is UTF-8. - * @param wc The wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 - * depending on the size of wchar_t. - * @return A wide string. - */ - ICE_API std::wstring - stringToWstring(const std::string& str, const StringConverterPtr& nc = 0, const WstringConverterPtr& wc = 0); - - /** - * Converts the given string from the native narrow string encoding to - * UTF-8 using the given converter. - * @param str The native narrow string. - * @param nc The narrow string converter. If null, the native string is returned. - * @return A UTF-8 string. - */ - ICE_API std::string nativeToUTF8(const std::string& str, const StringConverterPtr& nc); - - /** - * Converts the given string from UTF-8 to the native narrow string - * encoding using the given converter. - * @param str The UTF-8 string. - * @param nc The narrow string converter. If null, the UTF-8 string is returned. - * @return A native narrow string. - */ - ICE_API std::string UTF8ToNative(const std::string& str, const StringConverterPtr& nc); -} - -namespace IceUtilInternal -{ - // - // Convert from UTF-8 to UTF-16/32 - // - ICE_API std::vector toUTF16(const std::vector&); - ICE_API std::vector toUTF32(const std::vector&); - - // - // Convert from UTF-32 to UTF-8 - // - ICE_API std::vector fromUTF32(const std::vector&); -} - -#ifdef _WIN32 -namespace IceUtil -{ - /** - * Creates a StringConverter that converts to and from narrow chars - * in the given code page, using MultiByteToWideChar and WideCharToMultiByte. - * @param page The code page. - * @return The string converter. - */ - ICE_API StringConverterPtr createWindowsStringConverter(unsigned int page); -} -#endif - -#endif diff --git a/cpp/include/IceUtil/UUID.h b/cpp/include/IceUtil/UUID.h deleted file mode 100644 index f3b8f2da5fe..00000000000 --- a/cpp/include/IceUtil/UUID.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_UTIL_UUID_H -#define ICE_UTIL_UUID_H - -#include "Config.h" -#include - -namespace IceUtil -{ - /** - * Generates a universally unique identifier (UUID). - * @return The UUID. - */ - ICE_API std::string generateUUID(); -} - -#endif diff --git a/cpp/src/Glacier2/FilterManager.cpp b/cpp/src/Glacier2/FilterManager.cpp index 15b61dfec0d..13e3c1aa20d 100644 --- a/cpp/src/Glacier2/FilterManager.cpp +++ b/cpp/src/Glacier2/FilterManager.cpp @@ -8,7 +8,7 @@ #include "Ice/Ice.h" #include "Ice/Logger.h" #include "Ice/Properties.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" using namespace std; using namespace Ice; @@ -20,7 +20,7 @@ using namespace Ice; static void stringToSeq(const string& str, vector& seq) { - IceUtilInternal::splitString(str, " \t", seq); + IceInternal::splitString(str, " \t", seq); // // TODO: do something about unmatched quotes diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp index 51f707f68f1..0bb18c87798 100644 --- a/cpp/src/Glacier2/Glacier2Router.cpp +++ b/cpp/src/Glacier2/Glacier2Router.cpp @@ -2,11 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Glacier2/NullPermissionsVerifier.h" #include "Glacier2/Session.h" #include "Ice/Ice.h" -#include "IceUtil/Options.h" #include "Instance.h" #include "RouterI.h" #include "SessionRouterI.h" @@ -15,6 +15,8 @@ using namespace std; using namespace Ice; using namespace Glacier2; using namespace IceInternal; +using namespace IceUtilInternal; + namespace { class ClientLocator final : public ServantLocator diff --git a/cpp/src/Glacier2/Glacier2Router.rc b/cpp/src/Glacier2/Glacier2Router.rc index 0eb99660241..03e7628c855 100644 --- a/cpp/src/Glacier2/Glacier2Router.rc +++ b/cpp/src/Glacier2/Glacier2Router.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "glacier2router\0" #define ICE_ORIGINALFILENAME "glacier2router.exe\0" diff --git a/cpp/src/Glacier2/ProxyVerifier.cpp b/cpp/src/Glacier2/ProxyVerifier.cpp index a9be40815ed..e3dbfaf01a1 100644 --- a/cpp/src/Glacier2/ProxyVerifier.cpp +++ b/cpp/src/Glacier2/ProxyVerifier.cpp @@ -3,7 +3,7 @@ // #include "ProxyVerifier.h" -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" #include #include @@ -12,6 +12,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; // // TODO: Some of the address matching helper classes can probably be diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifier.rc b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifier.rc index d62799b3dc1..1afdc4531f2 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifier.rc +++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifier.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("glacier2cryptpermissionsverifier") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("glacier2cryptpermissionsverifier") ".dll\0" diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp index 5897eefd0a2..3e66a7acb52 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp +++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp @@ -5,8 +5,8 @@ #include "Glacier2/PermissionsVerifier.h" #include "Ice/Ice.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -25,7 +25,7 @@ #endif // Disable deprecation warnings from CommonCrypto APIs -#include "IceUtil/DisableWarnings.h" +#include "../IceUtil/DisableWarnings.h" using namespace std; using namespace Ice; @@ -71,7 +71,7 @@ namespace ifstream passwordFile(IceUtilInternal::streamFilename(file).c_str()); if (!passwordFile) { - string err = IceUtilInternal::lastErrorToString(); + string err = IceInternal::lastErrorToString(); throw Ice::InitializationException(__FILE__, __LINE__, "cannot open `" + file + "' for reading: " + err); } map passwords; diff --git a/cpp/src/Glacier2Lib/Glacier2.rc b/cpp/src/Glacier2Lib/Glacier2.rc index 088d9589141..2ae0ea4713d 100644 --- a/cpp/src/Glacier2Lib/Glacier2.rc +++ b/cpp/src/Glacier2Lib/Glacier2.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("glacier2") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("glacier2") ".dll\0" diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 5717ab89731..292d510dbb8 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -3,6 +3,7 @@ // #include "ConnectionFactory.h" +#include "../IceUtil/Random.h" #include "Acceptor.h" #include "CommunicatorFlushBatchAsync.h" #include "ConnectionI.h" @@ -13,7 +14,6 @@ #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" -#include "IceUtil/Random.h" #include "Instance.h" #include "ObjectAdapterI.h" // For getThreadPool(). #include "Reference.h" @@ -69,7 +69,7 @@ namespace return nullptr; } - class StartAcceptor : public IceUtil::TimerTask, public std::enable_shared_from_this + class StartAcceptor : public Ice::TimerTask, public std::enable_shared_from_this { public: StartAcceptor(const IncomingConnectionFactoryPtr& factory, const InstancePtr& instance) diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index a489d159adc..c09e822df20 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -3,6 +3,7 @@ // #include "ConnectionI.h" +#include "../IceUtil/DisableWarnings.h" #include "BatchRequestQueue.h" #include "CheckIdentity.h" #include "DefaultsAndOverrides.h" @@ -13,7 +14,6 @@ #include "Ice/LoggerUtil.h" #include "Ice/OutgoingResponse.h" #include "Ice/Properties.h" -#include "IceUtil/DisableWarnings.h" #include "IdleTimeoutTransceiverDecorator.h" #include "Instance.h" #include "ObjectAdapterI.h" // For getThreadPool() @@ -37,7 +37,7 @@ using namespace IceInternal; namespace { - class ConnectTimerTask final : public IceUtil::TimerTask + class ConnectTimerTask final : public Ice::TimerTask { public: ConnectTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {} @@ -54,7 +54,7 @@ namespace const weak_ptr _connection; }; - class CloseTimerTask final : public IceUtil::TimerTask + class CloseTimerTask final : public Ice::TimerTask { public: CloseTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {} @@ -71,7 +71,7 @@ namespace const weak_ptr _connection; }; - class InactivityTimerTask final : public IceUtil::TimerTask + class InactivityTimerTask final : public Ice::TimerTask { public: InactivityTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {} @@ -2278,9 +2278,7 @@ Ice::ConnectionI::initiateShutdown() } void -Ice::ConnectionI::idleCheck( - const IceUtil::TimerTaskPtr& idleCheckTimerTask, - const chrono::seconds& idleTimeout) noexcept +Ice::ConnectionI::idleCheck(const Ice::TimerTaskPtr& idleCheckTimerTask, const chrono::seconds& idleTimeout) noexcept { std::lock_guard lock(_mutex); // When _timer->isScheduled(idleCheckTimerTask) returns true, it means a read rescheduled the diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 92aac887f7b..f95d336048b 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -22,8 +22,7 @@ #include "Ice/OutgoingAsync.h" #include "Ice/OutgoingResponse.h" #include "Ice/OutputStream.h" -#include "IceUtil/StopWatch.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "RequestHandler.h" #include "TraceLevelsF.h" #include "TransceiverF.h" @@ -228,8 +227,7 @@ namespace Ice /// - its transceiver is waiting to be read /// - the idle check timer task has been rescheduled by a concurrent read /// In the two latter cases, this function reschedules the idle check timer task in idle timeout. - void - idleCheck(const IceUtil::TimerTaskPtr& idleCheckTimerTask, const std::chrono::seconds& idleTimeout) noexcept; + void idleCheck(const Ice::TimerTaskPtr& idleCheckTimerTask, const std::chrono::seconds& idleTimeout) noexcept; /// Shuts down the connection gracefully if it's at rest when this function is called. void inactivityCheck() noexcept; @@ -332,13 +330,13 @@ namespace Ice const IceInternal::TraceLevelsPtr _traceLevels; const IceInternal::ThreadPoolPtr _threadPool; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const std::chrono::seconds _connectTimeout; const std::chrono::seconds _closeTimeout; const std::chrono::seconds _inactivityTimeout; - IceUtil::TimerTaskPtr _inactivityTimerTask; + Ice::TimerTaskPtr _inactivityTimerTask; bool _inactivityTimerTaskScheduled; std::function _connectionStartCompleted; diff --git a/cpp/src/Ice/ConsoleUtil.h b/cpp/src/Ice/ConsoleUtil.h deleted file mode 100644 index c9f38bb3fde..00000000000 --- a/cpp/src/Ice/ConsoleUtil.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_CONSOLE_UTIL_H -#define ICE_CONSOLE_UTIL_H - -#include "IceUtil/ConsoleUtil.h" - -namespace IceInternal -{ - using IceUtilInternal::consoleErr; - using IceUtilInternal::consoleOut; - -#if defined(_WIN32) - using IceUtilInternal::endl; - using IceUtilInternal::flush; -#endif -} - -#endif diff --git a/cpp/src/IceUtil/CtrlCHandler.cpp b/cpp/src/Ice/CtrlCHandler.cpp similarity index 98% rename from cpp/src/IceUtil/CtrlCHandler.cpp rename to cpp/src/Ice/CtrlCHandler.cpp index e1e6284c59b..c35d2a1b53e 100644 --- a/cpp/src/IceUtil/CtrlCHandler.cpp +++ b/cpp/src/Ice/CtrlCHandler.cpp @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/CtrlCHandler.h" +#include "Ice/CtrlCHandler.h" #include "Ice/Exception.h" #ifdef _WIN32 @@ -16,8 +16,8 @@ # include #endif +using namespace Ice; using namespace std; -using namespace IceUtil; namespace { diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index e1f8035197b..bccb4dd6dfd 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -4,7 +4,7 @@ #include "DynamicLibrary.h" #include "Ice/StringConverter.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -208,7 +208,7 @@ IceInternal::DynamicLibrary::load(const string& lib) // Remember the most recent error in _err. // #if defined(_WIN32) - _err = "LoadLibraryW on `" + lib + "' failed with `" + IceUtilInternal::lastErrorToString() + "'"; + _err = "LoadLibraryW on `" + lib + "' failed with `" + IceInternal::lastErrorToString() + "'"; #else const char* err = dlerror(); if (err) @@ -237,7 +237,7 @@ IceInternal::DynamicLibrary::getSymbol(const string& name) // Remember the most recent error in _err. // #ifdef _WIN32 - _err = "GetProcAddress for `" + name + "' failed with `" + IceUtilInternal::lastErrorToString() + "'"; + _err = "GetProcAddress for `" + name + "' failed with `" + IceInternal::lastErrorToString() + "'"; #else const char* err = dlerror(); if (err) diff --git a/cpp/src/Ice/EndpointFactoryManager.cpp b/cpp/src/Ice/EndpointFactoryManager.cpp index 7f02c402790..1ce807eb996 100644 --- a/cpp/src/Ice/EndpointFactoryManager.cpp +++ b/cpp/src/Ice/EndpointFactoryManager.cpp @@ -9,7 +9,7 @@ #include "Ice/LocalException.h" #include "Ice/OutputStream.h" #include "Ice/Properties.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "Instance.h" #include "OpaqueEndpointI.h" @@ -68,7 +68,7 @@ EndpointIPtr IceInternal::EndpointFactoryManager::create(const string& str, bool oaEndpoint) const { vector v; - bool b = IceUtilInternal::splitString(str, " \t\n\r", v); + bool b = IceInternal::splitString(str, " \t\n\r", v); if (!b) { throw EndpointParseException(__FILE__, __LINE__, "mismatched quote"); diff --git a/cpp/src/Ice/HttpParser.cpp b/cpp/src/Ice/HttpParser.cpp index ab1d7b87b8e..47bc49d7fcd 100644 --- a/cpp/src/Ice/HttpParser.cpp +++ b/cpp/src/Ice/HttpParser.cpp @@ -3,9 +3,9 @@ // #include "HttpParser.h" +#include "Ice/Config.h" #include "Ice/LocalException.h" -#include "IceUtil/Config.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include @@ -299,7 +299,7 @@ IceInternal::HttpParser::parse(const byte* begin, const byte* end) { if (_headerName.empty()) { - _headerName = IceUtilInternal::toLower(bytesToString(start, p)); + _headerName = IceInternal::toLower(bytesToString(start, p)); HeaderFields::iterator q = _headers.find(_headerName); // // Add a placeholder entry if necessary. @@ -666,13 +666,13 @@ IceInternal::HttpParser::reason() const bool IceInternal::HttpParser::getHeader(const string& name, string& value, bool toLower) const { - HeaderFields::const_iterator q = _headers.find(IceUtilInternal::toLower(name)); + HeaderFields::const_iterator q = _headers.find(IceInternal::toLower(name)); if (q != _headers.end()) { - value = IceUtilInternal::trim(q->second.second); + value = IceInternal::trim(q->second.second); if (toLower) { - value = IceUtilInternal::toLower(value); + value = IceInternal::toLower(value); } return true; } @@ -686,7 +686,7 @@ IceInternal::HttpParser::getHeaders() const map headers; for (HeaderFields::const_iterator q = _headers.begin(); q != _headers.end(); ++q) { - headers.insert(make_pair(q->second.first, IceUtilInternal::trim(q->second.second))); + headers.insert(make_pair(q->second.first, IceInternal::trim(q->second.second))); } return headers; } diff --git a/cpp/src/Ice/IPEndpointI.h b/cpp/src/Ice/IPEndpointI.h index 1b6b948f987..13169b04f99 100644 --- a/cpp/src/Ice/IPEndpointI.h +++ b/cpp/src/Ice/IPEndpointI.h @@ -7,8 +7,8 @@ #include "EndpointI.h" #include "IPEndpointIF.h" +#include "Ice/Config.h" #include "Ice/ObserverHelper.h" -#include "IceUtil/Config.h" #include "Network.h" #include "ProtocolInstanceF.h" diff --git a/cpp/src/Ice/Ice.rc b/cpp/src/Ice/Ice.rc index b3953cd0a94..ebdc098046b 100644 --- a/cpp/src/Ice/Ice.rc +++ b/cpp/src/Ice/Ice.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("ice") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("ice") ".dll\0" diff --git a/cpp/src/Ice/IconvStringConverter.cpp b/cpp/src/Ice/IconvStringConverter.cpp index 76ea51ca9d1..e667a12f22a 100644 --- a/cpp/src/Ice/IconvStringConverter.cpp +++ b/cpp/src/Ice/IconvStringConverter.cpp @@ -8,7 +8,7 @@ using namespace std; using namespace Ice; -using namespace IceUtil; +using namespace Ice; IconvInitializationException::IconvInitializationException(const char* file, int line, string reason) noexcept : LocalException(file, line), diff --git a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp index dce4ce948bd..39019f97f3b 100644 --- a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +++ b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp @@ -13,7 +13,7 @@ using namespace IceInternal; namespace { - class HeartbeatTimerTask final : public IceUtil::TimerTask + class HeartbeatTimerTask final : public Ice::TimerTask { public: HeartbeatTimerTask(const ConnectionIPtr& connection) : _connection(connection) {} @@ -31,7 +31,7 @@ namespace const weak_ptr _connection; }; - class IdleCheckTimerTask final : public IceUtil::TimerTask, public enable_shared_from_this + class IdleCheckTimerTask final : public Ice::TimerTask, public enable_shared_from_this { public: IdleCheckTimerTask(const ConnectionIPtr& connection, const chrono::seconds& idleTimeout) diff --git a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h index 51d3cf434b9..802eb540259 100644 --- a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +++ b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h @@ -6,7 +6,7 @@ #define ICE_IDLE_TIMEOUT_TRANSCEIVER_DECORATOR_H #include "ConnectionI.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "Transceiver.h" #include @@ -22,7 +22,7 @@ namespace IceInternal const TransceiverPtr& decoratee, const std::chrono::seconds& idleTimeout, bool enableIdleCheck, - const IceUtil::TimerPtr& timer) + const Ice::TimerPtr& timer) : _decoratee(decoratee), _idleTimeout(idleTimeout), _enableIdleCheck(enableIdleCheck), @@ -71,11 +71,11 @@ namespace IceInternal const TransceiverPtr _decoratee; const std::chrono::seconds _idleTimeout; const bool _enableIdleCheck; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; // Set by decoratorInit - IceUtil::TimerTaskPtr _heartbeatTimerTask; - IceUtil::TimerTaskPtr _idleCheckTimerTask; + Ice::TimerTaskPtr _heartbeatTimerTask; + Ice::TimerTaskPtr _idleCheckTimerTask; }; } diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index 04d6425c5e0..52b6f004310 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -9,10 +9,10 @@ #include "Ice/LocalException.h" #include "Ice/Properties.h" #include "Ice/StringConverter.h" +#include "Ice/StringUtil.h" #include "Instance.h" #include "LoggerI.h" #include "PluginManagerI.h" -#include "StringUtil.h" #include #include @@ -420,7 +420,7 @@ IceInternal::getInstance(const CommunicatorPtr& communicator) return communicator->_instance; } -IceUtil::TimerPtr +Ice::TimerPtr IceInternal::getInstanceTimer(const CommunicatorPtr& communicator) { return communicator->_instance->timer(); diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp index 4231523b6c7..cfabc639e68 100644 --- a/cpp/src/Ice/InputStream.cpp +++ b/cpp/src/Ice/InputStream.cpp @@ -3,6 +3,7 @@ // #include "Ice/InputStream.h" +#include "../IceUtil/DisableWarnings.h" #include "DefaultsAndOverrides.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" @@ -12,7 +13,6 @@ #include "Ice/StringConverter.h" #include "Ice/UserExceptionFactory.h" #include "Ice/ValueFactory.h" -#include "IceUtil/DisableWarnings.h" #include "Instance.h" #include "TraceLevels.h" #include "TraceUtil.h" diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 10abecb9e16..0868498560d 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -3,9 +3,11 @@ // #include "Instance.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/DisableWarnings.h" +#include "../IceUtil/FileUtil.h" #include "CheckIdentity.h" #include "ConnectionFactory.h" -#include "ConsoleUtil.h" #include "DefaultsAndOverrides.h" #include "EndpointFactoryManager.h" #include "IPEndpointI.h" // For EndpointHostResolver @@ -19,10 +21,8 @@ #include "Ice/Properties.h" #include "Ice/ProxyFunctions.h" #include "Ice/Router.h" +#include "Ice/StringUtil.h" #include "Ice/UUID.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" #include "InstrumentationI.h" #include "LocatorInfo.h" #include "LoggerAdminI.h" @@ -76,6 +76,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; namespace IceUtilInternal { @@ -183,15 +184,15 @@ namespace IceInternal // Required because ObserverUpdaterI is a friend of Instan // // Timer specialization which supports the thread observer // - class Timer final : public IceUtil::Timer + class ThreadObserverTimer final : public Ice::Timer { public: - Timer() : _hasObserver(false) {} + ThreadObserverTimer() : _hasObserver(false) {} void updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr&); private: - void runTimerTask(const IceUtil::TimerTaskPtr&) final; + void runTimerTask(const Ice::TimerTaskPtr&) final; std::mutex _mutex; std::atomic _hasObserver; @@ -200,7 +201,7 @@ namespace IceInternal // Required because ObserverUpdaterI is a friend of Instan } void -Timer::updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr& obsv) +ThreadObserverTimer::updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr& obsv) { lock_guard lock(_mutex); assert(obsv); @@ -213,7 +214,7 @@ Timer::updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr& obsv) } void -Timer::runTimerTask(const IceUtil::TimerTaskPtr& task) +ThreadObserverTimer::runTimerTask(const Ice::TimerTaskPtr& task) { if (_hasObserver) { @@ -446,7 +447,7 @@ IceInternal::Instance::retryQueue() return _retryQueue; } -IceUtil::TimerPtr +Ice::TimerPtr IceInternal::Instance::timer() { lock_guard lock(_mutex); @@ -1495,7 +1496,7 @@ IceInternal::Instance::finishSetup(int& argc, const char* argv[], const Ice::Com // try { - _timer = make_shared(); + _timer = make_shared(); } catch (const Ice::Exception& ex) { diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 86de80981c9..fba5c770bda 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -11,6 +11,7 @@ #include "EndpointFactoryManagerF.h" #include "IPEndpointIF.h" #include "Ice/CommunicatorF.h" +#include "Ice/Config.h" #include "Ice/FacetMap.h" #include "Ice/ImplicitContext.h" #include "Ice/Initialize.h" @@ -19,8 +20,7 @@ #include "Ice/Plugin.h" #include "Ice/Process.h" #include "Ice/StringConverter.h" -#include "IceUtil/Config.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "LocatorInfoF.h" #include "NetworkF.h" #include "NetworkProxyF.h" @@ -42,8 +42,8 @@ namespace Ice namespace IceInternal { - class Timer; - using TimerPtr = std::shared_ptr; + class ThreadObserverTimer; + using ThreadObserverTimerPtr = std::shared_ptr; class MetricsAdminI; using MetricsAdminIPtr = std::shared_ptr; @@ -88,7 +88,7 @@ namespace IceInternal EndpointHostResolverPtr endpointHostResolver(); RetryQueuePtr retryQueue(); const std::vector& retryIntervals() const { return _retryIntervals; } - IceUtil::TimerPtr timer(); + Ice::TimerPtr timer(); EndpointFactoryManagerPtr endpointFactoryManager() const; Ice::PluginManagerPtr pluginManager() const; size_t messageSizeMax() const { return _messageSizeMax; } @@ -170,7 +170,7 @@ namespace IceInternal std::thread _endpointHostResolverThread; RetryQueuePtr _retryQueue; std::vector _retryIntervals; - TimerPtr _timer; + ThreadObserverTimerPtr _timer; EndpointFactoryManagerPtr _endpointFactoryManager; Ice::PluginManagerPtr _pluginManager; const Ice::ImplicitContextPtr _implicitContext; diff --git a/cpp/src/Ice/LocalException.cpp b/cpp/src/Ice/LocalException.cpp index 729408e0016..cbddacf1ac8 100644 --- a/cpp/src/Ice/LocalException.cpp +++ b/cpp/src/Ice/LocalException.cpp @@ -3,8 +3,9 @@ // #include "Ice/LocalException.h" +#include "Ice/Initialize.h" +#include "Ice/StringUtil.h" #include "Network.h" -#include "StringUtil.h" #include @@ -20,7 +21,7 @@ namespace { return "unknown error"; } - return IceUtilInternal::errorToString(error); + return IceInternal::errorToString(error); } } @@ -525,7 +526,7 @@ Ice::SyscallException::ice_print(ostream& out) const Exception::ice_print(out); if (error != 0) { - out << ":\nsyscall exception: " << IceUtilInternal::errorToString(error); + out << ":\nsyscall exception: " << IceInternal::errorToString(error); } } @@ -547,7 +548,7 @@ Ice::FileException::ice_print(ostream& out) const } else { - out << IceUtilInternal::errorToString(error); + out << IceInternal::errorToString(error); } if (!path.empty()) { diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp index accc6e963ac..ff2265a5049 100644 --- a/cpp/src/Ice/LocatorInfo.cpp +++ b/cpp/src/Ice/LocatorInfo.cpp @@ -3,6 +3,7 @@ // #include "LocatorInfo.h" +#include "../IceUtil/DisableWarnings.h" #include "EndpointI.h" #include "Ice/Comparable.h" #include "Ice/LocalException.h" @@ -10,7 +11,6 @@ #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" #include "Ice/ProxyFunctions.h" -#include "IceUtil/DisableWarnings.h" #include "Instance.h" #include "Reference.h" #include "TraceLevels.h" diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index 3de809d50ff..ad421df7147 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -3,15 +3,15 @@ // #include "LoggerI.h" -#include "TimeUtil.h" - -#include "IceUtil/StringUtil.h" - +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" #include "Ice/LocalException.h" -#include "IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" +#include "TimeUtil.h" #include #include +#include using namespace std; using namespace Ice; @@ -186,7 +186,7 @@ Ice::LoggerI::write(const string& message, bool indent) size_t sizeMax = _sizeMax; _sizeMax = 0; lock.unlock(); - error("FileLogger: cannot rename `" + _file + "'\n" + IceUtilInternal::lastErrorToString()); + error("FileLogger: cannot rename `" + _file + "'\n" + IceInternal::lastErrorToString()); lock.lock(); _sizeMax = sizeMax; } diff --git a/cpp/src/Ice/LoggerMiddleware.cpp b/cpp/src/Ice/LoggerMiddleware.cpp index 2dc3c94ec93..f8668a700df 100644 --- a/cpp/src/Ice/LoggerMiddleware.cpp +++ b/cpp/src/Ice/LoggerMiddleware.cpp @@ -3,8 +3,8 @@ // #include "LoggerMiddleware.h" +#include "Ice/StringUtil.h" #include "Ice/UserException.h" -#include "StringUtil.h" using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/Makefile.mk b/cpp/src/Ice/Makefile.mk index cddeda36837..fe785bbfdf0 100644 --- a/cpp/src/Ice/Makefile.mk +++ b/cpp/src/Ice/Makefile.mk @@ -25,7 +25,7 @@ Ice_cppflags += -DICE_USE_SYSTEMD $(shell pkg-config endif endif -Ice[iphoneos]_excludes := $(wildcard src/IceUtil/CtrlCHandler.cpp $(addprefix $(currentdir)/,Tcp*.cpp Service.cpp)) +Ice[iphoneos]_excludes := $(wildcard src/Ice/CtrlCHandler.cpp $(addprefix $(currentdir)/,Tcp*.cpp Service.cpp)) Ice[iphoneos]_extra_sources := $(wildcard $(addprefix $(currentdir)/ios/,*.cpp *.mm)) Ice[iphonesimulator]_excludes = $(Ice[iphoneos]_excludes) Ice[iphonesimulator]_extra_sources = $(Ice[iphoneos]_extra_sources) diff --git a/cpp/src/Ice/MetricsAdminI.cpp b/cpp/src/Ice/MetricsAdminI.cpp index 44f9ace03e6..67d47eb32d0 100644 --- a/cpp/src/Ice/MetricsAdminI.cpp +++ b/cpp/src/Ice/MetricsAdminI.cpp @@ -11,7 +11,7 @@ #include "Instance.h" #include "InstrumentationI.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -42,7 +42,7 @@ namespace for (size_t i = 0; i < sizeof(suffixes) / sizeof(*suffixes); ++i) { string prop = prefix + suffixes[i]; - if (IceUtilInternal::match(p->first, prop)) + if (IceInternal::match(p->first, prop)) { valid = true; break; @@ -115,7 +115,7 @@ MetricsMapI::MetricsMapI(const std::string& mapPrefix, const PropertiesPtr& prop if (!groupBy.empty()) { string v; - bool attribute = IceUtilInternal::isAlpha(groupBy[0]) || IceUtilInternal::isDigit(groupBy[0]); + bool attribute = IceInternal::isAlpha(groupBy[0]) || IceInternal::isDigit(groupBy[0]); if (!attribute) { groupByAttributes.push_back(""); @@ -123,7 +123,7 @@ MetricsMapI::MetricsMapI(const std::string& mapPrefix, const PropertiesPtr& prop for (string::const_iterator p = groupBy.begin(); p != groupBy.end(); ++p) { - bool isAlphaNum = IceUtilInternal::isAlpha(*p) || IceUtilInternal::isDigit(*p) || *p == '.'; + bool isAlphaNum = IceInternal::isAlpha(*p) || IceInternal::isDigit(*p) || *p == '.'; if (attribute && !isAlphaNum) { groupByAttributes.push_back(v); diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 1529e5a3da2..21048ad56ee 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -12,14 +12,14 @@ # include #endif +#include "../IceUtil/DisableWarnings.h" +#include "../IceUtil/Random.h" #include "Ice/Buffer.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" // For setTcpBufSize #include "Ice/Properties.h" // For setTcpBufSize #include "Ice/StringConverter.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/Random.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "Network.h" #include "NetworkProxy.h" #include "ProtocolInstance.h" // For setTcpBufSize @@ -786,7 +786,7 @@ string IceInternal::errorToStringDNS(int error) { #if defined(_WIN32) - return IceUtilInternal::errorToString(error); + return IceInternal::errorToString(error); #else return gai_strerror(error); #endif diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index b7dc56502b2..d9bac3b6d82 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -3,9 +3,9 @@ // #include "ObjectAdapterI.h" +#include "../IceUtil/ConsoleUtil.h" #include "CheckIdentity.h" #include "ConnectionFactory.h" -#include "ConsoleUtil.h" #include "DefaultsAndOverrides.h" #include "EndpointFactoryManager.h" #include "EndpointI.h" @@ -42,6 +42,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; namespace { diff --git a/cpp/src/Ice/OutputStream.cpp b/cpp/src/Ice/OutputStream.cpp index 4b529ab264a..4549957a8fd 100644 --- a/cpp/src/Ice/OutputStream.cpp +++ b/cpp/src/Ice/OutputStream.cpp @@ -23,7 +23,7 @@ using namespace IceInternal; namespace { - class StreamUTF8BufferI final : public IceUtil::UTF8Buffer + class StreamUTF8BufferI final : public Ice::UTF8Buffer { public: StreamUTF8BufferI(OutputStream& stream) : _stream(stream) {} diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index 13645551094..e203c01d4d1 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -3,12 +3,12 @@ // #include "PluginManagerI.h" +#include "../IceUtil/Options.h" #include "DynamicLibrary.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" -#include "IceUtil/Options.h" #include "Instance.h" using namespace std; diff --git a/cpp/src/Ice/Properties.cpp b/cpp/src/Ice/Properties.cpp index dc3df3633a1..63ee3ae692a 100644 --- a/cpp/src/Ice/Properties.cpp +++ b/cpp/src/Ice/Properties.cpp @@ -3,12 +3,12 @@ // #include "Ice/Properties.h" +#include "../IceUtil/FileUtil.h" #include "Ice/Initialize.h" #include "Ice/LocalException.h" #include "Ice/Logger.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "PropertyNames.h" #include @@ -61,7 +61,7 @@ namespace // As a courtesy to the user, perform a case-insensitive match and suggest the correct property. // Otherwise no other warning is issued. - if (logWarnings && IceUtilInternal::toLower(propPrefix) == IceUtilInternal::toLower(prefix)) + if (logWarnings && IceInternal::toLower(propPrefix) == IceInternal::toLower(prefix)) { ostringstream os; os << "unknown property prefix: `" << prefix << "'; did you mean `" << propPrefix << "'?"; @@ -79,7 +79,7 @@ namespace { auto prop = propertyArray->properties[i]; - if (prop.usesRegex ? IceUtilInternal::match(string{key}, prop.pattern) : key == prop.pattern) + if (prop.usesRegex ? IceInternal::match(string{key}, prop.pattern) : key == prop.pattern) { return prop; } @@ -282,7 +282,7 @@ Ice::Properties::getIcePropertyAsList(string_view key) { string_view defaultValue = getDefaultValue(key); StringSeq defaultList; - IceUtilInternal::splitString(defaultValue, ", \t\r\n", defaultList); + IceInternal::splitString(defaultValue, ", \t\r\n", defaultList); return getPropertyAsListWithDefault(key, defaultList); } @@ -297,7 +297,7 @@ Ice::Properties::getPropertyAsListWithDefault(string_view key, const StringSeq& p->second.used = true; StringSeq result; - if (!IceUtilInternal::splitString(p->second.value, ", \t\r\n", result)) + if (!IceInternal::splitString(p->second.value, ", \t\r\n", result)) { Warning out(getProcessLogger()); out << "mismatched quotes in property " << key << "'s value, returning default value"; @@ -338,7 +338,7 @@ Ice::Properties::setProperty(string_view key, string_view value) // // Trim whitespace // - string currentKey = IceUtilInternal::trim(string{key}); + string currentKey = IceInternal::trim(string{key}); if (currentKey.empty()) { throw InitializationException(__FILE__, __LINE__, "Attempt to set property with empty key"); @@ -449,7 +449,7 @@ Ice::Properties::load(string_view file) throw InitializationException( __FILE__, __LINE__, - "could not open Windows registry key `" + string{file} + "':\n" + IceUtilInternal::errorToString(err)); + "could not open Windows registry key `" + string{file} + "':\n" + IceInternal::errorToString(err)); } DWORD maxNameSize; // Size in characters not including terminating null character. @@ -475,8 +475,7 @@ Ice::Properties::load(string_view file) throw InitializationException( __FILE__, __LINE__, - "could not open Windows registry key `" + string{file} + "':\n" + - IceUtilInternal::errorToString(err)); + "could not open Windows registry key `" + string{file} + "':\n" + IceInternal::errorToString(err)); } for (DWORD i = 0; i < numValues; ++i) @@ -498,7 +497,7 @@ Ice::Properties::load(string_view file) } else { - os << IceUtilInternal::errorToString(err); + os << IceInternal::errorToString(err); } getProcessLogger()->warning(os.str()); continue; @@ -537,7 +536,7 @@ Ice::Properties::load(string_view file) ostringstream os; os << "could not expand variable in property `" << name << "', key: `" + string{file} + "':\n"; - os << IceUtilInternal::lastErrorToString(); + os << IceInternal::lastErrorToString(); getProcessLogger()->warning(os.str()); continue; } @@ -811,10 +810,10 @@ Ice::Properties::loadConfig() if (!value.empty()) { vector files; - IceUtilInternal::splitString(value, ",", files); + IceInternal::splitString(value, ",", files); for (vector::const_iterator i = files.begin(); i != files.end(); ++i) { - load(IceUtilInternal::trim(string{*i})); + load(IceInternal::trim(string{*i})); } PropertyValue pv{std::move(value), true}; diff --git a/cpp/src/Ice/ProtocolPluginFacade.h b/cpp/src/Ice/ProtocolPluginFacade.h index 14b8904bbce..6a8ce71df23 100644 --- a/cpp/src/Ice/ProtocolPluginFacade.h +++ b/cpp/src/Ice/ProtocolPluginFacade.h @@ -8,8 +8,8 @@ #include "EndpointFactoryF.h" #include "EndpointIF.h" #include "Ice/CommunicatorF.h" +#include "Ice/Config.h" #include "Ice/InstanceF.h" -#include "IceUtil/Config.h" #include "NetworkF.h" #include "ProtocolPluginFacadeF.h" diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index ee1823630a5..2c95b999f37 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -3,6 +3,7 @@ // #include "Reference.h" +#include "../IceUtil/Random.h" #include "CollocatedRequestHandler.h" #include "ConnectRequestHandler.h" #include "ConnectionFactory.h" @@ -17,17 +18,15 @@ #include "Ice/LoggerUtil.h" #include "Ice/OutputStream.h" #include "Ice/Router.h" +#include "Ice/StringUtil.h" #include "Instance.h" #include "LocatorInfo.h" #include "ObjectAdapterFactory.h" #include "OpaqueEndpointI.h" #include "ReferenceFactory.h" #include "RouterInfo.h" -#include "StringUtil.h" #include "TraceLevels.h" -#include "IceUtil/Random.h" - #include #include diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 7d63432a8f6..fd0ee247bbe 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -15,11 +15,11 @@ #include "Ice/Properties.h" #include "Ice/ProxyFunctions.h" #include "Ice/Router.h" +#include "Ice/StringUtil.h" #include "Instance.h" #include "LocatorInfo.h" #include "PropertyNames.h" #include "RouterInfo.h" -#include "StringUtil.h" #include @@ -117,7 +117,7 @@ IceInternal::ReferenceFactory::create(string_view str, const string& propertyPre // or double quotation marks. // string idstr; - end = IceUtilInternal::checkQuote(s, beg); + end = IceInternal::checkQuote(s, beg); if (end == string::npos) { throw ProxyParseException(__FILE__, __LINE__, "mismatched quotes around identity in `" + s + "'"); @@ -218,7 +218,7 @@ IceInternal::ReferenceFactory::create(string_view str, const string& propertyPre if (s[argumentBeg] != '@' && s[argumentBeg] != ':' && s[argumentBeg] != '-') { beg = argumentBeg; - end = IceUtilInternal::checkQuote(s, beg); + end = IceInternal::checkQuote(s, beg); if (end == string::npos) { throw ProxyParseException( @@ -499,7 +499,7 @@ IceInternal::ReferenceFactory::create(string_view str, const string& propertyPre } string adapterstr; - end = IceUtilInternal::checkQuote(s, beg); + end = IceInternal::checkQuote(s, beg); if (end == string::npos) { throw ProxyParseException(__FILE__, __LINE__, "mismatched quotes around adapter id in `" + s + "'"); @@ -701,7 +701,7 @@ IceInternal::ReferenceFactory::checkForUnknownProperties(const string& prefix) for (unsigned int i = 0; i < sizeof(suffixes) / sizeof(*suffixes); ++i) { string prop = prefix + "." + suffixes[i]; - if (IceUtilInternal::match(p->first, prop)) + if (IceInternal::match(p->first, prop)) { valid = true; break; diff --git a/cpp/src/Ice/RetryQueue.h b/cpp/src/Ice/RetryQueue.h index bc3c8f11bce..405f30995ea 100644 --- a/cpp/src/Ice/RetryQueue.h +++ b/cpp/src/Ice/RetryQueue.h @@ -6,7 +6,7 @@ #define ICE_RETRY_QUEUE_H #include "Ice/InstanceF.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "RequestHandler.h" // For CancellationHandler #include "RetryQueueF.h" @@ -20,9 +20,7 @@ namespace IceInternal using OutgoingAsyncBasePtr = std::shared_ptr; using ProxyOutgoingAsyncBasePtr = std::shared_ptr; - class RetryTask : public IceUtil::TimerTask, - public CancellationHandler, - public std::enable_shared_from_this + class RetryTask : public Ice::TimerTask, public CancellationHandler, public std::enable_shared_from_this { public: RetryTask(const InstancePtr&, const RetryQueuePtr&, const ProxyOutgoingAsyncBasePtr&); diff --git a/cpp/src/Ice/SSL/OpenSSLEngine.cpp b/cpp/src/Ice/SSL/OpenSSLEngine.cpp index 9d04c8dafbc..cb44b54d30d 100644 --- a/cpp/src/Ice/SSL/OpenSSLEngine.cpp +++ b/cpp/src/Ice/SSL/OpenSSLEngine.cpp @@ -3,14 +3,14 @@ // #include "OpenSSLEngine.h" +#include "../../IceUtil/FileUtil.h" #include "Ice/Communicator.h" #include "Ice/Config.h" #include "Ice/LocalException.h" #include "Ice/Logger.h" #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "OpenSSLEngineF.h" #include "OpenSSLTransceiverI.h" #include "SSLUtil.h" diff --git a/cpp/src/Ice/SSL/RFC2253.cpp b/cpp/src/Ice/SSL/RFC2253.cpp index fde9365cdc5..906ee631c58 100644 --- a/cpp/src/Ice/SSL/RFC2253.cpp +++ b/cpp/src/Ice/SSL/RFC2253.cpp @@ -4,7 +4,7 @@ #include "RFC2253.h" #include "Ice/SSL/SSLException.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -268,10 +268,10 @@ parseAttributeType(const string& data, size_t& pos) // // First the OID case. // - if (IceUtilInternal::isDigit(data[pos]) || + if (IceInternal::isDigit(data[pos]) || (data.size() - pos >= 4 && (data.substr(pos, 4) == "oid." || data.substr(pos, 4) == "OID."))) { - if (!IceUtilInternal::isDigit(data[pos])) + if (!IceInternal::isDigit(data[pos])) { result += data.substr(pos, 4); pos += 4; @@ -280,7 +280,7 @@ parseAttributeType(const string& data, size_t& pos) while (true) { // 1*DIGIT - while (pos < data.size() && IceUtilInternal::isDigit(data[pos])) + while (pos < data.size() && IceInternal::isDigit(data[pos])) { result += data[pos]; ++pos; @@ -291,7 +291,7 @@ parseAttributeType(const string& data, size_t& pos) result += data[pos]; ++pos; // 1*DIGIT must follow "." - if (pos < data.size() && !IceUtilInternal::isDigit(data[pos])) + if (pos < data.size() && !IceInternal::isDigit(data[pos])) { throw ParseException(__FILE__, __LINE__, "invalid attribute type (expected end of data)"); } @@ -302,7 +302,7 @@ parseAttributeType(const string& data, size_t& pos) } } } - else if (IceUtilInternal::isAlpha(data[pos])) + else if (IceInternal::isAlpha(data[pos])) { // // The grammar is wrong in this case. It should be ALPHA @@ -313,7 +313,7 @@ parseAttributeType(const string& data, size_t& pos) ++pos; // 1* KEYCHAR while (pos < data.size() && - (IceUtilInternal::isAlpha(data[pos]) || IceUtilInternal::isDigit(data[pos]) || data[pos] == '-')) + (IceInternal::isAlpha(data[pos]) || IceInternal::isDigit(data[pos]) || data[pos] == '-')) { result += data[pos]; ++pos; diff --git a/cpp/src/Ice/SSL/SSLEngine.cpp b/cpp/src/Ice/SSL/SSLEngine.cpp index 0315c6ec9a5..9c52df38b48 100644 --- a/cpp/src/Ice/SSL/SSLEngine.cpp +++ b/cpp/src/Ice/SSL/SSLEngine.cpp @@ -10,14 +10,14 @@ #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" #include "Ice/SSL/ConnectionInfo.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "TrustManager.h" #include using namespace std; using namespace Ice; -using namespace IceUtil; +using namespace Ice; using namespace Ice::SSL; Ice::SSL::SSLEngine::SSLEngine(const IceInternal::InstancePtr& instance) diff --git a/cpp/src/Ice/SSL/SSLUtil.cpp b/cpp/src/Ice/SSL/SSLUtil.cpp index bd4f1984de6..1c3bf4b0696 100644 --- a/cpp/src/Ice/SSL/SSLUtil.cpp +++ b/cpp/src/Ice/SSL/SSLUtil.cpp @@ -3,16 +3,16 @@ // #include "SSLUtil.h" +#include "../../IceUtil/FileUtil.h" #include "../Base64.h" #include "../Network.h" #include "../UniqueRef.h" #include "DistinguishedName.h" +#include "Ice/Config.h" #include "Ice/LocalException.h" #include "Ice/SSL/SSLException.h" #include "Ice/StringConverter.h" -#include "IceUtil/Config.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "RFC2253.h" #include @@ -20,7 +20,6 @@ using namespace std; using namespace Ice; using namespace IceInternal; -using namespace IceUtil; using namespace Ice::SSL; #if defined(__APPLE__) @@ -45,7 +44,7 @@ Ice::SSL::fromCFString(CFStringRef v) bool Ice::SSL::parseBytes(const string& arg, vector& buffer) { - string v = IceUtilInternal::toUpper(arg); + string v = IceInternal::toUpper(arg); // Check for any invalid characters. size_t pos = v.find_first_not_of(" :0123456789ABCDEF"); @@ -184,7 +183,7 @@ namespace if ((length = CertNameToStr(X509_ASN_ENCODING, certName, CERT_OID_NAME_STR | CERT_NAME_STR_REVERSE_FLAG, 0, 0)) == 0) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } vector buffer(length); @@ -195,7 +194,7 @@ namespace &buffer[0], length)) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } string s(&buffer[0]); @@ -250,7 +249,7 @@ Ice::SSL::getSubjectAltNames(PCCERT_CONTEXT cert) &altName, &length)) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } for (DWORD i = 0; i < altName->cAltEntry; ++i) @@ -330,7 +329,7 @@ Ice::SSL::encodeCertificate(PCCERT_CONTEXT cert) 0, &encodedLength)) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } vector encoded; @@ -342,7 +341,7 @@ Ice::SSL::encodeCertificate(PCCERT_CONTEXT cert) &encoded[0], &encodedLength)) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } s.assign(&encoded[0]); return s; @@ -367,7 +366,7 @@ Ice::SSL::decodeCertificate(const string& data) { // Base64 data should always be bigger than binary assert(GetLastError() != ERROR_MORE_DATA); - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } DWORD decodedLeng = 0; @@ -381,14 +380,14 @@ Ice::SSL::decodeCertificate(const string& data) &cert, &decodedLeng)) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } PCCERT_CONTEXT certContext = CertCreateCertificateContext(X509_ASN_ENCODING, cert->ToBeSigned.pbData, cert->ToBeSigned.cbData); LocalFree(cert); if (!certContext) { - throw CertificateEncodingException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw CertificateEncodingException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } return certContext; } diff --git a/cpp/src/Ice/SSL/SchannelEngine.cpp b/cpp/src/Ice/SSL/SchannelEngine.cpp index ceba59fc99b..d535dab0366 100644 --- a/cpp/src/Ice/SSL/SchannelEngine.cpp +++ b/cpp/src/Ice/SSL/SchannelEngine.cpp @@ -3,14 +3,14 @@ // #include "SchannelEngine.h" +#include "../../IceUtil/FileUtil.h" #include "DistinguishedName.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" #include "Ice/Logger.h" #include "Ice/StringConverter.h" +#include "Ice/StringUtil.h" #include "Ice/UUID.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" #include "SSLUtil.h" #include "SchannelTransceiverI.h" @@ -33,7 +33,8 @@ const int ICESSL_CALG_ECDH_EPHEM = 0x0000AE06; using namespace std; using namespace Ice; -using namespace IceUtil; +using namespace Ice; +using namespace IceInternal; using namespace IceUtilInternal; using namespace Ice::SSL; @@ -315,7 +316,7 @@ namespace throw InitializationException( __FILE__, __LINE__, - "SSL transport: error adding certificate to store:\n" + IceUtilInternal::lastErrorToString()); + "SSL transport: error adding certificate to store:\n" + IceInternal::lastErrorToString()); } } } while (next); @@ -337,7 +338,7 @@ namespace __FILE__, __LINE__, "SSL transport: failed to open certificate store `" + storeName + "':\n" + - IceUtilInternal::lastErrorToString()); + IceInternal::lastErrorToString()); } // @@ -369,7 +370,7 @@ namespace size_t pos; while ((pos = value.find(':', start)) != string::npos) { - string field = IceUtilInternal::toUpper(IceUtilInternal::trim(value.substr(start, pos - start))); + string field = IceInternal::toUpper(IceInternal::trim(value.substr(start, pos - start))); if (field != "SUBJECT" && field != "SUBJECTDN" && field != "ISSUER" && field != "ISSUERDN" && field != "THUMBPRINT" && field != "SUBJECTKEYID" && field != "SERIAL") { @@ -438,8 +439,7 @@ namespace throw InitializationException( __FILE__, __LINE__, - "SSL transport: error adding certificate to store:\n" + - IceUtilInternal::lastErrorToString()); + "SSL transport: error adding certificate to store:\n" + IceInternal::lastErrorToString()); } if (field == "SUBJECT" || field == "ISSUER") @@ -465,7 +465,7 @@ namespace __FILE__, __LINE__, "SSL transport: invalid value `" + value + "' for `IceSSL.FindCert' property:\n" + - IceUtilInternal::lastErrorToString()); + IceInternal::lastErrorToString()); } vector buffer(length); @@ -475,7 +475,7 @@ namespace __FILE__, __LINE__, "SSL transport: invalid value `" + value + "' for `IceSSL.FindCert' property:\n" + - IceUtilInternal::lastErrorToString()); + IceInternal::lastErrorToString()); } CERT_NAME_BLOB name = {length, &buffer[0]}; @@ -530,7 +530,7 @@ namespace __FILE__, __LINE__, "SSL transport: error adding certificate to store:\n" + - IceUtilInternal::lastErrorToString()); + IceInternal::lastErrorToString()); } } } @@ -667,16 +667,16 @@ namespace { if (p->first == AltNAmeIP) { - ipAddresses.push_back(IceUtilInternal::toLower(p->second)); + ipAddresses.push_back(IceInternal::toLower(p->second)); } else if (p->first == AltNameDNS) { - dnsNames.push_back(IceUtilInternal::toLower(p->second)); + dnsNames.push_back(IceInternal::toLower(p->second)); } } bool certNameOK = false; - string addrLower = IceUtilInternal::toLower(address); + string addrLower = IceInternal::toLower(address); bool isIpAddress = IceInternal::isIpAddress(address); // If address is an IP address, compare it to the subject alternative names IP address @@ -691,7 +691,7 @@ namespace if (dnsNames.empty()) { auto d = DistinguishedName(getSubjectName(cert)); - string dn = IceUtilInternal::toLower(string(d)); + string dn = IceInternal::toLower(string(d)); string cn = "cn=" + addrLower; string::size_type pos = dn.find(cn); if (pos != string::npos) @@ -1389,7 +1389,7 @@ Schannel::SSLEngine::validationCallback( if (err && (err != SEC_E_NO_CREDENTIALS || certificateRequired)) { ostringstream os; - os << "SSL transport: certificate verification failure:\n" << IceUtilInternal::errorToString(err); + os << "SSL transport: certificate verification failure:\n" << IceInternal::errorToString(err); throw SecurityException(__FILE__, __LINE__, os.str()); } @@ -1444,7 +1444,7 @@ Schannel::SSLEngine::validationCallback( extraPolicyPara.dwAuthType = incoming ? AUTHTYPE_CLIENT : AUTHTYPE_SERVER; // Disable because the policy only matches the CN of the certificate, not the SAN. extraPolicyPara.fdwChecks = SECURITY_FLAG_IGNORE_CERT_CN_INVALID; - extraPolicyPara.pwszServerName = const_cast(IceUtil::stringToWstring(host).c_str()); + extraPolicyPara.pwszServerName = const_cast(Ice::stringToWstring(host).c_str()); CERT_CHAIN_POLICY_PARA policyPara; memset(&policyPara, 0, sizeof(policyPara)); diff --git a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp index 87bc24f0755..20cb2c7ad01 100644 --- a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +++ b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp @@ -8,7 +8,7 @@ #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/SSL/ConnectionInfo.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "SSLInstance.h" #include "SSLUtil.h" #include "SchannelEngine.h" @@ -75,7 +75,7 @@ namespace throw InitializationException( __FILE__, __LINE__, - "SSL transport: error creating certificate chain engine:\n" + IceUtilInternal::lastErrorToString()); + "SSL transport: error creating certificate chain engine:\n" + IceInternal::lastErrorToString()); } return chainEngine; } @@ -167,7 +167,7 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) throw SecurityException( __FILE__, __LINE__, - "SSL transport: failed to acquire credentials handle:\n" + IceUtilInternal::lastErrorToString()); + "SSL transport: failed to acquire credentials handle:\n" + IceInternal::lastErrorToString()); } _ctxFlags = 0; @@ -199,7 +199,7 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) if (err != SEC_E_OK && err != SEC_I_CONTINUE_NEEDED) { ostringstream os; - os << "SSL transport: handshake failure:\n" << IceUtilInternal::errorToString(err); + os << "SSL transport: handshake failure:\n" << IceInternal::errorToString(err); throw SecurityException(__FILE__, __LINE__, os.str()); } @@ -297,7 +297,7 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) else if (err != SEC_I_CONTINUE_NEEDED && err != SEC_E_OK) { ostringstream os; - os << "SSL handshake failure:\n" << IceUtilInternal::errorToString(err); + os << "SSL handshake failure:\n" << IceInternal::errorToString(err); throw SecurityException(__FILE__, __LINE__, os.str()); } @@ -442,7 +442,7 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) if (err != SEC_E_OK) { ostringstream os; - os << "SSL transport: failure to query stream sizes attributes:\n" << IceUtilInternal::errorToString(err); + os << "SSL transport: failure to query stream sizes attributes:\n" << IceInternal::errorToString(err); throw SecurityException(__FILE__, __LINE__, os.str()); } @@ -457,7 +457,7 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) if (err != SEC_E_OK && err != SEC_E_NO_CREDENTIALS) { ostringstream os; - os << "SSL transport: failure to query remote certificate context:\n" << IceUtilInternal::errorToString(err); + os << "SSL transport: failure to query remote certificate context:\n" << IceInternal::errorToString(err); throw SecurityException(__FILE__, __LINE__, os.str()); } @@ -560,7 +560,7 @@ Schannel::TransceiverI::decryptMessage(IceInternal::Buffer& buffer) throw ProtocolException( __FILE__, __LINE__, - "SSL transport: protocol error during read:\n" + IceUtilInternal::errorToString(err)); + "SSL transport: protocol error during read:\n" + IceInternal::errorToString(err)); } SecBuffer* dataBuffer = getSecBufferWithType(inBufferDesc, SECBUFFER_DATA); @@ -632,7 +632,7 @@ Schannel::TransceiverI::encryptMessage(IceInternal::Buffer& buffer) throw ProtocolException( __FILE__, __LINE__, - "SSL transport: protocol error encrypting message:\n" + IceUtilInternal::errorToString(err)); + "SSL transport: protocol error encrypting message:\n" + IceInternal::errorToString(err)); } // EncryptMessage resizes the buffers, so resize the write buffer as well to reflect this. diff --git a/cpp/src/Ice/SSL/SecureTransportEngine.cpp b/cpp/src/Ice/SSL/SecureTransportEngine.cpp index 2a439d94d47..48d7f0db94d 100644 --- a/cpp/src/Ice/SSL/SecureTransportEngine.cpp +++ b/cpp/src/Ice/SSL/SecureTransportEngine.cpp @@ -3,6 +3,7 @@ // #include "SecureTransportEngine.h" +#include "../../IceUtil/FileUtil.h" #include "../Instance.h" #include "../TraceLevels.h" #include "Ice/Config.h" @@ -11,8 +12,7 @@ #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" #include "Ice/SSL/SSLException.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "SSLEngine.h" #include "SSLUtil.h" #include "SecureTransportEngineF.h" @@ -20,10 +20,10 @@ #include "SecureTransportUtil.h" // Disable deprecation warnings from SecureTransport APIs -#include "IceUtil/DisableWarnings.h" +#include "../../IceUtil/DisableWarnings.h" using namespace std; -using namespace IceUtil; +using namespace Ice; using namespace Ice; using namespace Ice::SSL; using namespace IceInternal; @@ -621,7 +621,7 @@ SecureTransport::SSLEngine::initialize() if (!certFile.empty()) { vector files; - if (!IceUtilInternal::splitString(certFile, IceUtilInternal::pathsep, files) || files.size() > 2) + if (!IceInternal::splitString(certFile, IceUtilInternal::pathsep, files) || files.size() > 2) { throw InitializationException( __FILE__, @@ -633,7 +633,7 @@ SecureTransport::SSLEngine::initialize() string keyFile = properties->getIceProperty("IceSSL.KeyFile"); if (!keyFile.empty()) { - if (!IceUtilInternal::splitString(keyFile, IceUtilInternal::pathsep, keyFiles) || keyFiles.size() > 2) + if (!IceInternal::splitString(keyFile, IceUtilInternal::pathsep, keyFiles) || keyFiles.size() > 2) { throw InitializationException( __FILE__, diff --git a/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp b/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp index 5c27b1cc51d..6b3baee5ce9 100644 --- a/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +++ b/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp @@ -13,7 +13,7 @@ #include // Disable deprecation warnings from SecureTransport APIs -#include "IceUtil/DisableWarnings.h" +#include "../../IceUtil/DisableWarnings.h" using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/SSL/SecureTransportUtil.cpp b/cpp/src/Ice/SSL/SecureTransportUtil.cpp index ce578bf79b5..0b8baf81ec4 100644 --- a/cpp/src/Ice/SSL/SecureTransportUtil.cpp +++ b/cpp/src/Ice/SSL/SecureTransportUtil.cpp @@ -3,13 +3,13 @@ // #include "SecureTransportUtil.h" +#include "../../IceUtil/FileUtil.h" #include "../Base64.h" #include "../UniqueRef.h" #include "DistinguishedName.h" #include "Ice/LocalException.h" #include "Ice/SSL/SSLException.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -813,7 +813,7 @@ Ice::SSL::SecureTransport::findCertificateChain( bool valid = false; while ((pos = value.find(':', start)) != string::npos) { - string field = IceUtilInternal::toUpper(IceUtilInternal::trim(value.substr(start, pos - start))); + string field = IceInternal::toUpper(IceInternal::trim(value.substr(start, pos - start))); string arg; if (field != "LABEL" && field != "SERIAL" && field != "SUBJECT" && field != "SUBJECTKEYID") { diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index fa78615c25a..db9ef3b594c 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -197,7 +197,7 @@ Selector::Selector(const InstancePtr& instance) : _instance(instance), _interrup if (epoll_ctl(_queueFd, EPOLL_CTL_ADD, _fdIntrRead, &event) != 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } # elif defined(ICE_USE_KQUEUE) _events.resize(256); @@ -213,7 +213,7 @@ Selector::Selector(const InstancePtr& instance) : _instance(instance), _interrup if (rs < 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } # elif defined(ICE_USE_SELECT) FD_ZERO(&_readFdSet); @@ -319,7 +319,7 @@ Selector::enable(EventHandler* handler, SocketOperation status) if (epoll_ctl(_queueFd, previous ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &event) != 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } # elif defined(ICE_USE_KQUEUE) struct kevent ev; @@ -373,7 +373,7 @@ Selector::disable(EventHandler* handler, SocketOperation status) if (epoll_ctl(_queueFd, newStatus ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, fd, &event) != 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } # elif defined(ICE_USE_KQUEUE) SOCKET fd = nativeInfo->fd(); @@ -545,7 +545,7 @@ Selector::finishSelect(vector>& handlers) if (ev.flags & EV_ERROR) { Ice::Error out(_instance->initializationData().logger); - out << "selector returned error:\n" << IceUtilInternal::errorToString(static_cast(ev.data)); + out << "selector returned error:\n" << IceInternal::errorToString(static_cast(ev.data)); continue; } p.first = reinterpret_cast(ev.udata); @@ -745,7 +745,7 @@ Selector::updateSelector() if (rs < 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } else { @@ -760,7 +760,7 @@ Selector::updateSelector() { Ice::Error out(_instance->initializationData().logger); out << "error while updating selector:\n" - << IceUtilInternal::errorToString(static_cast(_changes[static_cast(i)].data)); + << IceInternal::errorToString(static_cast(_changes[static_cast(i)].data)); } } } @@ -909,7 +909,7 @@ Selector::updateSelectorForEventHandler( if (epoll_ctl(_queueFd, op, fd, &event) != 0) { Ice::Error out(_instance->initializationData().logger); - out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); + out << "error while updating selector:\n" << IceInternal::errorToString(IceInternal::getSocketErrno()); } # elif defined(ICE_USE_KQUEUE) SOCKET fd = handler->getNativeInfo()->fd(); diff --git a/cpp/src/Ice/Selector.h b/cpp/src/Ice/Selector.h index a76d3aa5d4a..97064b337ca 100644 --- a/cpp/src/Ice/Selector.h +++ b/cpp/src/Ice/Selector.h @@ -5,7 +5,7 @@ #ifndef ICE_SELECTOR_H #define ICE_SELECTOR_H -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "EventHandlerF.h" #include "Ice/InstanceF.h" diff --git a/cpp/src/Ice/ServantManager.cpp b/cpp/src/Ice/ServantManager.cpp index 9c81608e16a..ee489a2cead 100644 --- a/cpp/src/Ice/ServantManager.cpp +++ b/cpp/src/Ice/ServantManager.cpp @@ -7,8 +7,8 @@ #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/ServantLocator.h" +#include "Ice/StringUtil.h" #include "Instance.h" -#include "StringUtil.h" using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 7594faed577..586a0f30be4 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -3,9 +3,9 @@ // #include "Ice/Service.h" +#include "../IceUtil/ConsoleUtil.h" #include "ArgVector.h" -#include "ConsoleUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "LoggerI.h" #ifdef _WIN32 @@ -24,6 +24,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; Ice::Service* Ice::Service::_instance = 0; static CtrlCHandler* _ctrlCHandler = 0; @@ -886,7 +887,7 @@ Ice::Service::initializeCommunicator(int& argc, char* argv[], const Initializati void Ice::Service::syserror(const string& msg) { - string errmsg = IceUtilInternal::lastErrorToString(); + string errmsg = IceInternal::lastErrorToString(); if (_logger) { ostringstream ostr; @@ -1197,7 +1198,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[]) // Don't need to pass a wide string converter in the argv conversions // as argv come from Windows API. // - const IceUtil::StringConverterPtr converter = IceUtil::getProcessStringConverter(); + const Ice::StringConverterPtr converter = Ice::getProcessStringConverter(); // // Merge the executable's arguments with the service's arguments. @@ -1223,7 +1224,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[]) vector executableArgs; for (int j = 1; j < argc; ++j) { - executableArgs.push_back(IceUtil::wstringToString(argv[j], converter)); + executableArgs.push_back(Ice::wstringToString(argv[j], converter)); } for (vector::iterator p = executableArgs.begin(); p != executableArgs.end(); ++p) { @@ -1453,7 +1454,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa { consoleErr << argv[0] << ": "; } - consoleErr << IceUtilInternal::errorToString(errno) << endl; + consoleErr << IceInternal::errorToString(errno) << endl; return EXIT_FAILURE; } @@ -1486,7 +1487,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa { consoleErr << argv[0] << ": "; } - consoleErr << IceUtilInternal::errorToString(errno) << endl; + consoleErr << IceInternal::errorToString(errno) << endl; _exit(EXIT_FAILURE); } break; @@ -1513,7 +1514,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa if (rs == -1) { consoleErr << "I/O error while reading error message from child:\n" - << IceUtilInternal::errorToString(errno); + << IceInternal::errorToString(errno); } else { diff --git a/cpp/src/IceUtil/StringConverter.cpp b/cpp/src/Ice/StringConverter.cpp similarity index 89% rename from cpp/src/IceUtil/StringConverter.cpp rename to cpp/src/Ice/StringConverter.cpp index ce1aabdea62..19c05262383 100644 --- a/cpp/src/IceUtil/StringConverter.cpp +++ b/cpp/src/Ice/StringConverter.cpp @@ -7,12 +7,12 @@ #if defined(_MSC_VER) && (_MSVC_LANG >= 201703L) # define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING #elif (__cplusplus >= 201703L) -# include "IceUtil/DisableWarnings.h" +# include "../IceUtil/DisableWarnings.h" #endif #include "Ice/Exception.h" -#include "IceUtil/StringConverter.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringConverter.h" +#include "Ice/StringUtil.h" #ifdef _WIN32 # include @@ -23,15 +23,15 @@ #include #include -using namespace IceUtil; -using namespace IceUtilInternal; +using namespace Ice; +using namespace IceInternal; using namespace std; namespace { mutex processStringConverterMutex; - IceUtil::StringConverterPtr processStringConverter; - IceUtil::WstringConverterPtr processWstringConverter; + StringConverterPtr processStringConverter; + WstringConverterPtr processWstringConverter; template struct SelectCodeCvt; @@ -114,16 +114,16 @@ namespace // Unexpected // assert(0); - throw Ice::IllegalConversionException(__FILE__, __LINE__, "codecvt.out noconv"); + throw IllegalConversionException(__FILE__, __LINE__, "codecvt.out noconv"); default: - throw Ice::IllegalConversionException(__FILE__, __LINE__, "codecvt.out error"); + throw IllegalConversionException(__FILE__, __LINE__, "codecvt.out error"); } if (targetStart == targetNext) { // We didn't convert a single character - throw Ice::IllegalConversionException(__FILE__, __LINE__, "no character converted by codecvt.out"); + throw IllegalConversionException(__FILE__, __LINE__, "no character converted by codecvt.out"); } sourceStart = sourceNext; @@ -162,7 +162,7 @@ namespace if (result != codecvt_base::ok) { - throw Ice::IllegalConversionException(__FILE__, __LINE__, "codecvt.in failure"); + throw IllegalConversionException(__FILE__, __LINE__, "codecvt.in failure"); } target.resize(static_cast(targetNext - targetStart)); @@ -214,33 +214,33 @@ namespace }; } -IceUtil::UTF8Buffer::~UTF8Buffer() +Ice::UTF8Buffer::~UTF8Buffer() { // Out of line to avoid weak vtable } WstringConverterPtr -IceUtil::createUnicodeWstringConverter() +Ice::createUnicodeWstringConverter() { return getUnicodeWstringConverter(); } StringConverterPtr -IceUtil::getProcessStringConverter() +Ice::getProcessStringConverter() { lock_guard lock(processStringConverterMutex); return processStringConverter; } void -IceUtil::setProcessStringConverter(const StringConverterPtr& converter) +Ice::setProcessStringConverter(const StringConverterPtr& converter) { lock_guard lock(processStringConverterMutex); processStringConverter = converter; } WstringConverterPtr -IceUtil::getProcessWstringConverter() +Ice::getProcessWstringConverter() { lock_guard lock(processStringConverterMutex); if (processWstringConverter) @@ -254,14 +254,14 @@ IceUtil::getProcessWstringConverter() } void -IceUtil::setProcessWstringConverter(const WstringConverterPtr& converter) +Ice::setProcessWstringConverter(const WstringConverterPtr& converter) { lock_guard lock(processStringConverterMutex); processWstringConverter = converter; } string -IceUtil::wstringToString(const wstring& v, const StringConverterPtr& converter, const WstringConverterPtr& wConverter) +Ice::wstringToString(const wstring& v, const StringConverterPtr& converter, const WstringConverterPtr& wConverter) { string target; if (!v.empty()) @@ -293,7 +293,7 @@ IceUtil::wstringToString(const wstring& v, const StringConverterPtr& converter, } wstring -IceUtil::stringToWstring(const string& v, const StringConverterPtr& converter, const WstringConverterPtr& wConverter) +Ice::stringToWstring(const string& v, const StringConverterPtr& converter, const WstringConverterPtr& wConverter) { wstring target; if (!v.empty()) @@ -328,7 +328,7 @@ IceUtil::stringToWstring(const string& v, const StringConverterPtr& converter, c } string -IceUtil::nativeToUTF8(const string& str, const IceUtil::StringConverterPtr& converter) +Ice::nativeToUTF8(const string& str, const Ice::StringConverterPtr& converter) { if (!converter || str.empty()) { @@ -342,7 +342,7 @@ IceUtil::nativeToUTF8(const string& str, const IceUtil::StringConverterPtr& conv } string -IceUtil::UTF8ToNative(const string& str, const IceUtil::StringConverterPtr& converter) +Ice::UTF8ToNative(const string& str, const Ice::StringConverterPtr& converter) { if (!converter || str.empty()) { @@ -360,7 +360,7 @@ typedef char16_t Char16T; typedef char32_t Char32T; vector -IceUtilInternal::toUTF16(const vector& source) +IceInternal::toUTF16(const vector& source) { vector result; if (!source.empty()) @@ -390,7 +390,7 @@ IceUtilInternal::toUTF16(const vector& source) } vector -IceUtilInternal::toUTF32(const vector& source) +IceInternal::toUTF32(const vector& source) { vector result; if (!source.empty()) @@ -419,7 +419,7 @@ IceUtilInternal::toUTF32(const vector& source) } vector -IceUtilInternal::fromUTF32(const vector& source) +IceInternal::fromUTF32(const vector& source) { vector result; if (!source.empty()) @@ -506,7 +506,7 @@ namespace if (writtenWchar == 0) { - throw Ice::IllegalConversionException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw IllegalConversionException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } wbuffer.resize(static_cast(writtenWchar)); @@ -566,7 +566,7 @@ namespace if (writtenChar == 0) { - throw Ice::IllegalConversionException(__FILE__, __LINE__, IceUtilInternal::lastErrorToString()); + throw IllegalConversionException(__FILE__, __LINE__, IceInternal::lastErrorToString()); } target.resize(static_cast(writtenChar)); @@ -574,7 +574,7 @@ namespace } StringConverterPtr -IceUtil::createWindowsStringConverter(unsigned int cp) +Ice::createWindowsStringConverter(unsigned int cp) { return make_shared(cp); } diff --git a/cpp/src/Ice/StringConverterPlugin.cpp b/cpp/src/Ice/StringConverterPlugin.cpp index b66ea5bd8a3..adefcbff8fd 100644 --- a/cpp/src/Ice/StringConverterPlugin.cpp +++ b/cpp/src/Ice/StringConverterPlugin.cpp @@ -9,7 +9,7 @@ #include "Ice/Initialize.h" #include "Ice/LoggerUtil.h" #include "Ice/StringConverter.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include @@ -107,7 +107,7 @@ extern "C" { if (args[i].find("iconv=") == 0) { - if (!IceUtilInternal::splitString(args[i].substr(strlen("iconv=")), ", \t\r\n", iconvArgs)) + if (!IceInternal::splitString(args[i].substr(strlen("iconv=")), ", \t\r\n", iconvArgs)) { Error out(communicator->getLogger()); out << "Plugin " << name << ": invalid iconv argument"; diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/Ice/StringUtil.cpp similarity index 96% rename from cpp/src/IceUtil/StringUtil.cpp rename to cpp/src/Ice/StringUtil.cpp index 56be3c45413..997851ac39f 100644 --- a/cpp/src/IceUtil/StringUtil.cpp +++ b/cpp/src/Ice/StringUtil.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/StringUtil.h" -#include "IceUtil/StringConverter.h" +#include "Ice/StringUtil.h" +#include "Ice/StringConverter.h" #include #include #include // for strerror_r @@ -17,7 +17,8 @@ #endif using namespace std; -using namespace IceUtil; +using namespace Ice; +using namespace IceInternal; namespace { @@ -109,7 +110,7 @@ namespace // Add escape sequences. Any characters that appear in special are prefixed with a backslash in the returned string. // string -IceUtilInternal::escapeString(const string& s, const string& special, ToStringMode toStringMode) +IceInternal::escapeString(const string& s, const string& special, ToStringMode toStringMode) { for (string::size_type i = 0; i < special.size(); ++i) { @@ -558,7 +559,7 @@ namespace // Remove escape sequences added by escapeString. // string -IceUtilInternal::unescapeString(const string& s, string::size_type start, string::size_type end, const string& special) +IceInternal::unescapeString(const string& s, string::size_type start, string::size_type end, const string& special) { assert(start <= end && end <= s.size()); @@ -628,7 +629,7 @@ IceUtilInternal::unescapeString(const string& s, string::size_type start, string } bool -IceUtilInternal::splitString(string_view str, string_view delim, vector& result) +IceInternal::splitString(string_view str, string_view delim, vector& result) { string::size_type pos = 0; string::size_type length = str.length(); @@ -689,7 +690,7 @@ IceUtilInternal::splitString(string_view str, string_view delim, vector& } string -IceUtilInternal::joinString(const std::vector& values, const std::string& delimiter) +IceInternal::joinString(const std::vector& values, const std::string& delimiter) { ostringstream out; for (unsigned int i = 0; i < values.size(); i++) @@ -707,7 +708,7 @@ IceUtilInternal::joinString(const std::vector& values, const std::s // Trim white space (" \t\r\n") // string -IceUtilInternal::trim(const string& s) +IceInternal::trim(const string& s) { static const string delim = " \t\r\n"; string::size_type beg = s.find_first_not_of(delim); @@ -728,7 +729,7 @@ IceUtilInternal::trim(const string& s) // If no matching closing quote is found, then -1 is returned. // string::size_type -IceUtilInternal::checkQuote(const string& s, string::size_type start) +IceInternal::checkQuote(const string& s, string::size_type start) { string::value_type quoteChar = s[start]; if (quoteChar == '"' || quoteChar == '\'') @@ -755,7 +756,7 @@ IceUtilInternal::checkQuote(const string& s, string::size_type start) // (whereas regex() isn't). Only one * per pattern is supported. // bool -IceUtilInternal::match(const string& s, const string& pat, bool emptyMatch) +IceInternal::match(const string& s, const string& pat, bool emptyMatch) { assert(!s.empty()); assert(!pat.empty()); @@ -806,7 +807,7 @@ IceUtilInternal::match(const string& s, const string& pat, bool emptyMatch) #ifdef _WIN32 string -IceUtilInternal::errorToString(int error, LPCVOID source) +IceInternal::errorToString(int error, LPCVOID source) { if (error < WSABASEERR) { @@ -1009,7 +1010,7 @@ IceUtilInternal::errorToString(int error, LPCVOID source) } string -IceUtilInternal::lastErrorToString() +IceInternal::lastErrorToString() { return errorToString(GetLastError()); } @@ -1017,7 +1018,7 @@ IceUtilInternal::lastErrorToString() #else string -IceUtilInternal::errorToString(int error) +IceInternal::errorToString(int error) { vector buffer(500); while (true) @@ -1059,7 +1060,7 @@ IceUtilInternal::errorToString(int error) } string -IceUtilInternal::lastErrorToString() +IceInternal::lastErrorToString() { return errorToString(errno); } @@ -1067,7 +1068,7 @@ IceUtilInternal::lastErrorToString() #endif string -IceUtilInternal::toLower(std::string_view s) +IceInternal::toLower(std::string_view s) { string result; result.reserve(s.size()); @@ -1086,7 +1087,7 @@ IceUtilInternal::toLower(std::string_view s) } string -IceUtilInternal::toUpper(std::string_view s) +IceInternal::toUpper(std::string_view s) { string result; result.reserve(s.size()); @@ -1105,19 +1106,19 @@ IceUtilInternal::toUpper(std::string_view s) } bool -IceUtilInternal::isAlpha(char c) +IceInternal::isAlpha(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } bool -IceUtilInternal::isDigit(char c) +IceInternal::isDigit(char c) { return c >= '0' && c <= '9'; } string -IceUtilInternal::removeWhitespace(const std::string& s) +IceInternal::removeWhitespace(const std::string& s) { string result; for (unsigned int i = 0; i < s.length(); ++i) diff --git a/cpp/src/Ice/StringUtil.h b/cpp/src/Ice/StringUtil.h deleted file mode 100644 index 4c26743ef11..00000000000 --- a/cpp/src/Ice/StringUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_STRING_UTIL_H -#define ICE_STRING_UTIL_H - -#include "Ice/Initialize.h" -#include "IceUtil/StringUtil.h" - -namespace IceInternal -{ - // - // Adapter for ToStringMode - // - inline std::string escapeString(const std::string& s, const std::string& special, Ice::ToStringMode mode) - { - return IceUtilInternal::escapeString(s, special, static_cast(mode)); - } - - // - // Provided for consistency with escapeString - // - using IceUtilInternal::unescapeString; -} - -#endif diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp index 9328a012075..a6cc75a62a9 100644 --- a/cpp/src/Ice/TcpAcceptor.cpp +++ b/cpp/src/Ice/TcpAcceptor.cpp @@ -9,7 +9,7 @@ # include "Ice/LocalException.h" # include "Ice/LoggerUtil.h" # include "Ice/Properties.h" -# include "IceUtil/StringUtil.h" +# include "Ice/StringUtil.h" # include "ProtocolInstance.h" # include "StreamSocket.h" # include "TcpAcceptor.h" @@ -173,7 +173,7 @@ IceInternal::TcpAcceptor::toDetailedString() const if (!intfs.empty()) { os << "\nlocal interfaces = "; - os << IceUtilInternal::joinString(intfs, ", "); + os << IceInternal::joinString(intfs, ", "); } return os.str(); } diff --git a/cpp/src/Ice/TcpEndpointI.h b/cpp/src/Ice/TcpEndpointI.h index d728ee95e88..3533eb4b5bb 100644 --- a/cpp/src/Ice/TcpEndpointI.h +++ b/cpp/src/Ice/TcpEndpointI.h @@ -7,8 +7,8 @@ #include "EndpointFactory.h" #include "IPEndpointI.h" +#include "Ice/Config.h" #include "Ice/SSL/ServerAuthenticationOptions.h" -#include "IceUtil/Config.h" #include "Network.h" // for IceIternal::Address namespace IceInternal diff --git a/cpp/src/Ice/Timer.cpp b/cpp/src/Ice/Timer.cpp index 041766af8f2..267690ba404 100644 --- a/cpp/src/Ice/Timer.cpp +++ b/cpp/src/Ice/Timer.cpp @@ -2,13 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Timer.h" -#include "ConsoleUtil.h" +#include "Ice/Timer.h" +#include "../IceUtil/ConsoleUtil.h" #include "Ice/Exception.h" using namespace std; -using namespace IceUtil; +using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; TimerTask::~TimerTask() { @@ -129,7 +130,7 @@ Timer::run() } catch (const Ice::Exception& e) { - consoleErr << "IceUtil::Timer::run(): uncaught exception:\n" << e.what(); + consoleErr << "Ice::Timer::run(): uncaught exception:\n" << e.what(); #ifdef __GNUC__ consoleErr << "\n" << e.ice_stackTrace(); #endif @@ -137,11 +138,11 @@ Timer::run() } catch (const std::exception& e) { - consoleErr << "IceUtil::Timer::run(): uncaught exception:\n" << e.what() << endl; + consoleErr << "Ice::Timer::run(): uncaught exception:\n" << e.what() << endl; } catch (...) { - consoleErr << "IceUtil::Timer::run(): uncaught exception" << endl; + consoleErr << "Ice::Timer::run(): uncaught exception" << endl; } if (!token.delay) diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp index 3098637f864..497d53db7bb 100644 --- a/cpp/src/Ice/TraceUtil.cpp +++ b/cpp/src/Ice/TraceUtil.cpp @@ -8,10 +8,10 @@ #include "Ice/Object.h" #include "Ice/OutputStream.h" #include "Ice/Proxy.h" +#include "Ice/StringUtil.h" #include "Ice/VersionFunctions.h" #include "Instance.h" #include "ReplyStatus.h" -#include "StringUtil.h" #include "TraceLevels.h" #include diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/Ice/UUID.cpp similarity index 96% rename from cpp/src/IceUtil/UUID.cpp rename to cpp/src/Ice/UUID.cpp index 18692737c0c..66f3a7c7edf 100644 --- a/cpp/src/IceUtil/UUID.cpp +++ b/cpp/src/Ice/UUID.cpp @@ -2,12 +2,12 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/UUID.h" +#include "Ice/UUID.h" // We use a high quality random number generator // (std::random_device) to generate "version 4" UUIDs, as described in // http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-00.txt -#include "IceUtil/Random.h" +#include "../IceUtil/Random.h" using namespace std; @@ -37,7 +37,7 @@ namespace } string -IceUtil::generateUUID() +Ice::generateUUID() { struct UUID { diff --git a/cpp/src/Ice/UdpEndpointI.h b/cpp/src/Ice/UdpEndpointI.h index 644a3170dd9..6225f9afbef 100644 --- a/cpp/src/Ice/UdpEndpointI.h +++ b/cpp/src/Ice/UdpEndpointI.h @@ -7,8 +7,8 @@ #include "EndpointFactory.h" #include "IPEndpointI.h" +#include "Ice/Config.h" #include "Ice/SSL/ServerAuthenticationOptions.h" -#include "IceUtil/Config.h" #include "Network.h" #include diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index 8d4d3d13294..22eb90d6dcb 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -8,7 +8,7 @@ #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/Properties.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "ProtocolInstance.h" #include "UdpEndpointI.h" @@ -535,7 +535,7 @@ IceInternal::UdpTransceiver::toDetailedString() const if (!intfs.empty()) { os << "\nlocal interfaces = "; - os << IceUtilInternal::joinString(intfs, ", "); + os << IceInternal::joinString(intfs, ", "); } return os.str(); } diff --git a/cpp/src/IceUtil/UtilException.cpp b/cpp/src/Ice/UtilException.cpp similarity index 97% rename from cpp/src/IceUtil/UtilException.cpp rename to cpp/src/Ice/UtilException.cpp index 581a31b3c62..928e791b1ab 100644 --- a/cpp/src/IceUtil/UtilException.cpp +++ b/cpp/src/Ice/UtilException.cpp @@ -22,9 +22,9 @@ # define __STDC_LIMIT_MACROS #endif +#include "../IceUtil/Exception.h" #include "Ice/Exception.h" -#include "IceUtil/Exception.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #ifdef _WIN32 # include @@ -64,7 +64,7 @@ #if defined(_WIN32) && !defined(ICE_BUILDING_SLICE_COMPILERS) # define ICE_DBGHELP # define DBGHELP_TRANSLATE_TCHAR -# include "IceUtil/StringConverter.h" +# include "Ice/StringConverter.h" // TODO: check if this is still needed for VS2022 # pragma warning(disable : 4091) // VS 2015 RC issues this warning for code in DbgHelp.h # include @@ -368,7 +368,7 @@ namespace if (SymInitialize(process, 0, TRUE) == 0) { process = 0; - return "No stack trace: SymInitialize failed with " + IceUtilInternal::errorToString(GetLastError()); + return "No stack trace: SymInitialize failed with " + IceInternal::errorToString(GetLastError()); } } lock.unlock(); @@ -395,10 +395,10 @@ namespace if (refreshModuleList && SymRefreshModuleList(process) == 0) { - return "No stack trace: SymRefreshModuleList failed with " + IceUtilInternal::errorToString(GetLastError()); + return "No stack trace: SymRefreshModuleList failed with " + IceInternal::errorToString(GetLastError()); } # ifdef DBGHELP_TRANSLATE_TCHAR - const IceUtil::StringConverterPtr converter = IceUtil::getProcessStringConverter(); + const Ice::StringConverterPtr converter = Ice::getProcessStringConverter(); # endif for (size_t i = 0; i < stackFrames.size(); i++) { @@ -604,7 +604,7 @@ Ice::FileLockException::ice_print(ostream& os) const os << ":\ncould not lock file: `" << _path << "'"; if (_error != 0) { - os << "\nsyscall exception: " << IceUtilInternal::errorToString(_error); + os << "\nsyscall exception: " << IceInternal::errorToString(_error); } } diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index 64af8514c3b..c4d964a10b1 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -3,6 +3,7 @@ // #include "WSTransceiver.h" +#include "../IceUtil/Random.h" #include "Base64.h" #include "Endian.h" #include "HttpParser.h" @@ -13,8 +14,7 @@ #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" #include "Ice/SHA1.h" -#include "IceUtil/Random.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "ProtocolInstance.h" #include @@ -937,13 +937,13 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer) if (_parser->getHeader("Sec-WebSocket-Protocol", val, true)) { vector protocols; - if (!IceUtilInternal::splitString(val, ",", protocols)) + if (!IceInternal::splitString(val, ",", protocols)) { throw WebSocketException("invalid value `" + val + "' for WebSocket protocol"); } for (vector::iterator p = protocols.begin(); p != protocols.end(); ++p) { - if (IceUtilInternal::trim(*p) != _iceProtocol) + if (IceInternal::trim(*p) != _iceProtocol) { throw WebSocketException("unknown value `" + *p + "' for WebSocket protocol"); } diff --git a/cpp/src/Ice/ios/StreamAcceptor.cpp b/cpp/src/Ice/ios/StreamAcceptor.cpp index 5ed1014eee3..70205073f18 100644 --- a/cpp/src/Ice/ios/StreamAcceptor.cpp +++ b/cpp/src/Ice/ios/StreamAcceptor.cpp @@ -11,7 +11,7 @@ # include "../UniqueRef.h" # include "Ice/Exception.h" # include "Ice/Properties.h" -# include "IceUtil/StringUtil.h" +# include "Ice/StringUtil.h" # include "StreamAcceptor.h" # include "StreamEndpointI.h" # include "StreamTransceiver.h" @@ -105,7 +105,7 @@ IceObjC::StreamAcceptor::toDetailedString() const if (!intfs.empty()) { os << "\nlocal interfaces = "; - os << IceUtilInternal::joinString(intfs, ", "); + os << IceInternal::joinString(intfs, ", "); } return os.str(); } diff --git a/cpp/src/Ice/ios/StreamEndpointI.cpp b/cpp/src/Ice/ios/StreamEndpointI.cpp index 98afdd48fa7..f7c01f60cc8 100644 --- a/cpp/src/Ice/ios/StreamEndpointI.cpp +++ b/cpp/src/Ice/ios/StreamEndpointI.cpp @@ -15,7 +15,7 @@ # include "Ice/LocalException.h" # include "Ice/OutputStream.h" # include "Ice/Properties.h" -# include "IceUtil/StringUtil.h" +# include "Ice/StringUtil.h" # include "StreamAcceptor.h" # include "StreamConnector.h" # include "StreamEndpointI.h" diff --git a/cpp/src/Ice/msbuild/ice/ice.vcxproj b/cpp/src/Ice/msbuild/ice/ice.vcxproj index 780cb3d3f3d..129bd479edd 100644 --- a/cpp/src/Ice/msbuild/ice/ice.vcxproj +++ b/cpp/src/Ice/msbuild/ice/ice.vcxproj @@ -501,15 +501,15 @@ ..\..\..\..\..\slice\Ice\Version.ice - + - - - - + + + + diff --git a/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters b/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters index 9ed9221b347..e3e0c525553 100644 --- a/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters +++ b/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters @@ -216,7 +216,7 @@ Source Files - + Source Files @@ -231,16 +231,16 @@ Source Files - + Source Files - + Source Files - + Source Files - + Source Files diff --git a/cpp/src/IceBT/AcceptorI.cpp b/cpp/src/IceBT/AcceptorI.cpp index 7ea8526197a..0ad344a0916 100644 --- a/cpp/src/IceBT/AcceptorI.cpp +++ b/cpp/src/IceBT/AcceptorI.cpp @@ -15,7 +15,7 @@ #include "Ice/Exception.h" #include "Ice/LocalException.h" #include "Ice/Properties.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" using namespace std; using namespace Ice; @@ -188,7 +188,7 @@ IceBT::AcceptorI::AcceptorI( _name(name), _channel(channel) { - string s = IceUtilInternal::trim(_addr); + string s = IceInternal::trim(_addr); if (s.empty()) { // @@ -197,7 +197,7 @@ IceBT::AcceptorI::AcceptorI( s = _instance->engine()->getDefaultAdapterAddress(); } - s = IceUtilInternal::toUpper(s); + s = IceInternal::toUpper(s); DeviceAddress da; if (!parseDeviceAddress(s, da)) diff --git a/cpp/src/IceBT/EndpointI.cpp b/cpp/src/IceBT/EndpointI.cpp index 4e88a7edfbb..67206206ad6 100644 --- a/cpp/src/IceBT/EndpointI.cpp +++ b/cpp/src/IceBT/EndpointI.cpp @@ -11,9 +11,9 @@ #include "Ice/LocalException.h" #include "Ice/Object.h" #include "Ice/Properties.h" +#include "Ice/StringUtil.h" #include "Ice/UUID.h" #include "IceBT/ConnectionInfo.h" -#include "IceUtil/StringUtil.h" #include "Instance.h" #include "Util.h" @@ -517,7 +517,7 @@ IceBT::EndpointI::hash() const noexcept bool IceBT::EndpointI::checkOption(const string& option, const string& argument, const string& endpoint) { - string arg = IceUtilInternal::trim(argument); + string arg = IceInternal::trim(argument); if (option == "-a") { if (arg.empty()) diff --git a/cpp/src/IceBT/Engine.cpp b/cpp/src/IceBT/Engine.cpp index 5478717fbfb..a84da23219c 100644 --- a/cpp/src/IceBT/Engine.cpp +++ b/cpp/src/IceBT/Engine.cpp @@ -5,8 +5,8 @@ #include "Engine.h" #include "DBus.h" #include "Ice/LocalException.h" -#include "IceUtil/StringUtil.h" -#include "IceUtil/UUID.h" +#include "Ice/StringUtil.h" +#include "Ice/UUID.h" #include "Util.h" #include @@ -218,7 +218,7 @@ namespace IceBT assert(str); addr = str->v; } - return IceUtilInternal::toUpper(addr); + return IceInternal::toUpper(addr); } string getAdapter() const @@ -253,7 +253,7 @@ namespace IceBT assert(str); addr = str->v; } - return IceUtilInternal::toUpper(addr); + return IceInternal::toUpper(addr); } VariantMap properties; @@ -462,7 +462,7 @@ namespace IceBT // for (RemoteDeviceMap::const_iterator p = _remoteDevices.begin(); p != _remoteDevices.end(); ++p) { - if (p->second.getAddress() == IceUtilInternal::toUpper(addr)) + if (p->second.getAddress() == IceInternal::toUpper(addr)) { return true; } @@ -543,7 +543,7 @@ namespace IceBT for (AdapterMap::iterator p = _adapters.begin(); p != _adapters.end(); ++p) { - if (p->second.getAddress() == IceUtilInternal::toUpper(addr)) + if (p->second.getAddress() == IceInternal::toUpper(addr)) { path = p->first; p->second.callbacks.push_back(move(cb)); @@ -585,7 +585,7 @@ namespace IceBT for (AdapterMap::iterator p = _adapters.begin(); p != _adapters.end(); ++p) { - if (p->second.getAddress() == IceUtilInternal::toUpper(addr)) + if (p->second.getAddress() == IceInternal::toUpper(addr)) { path = p->first; p->second.callbacks.clear(); @@ -830,7 +830,7 @@ namespace IceBT // // Generate a unique object path. Path elements can only contain "[A-Z][a-z][0-9]_". // - string path = "/com/zeroc/P" + IceUtil::generateUUID(); + string path = "/com/zeroc/P" + Ice::generateUUID(); for (string::iterator p = path.begin(); p != path.end(); ++p) { if (*p == '-') @@ -1109,7 +1109,7 @@ namespace IceBT for (RemoteDeviceMap::iterator p = _remoteDevices.begin(); p != _remoteDevices.end(); ++p) { - if (p->second.getAddress() == IceUtilInternal::toUpper(addr)) + if (p->second.getAddress() == IceInternal::toUpper(addr)) { devicePath = p->first; break; diff --git a/cpp/src/IceBT/TransceiverI.cpp b/cpp/src/IceBT/TransceiverI.cpp index 250dfe5e75b..9503f7c60d0 100644 --- a/cpp/src/IceBT/TransceiverI.cpp +++ b/cpp/src/IceBT/TransceiverI.cpp @@ -11,7 +11,7 @@ #include "Ice/Connection.h" #include "Ice/LocalException.h" -#include "IceUtil/DisableWarnings.h" +#include "../IceUtil/DisableWarnings.h" using namespace std; using namespace Ice; diff --git a/cpp/src/IceBT/Util.cpp b/cpp/src/IceBT/Util.cpp index f2e3df93ec7..e752139f4db 100644 --- a/cpp/src/IceBT/Util.cpp +++ b/cpp/src/IceBT/Util.cpp @@ -6,7 +6,7 @@ #include "../Ice/Network.h" #include "Ice/LocalException.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" using namespace std; using namespace Ice; @@ -68,7 +68,7 @@ IceBT::formatDeviceAddress(const DeviceAddress& addr) addr.b[2], addr.b[1], addr.b[0]); - return IceUtilInternal::toUpper(string(buf)); + return IceInternal::toUpper(string(buf)); } string diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp index f729fe7a375..1bc6d7952ee 100644 --- a/cpp/src/IceBox/Admin.cpp +++ b/cpp/src/IceBox/Admin.cpp @@ -2,13 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Ice/Ice.h" #include "IceBox/IceBox.h" -#include "IceUtil/Options.h" using namespace std; using namespace IceInternal; +using namespace IceUtilInternal; int run(const Ice::StringSeq&); diff --git a/cpp/src/IceBox/IceBox.rc b/cpp/src/IceBox/IceBox.rc index 8f9232d5ae8..ecc17934621 100644 --- a/cpp/src/IceBox/IceBox.rc +++ b/cpp/src/IceBox/IceBox.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icebox") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icebox") ".dll\0" diff --git a/cpp/src/IceBox/IceBoxAdmin.rc b/cpp/src/IceBox/IceBoxAdmin.rc index 2a3c6481c6f..9da7f9885fa 100644 --- a/cpp/src/IceBox/IceBoxAdmin.rc +++ b/cpp/src/IceBox/IceBoxAdmin.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "iceboxadmin\0" #define ICE_ORIGINALFILENAME "iceboxadmin.exe\0" diff --git a/cpp/src/IceBox/IceBoxExe.rc b/cpp/src/IceBox/IceBoxExe.rc index 5c08aa5c139..c9a62950cd3 100644 --- a/cpp/src/IceBox/IceBoxExe.rc +++ b/cpp/src/IceBox/IceBoxExe.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icebox\0" #define ICE_ORIGINALFILENAME "icebox.exe\0" diff --git a/cpp/src/IceBox/IceBoxService.cpp b/cpp/src/IceBox/IceBoxService.cpp index 47654f1ba32..d82ddd78a9f 100644 --- a/cpp/src/IceBox/IceBoxService.cpp +++ b/cpp/src/IceBox/IceBoxService.cpp @@ -3,7 +3,7 @@ // #include "Ice/Ice.h" -#include "IceUtil/Options.h" +#include "../IceUtil/Options.h" #include "ServiceManagerI.h" using namespace std; diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index ce31e290e8b..66cfb991200 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -3,13 +3,13 @@ // #include "ServiceManagerI.h" -#include "../Ice/ConsoleUtil.h" #include "../Ice/DynamicLibrary.h" #include "../Ice/Instance.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Ice/Ice.h" #include "Ice/Initialize.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" using namespace Ice; using namespace IceUtilInternal; @@ -969,7 +969,7 @@ IceBox::ServiceManagerI::configureAdmin(const PropertiesPtr& properties, const s if (!facetNames.empty()) { // TODO: need joinString with escape! - properties->setProperty("Ice.Admin.Facets", IceUtilInternal::joinString(facetNames, " ")); + properties->setProperty("Ice.Admin.Facets", IceInternal::joinString(facetNames, " ")); } return true; } diff --git a/cpp/src/IceBridge/IceBridge.cpp b/cpp/src/IceBridge/IceBridge.cpp index dbb408becd4..f83c118a4c2 100644 --- a/cpp/src/IceBridge/IceBridge.cpp +++ b/cpp/src/IceBridge/IceBridge.cpp @@ -2,12 +2,12 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/Options.h" #include "Ice/Connection.h" #include "Ice/ObjectAdapter.h" #include "Ice/Router.h" #include "Ice/Service.h" #include "Ice/UUID.h" -#include "IceUtil/Options.h" #include diff --git a/cpp/src/IceBridge/IceBridge.rc b/cpp/src/IceBridge/IceBridge.rc index 3e3290d9484..dee1a87332e 100644 --- a/cpp/src/IceBridge/IceBridge.rc +++ b/cpp/src/IceBridge/IceBridge.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icebridge\0" #define ICE_ORIGINALFILENAME "icebridge.exe\0" diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index 67aa50a33b7..3a9ac09bc1a 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -5,11 +5,11 @@ #ifndef ICE_DB_H #define ICE_DB_H +#include "../IceUtil/Exception.h" +#include "../IceUtil/FileUtil.h" #include "Ice/Initialize.h" #include "Ice/InputStream.h" #include "Ice/OutputStream.h" -#include "IceUtil/Exception.h" -#include "IceUtil/FileUtil.h" #include diff --git a/cpp/src/IceDB/IceDB.rc b/cpp/src/IceDB/IceDB.rc index 2e2038efd2e..215400b7dc2 100644 --- a/cpp/src/IceDB/IceDB.rc +++ b/cpp/src/IceDB/IceDB.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icedb") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icedb") ".dll\0" diff --git a/cpp/src/IceDiscovery/IceDiscovery.rc b/cpp/src/IceDiscovery/IceDiscovery.rc index f330cb7228d..bb667455115 100644 --- a/cpp/src/IceDiscovery/IceDiscovery.rc +++ b/cpp/src/IceDiscovery/IceDiscovery.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icediscovery") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icediscovery") ".dll\0" diff --git a/cpp/src/IceDiscovery/LocatorI.cpp b/cpp/src/IceDiscovery/LocatorI.cpp index 87611a3e3f0..1999e990b67 100644 --- a/cpp/src/IceDiscovery/LocatorI.cpp +++ b/cpp/src/IceDiscovery/LocatorI.cpp @@ -9,7 +9,7 @@ #include "Ice/LocalException.h" #include "Ice/ObjectAdapter.h" -#include "IceUtil/Random.h" +#include "../IceUtil/Random.h" #include diff --git a/cpp/src/IceDiscovery/LookupI.h b/cpp/src/IceDiscovery/LookupI.h index 2a9d156c408..89f1e1ce1b2 100644 --- a/cpp/src/IceDiscovery/LookupI.h +++ b/cpp/src/IceDiscovery/LookupI.h @@ -10,7 +10,7 @@ #include "Ice/Comparable.h" #include "Ice/Properties.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include #include @@ -19,7 +19,7 @@ namespace IceDiscovery { class LookupI; - class Request : public IceUtil::TimerTask + class Request : public Ice::TimerTask { public: Request(const LookupIPtr&, int); @@ -137,7 +137,7 @@ namespace IceDiscovery void objectRequestTimedOut(const ObjectRequestPtr&); void objectRequestException(const ObjectRequestPtr&, std::exception_ptr); - const IceUtil::TimerPtr& timer() { return _timer; } + const Ice::TimerPtr& timer() { return _timer; } int latencyMultiplier() { return _latencyMultiplier; } @@ -150,7 +150,7 @@ namespace IceDiscovery const int _latencyMultiplier; const std::string _domainId; - IceUtil::TimerPtr _timer; + Ice::TimerPtr _timer; bool _warnOnce; std::map _objectRequests; diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index ea802e851de..e1a550b1130 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -4,9 +4,9 @@ #include "Activator.h" #include "../Ice/ArgVector.h" +#include "../IceUtil/FileUtil.h" #include "Ice/Ice.h" #include "IceGrid/Admin.h" -#include "IceUtil/FileUtil.h" #include "Internal.h" #include "ServerI.h" #include "TraceLevels.h" @@ -72,7 +72,7 @@ namespace IceGrid os << cannot << " `" << name << "'"; if (err) { - os << ": " << IceUtilInternal::errorToString(err); + os << ": " << IceInternal::errorToString(err); } const string msg = os.str(); ssize_t sz = write(fd, msg.c_str(), msg.size()); @@ -582,7 +582,7 @@ Activator::activate( if (!b) { - string message = IceUtilInternal::lastErrorToString(); + string message = IceInternal::lastErrorToString(); Ice::Warning out(_traceLevels->logger); out << "server activation failed for `" << name << "':\n" << message; @@ -612,7 +612,7 @@ Activator::activate( { TerminateProcess(pp->hnd, 0); - string message = IceUtilInternal::lastErrorToString(); + string message = IceInternal::lastErrorToString(); Ice::Warning out(_traceLevels->logger); out << "server activation failed for `" << name << "':\ncouldn't register wait callback\n" << message; @@ -662,7 +662,7 @@ Activator::activate( throw SyscallException(__FILE__, __LINE__); } vector grps; - if (IceUtilInternal::splitString(grouplist, ",", grps)) + if (IceInternal::splitString(grouplist, ",", grps)) { for (vector::const_iterator p = grps.begin(); p != grps.end(); ++p) { @@ -738,7 +738,7 @@ Activator::activate( // // - // Unblock signals blocked by IceUtil::CtrlCHandler. + // Unblock signals blocked by Ice::CtrlCHandler. // sigset_t sigs; sigemptyset(&sigs); diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index c5e43aa6acb..ddb37c324d2 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -3,10 +3,10 @@ // #include "AdapterCache.h" +#include "../IceUtil/Random.h" #include "Ice/Communicator.h" #include "Ice/Locator.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/Random.h" #include "NodeCache.h" #include "NodeSessionI.h" #include "ServerCache.h" diff --git a/cpp/src/IceGrid/Allocatable.h b/cpp/src/IceGrid/Allocatable.h index 4bb95a80ace..dadcae770db 100644 --- a/cpp/src/IceGrid/Allocatable.h +++ b/cpp/src/IceGrid/Allocatable.h @@ -5,7 +5,7 @@ #ifndef ICE_GRID_ALLOCATABLE_H #define ICE_GRID_ALLOCATABLE_H -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "IceGrid/Session.h" @@ -17,7 +17,7 @@ namespace IceGrid class Allocatable; class SessionI; - class AllocationRequest : public IceUtil::TimerTask, public std::enable_shared_from_this + class AllocationRequest : public Ice::TimerTask, public std::enable_shared_from_this { public: virtual ~AllocationRequest() = default; diff --git a/cpp/src/IceGrid/AllocatableObjectCache.cpp b/cpp/src/IceGrid/AllocatableObjectCache.cpp index a96341de31a..ceed26d69a5 100644 --- a/cpp/src/IceGrid/AllocatableObjectCache.cpp +++ b/cpp/src/IceGrid/AllocatableObjectCache.cpp @@ -3,10 +3,10 @@ // #include "AllocatableObjectCache.h" +#include "../IceUtil/Random.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/Random.h" #include "ServerCache.h" #include "SessionI.h" diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 37f69e00f91..1d01e17f25c 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -2,15 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" #include "../IceLocatorDiscovery/Plugin.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "FileParserI.h" #include "Glacier2/Router.h" #include "Ice/Ice.h" +#include "Ice/StringUtil.h" #include "Ice/UUID.h" #include "IceGrid/Registry.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" #include "Parser.h" #include @@ -28,6 +28,7 @@ #endif using namespace std; +using namespace IceUtilInternal; using namespace IceInternal; class Client; @@ -78,7 +79,7 @@ main(int argc, char* argv[]) try { - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; auto defaultProps = Ice::createProperties(); defaultProps->setProperty("IceGridAdmin.Server.Endpoints", "tcp -h localhost"); Ice::InitializationData id; @@ -174,7 +175,7 @@ getPassword(const string& prompt) } #endif consoleOut << endl; - return IceUtilInternal::trim(password); + return IceInternal::trim(password); } extern "C" ICE_LOCATOR_DISCOVERY_API Ice::Plugin* @@ -358,7 +359,7 @@ run(const Ice::StringSeq& args) { return 1; } - line = IceUtilInternal::trim(line); + line = IceInternal::trim(line); istringstream is(line); is >> num; @@ -414,7 +415,7 @@ run(const Ice::StringSeq& args) { return 1; } - id = IceUtilInternal::trim(id); + id = IceInternal::trim(id); } if (password.empty()) @@ -566,7 +567,7 @@ run(const Ice::StringSeq& args) { return 1; } - id = IceUtilInternal::trim(id); + id = IceInternal::trim(id); } if (password.empty()) diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 1239e1c6b49..abbbd4ef543 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -4,12 +4,12 @@ #include "Database.h" #include "../Ice/Protocol.h" +#include "../IceUtil/Random.h" #include "DescriptorHelper.h" #include "Ice/Ice.h" +#include "Ice/StringUtil.h" #include "IceGrid/IceGrid.h" #include "IceGrid/Session.h" -#include "IceUtil/Random.h" -#include "IceUtil/StringUtil.h" #include "NodeSessionI.h" #include "ReplicaSessionI.h" #include "Topics.h" @@ -1467,12 +1467,12 @@ Database::getAllAdapters(const string& expression) AdapterMapROCursor cursor(_adapters, txn); while (cursor.get(name, info, MDB_NEXT)) { - if (expression.empty() || IceUtilInternal::match(name, expression, true)) + if (expression.empty() || IceInternal::match(name, expression, true)) { result.push_back(name); } string replicaGroupId = info.replicaGroupId; - if (!replicaGroupId.empty() && (expression.empty() || IceUtilInternal::match(replicaGroupId, expression, true))) + if (!replicaGroupId.empty() && (expression.empty() || IceInternal::match(replicaGroupId, expression, true))) { groups.insert(replicaGroupId); } @@ -1883,7 +1883,7 @@ Database::getAllObjectInfos(const string& expression) ObjectsMapROCursor cursor(_objects, txn); while (cursor.get(id, info, MDB_NEXT)) { - if (expression.empty() || IceUtilInternal::match(_communicator->identityToString(id), expression, true)) + if (expression.empty() || IceInternal::match(_communicator->identityToString(id), expression, true)) { infos.push_back(info); } diff --git a/cpp/src/IceGrid/Database.h b/cpp/src/IceGrid/Database.h index e5a7906deff..d3555c198ae 100644 --- a/cpp/src/IceGrid/Database.h +++ b/cpp/src/IceGrid/Database.h @@ -5,11 +5,11 @@ #ifndef ICE_GRID_DATABASE_H #define ICE_GRID_DATABASE_H +#include "../IceUtil/FileUtil.h" #include "AdapterCache.h" #include "AllocatableObjectCache.h" #include "Ice/CommunicatorF.h" #include "IceGrid/Admin.h" -#include "IceUtil/FileUtil.h" #include "Internal.h" #include "NodeCache.h" #include "ObjectCache.h" diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index 9f53e0801ca..0db196468ee 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace IceInternal; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; using namespace IceGrid; @@ -568,11 +568,11 @@ Resolver::operator()(const ObjectDescriptorSeq& objects, const string& proxyOpti obj.id = operator()(q->id, type + " object identity"); if (!q->proxyOptions.empty()) { - obj.proxyOptions = IceUtilInternal::trim(operator()(q->proxyOptions, type + " object proxy options")); + obj.proxyOptions = IceInternal::trim(operator()(q->proxyOptions, type + " object proxy options")); } else if (!proxyOptions.empty()) { - obj.proxyOptions = IceUtilInternal::trim(operator()(proxyOptions, type + " object proxy options")); + obj.proxyOptions = IceInternal::trim(operator()(proxyOptions, type + " object proxy options")); } validateProxyOptions(*this, obj.proxyOptions); result.push_back(obj); diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h index 45578c35178..b695b2c5b02 100644 --- a/cpp/src/IceGrid/DescriptorHelper.h +++ b/cpp/src/IceGrid/DescriptorHelper.h @@ -5,9 +5,9 @@ #ifndef ICE_GRID_DESCRIPTOR_HELPER_H #define ICE_GRID_DESCRIPTOR_HELPER_H +#include "../IceUtil/OutputUtil.h" #include "../IceXML/Parser.h" #include "IceGrid/Admin.h" -#include "IceUtil/OutputUtil.h" #include "Internal.h" #include diff --git a/cpp/src/IceGrid/FileCache.cpp b/cpp/src/IceGrid/FileCache.cpp index 48f1299d6b9..4b10cb8901a 100644 --- a/cpp/src/IceGrid/FileCache.cpp +++ b/cpp/src/IceGrid/FileCache.cpp @@ -5,7 +5,7 @@ #include "Ice/Communicator.h" #include "Ice/Properties.h" -#include "IceUtil/FileUtil.h" +#include "../IceUtil/FileUtil.h" #include "FileCache.h" #include "IceGrid/Exception.h" diff --git a/cpp/src/IceGrid/FileUserAccountMapperI.cpp b/cpp/src/IceGrid/FileUserAccountMapperI.cpp index 9f8ecf7a0f3..602d9402f29 100644 --- a/cpp/src/IceGrid/FileUserAccountMapperI.cpp +++ b/cpp/src/IceGrid/FileUserAccountMapperI.cpp @@ -3,8 +3,8 @@ // #include "FileUserAccountMapperI.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" #include using namespace std; @@ -15,7 +15,7 @@ FileUserAccountMapperI::FileUserAccountMapperI(const string& filename) ifstream file(IceUtilInternal::streamFilename(filename).c_str()); // filename is a UTF-8 string if (!file) { - throw runtime_error("cannot open `" + filename + "' for reading: " + IceUtilInternal::errorToString(errno)); + throw runtime_error("cannot open `" + filename + "' for reading: " + IceInternal::errorToString(errno)); } const string delim = " \t\r\n"; diff --git a/cpp/src/IceGrid/IceGridAdmin.rc b/cpp/src/IceGrid/IceGridAdmin.rc index 236aa91e3d6..299c8f30ca1 100644 --- a/cpp/src/IceGrid/IceGridAdmin.rc +++ b/cpp/src/IceGrid/IceGridAdmin.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icegridadmin\0" #define ICE_ORIGINALFILENAME "icegridadmin.exe\0" diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 836bacfb4d7..29a6f922bc3 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -2,14 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" #include "Activator.h" #include "DescriptorParser.h" #include "FileUserAccountMapperI.h" #include "Ice/Ice.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" -#include "IceUtil/Timer.h" +#include "Ice/StringUtil.h" +#include "Ice/Timer.h" #include "NodeAdminRouter.h" #include "NodeI.h" #include "NodeSessionManager.h" @@ -28,6 +28,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; using namespace IceGrid; namespace @@ -61,7 +62,7 @@ namespace void usage(const std::string&); shared_ptr _activator; - IceUtil::TimerPtr _timer; + Ice::TimerPtr _timer; shared_ptr _registry; shared_ptr _node; unique_ptr _sessions; @@ -417,7 +418,7 @@ NodeService::startImpl(int argc, char* argv[], int& status) // // Create a new timer to handle server activation/deactivation timeouts. // - _timer = make_shared(); + _timer = make_shared(); // // The IceGrid instance name. @@ -552,14 +553,14 @@ NodeService::startImpl(int argc, char* argv[], int& status) { consoleOut << "user id: " << flush; getline(cin, username); - username = IceUtilInternal::trim(username); + username = IceInternal::trim(username); } if (password.empty()) { consoleOut << "password: " << flush; getline(cin, password); - password = IceUtilInternal::trim(password); + password = IceInternal::trim(password); } session = registry->createAdminSession(username, password); diff --git a/cpp/src/IceGrid/IceGridNode.rc b/cpp/src/IceGrid/IceGridNode.rc index 0cb7eaa333a..8fcaeb5176a 100644 --- a/cpp/src/IceGrid/IceGridNode.rc +++ b/cpp/src/IceGrid/IceGridNode.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icegridnode\0" #define ICE_ORIGINALFILENAME "icegridnode.exe\0" diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp index 3d719c6f09b..600c8b31997 100644 --- a/cpp/src/IceGrid/IceGridRegistry.cpp +++ b/cpp/src/IceGrid/IceGridRegistry.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Ice/Ice.h" -#include "IceUtil/Options.h" #include "RegistryI.h" #include "TraceLevels.h" #include "Util.h" diff --git a/cpp/src/IceGrid/IceGridRegistry.rc b/cpp/src/IceGrid/IceGridRegistry.rc index 570173b9ce5..e863395b172 100644 --- a/cpp/src/IceGrid/IceGridRegistry.rc +++ b/cpp/src/IceGrid/IceGridRegistry.rc @@ -1,6 +1,6 @@ #include "winver.h" -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icegridregistry\0" #define ICE_ORIGINALFILENAME "icegridregistry.exe\0" diff --git a/cpp/src/IceGrid/InternalRegistryI.cpp b/cpp/src/IceGrid/InternalRegistryI.cpp index 8cd3a5a4cc6..e2d616e1341 100644 --- a/cpp/src/IceGrid/InternalRegistryI.cpp +++ b/cpp/src/IceGrid/InternalRegistryI.cpp @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/DisableWarnings.h" +#include "../IceUtil/DisableWarnings.h" #include "../Ice/SSL/RFC2253.h" #include "../Ice/SSL/SSLUtil.h" diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index a3b88741bbc..24003bfa8b0 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -3,10 +3,10 @@ // #include "NodeI.h" +#include "../IceUtil/FileUtil.h" #include "Activator.h" #include "Ice/Ice.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "NodeSessionManager.h" #include "ServerAdapterI.h" #include "ServerI.h" @@ -48,7 +48,7 @@ NodeI::NodeI( const Ice::ObjectAdapterPtr& adapter, NodeSessionManager& sessions, const shared_ptr& activator, - const IceUtil::TimerPtr& timer, + const Ice::TimerPtr& timer, const shared_ptr& traceLevels, NodePrx proxy, const string& name, @@ -277,7 +277,7 @@ NodeI::getActivator() const return _activator; } -IceUtil::TimerPtr +Ice::TimerPtr NodeI::getTimer() const { return _timer; diff --git a/cpp/src/IceGrid/NodeI.h b/cpp/src/IceGrid/NodeI.h index cccec8389ef..9ac92da4f74 100644 --- a/cpp/src/IceGrid/NodeI.h +++ b/cpp/src/IceGrid/NodeI.h @@ -6,8 +6,8 @@ #define ICE_GRID_NODE_I_H #include "FileCache.h" +#include "Ice/Timer.h" #include "IceGrid/UserAccountMapper.h" -#include "IceUtil/Timer.h" #include "Internal.h" #include "PlatformInfo.h" @@ -44,7 +44,7 @@ namespace IceGrid const Ice::ObjectAdapterPtr&, NodeSessionManager&, const std::shared_ptr&, - const IceUtil::TimerPtr&, + const Ice::TimerPtr&, const std::shared_ptr&, NodePrx, const std::string&, @@ -100,7 +100,7 @@ namespace IceGrid void shutdown(); - IceUtil::TimerPtr getTimer() const; + Ice::TimerPtr getTimer() const; Ice::CommunicatorPtr getCommunicator() const; Ice::ObjectAdapterPtr getAdapter() const; std::shared_ptr getActivator() const; @@ -164,7 +164,7 @@ namespace IceGrid const Ice::ObjectAdapterPtr _adapter; NodeSessionManager& _sessions; const std::shared_ptr _activator; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const std::shared_ptr _traceLevels; const std::string _name; const NodePrx _proxy; diff --git a/cpp/src/IceGrid/ObjectCache.cpp b/cpp/src/IceGrid/ObjectCache.cpp index b6ded826236..cfb16a29949 100644 --- a/cpp/src/IceGrid/ObjectCache.cpp +++ b/cpp/src/IceGrid/ObjectCache.cpp @@ -3,10 +3,10 @@ // #include "ObjectCache.h" +#include "../IceUtil/Random.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/Random.h" #include "NodeSessionI.h" #include "ServerCache.h" #include "SessionI.h" @@ -133,7 +133,7 @@ ObjectCache::getAll(const string& expression) ObjectInfoSeq infos; for (auto p = _entries.cbegin(); p != _entries.cend(); ++p) { - if (expression.empty() || IceUtilInternal::match(_communicator->identityToString(p->first), expression, true)) + if (expression.empty() || IceInternal::match(_communicator->identityToString(p->first), expression, true)) { infos.push_back(p->second->getObjectInfo()); } diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index d75f83419e4..047a6710322 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -4,12 +4,13 @@ #include "../IceXML/Parser.h" #include "../Ice/TimeUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/DisableWarnings.h" +#include "../IceUtil/Options.h" #include "DescriptorHelper.h" #include "DescriptorParser.h" #include "Ice/Ice.h" #include "IceBox/IceBox.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/Options.h" #include "Parser.h" #include "Util.h" @@ -29,9 +30,9 @@ extern int yydebug; int yyparse(); using namespace std; -using namespace IceUtil; -using namespace IceUtilInternal; using namespace Ice; +using namespace IceUtilInternal; +using namespace IceInternal; using namespace IceGrid; namespace diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index c33a0a6e72e..53e8830d158 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" @@ -36,7 +36,7 @@ namespace string pdhErrorToString(PDH_STATUS err) { - return IceUtilInternal::errorToString(err, GetModuleHandle(TEXT("PDH.DLL"))); + return IceInternal::errorToString(err, GetModuleHandle(TEXT("PDH.DLL"))); } static string getLocalizedPerfName(int idx, const Ice::LoggerPtr& logger) @@ -93,7 +93,7 @@ namespace { Ice::Warning out(logger); out << "Unable to figure out the number of process sockets:\n"; - out << IceUtilInternal::lastErrorToString(); + out << IceInternal::lastErrorToString(); return 0; } } @@ -332,7 +332,7 @@ PlatformInfo::PlatformInfo( string cwd; if (IceUtilInternal::getcwd(cwd) != 0) { - throw runtime_error("cannot get the current directory:\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot get the current directory:\n" + IceInternal::lastErrorToString()); } _cwd = string(cwd); diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp index 0f43c0093f3..d5617c6d4fc 100644 --- a/cpp/src/IceGrid/RegistryI.cpp +++ b/cpp/src/IceGrid/RegistryI.cpp @@ -7,6 +7,7 @@ #include "../Ice/ProtocolPluginFacade.h" // Just to get the hostname #include "../Ice/SSL/SSLUtil.h" #include "../IceStorm/Service.h" +#include "../IceUtil/FileUtil.h" #include "AdminCallbackRouter.h" #include "AdminI.h" #include "AdminSessionI.h" @@ -18,7 +19,6 @@ #include "Ice/Ice.h" #include "Ice/UUID.h" #include "IceLocatorDiscovery.h" -#include "IceUtil/FileUtil.h" #include "InternalRegistryI.h" #include "LocatorI.h" #include "LocatorRegistryI.h" @@ -730,7 +730,7 @@ RegistryI::setupClientSessionFactory(const IceGrid::LocatorPrx& locator) } assert(_reaper); - _timer = make_shared(); // Used for session allocation timeout. + _timer = make_shared(); // Used for session allocation timeout. _clientSessionFactory = make_shared(servantManager, _database, _timer, _reaper); if (servantManager && _master) // Slaves don't support client session manager objects. diff --git a/cpp/src/IceGrid/RegistryI.h b/cpp/src/IceGrid/RegistryI.h index 2882b11a684..4115970479d 100644 --- a/cpp/src/IceGrid/RegistryI.h +++ b/cpp/src/IceGrid/RegistryI.h @@ -7,9 +7,9 @@ #include "../IceStorm/Service.h" #include "Glacier2/PermissionsVerifier.h" +#include "Ice/Timer.h" #include "IceGrid/PluginFacade.h" #include "IceGrid/Registry.h" -#include "IceUtil/Timer.h" #include "Internal.h" #include "PlatformInfo.h" #include "ReplicaSessionManager.h" @@ -104,7 +104,7 @@ namespace IceGrid bool _master; std::string _replicaName; std::shared_ptr _reaper; - IceUtil::TimerPtr _timer; + Ice::TimerPtr _timer; std::shared_ptr _servantManager; std::chrono::seconds _sessionTimeout; std::unique_ptr _session; diff --git a/cpp/src/IceGrid/Scanner.cpp b/cpp/src/IceGrid/Scanner.cpp index 89b050f4f16..2eb290ff884 100644 --- a/cpp/src/IceGrid/Scanner.cpp +++ b/cpp/src/IceGrid/Scanner.cpp @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include #line 9 "src/IceGrid/Scanner.cpp" diff --git a/cpp/src/IceGrid/Scanner.l b/cpp/src/IceGrid/Scanner.l index 2e9899d3ea3..64357672190 100644 --- a/cpp/src/IceGrid/Scanner.l +++ b/cpp/src/IceGrid/Scanner.l @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include } diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp index 5660587fde9..a9b669ff18d 100644 --- a/cpp/src/IceGrid/ServerCache.cpp +++ b/cpp/src/IceGrid/ServerCache.cpp @@ -3,13 +3,13 @@ // #include "ServerCache.h" +#include "../IceUtil/DisableWarnings.h" #include "AdapterCache.h" #include "AllocatableObjectCache.h" #include "DescriptorHelper.h" #include "Ice/Communicator.h" #include "Ice/LocalException.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/DisableWarnings.h" #include "NodeCache.h" #include "ObjectCache.h" #include "SessionI.h" diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index d851a6a1adb..9f8cf8362fe 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -4,11 +4,11 @@ #include "ServerI.h" #include "../Ice/TimeUtil.h" +#include "../IceUtil/DisableWarnings.h" +#include "../IceUtil/FileUtil.h" #include "Activator.h" #include "DescriptorHelper.h" #include "Ice/Ice.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/FileUtil.h" #include "NodeI.h" #include "ServerAdapterI.h" #include "TraceLevels.h" @@ -40,7 +40,7 @@ namespace IceGrid DIR* d; if ((d = opendir(path.c_str())) == 0) { - throw runtime_error("cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot read directory `" + path + "':\n" + IceInternal::lastErrorToString()); } struct dirent* entry; @@ -57,7 +57,7 @@ namespace IceGrid if (closedir(d)) { - throw runtime_error("cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot read directory `" + path + "':\n" + IceInternal::lastErrorToString()); } for (size_t i = 0; i < namelist.size(); ++i) @@ -70,7 +70,7 @@ namespace IceGrid if (chown(path.c_str(), uid, gid) != 0) { throw runtime_error( - "can't change permissions on `" + name + "':\n" + IceUtilInternal::lastErrorToString()); + "can't change permissions on `" + name + "':\n" + IceInternal::lastErrorToString()); } } else if (name != "..") @@ -80,7 +80,7 @@ namespace IceGrid IceUtilInternal::structstat buf; if (IceUtilInternal::stat(name, &buf) == -1) { - throw runtime_error("cannot stat `" + name + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot stat `" + name + "':\n" + IceInternal::lastErrorToString()); } if (S_ISDIR(buf.st_mode)) @@ -92,7 +92,7 @@ namespace IceGrid if (chown(name.c_str(), uid, gid) != 0) { throw runtime_error( - "can't change permissions on `" + name + "':\n" + IceUtilInternal::lastErrorToString()); + "can't change permissions on `" + name + "':\n" + IceInternal::lastErrorToString()); } } } @@ -167,7 +167,7 @@ namespace IceGrid return props; } - class CommandTimeoutTimerTask final : public IceUtil::TimerTask + class CommandTimeoutTimerTask final : public Ice::TimerTask { public: CommandTimeoutTimerTask(const shared_ptr& command) : _command(command) {} @@ -178,7 +178,7 @@ namespace IceGrid const shared_ptr _command; }; - class DelayedStart : public IceUtil::TimerTask + class DelayedStart : public Ice::TimerTask { public: DelayedStart(const shared_ptr& server, const shared_ptr& traceLevels) @@ -381,7 +381,7 @@ ServerCommand::ServerCommand(const shared_ptr& server) : _server(server TimedServerCommand::TimedServerCommand( const shared_ptr& server, - const IceUtil::TimerPtr& timer, + const Ice::TimerPtr& timer, chrono::seconds timeout) : ServerCommand(server), _timer(timer), @@ -634,7 +634,7 @@ StartCommand::finished() StopCommand::StopCommand( const shared_ptr& server, - const IceUtil::TimerPtr& timer, + const Ice::TimerPtr& timer, chrono::seconds timeout, bool deactivate) : TimedServerCommand(server, timer, timeout), diff --git a/cpp/src/IceGrid/ServerI.h b/cpp/src/IceGrid/ServerI.h index fe0bc1994af..61a7669be05 100644 --- a/cpp/src/IceGrid/ServerI.h +++ b/cpp/src/IceGrid/ServerI.h @@ -6,7 +6,7 @@ #define ICE_GRID_SERVER_I_H #include "Activator.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "Internal.h" #include @@ -162,7 +162,7 @@ namespace IceGrid std::set _activatedAdapters; std::optional _failureTime; ServerActivation _previousActivation; - std::shared_ptr _timerTask; + std::shared_ptr _timerTask; bool _waitForReplication; std::string _stdErrFile; std::string _stdOutFile; @@ -197,15 +197,15 @@ namespace IceGrid class TimedServerCommand : public ServerCommand, public std::enable_shared_from_this { public: - TimedServerCommand(const std::shared_ptr&, const IceUtil::TimerPtr&, std::chrono::seconds); + TimedServerCommand(const std::shared_ptr&, const Ice::TimerPtr&, std::chrono::seconds); virtual void timeout() = 0; void startTimer(); void stopTimer(); private: - IceUtil::TimerPtr _timer; - std::shared_ptr _timerTask; + Ice::TimerPtr _timer; + std::shared_ptr _timerTask; std::chrono::seconds _timeout; }; @@ -232,7 +232,7 @@ namespace IceGrid class StopCommand : public TimedServerCommand { public: - StopCommand(const std::shared_ptr&, const IceUtil::TimerPtr&, std::chrono::seconds, bool = true); + StopCommand(const std::shared_ptr&, const Ice::TimerPtr&, std::chrono::seconds, bool = true); static bool isStopped(ServerI::InternalServerState); diff --git a/cpp/src/IceGrid/SessionI.cpp b/cpp/src/IceGrid/SessionI.cpp index cc90477c7e4..683fb12a194 100644 --- a/cpp/src/IceGrid/SessionI.cpp +++ b/cpp/src/IceGrid/SessionI.cpp @@ -111,7 +111,7 @@ BaseSessionI::getGlacier2AdapterIdSet() return _servantManager->getGlacier2AdapterIdSet(shared_from_this()); } -SessionI::SessionI(const string& id, const shared_ptr& database, const IceUtil::TimerPtr& timer) +SessionI::SessionI(const string& id, const shared_ptr& database, const Ice::TimerPtr& timer) : BaseSessionI(id, "client", database), _timer(timer), _allocationTimeout(-1) @@ -261,7 +261,7 @@ SessionI::destroyImpl(bool shutdown) ClientSessionFactory::ClientSessionFactory( const shared_ptr& servantManager, const shared_ptr& database, - const IceUtil::TimerPtr& timer, + const Ice::TimerPtr& timer, const shared_ptr& reaper) : _servantManager(servantManager), _database(database), diff --git a/cpp/src/IceGrid/SessionI.h b/cpp/src/IceGrid/SessionI.h index 5dc934a09b7..30ccda16a60 100644 --- a/cpp/src/IceGrid/SessionI.h +++ b/cpp/src/IceGrid/SessionI.h @@ -5,8 +5,8 @@ #ifndef ICEGRID_SESSIONI_H #define ICEGRID_SESSIONI_H +#include "Ice/Timer.h" #include "IceGrid/Session.h" -#include "IceUtil/Timer.h" #include "ReapThread.h" #include "SessionServantManager.h" #include @@ -53,7 +53,7 @@ namespace IceGrid class SessionI final : public BaseSessionI, public Session { public: - SessionI(const std::string&, const std::shared_ptr&, const IceUtil::TimerPtr&); + SessionI(const std::string&, const std::shared_ptr&, const Ice::TimerPtr&); Ice::ObjectPrx _register(const std::shared_ptr&, const Ice::ConnectionPtr&); @@ -74,7 +74,7 @@ namespace IceGrid void destroy(const Ice::Current&) final; int getAllocationTimeout() const; - const IceUtil::TimerPtr& getTimer() const { return _timer; } + const Ice::TimerPtr& getTimer() const { return _timer; } bool addAllocationRequest(const std::shared_ptr&); void removeAllocationRequest(const std::shared_ptr&); @@ -84,7 +84,7 @@ namespace IceGrid private: void destroyImpl(bool) final; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; int _allocationTimeout; std::set> _requests; std::set> _allocations; @@ -96,7 +96,7 @@ namespace IceGrid ClientSessionFactory( const std::shared_ptr&, const std::shared_ptr&, - const IceUtil::TimerPtr&, + const Ice::TimerPtr&, const std::shared_ptr&); Glacier2::SessionPrx @@ -109,7 +109,7 @@ namespace IceGrid private: const std::shared_ptr _servantManager; const std::shared_ptr _database; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const std::shared_ptr _reaper; const bool _filters; }; diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index 40e216e22cf..866184693e8 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -3,10 +3,10 @@ // #include "Util.h" +#include "../IceUtil/FileUtil.h" #include "Ice/Ice.h" +#include "Ice/StringUtil.h" #include "IceGrid/Admin.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" #include "Internal.h" #ifdef _WIN32 @@ -30,7 +30,7 @@ namespace { string path = simplify(pa); #ifdef _WIN32 - return path == "/" || path.size() == 3 && IceUtilInternal::isAlpha(path[0]) && path[1] == ':' && path[2] == '/'; + return path == "/" || path.size() == 3 && IceInternal::isAlpha(path[0]) && path[1] == ':' && path[2] == '/'; #else return path == "/"; #endif @@ -375,7 +375,7 @@ IceGrid::createDirectory(const string& pa) { if (errno != EEXIST) { - throw runtime_error("cannot create directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot create directory `" + path + "':\n" + IceInternal::lastErrorToString()); } } } @@ -392,13 +392,13 @@ IceGrid::readDirectory(const string& pa) // any string converter in stringToWstring or wstringToString conversions. // StringSeq result; - const wstring fs = IceUtil::stringToWstring(simplify(path + "/*")); + const wstring fs = Ice::stringToWstring(simplify(path + "/*")); struct _wfinddata_t data; intptr_t h = _wfindfirst(fs.c_str(), &data); if (h == -1) { - throw runtime_error("cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot read directory `" + path + "':\n" + IceInternal::lastErrorToString()); } while (true) @@ -417,7 +417,7 @@ IceGrid::readDirectory(const string& pa) { break; } - string reason = "cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString(); + string reason = "cannot read directory `" + path + "':\n" + IceInternal::lastErrorToString(); _findclose(h); throw runtime_error(reason); } @@ -435,7 +435,7 @@ IceGrid::readDirectory(const string& pa) if (n < 0) { - throw runtime_error("cannot read directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot read directory `" + path + "':\n" + IceInternal::lastErrorToString()); } StringSeq result; @@ -469,7 +469,7 @@ IceGrid::remove(const string& pa) IceUtilInternal::structstat buf; if (IceUtilInternal::stat(path, &buf) == -1) { - throw runtime_error("cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot stat `" + path + "':\n" + IceInternal::lastErrorToString()); } if (S_ISDIR(buf.st_mode)) @@ -480,14 +480,14 @@ IceGrid::remove(const string& pa) { assert(false); } - throw runtime_error("cannot remove directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot remove directory `" + path + "':\n" + IceInternal::lastErrorToString()); } } else { if (IceUtilInternal::remove(path) == -1) { - throw runtime_error("cannot remove file `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot remove file `" + path + "':\n" + IceInternal::lastErrorToString()); } } } @@ -500,7 +500,7 @@ IceGrid::removeRecursive(const string& pa) IceUtilInternal::structstat buf; if (IceUtilInternal::stat(path, &buf) == -1) { - throw runtime_error("cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot stat `" + path + "':\n" + IceInternal::lastErrorToString()); } if (S_ISDIR(buf.st_mode)) @@ -515,7 +515,7 @@ IceGrid::removeRecursive(const string& pa) { if (IceUtilInternal::rmdir(path) == -1) { - throw runtime_error("cannot remove directory `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot remove directory `" + path + "':\n" + IceInternal::lastErrorToString()); } } } @@ -523,7 +523,7 @@ IceGrid::removeRecursive(const string& pa) { if (IceUtilInternal::remove(path) == -1) { - throw runtime_error("cannot remove file `" + path + "':\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("cannot remove file `" + path + "':\n" + IceInternal::lastErrorToString()); } } } @@ -573,7 +573,7 @@ IceGrid::simplify(const string& path) result.erase(0, 2); } - if (result == "/." || (result.size() == 4 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && + if (result == "/." || (result.size() == 4 && IceInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/' && result[3] == '.')) { return result.substr(0, result.size() - 1); @@ -585,7 +585,7 @@ IceGrid::simplify(const string& path) } if (result == "/" || - (result.size() == 3 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/')) + (result.size() == 3 && IceInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/')) { return result; } diff --git a/cpp/src/IceGrid/Util.h b/cpp/src/IceGrid/Util.h index dd79edfd38b..bfcfeef2892 100644 --- a/cpp/src/IceGrid/Util.h +++ b/cpp/src/IceGrid/Util.h @@ -5,12 +5,12 @@ #ifndef ICE_GRID_UTIL_H #define ICE_GRID_UTIL_H +#include "../IceUtil/Random.h" #include "Ice/BuiltinSequences.h" +#include "Ice/StringUtil.h" #include "IceGrid/Admin.h" #include "IceGrid/Descriptor.h" #include "IceGrid/Exception.h" -#include "IceUtil/Random.h" -#include "IceUtil/StringUtil.h" #include #include @@ -128,7 +128,7 @@ namespace IceGrid std::vector keys; for (typename T::const_iterator p = m.begin(); p != m.end(); ++p) { - if (expression.empty() || IceUtilInternal::match(p->first, expression, true)) + if (expression.empty() || IceInternal::match(p->first, expression, true)) { keys.push_back(p->first); } diff --git a/cpp/src/IceGridLib/IceGrid.rc b/cpp/src/IceGridLib/IceGrid.rc index 57f12403854..4ed310c5ec8 100644 --- a/cpp/src/IceGridLib/IceGrid.rc +++ b/cpp/src/IceGridLib/IceGrid.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icegrid") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icegrid") ".dll\0" diff --git a/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.rc b/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.rc index bc4058e2852..7c4ee9ac850 100644 --- a/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.rc +++ b/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icelocatordiscovery") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icelocatordiscovery") ".dll\0" diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index eadaa057993..6be38d1ebd8 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -57,7 +57,7 @@ namespace using RequestPtr = std::shared_ptr; class LocatorI final : public Ice::BlobjectArrayAsync, - public IceUtil::TimerTask, + public Ice::TimerTask, public std::enable_shared_from_this { public: @@ -85,7 +85,7 @@ namespace chrono::milliseconds _timeout; int _retryCount; chrono::milliseconds _retryDelay; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const int _traceLevel; string _instanceName; diff --git a/cpp/src/IceStorm/Admin.cpp b/cpp/src/IceStorm/Admin.cpp index ead9ca9f889..8833dc14f04 100644 --- a/cpp/src/IceStorm/Admin.cpp +++ b/cpp/src/IceStorm/Admin.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Ice/Ice.h" -#include "IceUtil/Options.h" #include "Parser.h" #ifdef _WIN32 @@ -14,6 +14,7 @@ using namespace std; using namespace IceInternal; +using namespace IceUtilInternal; int run(const shared_ptr&, const Ice::StringSeq&); diff --git a/cpp/src/IceStorm/IceStormAdmin.rc b/cpp/src/IceStorm/IceStormAdmin.rc index 6c2e1359840..6dea83e8b44 100644 --- a/cpp/src/IceStorm/IceStormAdmin.rc +++ b/cpp/src/IceStorm/IceStormAdmin.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icestormadmin\0" #define ICE_ORIGINALFILENAME "icestormadmin.exe\0" diff --git a/cpp/src/IceStorm/IceStormDB.cpp b/cpp/src/IceStorm/IceStormDB.cpp index 265cd4f2e2c..3d53722dc66 100644 --- a/cpp/src/IceStorm/IceStormDB.cpp +++ b/cpp/src/IceStorm/IceStormDB.cpp @@ -2,19 +2,20 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" #include "../IceDB/IceDB.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" +#include "../IceUtil/Options.h" #include "DBTypes.h" #include "Ice/Ice.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include using namespace std; using namespace IceInternal; +using namespace IceUtilInternal; int run(const shared_ptr&, const Ice::StringSeq&); @@ -154,8 +155,7 @@ run(const shared_ptr& communicator, const Ice::StringSeq& arg ifstream fs(IceUtilInternal::streamFilename(dbFile).c_str(), ios::binary); if (fs.fail()) { - consoleErr << args[0] << ": could not open input file: " << IceUtilInternal::errorToString(errno) - << endl; + consoleErr << args[0] << ": could not open input file: " << IceInternal::errorToString(errno) << endl; return 1; } fs.unsetf(ios::skipws); @@ -311,8 +311,7 @@ run(const shared_ptr& communicator, const Ice::StringSeq& arg ofstream fs(IceUtilInternal::streamFilename(dbFile).c_str(), ios::binary); if (fs.fail()) { - consoleErr << args[0] << ": could not open output file: " << IceUtilInternal::errorToString(errno) - << endl; + consoleErr << args[0] << ": could not open output file: " << IceInternal::errorToString(errno) << endl; return 1; } fs.write(reinterpret_cast(stream.b.begin()), static_cast(stream.b.size())); diff --git a/cpp/src/IceStorm/IceStormDB.rc b/cpp/src/IceStorm/IceStormDB.rc index c8c32600067..148de2c29cb 100644 --- a/cpp/src/IceStorm/IceStormDB.rc +++ b/cpp/src/IceStorm/IceStormDB.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icestormdb\0" #define ICE_ORIGINALFILENAME "icestormdb.exe\0" diff --git a/cpp/src/IceStorm/IceStormService.rc b/cpp/src/IceStorm/IceStormService.rc index 7daaddfe37e..643f4894ab3 100644 --- a/cpp/src/IceStorm/IceStormService.rc +++ b/cpp/src/IceStorm/IceStormService.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icestormservice") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icestormservice") ".dll\0" diff --git a/cpp/src/IceStorm/Instance.cpp b/cpp/src/IceStorm/Instance.cpp index e70b3921546..6159ee04a08 100644 --- a/cpp/src/IceStorm/Instance.cpp +++ b/cpp/src/IceStorm/Instance.cpp @@ -7,7 +7,7 @@ #include "../Ice/TraceUtil.h" #include "Ice/Communicator.h" #include "Ice/Properties.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "InstrumentationI.h" #include "NodeI.h" #include "Observers.h" @@ -84,7 +84,7 @@ Instance::Instance( } } - _timer = make_shared(); + _timer = make_shared(); string policy = properties->getProperty(name + ".Send.QueueSizeMaxPolicy"); if (policy == "RemoveSubscriber") @@ -193,7 +193,7 @@ Instance::traceLevels() const return _traceLevels; } -IceUtil::TimerPtr +Ice::TimerPtr Instance::timer() const { return _timer; diff --git a/cpp/src/IceStorm/Instance.h b/cpp/src/IceStorm/Instance.h index be9ccd5004a..09d3b10868e 100644 --- a/cpp/src/IceStorm/Instance.h +++ b/cpp/src/IceStorm/Instance.h @@ -67,7 +67,7 @@ namespace IceStorm std::shared_ptr node() const; std::optional nodeProxy() const; std::shared_ptr traceLevels() const; - IceUtil::TimerPtr timer() const; + Ice::TimerPtr timer() const; std::optional topicReplicaProxy() const; std::optional publisherReplicaProxy() const; std::shared_ptr observer() const; @@ -101,7 +101,7 @@ namespace IceStorm const std::shared_ptr _topicReaper; std::shared_ptr _node; std::shared_ptr _observers; - IceUtil::TimerPtr _timer; + Ice::TimerPtr _timer; std::shared_ptr _observer; }; diff --git a/cpp/src/IceStorm/NodeI.cpp b/cpp/src/IceStorm/NodeI.cpp index afc99fc1d2d..3ade780752a 100644 --- a/cpp/src/IceStorm/NodeI.cpp +++ b/cpp/src/IceStorm/NodeI.cpp @@ -13,7 +13,7 @@ using namespace std; namespace { - class CheckTask : public IceUtil::TimerTask + class CheckTask : public Ice::TimerTask { const shared_ptr _node; @@ -22,7 +22,7 @@ namespace virtual void runTimerTask() { _node->check(); } }; - class MergeTask : public IceUtil::TimerTask + class MergeTask : public Ice::TimerTask { const shared_ptr _node; const set _s; @@ -32,7 +32,7 @@ namespace virtual void runTimerTask() { _node->merge(_s); } }; - class MergeContinueTask : public IceUtil::TimerTask + class MergeContinueTask : public Ice::TimerTask { const shared_ptr _node; @@ -41,7 +41,7 @@ namespace virtual void runTimerTask() { _node->mergeContinue(); } }; - class TimeoutTask : public IceUtil::TimerTask + class TimeoutTask : public Ice::TimerTask { const shared_ptr _node; diff --git a/cpp/src/IceStorm/NodeI.h b/cpp/src/IceStorm/NodeI.h index 1e455d04be6..cc4299a61a2 100644 --- a/cpp/src/IceStorm/NodeI.h +++ b/cpp/src/IceStorm/NodeI.h @@ -7,7 +7,7 @@ #include "Election.h" #include "Ice/Ice.h" -#include "IceUtil/Timer.h" +#include "Ice/Timer.h" #include "Instance.h" #include "Replica.h" @@ -60,7 +60,7 @@ namespace IceStormElection private: void setState(NodeState); - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const std::shared_ptr _traceLevels; const std::shared_ptr _observers; const std::shared_ptr _replica; // The replica. @@ -90,10 +90,10 @@ namespace IceStormElection std::optional _coordinatorProxy; bool _destroy; - IceUtil::TimerTaskPtr _mergeTask; - IceUtil::TimerTaskPtr _timeoutTask; - IceUtil::TimerTaskPtr _checkTask; - IceUtil::TimerTaskPtr _mergeContinueTask; + Ice::TimerTaskPtr _mergeTask; + Ice::TimerTaskPtr _timeoutTask; + Ice::TimerTaskPtr _checkTask; + Ice::TimerTaskPtr _mergeContinueTask; mutable std::recursive_mutex _mutex; std::condition_variable_any _condVar; diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp index 1b910aed687..8c74a962466 100644 --- a/cpp/src/IceStorm/Parser.cpp +++ b/cpp/src/IceStorm/Parser.cpp @@ -3,10 +3,10 @@ // #include "Parser.h" -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/DisableWarnings.h" #include "Ice/Ice.h" #include "IceStormInternal.h" -#include "IceUtil/DisableWarnings.h" #include #if defined(__APPLE__) || defined(__linux__) @@ -24,6 +24,7 @@ int yyparse(); using namespace std; using namespace Ice; using namespace IceInternal; +using namespace IceUtilInternal; using namespace IceStorm; namespace IceStorm diff --git a/cpp/src/IceStorm/Scanner.cpp b/cpp/src/IceStorm/Scanner.cpp index 3dba5be917b..5c09f98a17d 100644 --- a/cpp/src/IceStorm/Scanner.cpp +++ b/cpp/src/IceStorm/Scanner.cpp @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include #line 9 "src/IceStorm/Scanner.cpp" diff --git a/cpp/src/IceStorm/Scanner.l b/cpp/src/IceStorm/Scanner.l index b26f573da0e..afa9c888f2e 100644 --- a/cpp/src/IceStorm/Scanner.l +++ b/cpp/src/IceStorm/Scanner.l @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include } diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index 5931b85f12b..35a059c5b50 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -6,8 +6,8 @@ #include "Service.h" #include "../Ice/PluginManagerI.h" // For loadPlugin +#include "Ice/StringUtil.h" #include "IceGrid/Registry.h" -#include "IceUtil/StringUtil.h" #include "Instance.h" #include "NodeI.h" #include "Observers.h" @@ -231,12 +231,12 @@ ServiceI::start(const string& name, const CommunicatorPtr& communicator, const S // The node id follows. We find the first digit (the start of the node id, and then the end of the // digits). string::size_type start = instanceName.size(); - while (start < adapterid.size() && !IceUtilInternal::isDigit(adapterid[start])) + while (start < adapterid.size() && !IceInternal::isDigit(adapterid[start])) { ++start; } string::size_type end = start; - while (end < adapterid.size() && IceUtilInternal::isDigit(adapterid[end])) + while (end < adapterid.size() && IceInternal::isDigit(adapterid[end])) { ++end; } @@ -494,7 +494,7 @@ ServiceI::validateProperties(const string& name, const Ice::PropertiesPtr& prope for (unsigned int i = 0; i < sizeof(suffixes) / sizeof(*suffixes); ++i) { string prop = prefix + suffixes[i]; - if (IceUtilInternal::match(p->first, prop)) + if (IceInternal::match(p->first, prop)) { valid = true; break; diff --git a/cpp/src/IceStorm/Subscriber.cpp b/cpp/src/IceStorm/Subscriber.cpp index 641637043e5..1eceb258acf 100644 --- a/cpp/src/IceStorm/Subscriber.cpp +++ b/cpp/src/IceStorm/Subscriber.cpp @@ -4,7 +4,7 @@ #include "Subscriber.h" #include "Ice/LoggerUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "Instance.h" #include "NodeI.h" #include "SendQueueSizeMaxReached.h" @@ -426,7 +426,7 @@ Subscriber::create(const shared_ptr& instance, const SubscriberRecord& p = rec.theQoS.find("locatorCacheTimeout"); if (p != rec.theQoS.end()) { - istringstream is(IceUtilInternal::trim(p->second)); + istringstream is(IceInternal::trim(p->second)); int locatorCacheTimeout; if (!(is >> locatorCacheTimeout) || !is.eof()) { @@ -438,7 +438,7 @@ Subscriber::create(const shared_ptr& instance, const SubscriberRecord& p = rec.theQoS.find("connectionCached"); if (p != rec.theQoS.end()) { - istringstream is(IceUtilInternal::trim(p->second)); + istringstream is(IceInternal::trim(p->second)); int connectionCached; if (!(is >> connectionCached) || !is.eof()) { diff --git a/cpp/src/IceStormLib/IceStorm.rc b/cpp/src/IceStormLib/IceStorm.rc index d0660d430db..949c026c5b5 100644 --- a/cpp/src/IceStormLib/IceStorm.rc +++ b/cpp/src/IceStormLib/IceStorm.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icestorm") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icestorm") ".dll\0" diff --git a/cpp/src/IceUtil/ConsoleUtil.cpp b/cpp/src/IceUtil/ConsoleUtil.cpp index acd8da8ff21..40c8661c5e9 100644 --- a/cpp/src/IceUtil/ConsoleUtil.cpp +++ b/cpp/src/IceUtil/ConsoleUtil.cpp @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ConsoleUtil.h" +#include "ConsoleUtil.h" #include "Ice/Exception.h" #ifdef _WIN32 @@ -38,8 +38,8 @@ ConsoleOut IceUtilInternal::consoleOut; ConsoleErr IceUtilInternal::consoleErr; ConsoleUtil::ConsoleUtil() - : _converter(IceUtil::getProcessStringConverter()), - _consoleConverter(IceUtil::createWindowsStringConverter(GetConsoleOutputCP())) + : _converter(Ice::getProcessStringConverter()), + _consoleConverter(Ice::createWindowsStringConverter(GetConsoleOutputCP())) { } diff --git a/cpp/include/IceUtil/ConsoleUtil.h b/cpp/src/IceUtil/ConsoleUtil.h similarity index 91% rename from cpp/include/IceUtil/ConsoleUtil.h rename to cpp/src/IceUtil/ConsoleUtil.h index c883bd07dbb..f247756a513 100644 --- a/cpp/include/IceUtil/ConsoleUtil.h +++ b/cpp/src/IceUtil/ConsoleUtil.h @@ -5,8 +5,8 @@ #ifndef ICE_UTIL_CONSOLE_UTIL_H #define ICE_UTIL_CONSOLE_UTIL_H -#include "Config.h" -#include "StringConverter.h" +#include "Ice/Config.h" +#include "Ice/StringConverter.h" #include #include @@ -27,8 +27,8 @@ namespace IceUtilInternal private: std::string toConsoleEncoding(const std::string&) const; - IceUtil::StringConverterPtr _converter; - IceUtil::StringConverterPtr _consoleConverter; + Ice::StringConverterPtr _converter; + Ice::StringConverterPtr _consoleConverter; }; const ICE_API ConsoleUtil& getConsoleUtil(); diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/src/IceUtil/DisableWarnings.h similarity index 100% rename from cpp/include/IceUtil/DisableWarnings.h rename to cpp/src/IceUtil/DisableWarnings.h diff --git a/cpp/include/IceUtil/Exception.h b/cpp/src/IceUtil/Exception.h similarity index 93% rename from cpp/include/IceUtil/Exception.h rename to cpp/src/IceUtil/Exception.h index 9fe36cd1e05..8fce94343d6 100644 --- a/cpp/include/IceUtil/Exception.h +++ b/cpp/src/IceUtil/Exception.h @@ -5,7 +5,7 @@ #ifndef ICE_UTIL_EXCEPTION_H #define ICE_UTIL_EXCEPTION_H -#include "Config.h" +#include "Ice/Config.h" namespace IceUtilInternal { diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp index b222c415cdc..6fb91b00dfe 100644 --- a/cpp/src/IceUtil/FileUtil.cpp +++ b/cpp/src/IceUtil/FileUtil.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/FileUtil.h" +#include "FileUtil.h" +#include "DisableWarnings.h" #include "Ice/Exception.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/StringConverter.h" +#include "Ice/StringConverter.h" #include #include #include @@ -95,7 +95,7 @@ bool IceUtilInternal::isEmptyDirectory(const string& path) { #ifdef _WIN32 - return PathIsDirectoryEmptyW(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str()); + return PathIsDirectoryEmptyW(stringToWstring(path, Ice::getProcessStringConverter()).c_str()); #else struct dirent* d; DIR* dir = opendir(path.c_str()); @@ -146,7 +146,7 @@ IceUtilInternal::freopen(const std::string& path, const std::string& mode, FILE* // Don't need to use a wide string converter, the wide strings are directly passed // to Windows API. // - const IceUtil::StringConverterPtr converter = IceUtil::getProcessStringConverter(); + const Ice::StringConverterPtr converter = Ice::getProcessStringConverter(); return _wfreopen(stringToWstring(path, converter).c_str(), stringToWstring(mode, converter).c_str(), stream); # else return freopen(path.c_str(), mode.c_str(), stream); @@ -166,13 +166,13 @@ IceUtilInternal::stat(const string& path, structstat* buffer) // Don't need to use a wide string converter, the wide string is directly passed // to Windows API. // - return _wstat(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str(), buffer); + return _wstat(stringToWstring(path, Ice::getProcessStringConverter()).c_str(), buffer); } int IceUtilInternal::remove(const string& path) { - return ::_wremove(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str()); + return ::_wremove(stringToWstring(path, Ice::getProcessStringConverter()).c_str()); } int @@ -182,7 +182,7 @@ IceUtilInternal::rename(const string& from, const string& to) // Don't need to use a wide string converter, the wide strings are directly passed // to Windows API. // - const IceUtil::StringConverterPtr converter = IceUtil::getProcessStringConverter(); + const Ice::StringConverterPtr converter = Ice::getProcessStringConverter(); return ::_wrename(stringToWstring(from, converter).c_str(), stringToWstring(to, converter).c_str()); } @@ -193,7 +193,7 @@ IceUtilInternal::rmdir(const string& path) // Don't need to use a wide string converter, the wide string is directly passed // to Windows API. // - return ::_wrmdir(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str()); + return ::_wrmdir(stringToWstring(path, Ice::getProcessStringConverter()).c_str()); } int @@ -203,7 +203,7 @@ IceUtilInternal::mkdir(const string& path, int) // Don't need to use a wide string converter, the wide string is directly passed // to Windows API. // - return ::_wmkdir(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str()); + return ::_wmkdir(stringToWstring(path, Ice::getProcessStringConverter()).c_str()); } FILE* @@ -213,7 +213,7 @@ IceUtilInternal::fopen(const string& path, const string& mode) // Don't need to use a wide string converter, the wide strings are directly passed // to Windows API. // - const IceUtil::StringConverterPtr converter = IceUtil::getProcessStringConverter(); + const Ice::StringConverterPtr converter = Ice::getProcessStringConverter(); return ::_wfopen(stringToWstring(path, converter).c_str(), stringToWstring(mode, converter).c_str()); } @@ -226,14 +226,11 @@ IceUtilInternal::open(const string& path, int flags) // if (flags & _O_CREAT) { - return ::_wopen( - stringToWstring(path, IceUtil::getProcessStringConverter()).c_str(), - flags, - _S_IREAD | _S_IWRITE); + return ::_wopen(stringToWstring(path, Ice::getProcessStringConverter()).c_str(), flags, _S_IREAD | _S_IWRITE); } else { - return ::_wopen(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str(), flags); + return ::_wopen(stringToWstring(path, Ice::getProcessStringConverter()).c_str(), flags); } } @@ -249,7 +246,7 @@ IceUtilInternal::getcwd(string& cwd) { return -1; } - cwd = wstringToString(cwdbuf, IceUtil::getProcessStringConverter()); + cwd = wstringToString(cwdbuf, Ice::getProcessStringConverter()); return 0; } @@ -260,7 +257,7 @@ IceUtilInternal::unlink(const string& path) // Don't need to use a wide string converter, the wide string is directly passed // to Windows API. // - return _wunlink(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str()); + return _wunlink(stringToWstring(path, Ice::getProcessStringConverter()).c_str()); } int @@ -280,7 +277,7 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) : _fd(INVALID_HANDL // to Windows API. // _fd = ::CreateFileW( - stringToWstring(path, IceUtil::getProcessStringConverter()).c_str(), + stringToWstring(path, Ice::getProcessStringConverter()).c_str(), GENERIC_WRITE, 0, nullptr, @@ -327,7 +324,7 @@ IceUtilInternal::FileLock::~FileLock() wstring IceUtilInternal::streamFilename(const string& filename) { - return stringToWstring(filename, IceUtil::getProcessStringConverter()); + return stringToWstring(filename, Ice::getProcessStringConverter()); } #else diff --git a/cpp/include/IceUtil/FileUtil.h b/cpp/src/IceUtil/FileUtil.h similarity index 97% rename from cpp/include/IceUtil/FileUtil.h rename to cpp/src/IceUtil/FileUtil.h index 7da15b94ad8..fdf72c2d179 100644 --- a/cpp/include/IceUtil/FileUtil.h +++ b/cpp/src/IceUtil/FileUtil.h @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#ifndef ICE_FILE_UTIL_H -#define ICE_FILE_UTIL_H +#ifndef ICE_UTIL_FILE_UTIL_H +#define ICE_UTIL_FILE_UTIL_H -#include "Config.h" +#include "Ice/Config.h" #ifdef _WIN32 # ifndef NOMINMAX diff --git a/cpp/src/IceUtil/Makefile.mk b/cpp/src/IceUtil/Makefile.mk index be110f2d5e7..50f9066986b 100644 --- a/cpp/src/IceUtil/Makefile.mk +++ b/cpp/src/IceUtil/Makefile.mk @@ -7,9 +7,7 @@ $(project)_libraries = IceUtil IceUtil_targetdir := $(libdir) IceUtil_cppflags := $(if $(filter yes,$(libbacktrace)),-DICE_LIBBACKTRACE) -ifeq ($(os),Darwin) -IceUtil_excludes = src/IceUtil/ConvertUTF.cpp src/IceUtil/Unicode.cpp -endif +IceUtil_extra_sources := src/Ice/CtrlCHandler.cpp src/Ice/StringConverter.cpp src/StringUtil.cpp src/Ice/UtilException.cpp src/Ice/UUID.cpp # Always enable the static configuration for the IceUtil library and never # install it. diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp index 3f464910338..7014c7e5fea 100644 --- a/cpp/src/IceUtil/Options.cpp +++ b/cpp/src/IceUtil/Options.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" +#include "Options.h" +#include "Ice/StringUtil.h" #include #include @@ -457,7 +457,7 @@ IceUtilInternal::Options::split(const string& line) case 'c': { c = l[++i]; - if (IceUtilInternal::isAlpha(c) || c == '@' || (c >= '[' && c <= '_')) + if (IceInternal::isAlpha(c) || c == '@' || (c >= '[' && c <= '_')) { arg.push_back(static_cast(toupper(static_cast(c)) - '@')); } diff --git a/cpp/include/IceUtil/Options.h b/cpp/src/IceUtil/Options.h similarity index 99% rename from cpp/include/IceUtil/Options.h rename to cpp/src/IceUtil/Options.h index 68c622ba2bb..c9073f4f0c6 100644 --- a/cpp/include/IceUtil/Options.h +++ b/cpp/src/IceUtil/Options.h @@ -5,7 +5,7 @@ #ifndef ICE_UTIL_OPTIONS_H #define ICE_UTIL_OPTIONS_H -#include "Config.h" +#include "Ice/Config.h" #include "Ice/Exception.h" #include #include diff --git a/cpp/src/IceUtil/OutputUtil.cpp b/cpp/src/IceUtil/OutputUtil.cpp index 68fc999ab2c..04f2227a219 100644 --- a/cpp/src/IceUtil/OutputUtil.cpp +++ b/cpp/src/IceUtil/OutputUtil.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/OutputUtil.h" -#include "IceUtil/FileUtil.h" +#include "OutputUtil.h" +#include "FileUtil.h" #include #include diff --git a/cpp/include/IceUtil/OutputUtil.h b/cpp/src/IceUtil/OutputUtil.h similarity index 99% rename from cpp/include/IceUtil/OutputUtil.h rename to cpp/src/IceUtil/OutputUtil.h index 303c0be397b..41c52c9468f 100644 --- a/cpp/include/IceUtil/OutputUtil.h +++ b/cpp/src/IceUtil/OutputUtil.h @@ -5,7 +5,7 @@ #ifndef ICE_UTIL_OUTPUT_UTIL_H #define ICE_UTIL_OUTPUT_UTIL_H -#include "Config.h" +#include "Ice/Config.h" #include #include #include diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp index 9ddcd41678f..26dd6fa9320 100644 --- a/cpp/src/IceUtil/Random.cpp +++ b/cpp/src/IceUtil/Random.cpp @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Random.h" +#include "Random.h" #include diff --git a/cpp/include/IceUtil/Random.h b/cpp/src/IceUtil/Random.h similarity index 95% rename from cpp/include/IceUtil/Random.h rename to cpp/src/IceUtil/Random.h index 01e613e5c1a..f091bb2365d 100644 --- a/cpp/include/IceUtil/Random.h +++ b/cpp/src/IceUtil/Random.h @@ -5,8 +5,7 @@ #ifndef ICE_UTIL_RANDOM_H #define ICE_UTIL_RANDOM_H -#include "Config.h" - +#include "Ice/Config.h" #include #include diff --git a/cpp/include/IceUtil/ResourceConfig.h b/cpp/src/IceUtil/ResourceConfig.h similarity index 100% rename from cpp/include/IceUtil/ResourceConfig.h rename to cpp/src/IceUtil/ResourceConfig.h diff --git a/cpp/include/IceUtil/ScannerConfig.h b/cpp/src/IceUtil/ScannerConfig.h similarity index 95% rename from cpp/include/IceUtil/ScannerConfig.h rename to cpp/src/IceUtil/ScannerConfig.h index 04a00e132b0..0008e25c99d 100644 --- a/cpp/include/IceUtil/ScannerConfig.h +++ b/cpp/src/IceUtil/ScannerConfig.h @@ -5,7 +5,7 @@ #ifndef ICE_UTIL_SCANNER_CONFIG_H #define ICE_UTIL_SCANNER_CONFIG_H -#include "Config.h" // Required by generated Scanners. +#include "Ice/Config.h" // Required by generated Scanners. #ifdef _MSC_VER // Suppress the scanner's inclusion of the non-ANSI header file 'unistd.h'. diff --git a/cpp/include/IceUtil/UndefSysMacros.h b/cpp/src/IceUtil/UndefSysMacros.h similarity index 100% rename from cpp/include/IceUtil/UndefSysMacros.h rename to cpp/src/IceUtil/UndefSysMacros.h diff --git a/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj b/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj index 9d6035a7113..6fe44783cfd 100644 --- a/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj +++ b/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj @@ -87,39 +87,34 @@ - + - - + + - - + + - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - + \ No newline at end of file diff --git a/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj.filters b/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj.filters index 85b007c1a4f..320639efd63 100644 --- a/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj.filters +++ b/cpp/src/IceUtil/msbuild/iceutil/iceutil.vcxproj.filters @@ -15,10 +15,10 @@ - + Source Files - + Source Files @@ -30,16 +30,16 @@ Source Files - + Source Files - + Source Files Source Files - + Source Files @@ -47,68 +47,50 @@ - + Header Files - + Header Files - + Header Files - - Header Files - - - Header Files - - - Header Files - - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - - Header Files - - - Header Files - - - Header Files - - + Header Files - + Header Files - + Header Files - + \ No newline at end of file diff --git a/cpp/src/IceXML/IceXML.rc b/cpp/src/IceXML/IceXML.rc index c48a6d026f3..d3f304ab77b 100644 --- a/cpp/src/IceXML/IceXML.rc +++ b/cpp/src/IceXML/IceXML.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME ICE_LIBNAME("icexml") "\0" #define ICE_ORIGINALFILENAME ICE_LIBNAME("icexml") ".dll\0" diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index 44e9a9a1dc9..efb53d33d80 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -3,7 +3,7 @@ // #include "Parser.h" -#include "IceUtil/FileUtil.h" +#include "../IceUtil/FileUtil.h" #include diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp index d01f07a46a9..702b5c6b258 100644 --- a/cpp/src/Slice/FileTracker.cpp +++ b/cpp/src/Slice/FileTracker.cpp @@ -3,8 +3,8 @@ // #include "FileTracker.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/FileUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" #include diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 27089c7fb34..4a2c063d51b 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -111,7 +111,7 @@ /* First part of user prologue. */ #line 66 "src/Slice/Grammar.y" -#include "IceUtil/UUID.h" +#include "Ice/UUID.h" #include "Parser.h" #include @@ -2231,7 +2231,7 @@ yyparse(void) } else { - st = cont->createStruct(IceUtil::generateUUID()); // Dummy + st = cont->createStruct(Ice::generateUUID()); // Dummy assert(st); currentUnit->pushContainer(st); } @@ -2675,17 +2675,17 @@ yyparse(void) auto cl = dynamic_pointer_cast(currentUnit->currentContainer()); if (cl) { - yyval = cl->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = cl->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } auto st = dynamic_pointer_cast(currentUnit->currentContainer()); if (st) { - yyval = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = st->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } auto ex = dynamic_pointer_cast(currentUnit->currentContainer()); if (ex) { - yyval = ex->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = ex->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } assert(yyval); currentUnit->error("missing data member name"); @@ -3156,7 +3156,7 @@ yyparse(void) ExceptionPtr exception = cont->lookupException(scoped->v); if (!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy + exception = cont->createException(Ice::generateUUID(), 0, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); yyval = exception; @@ -3169,7 +3169,7 @@ yyparse(void) { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as exception name"); - yyval = currentUnit->currentContainer()->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy + yyval = currentUnit->currentContainer()->createException(Ice::generateUUID(), 0, Dummy); // Dummy } #line 3305 "src/Slice/Grammar.cpp" break; @@ -3258,7 +3258,7 @@ yyparse(void) } else { - en = cont->createEnum(IceUtil::generateUUID(), Dummy); + en = cont->createEnum(Ice::generateUUID(), Dummy); } currentUnit->pushContainer(en); yyval = en; @@ -3289,7 +3289,7 @@ yyparse(void) { currentUnit->error("missing enumeration name"); ContainerPtr cont = currentUnit->currentContainer(); - EnumPtr en = cont->createEnum(IceUtil::generateUUID(), Dummy); + EnumPtr en = cont->createEnum(Ice::generateUUID(), Dummy); currentUnit->pushContainer(en); yyval = en; } @@ -3537,7 +3537,7 @@ yyparse(void) auto op = dynamic_pointer_cast(currentUnit->currentContainer()); if (op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + op->createParamDecl(Ice::generateUUID(), type, isOutParam->v, false, 0); // Dummy currentUnit->error("missing parameter name"); } } @@ -3552,7 +3552,7 @@ yyparse(void) auto op = dynamic_pointer_cast(currentUnit->currentContainer()); if (op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + op->createParamDecl(Ice::generateUUID(), type, isOutParam->v, false, 0); // Dummy currentUnit->error("missing parameter name"); } } @@ -3909,7 +3909,7 @@ yyparse(void) auto value = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("missing constant name"); yyval = currentUnit->currentContainer()->createConst( - IceUtil::generateUUID(), + Ice::generateUUID(), const_type, metaData->v, value->v, diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index 6171cb7a8ab..9f39f5da6af 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -65,7 +65,7 @@ int slice_lex(YYSTYPE* lvalp, YYLTYPE* llocp); %{ -#include "IceUtil/UUID.h" +#include "Ice/UUID.h" #include "Parser.h" #include @@ -724,7 +724,7 @@ struct_def } else { - st = cont->createStruct(IceUtil::generateUUID()); // Dummy + st = cont->createStruct(Ice::generateUUID()); // Dummy assert(st); currentUnit->pushContainer(st); } @@ -1107,17 +1107,17 @@ data_member auto cl = dynamic_pointer_cast(currentUnit->currentContainer()); if (cl) { - $$ = cl->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + $$ = cl->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } auto st = dynamic_pointer_cast(currentUnit->currentContainer()); if (st) { - $$ = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + $$ = st->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } auto ex = dynamic_pointer_cast(currentUnit->currentContainer()); if (ex) { - $$ = ex->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + $$ = ex->createDataMember(Ice::generateUUID(), type, false, 0, 0, "", ""); // Dummy } assert($$); currentUnit->error("missing data member name"); @@ -1525,7 +1525,7 @@ exception ExceptionPtr exception = cont->lookupException(scoped->v); if (!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy + exception = cont->createException(Ice::generateUUID(), 0, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); $$ = exception; @@ -1534,7 +1534,7 @@ exception { auto ident = dynamic_pointer_cast($1); currentUnit->error("keyword `" + ident->v + "' cannot be used as exception name"); - $$ = currentUnit->currentContainer()->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy + $$ = currentUnit->currentContainer()->createException(Ice::generateUUID(), 0, Dummy); // Dummy } ; @@ -1615,7 +1615,7 @@ enum_def } else { - en = cont->createEnum(IceUtil::generateUUID(), Dummy); + en = cont->createEnum(Ice::generateUUID(), Dummy); } currentUnit->pushContainer(en); $$ = en; @@ -1639,7 +1639,7 @@ ICE_ENUM { currentUnit->error("missing enumeration name"); ContainerPtr cont = currentUnit->currentContainer(); - EnumPtr en = cont->createEnum(IceUtil::generateUUID(), Dummy); + EnumPtr en = cont->createEnum(Ice::generateUUID(), Dummy); currentUnit->pushContainer(en); $$ = en; } @@ -1844,7 +1844,7 @@ parameters auto op = dynamic_pointer_cast(currentUnit->currentContainer()); if (op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + op->createParamDecl(Ice::generateUUID(), type, isOutParam->v, false, 0); // Dummy currentUnit->error("missing parameter name"); } } @@ -1855,7 +1855,7 @@ parameters auto op = dynamic_pointer_cast(currentUnit->currentContainer()); if (op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + op->createParamDecl(Ice::generateUUID(), type, isOutParam->v, false, 0); // Dummy currentUnit->error("missing parameter name"); } } @@ -2105,7 +2105,7 @@ const_def auto const_type = dynamic_pointer_cast($3); auto value = dynamic_pointer_cast($5); currentUnit->error("missing constant name"); - $$ = currentUnit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v, + $$ = currentUnit->currentContainer()->createConst(Ice::generateUUID(), const_type, metaData->v, value->v, value->valueAsString, value->valueAsLiteral, Dummy); // Dummy } ; diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 1cea6674bdc..d911e99b4bd 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -4,7 +4,7 @@ #include "Parser.h" #include "GrammarUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include "Util.h" #include @@ -255,10 +255,10 @@ Slice::DefinitionContext::initSuppressedWarnings() { value = value.substr(prefix.length() + 1); vector result; - IceUtilInternal::splitString(value, ",", result); + IceInternal::splitString(value, ",", result); for (const auto& p : result) { - string s = IceUtilInternal::trim(p); + string s = IceInternal::trim(p); if (s == "all") { _suppressedWarnings.insert(All); @@ -689,10 +689,10 @@ namespace string::size_type nextPos; while ((nextPos = comment.find_first_of('\n', pos)) != string::npos) { - result.push_back(IceUtilInternal::trim(string(comment, pos, nextPos - pos))); + result.push_back(IceInternal::trim(string(comment, pos, nextPos - pos))); pos = nextPos + 1; } - string lastLine = IceUtilInternal::trim(string(comment, pos)); + string lastLine = IceInternal::trim(string(comment, pos)); if (!lastLine.empty()) { result.push_back(lastLine); @@ -761,7 +761,7 @@ Slice::Contained::parseComment(bool stripMarkup) const // if (auto reason = getDeprecationReason(false)) { - comment->_deprecated.push_back(IceUtilInternal::trim(*reason)); + comment->_deprecated.push_back(IceInternal::trim(*reason)); } if (!comment->_isDeprecated && _comment.empty()) @@ -804,7 +804,7 @@ Slice::Contained::parseComment(bool stripMarkup) const const string seeTag = "@see"; for (; i != lines.end(); ++i) { - const string l = IceUtilInternal::trim(*i); + const string l = IceInternal::trim(*i); string line; if (parseCommentLine(l, paramTag, true, name, line)) { @@ -2724,8 +2724,8 @@ Slice::ClassDef::createDataMember( return nullptr; } - string baseName = IceUtilInternal::toLower(dataMember->name()); - string newName = IceUtilInternal::toLower(name); + string baseName = IceInternal::toLower(dataMember->name()); + string newName = IceInternal::toLower(name); if (baseName == newName) { ostringstream os; @@ -3220,8 +3220,8 @@ Slice::InterfaceDef::createOperation( return nullptr; } - string newName = IceUtilInternal::toLower(name); - string thisName = IceUtilInternal::toLower(this->name()); + string newName = IceInternal::toLower(name); + string thisName = IceInternal::toLower(this->name()); if (newName == thisName) { ostringstream os; @@ -3244,8 +3244,8 @@ Slice::InterfaceDef::createOperation( return nullptr; } - string baseName = IceUtilInternal::toLower(op->name()); - string newName2 = IceUtilInternal::toLower(name); + string baseName = IceInternal::toLower(op->name()); + string newName2 = IceInternal::toLower(name); if (baseName == newName2) { ostringstream os; @@ -3478,8 +3478,8 @@ Slice::Exception::createDataMember( return nullptr; } - string baseName = IceUtilInternal::toLower(r->name()); - string newName = IceUtilInternal::toLower(name); + string baseName = IceInternal::toLower(r->name()); + string newName = IceInternal::toLower(name); if (baseName == newName) // TODO use ciCompare { ostringstream os; @@ -5154,7 +5154,7 @@ Slice::Unit::findDefinitionContext(const string& file) const void Slice::Unit::addContent(const ContainedPtr& contained) { - string scoped = IceUtilInternal::toLower(contained->scoped()); + string scoped = IceInternal::toLower(contained->scoped()); _contentMap[scoped].push_back(contained); } @@ -5164,7 +5164,7 @@ Slice::Unit::findContents(const string& scoped) const assert(!scoped.empty()); assert(scoped[0] == ':'); - string name = IceUtilInternal::toLower(scoped); + string name = IceInternal::toLower(scoped); map::const_iterator p = _contentMap.find(name); if (p != _contentMap.end()) { diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index b35f3fd353e..a270da17e6c 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -3,11 +3,11 @@ // #include "Preprocessor.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringConverter.h" -#include "IceUtil/StringUtil.h" -#include "IceUtil/UUID.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringConverter.h" +#include "Ice/StringUtil.h" +#include "Ice/UUID.h" #include "Util.h" #include #include @@ -24,6 +24,7 @@ using namespace std; using namespace Slice; +using namespace IceInternal; using namespace IceUtilInternal; // @@ -87,7 +88,7 @@ Slice::Preprocessor::addQuotes(const string& arg) // Add quotes around the given argument to ensure that arguments // with spaces will be preserved as a single argument // - return "\"" + escapeString(arg, "", ToStringMode::Unicode) + "\""; + return "\"" + escapeString(arg, "", Ice::ToStringMode::Unicode) + "\""; } string @@ -124,7 +125,7 @@ Slice::Preprocessor::normalizeIncludePath(const string& path) } if (result == "/" || - (result.size() == 3 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/')) + (result.size() == 3 && IceInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/')) { return result; } @@ -243,10 +244,10 @@ Slice::Preprocessor::preprocess(bool keepComments, const vector& extraAr // process call _tempnam before any of them call fopen and // they will end up using the same tmp file. // - wchar_t* name = _wtempnam(0, IceUtil::stringToWstring("slice-" + IceUtil::generateUUID()).c_str()); + wchar_t* name = _wtempnam(0, Ice::stringToWstring("slice-" + Ice::generateUUID()).c_str()); if (name) { - _cppFile = IceUtil::wstringToString(name); + _cppFile = Ice::wstringToString(name); free(name); _cppHandle = IceUtilInternal::fopen(_cppFile, "w+"); } @@ -260,9 +261,9 @@ Slice::Preprocessor::preprocess(bool keepComments, const vector& extraAr if (_cppHandle == 0) { #ifdef _WIN32 - _cppFile = "slice-" + IceUtil::generateUUID(); + _cppFile = "slice-" + Ice::generateUUID(); #else - _cppFile = ".slice-" + IceUtil::generateUUID(); + _cppFile = ".slice-" + Ice::generateUUID(); #endif _cppHandle = IceUtilInternal::fopen(_cppFile, "w+"); } @@ -454,7 +455,7 @@ Slice::Preprocessor::printMakefileDependencies( while ((end = unprocessed.find("\n", pos)) != string::npos) { end += 1; - string file = IceUtilInternal::trim(unprocessed.substr(pos, end - pos)); + string file = IceInternal::trim(unprocessed.substr(pos, end - pos)); if (file.rfind(".ice") == file.size() - 4) { if (IceUtilInternal::isAbsolutePath(file)) @@ -781,7 +782,7 @@ Slice::Preprocessor::checkInputFile() string::size_type pos = base.rfind('.'); if (pos != string::npos) { - suffix = IceUtilInternal::toLower(base.substr(pos)); + suffix = IceInternal::toLower(base.substr(pos)); } if (suffix != ".ice") { diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp index 228fab16a32..623b60b3cbd 100644 --- a/cpp/src/Slice/Scanner.cpp +++ b/cpp/src/Slice/Scanner.cpp @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include #line 9 "src/Slice/Scanner.cpp" diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 2512410bdd8..b0fddabf238 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -3,7 +3,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ScannerConfig.h" +#include "../IceUtil/ScannerConfig.h" #include } diff --git a/cpp/src/Slice/SliceUtil.cpp b/cpp/src/Slice/SliceUtil.cpp index 5db7f57e229..9053966953f 100644 --- a/cpp/src/Slice/SliceUtil.cpp +++ b/cpp/src/Slice/SliceUtil.cpp @@ -2,11 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" #include "FileTracker.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringConverter.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringConverter.h" +#include "Ice/StringUtil.h" #include "Util.h" #include #include @@ -390,7 +390,7 @@ Slice::writeDependencies(const string& dependencies, const string& dependFile) if (!of) { ostringstream os; - os << "cannot open file `" << dependFile << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open file `" << dependFile << "': " << IceInternal::errorToString(errno); throw Slice::FileException(__FILE__, __LINE__, os.str()); } of << dependencies; @@ -405,7 +405,7 @@ Slice::argvToArgs(int argc, wchar_t* argv[]) vector args; for (int i = 0; i < argc; i++) { - args.push_back(IceUtil::wstringToString(argv[i])); + args.push_back(Ice::wstringToString(argv[i])); } return args; } diff --git a/cpp/src/Slice/StringLiteralUtil.cpp b/cpp/src/Slice/StringLiteralUtil.cpp index 9701f5ea31f..0735179aefc 100644 --- a/cpp/src/Slice/StringLiteralUtil.cpp +++ b/cpp/src/Slice/StringLiteralUtil.cpp @@ -4,7 +4,7 @@ #include "Util.h" -#include "IceUtil/StringConverter.h" +#include "Ice/StringConverter.h" #include #include @@ -12,8 +12,9 @@ using namespace std; using namespace Slice; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; +using namespace IceInternal; namespace { diff --git a/cpp/src/Slice/Util.h b/cpp/src/Slice/Util.h index aa7cc608773..cb491c8f934 100644 --- a/cpp/src/Slice/Util.h +++ b/cpp/src/Slice/Util.h @@ -5,7 +5,7 @@ #ifndef SLICE_UTIL_H #define SLICE_UTIL_H -#include "IceUtil/OutputUtil.h" +#include "../IceUtil/OutputUtil.h" #include "Parser.h" namespace Slice diff --git a/cpp/src/ice2slice/Gen.h b/cpp/src/ice2slice/Gen.h index 26babca1af3..b6fc0db11bf 100644 --- a/cpp/src/ice2slice/Gen.h +++ b/cpp/src/ice2slice/Gen.h @@ -5,8 +5,8 @@ #ifndef GEN_H #define GEN_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" #include diff --git a/cpp/src/ice2slice/Ice2Slice.rc b/cpp/src/ice2slice/Ice2Slice.rc index 51f994e4fc3..444e9096708 100644 --- a/cpp/src/ice2slice/Ice2Slice.rc +++ b/cpp/src/ice2slice/Ice2Slice.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "ice2slice\0" #define ICE_ORIGINALFILENAME "ice2slice.exe\0" diff --git a/cpp/src/ice2slice/Main.cpp b/cpp/src/ice2slice/Main.cpp index 83a5c3d9a0e..8f61d7a1454 100644 --- a/cpp/src/ice2slice/Main.cpp +++ b/cpp/src/ice2slice/Main.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" #include "Gen.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include #include @@ -133,7 +133,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/icegriddb/IceGridDB.cpp b/cpp/src/icegriddb/IceGridDB.cpp index 5575bd54a16..6af2b9a2a77 100644 --- a/cpp/src/icegriddb/IceGridDB.cpp +++ b/cpp/src/icegriddb/IceGridDB.cpp @@ -2,21 +2,22 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" #include "../IceDB/IceDB.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/DisableWarnings.h" +#include "../IceUtil/FileUtil.h" +#include "../IceUtil/Options.h" #include "DBTypes.h" #include "Ice/Ice.h" +#include "Ice/StringUtil.h" #include "IceGrid/Admin.h" -#include "IceUtil/DisableWarnings.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" #include #include using namespace std; using namespace IceInternal; +using namespace IceUtilInternal; namespace { @@ -200,8 +201,7 @@ run(const Ice::StringSeq& args) ifstream fs(IceUtilInternal::streamFilename(dbFile).c_str(), ios::binary); if (fs.fail()) { - consoleErr << args[0] << ": could not open input file: " << IceUtilInternal::errorToString(errno) - << endl; + consoleErr << args[0] << ": could not open input file: " << IceInternal::errorToString(errno) << endl; return 1; } fs.unsetf(ios::skipws); @@ -505,8 +505,7 @@ run(const Ice::StringSeq& args) ofstream fs(IceUtilInternal::streamFilename(dbFile).c_str(), ios::binary); if (fs.fail()) { - consoleErr << args[0] << ": could not open output file: " << IceUtilInternal::errorToString(errno) - << endl; + consoleErr << args[0] << ": could not open output file: " << IceInternal::errorToString(errno) << endl; return 1; } fs.write(reinterpret_cast(stream.b.begin()), static_cast(stream.b.size())); diff --git a/cpp/src/icegriddb/IceGridDB.rc b/cpp/src/icegriddb/IceGridDB.rc index dbce8f449a0..e9b7e8a9b05 100644 --- a/cpp/src/icegriddb/IceGridDB.rc +++ b/cpp/src/icegriddb/IceGridDB.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "icegriddb\0" #define ICE_ORIGINALFILENAME "icegriddb.exe\0" diff --git a/cpp/src/iceserviceinstall/IceServiceInstall.rc b/cpp/src/iceserviceinstall/IceServiceInstall.rc index 09e55d52923..542d585fcde 100644 --- a/cpp/src/iceserviceinstall/IceServiceInstall.rc +++ b/cpp/src/iceserviceinstall/IceServiceInstall.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "iceserviceinstall\0" #define ICE_ORIGINALFILENAME "iceserviceinstall.exe\0" diff --git a/cpp/src/iceserviceinstall/Install.cpp b/cpp/src/iceserviceinstall/Install.cpp index aed57e8b263..2328dfae265 100644 --- a/cpp/src/iceserviceinstall/Install.cpp +++ b/cpp/src/iceserviceinstall/Install.cpp @@ -2,13 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "../Ice/ConsoleUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "Ice/Ice.h" -#include "IceUtil/Options.h" #include "ServiceInstaller.h" using namespace std; using namespace IceInternal; +using namespace IceUtilInternal; int run(const Ice::StringSeq&); diff --git a/cpp/src/iceserviceinstall/ServiceInstaller.cpp b/cpp/src/iceserviceinstall/ServiceInstaller.cpp index b2fcdb60cd5..3856762323d 100644 --- a/cpp/src/iceserviceinstall/ServiceInstaller.cpp +++ b/cpp/src/iceserviceinstall/ServiceInstaller.cpp @@ -3,8 +3,8 @@ // #include "ServiceInstaller.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" #include @@ -208,7 +208,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) if (scm == 0) { DWORD res = GetLastError(); - throw runtime_error("Cannot open SCM: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot open SCM: " + IceInternal::errorToString(res)); } string deps = dependency; @@ -279,7 +279,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) { DWORD res = GetLastError(); CloseServiceHandle(scm); - throw runtime_error("Cannot create service" + _serviceName + ": " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot create service" + _serviceName + ": " + IceInternal::errorToString(res)); } // @@ -294,7 +294,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) CloseServiceHandle(scm); CloseServiceHandle(service); throw runtime_error( - "Cannot set description for service" + _serviceName + ": " + IceUtilInternal::errorToString(res)); + "Cannot set description for service" + _serviceName + ": " + IceInternal::errorToString(res)); } // @@ -310,8 +310,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) CloseServiceHandle(scm); CloseServiceHandle(service); throw runtime_error( - "Cannot set delayed auto start for service" + _serviceName + ": " + - IceUtilInternal::errorToString(res)); + "Cannot set delayed auto start for service" + _serviceName + ": " + IceInternal::errorToString(res)); } } @@ -326,7 +325,7 @@ IceServiceInstaller::uninstall() if (scm == 0) { DWORD res = GetLastError(); - throw runtime_error("Cannot open SCM: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot open SCM: " + IceInternal::errorToString(res)); } // @@ -338,7 +337,7 @@ IceServiceInstaller::uninstall() { DWORD res = GetLastError(); CloseServiceHandle(scm); - throw runtime_error("Cannot open service '" + _serviceName + "': " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot open service '" + _serviceName + "': " + IceInternal::errorToString(res)); } // @@ -352,7 +351,7 @@ IceServiceInstaller::uninstall() { CloseServiceHandle(scm); CloseServiceHandle(service); - throw runtime_error("Cannot stop service '" + _serviceName + "': " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot stop service '" + _serviceName + "': " + IceInternal::errorToString(res)); } } @@ -361,7 +360,7 @@ IceServiceInstaller::uninstall() DWORD res = GetLastError(); CloseServiceHandle(scm); CloseServiceHandle(service); - throw runtime_error("Cannot delete service '" + _serviceName + "': " + IceUtilInternal::errorToString(res)); + throw runtime_error("Cannot delete service '" + _serviceName + "': " + IceInternal::errorToString(res)); } CloseServiceHandle(scm); @@ -431,7 +430,7 @@ IceServiceInstaller::getServiceInstallerPath() wchar_t buffer[MAX_PATH]; if (!GetModuleFileNameW(0, buffer, MAX_PATH)) { - throw runtime_error("Can not get full path to service installer:\n" + IceUtilInternal::lastErrorToString()); + throw runtime_error("Can not get full path to service installer:\n" + IceInternal::lastErrorToString()); } string path = wstringToString(buffer); @@ -471,8 +470,7 @@ IceServiceInstaller::initializeSid(const string& name) domainName.resize(domainNameSize); continue; } - throw runtime_error( - "Could not retrieve Security ID for " + name + ": " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not retrieve Security ID for " + name + ": " + IceInternal::errorToString(res)); } _sid = reinterpret_cast(_sidBuffer.data()); } @@ -504,7 +502,7 @@ IceServiceInstaller::initializeSid(const string& name) { DWORD res = GetLastError(); throw runtime_error( - "Could not retrieve full account name for " + name + ": " + IceUtilInternal::errorToString(res)); + "Could not retrieve full account name for " + name + ": " + IceInternal::errorToString(res)); } _sidName = wstringToString(domainName) + "\\" + wstringToString(accountName); @@ -546,8 +544,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b GetNamedSecurityInfoW(const_cast(stringToWstring(path).c_str()), type, flags, 0, 0, &acl, 0, &sd); if (res != ERROR_SUCCESS) { - throw runtime_error( - "Could not retrieve securify info for " + path + ": " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not retrieve securify info for " + path + ": " + IceInternal::errorToString(res)); } // @@ -557,14 +554,14 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b { if (!AuthzInitializeResourceManager(AUTHZ_RM_FLAG_NO_AUDIT, 0, 0, 0, 0, &manager)) { - throw runtime_error("AutzInitializeResourceManager failed: " + IceUtilInternal::lastErrorToString()); + throw runtime_error("AutzInitializeResourceManager failed: " + IceInternal::lastErrorToString()); } LUID unusedId = {0}; if (!AuthzInitializeContextFromSid(0, _sid, manager, 0, unusedId, 0, &clientContext)) { - throw runtime_error("AuthzInitializeContextFromSid failed: " + IceUtilInternal::lastErrorToString()); + throw runtime_error("AuthzInitializeContextFromSid failed: " + IceInternal::lastErrorToString()); } AUTHZ_ACCESS_REQUEST accessRequest = {0}; @@ -585,7 +582,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b if (!AuthzAccessCheck(0, clientContext, &accessRequest, 0, sd, 0, 0, &accessReply, 0)) { - throw runtime_error("AuthzAccessCheck failed: " + IceUtilInternal::lastErrorToString()); + throw runtime_error("AuthzAccessCheck failed: " + IceInternal::lastErrorToString()); } bool done = false; @@ -638,7 +635,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b res = SetEntriesInAclW(1, &ea, acl, &newAcl); if (res != ERROR_SUCCESS) { - throw runtime_error("Could not modify ACL for " + path + ": " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not modify ACL for " + path + ": " + IceInternal::errorToString(res)); } res = SetNamedSecurityInfoW( @@ -652,8 +649,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b if (res != ERROR_SUCCESS) { throw runtime_error( - "Could not grant access to " + _sidName + " on " + path + ": " + - IceUtilInternal::errorToString(res)); + "Could not grant access to " + _sidName + " on " + path + ": " + IceInternal::errorToString(res)); } if (_debug) @@ -701,7 +697,7 @@ IceServiceInstaller::mkdir(const string& path) const } else { - throw runtime_error("Could not create directory " + path + ": " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not create directory " + path + ": " + IceInternal::errorToString(res)); } } else @@ -737,13 +733,13 @@ IceServiceInstaller::addLog(const string& log) const if (res != ERROR_SUCCESS) { - throw runtime_error("Could not create new Event Log '" + log + "': " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not create new Event Log '" + log + "': " + IceInternal::errorToString(res)); } res = RegCloseKey(key); if (res != ERROR_SUCCESS) { - throw runtime_error("Could not close registry key handle: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not close registry key handle: " + IceInternal::errorToString(res)); } } @@ -762,7 +758,7 @@ IceServiceInstaller::removeLog(const string& log) const if (res != ERROR_SUCCESS && res != ERROR_ACCESS_DENIED) { throw runtime_error( - "Could not remove registry key '" + createLog(log) + "': " + IceUtilInternal::errorToString(res)); + "Could not remove registry key '" + createLog(log) + "': " + IceInternal::errorToString(res)); } } @@ -787,7 +783,7 @@ IceServiceInstaller::addSource(const string& source, const string& log, const st &disposition); if (res != ERROR_SUCCESS) { - throw runtime_error("Could not create Event Log source in registry: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not create Event Log source in registry: " + IceInternal::errorToString(res)); } // @@ -822,13 +818,13 @@ IceServiceInstaller::addSource(const string& source, const string& log, const st if (res != ERROR_SUCCESS) { RegCloseKey(key); - throw runtime_error("Could not set registry key: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not set registry key: " + IceInternal::errorToString(res)); } res = RegCloseKey(key); if (res != ERROR_SUCCESS) { - throw runtime_error("Could not close registry key handle: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not close registry key handle: " + IceInternal::errorToString(res)); } } @@ -850,7 +846,7 @@ IceServiceInstaller::removeSource(const string& source) const if (res != ERROR_SUCCESS) { - throw runtime_error("Could not open EventLog key: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not open EventLog key: " + IceInternal::errorToString(res)); } DWORD index = 0; @@ -877,7 +873,7 @@ IceServiceInstaller::removeSource(const string& source) const res = RegCloseKey(key); if (res != ERROR_SUCCESS) { - throw runtime_error("Could not close registry key handle: " + IceUtilInternal::errorToString(res)); + throw runtime_error("Could not close registry key handle: " + IceInternal::errorToString(res)); } return wstringToString(subkey); } @@ -895,7 +891,7 @@ IceServiceInstaller::removeSource(const string& source) const { RegCloseKey(key); throw runtime_error( - "Error while searching EventLog with source '" + source + "': " + IceUtilInternal::errorToString(res)); + "Error while searching EventLog with source '" + source + "': " + IceInternal::errorToString(res)); } } diff --git a/cpp/src/slice2cpp/CPlusPlusUtil.h b/cpp/src/slice2cpp/CPlusPlusUtil.h index 3f4c2962b47..5daa1656586 100644 --- a/cpp/src/slice2cpp/CPlusPlusUtil.h +++ b/cpp/src/slice2cpp/CPlusPlusUtil.h @@ -5,8 +5,8 @@ #ifndef C_PLUS_PLUS_UTIL_H #define C_PLUS_PLUS_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" #include "TypeContext.h" namespace Slice diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 2a45b2b4d85..f3c43248b9b 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3,11 +3,11 @@ // #include "Gen.h" +#include "../IceUtil/FileUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Util.h" #include "CPlusPlusUtil.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -16,6 +16,7 @@ using namespace std; using namespace Slice; +using namespace IceInternal; using namespace IceUtilInternal; namespace @@ -252,7 +253,7 @@ namespace string marshaledResultStructName(const string& name) { assert(!name.empty()); - string stName = IceUtilInternal::toUpper(name.substr(0, 1)) + name.substr(1); + string stName = IceInternal::toUpper(name.substr(0, 1)) + name.substr(1); stName += "MarshaledResult"; return stName; } @@ -626,7 +627,7 @@ Slice::Gen::Gen( Slice::Gen::~Gen() { - H << "\n\n#include "; + H << "\n\n#include "; H << "\n#endif\n"; C << '\n'; @@ -681,7 +682,7 @@ Slice::Gen::generate(const UnitPtr& p) if (!H) { ostringstream os; - os << "cannot open `" << fileH << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << fileH << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(fileH); @@ -690,7 +691,7 @@ Slice::Gen::generate(const UnitPtr& p) if (!C) { ostringstream os; - os << "cannot open `" << fileC << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << fileC << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(fileC); @@ -729,7 +730,7 @@ Slice::Gen::generate(const UnitPtr& p) } C << _base << "." << _headerExtension << "\""; - H << "\n#include "; + H << "\n#include "; if (!dc->hasMetaDataDirective("cpp:no-default-include")) { diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index c599e28a0e5..bfa571ff5a1 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -5,8 +5,8 @@ #ifndef GEN_H #define GEN_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" #include "TypeContext.h" namespace Slice diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 0af14f248d4..4328f043ffc 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" @@ -176,7 +176,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2cpp/Slice2Cpp.rc b/cpp/src/slice2cpp/Slice2Cpp.rc index 81270636f24..30f38190a37 100644 --- a/cpp/src/slice2cpp/Slice2Cpp.rc +++ b/cpp/src/slice2cpp/Slice2Cpp.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2cpp\0" #define ICE_ORIGINALFILENAME "slice2cpp.exe\0" diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp index 8a8d2dc0b21..68822732e7c 100644 --- a/cpp/src/slice2cs/CsUtil.cpp +++ b/cpp/src/slice2cs/CsUtil.cpp @@ -5,7 +5,7 @@ #include "CsUtil.h" #include "../Slice/Util.h" #include "DotNetNames.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -412,7 +412,7 @@ string Slice::CsGenerator::resultStructName(const string& className, const string& opName, bool marshaledResult) { ostringstream s; - s << className << "_" << IceUtilInternal::toUpper(opName.substr(0, 1)) << opName.substr(1) + s << className << "_" << IceInternal::toUpper(opName.substr(0, 1)) << opName.substr(1) << (marshaledResult ? "MarshaledResult" : "Result"); return s.str(); } diff --git a/cpp/src/slice2cs/CsUtil.h b/cpp/src/slice2cs/CsUtil.h index 675c9646476..7672a215164 100644 --- a/cpp/src/slice2cs/CsUtil.h +++ b/cpp/src/slice2cs/CsUtil.h @@ -5,8 +5,8 @@ #ifndef CS_UTIL_H #define CS_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" namespace Slice { diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index da9e12abeb7..81ab606b128 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -3,8 +3,8 @@ // #include "Gen.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/FileUtil.h" +#include "Ice/StringUtil.h" #include #ifndef _WIN32 @@ -16,7 +16,7 @@ #include "../Slice/FileTracker.h" #include "../Slice/Util.h" #include "DotNetNames.h" -#include "IceUtil/UUID.h" +#include "Ice/UUID.h" #include #include #include @@ -24,7 +24,8 @@ using namespace std; using namespace Slice; -using namespace IceUtil; +using namespace Ice; +using namespace IceInternal; using namespace IceUtilInternal; namespace @@ -1489,7 +1490,7 @@ Slice::Gen::Gen(const string& base, const vector& includePaths, const st if (!_out) { ostringstream os; - os << "cannot open `" << file << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(file); diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp index cf672a1738f..e0adb813c08 100644 --- a/cpp/src/slice2cs/Main.cpp +++ b/cpp/src/slice2cs/Main.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" #include "Gen.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include #include @@ -153,7 +153,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2cs/Slice2Cs.rc b/cpp/src/slice2cs/Slice2Cs.rc index c4801e5be11..b3817ace7b3 100644 --- a/cpp/src/slice2cs/Slice2Cs.rc +++ b/cpp/src/slice2cs/Slice2Cs.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2cs\0" #define ICE_ORIGINALFILENAME "slice2cs.exe\0" diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 73d613a8ef1..5d123614675 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4,7 +4,7 @@ #include "Gen.h" #include "../Slice/Util.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -1844,12 +1844,12 @@ Slice::JavaVisitor::writeDocCommentLines(Output& out, const string& text) } else { - string s = IceUtilInternal::trim(text.substr(start, pos - start)); + string s = IceInternal::trim(text.substr(start, pos - start)); out << s; // Emit the first line. start = pos + 1; while ((pos = text.find_first_of(ws, start)) != string::npos) { - string line = IceUtilInternal::trim(text.substr(start, pos - start)); + string line = IceInternal::trim(text.substr(start, pos - start)); if (line.empty()) { out << nl << " *"; @@ -1862,7 +1862,7 @@ Slice::JavaVisitor::writeDocCommentLines(Output& out, const string& text) } if (start < text.size()) { - string line = IceUtilInternal::trim(text.substr(start)); + string line = IceInternal::trim(text.substr(start)); if (line.empty()) { out << nl << " *"; diff --git a/cpp/src/slice2java/JavaUtil.cpp b/cpp/src/slice2java/JavaUtil.cpp index b1aa0a5e504..383c07bb474 100644 --- a/cpp/src/slice2java/JavaUtil.cpp +++ b/cpp/src/slice2java/JavaUtil.cpp @@ -3,10 +3,10 @@ // #include "JavaUtil.h" +#include "../IceUtil/FileUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Util.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -707,7 +707,7 @@ Slice::JavaOutput::openClass(const string& cls, const string& prefix, const stri else { ostringstream os; - os << "cannot create directory `" << path << "': " << IceUtilInternal::errorToString(errno); + os << "cannot create directory `" << path << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addDirectory(path); @@ -745,7 +745,7 @@ Slice::JavaOutput::openClass(const string& cls, const string& prefix, const stri else { ostringstream os; - os << "cannot open file `" << path << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open file `" << path << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } } diff --git a/cpp/src/slice2java/JavaUtil.h b/cpp/src/slice2java/JavaUtil.h index b2d843c264d..8cdc9618fb5 100644 --- a/cpp/src/slice2java/JavaUtil.h +++ b/cpp/src/slice2java/JavaUtil.h @@ -5,8 +5,8 @@ #ifndef JAVA_UTIL_H #define JAVA_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" namespace Slice { diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index f0b3cd490f6..de6a01ad0ee 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" #include "Gen.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include #include @@ -162,7 +162,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2java/Slice2Java.rc b/cpp/src/slice2java/Slice2Java.rc index e5d46bdacb3..79634c5102d 100644 --- a/cpp/src/slice2java/Slice2Java.rc +++ b/cpp/src/slice2java/Slice2Java.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2java\0" #define ICE_ORIGINALFILENAME "slice2java.exe\0" diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index a34f69e844c..0bcb522e39d 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -4,11 +4,11 @@ #include "Gen.h" #include "../Ice/Endian.h" +#include "../IceUtil/FileUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Util.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/StringUtil.h" -#include "IceUtil/UUID.h" +#include "Ice/StringUtil.h" +#include "Ice/UUID.h" #include #include @@ -17,7 +17,7 @@ using namespace std; using namespace Slice; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; namespace @@ -628,7 +628,7 @@ Slice::Gen::Gen(const string& base, const vector& includePaths, const st if (!_javaScriptOutput) { ostringstream os; - os << "cannot open `" << file << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(file); @@ -646,7 +646,7 @@ Slice::Gen::Gen(const string& base, const vector& includePaths, const st if (!_typeScriptOutput) { ostringstream os; - os << "cannot open `" << file << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(file); diff --git a/cpp/src/slice2js/JsUtil.cpp b/cpp/src/slice2js/JsUtil.cpp index 0f4aa6af135..ef0a827f952 100644 --- a/cpp/src/slice2js/JsUtil.cpp +++ b/cpp/src/slice2js/JsUtil.cpp @@ -4,7 +4,7 @@ #include "JsUtil.h" #include "../Slice/Util.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -20,6 +20,7 @@ using namespace std; using namespace Slice; +using namespace IceInternal; using namespace IceUtilInternal; string diff --git a/cpp/src/slice2js/JsUtil.h b/cpp/src/slice2js/JsUtil.h index 3c83dbfbb13..e808060263a 100644 --- a/cpp/src/slice2js/JsUtil.h +++ b/cpp/src/slice2js/JsUtil.h @@ -5,8 +5,8 @@ #ifndef JS_UTIL_H #define JS_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" namespace Slice { diff --git a/cpp/src/slice2js/Main.cpp b/cpp/src/slice2js/Main.cpp index 0bda8bc6406..ca7cf56a661 100644 --- a/cpp/src/slice2js/Main.cpp +++ b/cpp/src/slice2js/Main.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" #include "Gen.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include #include @@ -186,7 +186,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2js/Slice2Js.rc b/cpp/src/slice2js/Slice2Js.rc index 0b7bd661313..746b8236240 100644 --- a/cpp/src/slice2js/Slice2Js.rc +++ b/cpp/src/slice2js/Slice2Js.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2js\0" #define ICE_ORIGINALFILENAME "slice2js.exe\0" diff --git a/cpp/src/slice2matlab/Main.cpp b/cpp/src/slice2matlab/Main.cpp index 2d527c4c67f..67837c59f25 100644 --- a/cpp/src/slice2matlab/Main.cpp +++ b/cpp/src/slice2matlab/Main.cpp @@ -2,16 +2,16 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/FileUtil.h" +#include "../IceUtil/Options.h" +#include "../IceUtil/OutputUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Parser.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/FileUtil.h" -#include "IceUtil/Options.h" -#include "IceUtil/OutputUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/CtrlCHandler.h" +#include "Ice/StringUtil.h" #include #include @@ -342,7 +342,7 @@ namespace else { ostringstream os; - os << "cannot create directory `" << path << "': " << IceUtilInternal::errorToString(errno); + os << "cannot create directory `" << path << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addDirectory(path); @@ -804,10 +804,10 @@ namespace string::size_type nextPos; while ((nextPos = comment.find_first_of('\n', pos)) != string::npos) { - result.push_back(IceUtilInternal::trim(string(comment, pos, nextPos - pos))); + result.push_back(IceInternal::trim(string(comment, pos, nextPos - pos))); pos = nextPos + 1; } - string lastLine = IceUtilInternal::trim(string(comment, pos)); + string lastLine = IceInternal::trim(string(comment, pos)); if (!lastLine.empty()) { result.push_back(lastLine); @@ -884,7 +884,7 @@ namespace // First check metadata for a deprecated tag. if (auto reason = p->getDeprecationReason(false)) { - doc.deprecateReason.push_back(IceUtilInternal::trim(*reason)); + doc.deprecateReason.push_back(IceInternal::trim(*reason)); } // @@ -923,7 +923,7 @@ namespace const string seeTag = "@see"; for (; i != lines.end(); ++i) { - const string l = IceUtilInternal::trim(*i); + const string l = IceInternal::trim(*i); string line; if (parseCommentLine(l, paramTag, true, name, line)) { @@ -4643,7 +4643,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2matlab/Slice2Matlab.rc b/cpp/src/slice2matlab/Slice2Matlab.rc index 0b12debaa14..3205b236e28 100644 --- a/cpp/src/slice2matlab/Slice2Matlab.rc +++ b/cpp/src/slice2matlab/Slice2Matlab.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2matlab\0" #define ICE_ORIGINALFILENAME "slice2matlab.exe\0" diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp index 36ddc160f8b..5dc8819a9b4 100644 --- a/cpp/src/slice2php/Main.cpp +++ b/cpp/src/slice2php/Main.cpp @@ -2,15 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" +#include "../IceUtil/OutputUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Parser.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" -#include "IceUtil/OutputUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/CtrlCHandler.h" +#include "Ice/StringUtil.h" #include "PHPUtil.h" #include @@ -1459,7 +1459,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; @@ -1572,7 +1572,7 @@ compile(const vector& argv) if (!out) { ostringstream os; - os << "cannot open`" << file << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open`" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(file); diff --git a/cpp/src/slice2php/PHPUtil.h b/cpp/src/slice2php/PHPUtil.h index d733e6a38a9..54acfeb838b 100644 --- a/cpp/src/slice2php/PHPUtil.h +++ b/cpp/src/slice2php/PHPUtil.h @@ -5,7 +5,7 @@ #ifndef SLICE_PHP_UTIL_H #define SLICE_PHP_UTIL_H -#include "IceUtil/Config.h" +#include "Ice/Config.h" #include namespace Slice diff --git a/cpp/src/slice2php/Slice2PHP.rc b/cpp/src/slice2php/Slice2PHP.rc index 8290a5d0e1b..ecd094c5c82 100644 --- a/cpp/src/slice2php/Slice2PHP.rc +++ b/cpp/src/slice2php/Slice2PHP.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2php\0" #define ICE_ORIGINALFILENAME "slice2php.exe\0" diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp index cfa94d7030b..558a48d5819 100644 --- a/cpp/src/slice2py/Main.cpp +++ b/cpp/src/slice2py/Main.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" #include "../Slice/Util.h" -#include "IceUtil/ConsoleUtil.h" #include "PythonUtil.h" using namespace std; diff --git a/cpp/src/slice2py/Python.cpp b/cpp/src/slice2py/Python.cpp index d9443b516e0..6a90b371ade 100644 --- a/cpp/src/slice2py/Python.cpp +++ b/cpp/src/slice2py/Python.cpp @@ -2,15 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" +#include "Ice/StringUtil.h" // BUGFIX: With MSVC2013 if this isn't included you get strange linker errors. +#include "../IceUtil/FileUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" -#include "IceUtil/FileUtil.h" #include "PythonUtil.h" #include @@ -61,7 +61,7 @@ namespace if (IceUtilInternal::mkdir(dir, 0777) != 0) { ostringstream os; - os << "cannot create directory '" << dir << "': " << IceUtilInternal::errorToString(errno); + os << "cannot create directory '" << dir << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } } @@ -76,7 +76,7 @@ namespace assert(!pkgdir.empty()); vector elements; - if (!IceUtilInternal::splitString(pkgdir, "/", elements)) + if (!IceInternal::splitString(pkgdir, "/", elements)) { throw FileException(__FILE__, __LINE__, "invalid path in '" + pkgdir + "'"); } @@ -100,7 +100,7 @@ namespace if (IceUtilInternal::mkdir(path, 0777) != 0) { ostringstream os; - os << "cannot create directory '" << path << "': " << IceUtilInternal::errorToString(errno); + os << "cannot create directory '" << path << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addDirectory(path); @@ -128,7 +128,7 @@ namespace if (!out) { ostringstream os; - os << "cannot open '" << initFile << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open '" << initFile << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(initFile); @@ -202,7 +202,7 @@ namespace for (StringList::iterator p = modules.begin(); p != modules.end(); ++p) { vector vs; - if (!IceUtilInternal::splitString(*p, ".", vs)) + if (!IceInternal::splitString(*p, ".", vs)) { assert(false); } @@ -285,7 +285,7 @@ namespace if (!in) { ostringstream os; - os << "cannot open file '" << initPath << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open file '" << initPath << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } @@ -380,7 +380,7 @@ namespace if (!os) { ostringstream oss; - oss << "cannot open file '" << initPath << "': " << IceUtilInternal::errorToString(errno); + oss << "cannot open file '" << initPath << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, oss.str()); } FileTracker::instance()->addFile(initPath); @@ -534,7 +534,7 @@ Slice::Python::compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); bool keepComments = true; @@ -703,7 +703,7 @@ Slice::Python::compile(const vector& argv) if (!out) { ostringstream oss; - oss << "cannot open '" << path << "': " << IceUtilInternal::errorToString(errno); + oss << "cannot open '" << path << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, oss.str()); } FileTracker::instance()->addFile(path); diff --git a/cpp/src/slice2py/PythonUtil.cpp b/cpp/src/slice2py/PythonUtil.cpp index 6c2113adeb0..d727cd0d64e 100644 --- a/cpp/src/slice2py/PythonUtil.cpp +++ b/cpp/src/slice2py/PythonUtil.cpp @@ -4,7 +4,7 @@ #include "PythonUtil.h" #include "../Slice/Util.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include #include @@ -12,6 +12,7 @@ using namespace std; using namespace Slice; +using namespace IceInternal; using namespace IceUtilInternal; namespace @@ -2712,7 +2713,7 @@ Slice::Python::getImportFileName(const string& file, const UnitPtr& ut, const ve // The metadata is present, so the generated file was placed in the specified directory. // vector names; - IceUtilInternal::splitString(pkgdir, "/", names); + IceInternal::splitString(pkgdir, "/", names); assert(!names.empty()); pkgdir = ""; for (vector::iterator p = names.begin(); p != names.end(); ++p) diff --git a/cpp/src/slice2py/PythonUtil.h b/cpp/src/slice2py/PythonUtil.h index 4b43b979e0d..407d1255bcd 100644 --- a/cpp/src/slice2py/PythonUtil.h +++ b/cpp/src/slice2py/PythonUtil.h @@ -5,8 +5,8 @@ #ifndef SLICE_PYTHON_UTIL_H #define SLICE_PYTHON_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" namespace Slice { diff --git a/cpp/src/slice2py/Slice2Py.rc b/cpp/src/slice2py/Slice2Py.rc index 64b0d62074e..af3eb0332dd 100644 --- a/cpp/src/slice2py/Slice2Py.rc +++ b/cpp/src/slice2py/Slice2Py.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2py\0" #define ICE_ORIGINALFILENAME "slice2py.exe\0" diff --git a/cpp/src/slice2rb/Main.cpp b/cpp/src/slice2rb/Main.cpp index d115107567c..cbfe0622541 100644 --- a/cpp/src/slice2rb/Main.cpp +++ b/cpp/src/slice2rb/Main.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" #include "../Slice/Util.h" -#include "IceUtil/ConsoleUtil.h" #include "RubyUtil.h" using namespace std; diff --git a/cpp/src/slice2rb/Ruby.cpp b/cpp/src/slice2rb/Ruby.cpp index df0e072f75c..f5cecac4cfa 100644 --- a/cpp/src/slice2rb/Ruby.cpp +++ b/cpp/src/slice2rb/Ruby.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" +#include "Ice/CtrlCHandler.h" +#include "Ice/StringUtil.h" #include "RubyUtil.h" #include @@ -142,7 +142,7 @@ Slice::Ruby::compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; @@ -257,7 +257,7 @@ Slice::Ruby::compile(const vector& argv) if (!out) { ostringstream oss; - oss << "cannot open`" << file << "': " << IceUtilInternal::errorToString(errno); + oss << "cannot open`" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, oss.str()); } FileTracker::instance()->addFile(file); diff --git a/cpp/src/slice2rb/RubyUtil.cpp b/cpp/src/slice2rb/RubyUtil.cpp index 058976f0b9e..8cb13df1550 100644 --- a/cpp/src/slice2rb/RubyUtil.cpp +++ b/cpp/src/slice2rb/RubyUtil.cpp @@ -3,8 +3,8 @@ // #include "RubyUtil.h" +#include "../IceUtil/FileUtil.h" #include "../Slice/Util.h" -#include "IceUtil/FileUtil.h" #include #include diff --git a/cpp/src/slice2rb/RubyUtil.h b/cpp/src/slice2rb/RubyUtil.h index 597252c67a0..d2eb8cb3c81 100644 --- a/cpp/src/slice2rb/RubyUtil.h +++ b/cpp/src/slice2rb/RubyUtil.h @@ -5,8 +5,8 @@ #ifndef SLICE_RUBY_UTIL_H #define SLICE_RUBY_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" namespace Slice { diff --git a/cpp/src/slice2rb/Slice2Rb.rc b/cpp/src/slice2rb/Slice2Rb.rc index 8034cf91ff0..a1f9ed15785 100644 --- a/cpp/src/slice2rb/Slice2Rb.rc +++ b/cpp/src/slice2rb/Slice2Rb.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2rb\0" #define ICE_ORIGINALFILENAME "slice2rb.exe\0" diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 33f5321045b..50e76b2b45c 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -3,11 +3,11 @@ // // +#include "../IceUtil/OutputUtil.h" #include "../Slice/FileTracker.h" #include "../Slice/Parser.h" #include "../Slice/Util.h" -#include "IceUtil/OutputUtil.h" -#include "IceUtil/StringUtil.h" +#include "Ice/StringUtil.h" #include #include @@ -58,7 +58,7 @@ Gen::Gen(const string& base, const vector& includePaths, const string& d if (!_out) { ostringstream os; - os << "cannot open `" << file << "': " << IceUtilInternal::errorToString(errno); + os << "cannot open `" << file << "': " << IceInternal::errorToString(errno); throw FileException(__FILE__, __LINE__, os.str()); } FileTracker::instance()->addFile(file); diff --git a/cpp/src/slice2swift/Main.cpp b/cpp/src/slice2swift/Main.cpp index d6b7142d639..360bdb45aa3 100644 --- a/cpp/src/slice2swift/Main.cpp +++ b/cpp/src/slice2swift/Main.cpp @@ -2,14 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../IceUtil/ConsoleUtil.h" +#include "../IceUtil/Options.h" #include "../Slice/FileTracker.h" #include "../Slice/Parser.h" #include "../Slice/Preprocessor.h" #include "../Slice/Util.h" #include "Gen.h" -#include "IceUtil/ConsoleUtil.h" -#include "IceUtil/CtrlCHandler.h" -#include "IceUtil/Options.h" +#include "Ice/CtrlCHandler.h" #include #include @@ -157,7 +157,7 @@ compile(const vector& argv) int status = EXIT_SUCCESS; - IceUtil::CtrlCHandler ctrlCHandler; + Ice::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); ostringstream os; diff --git a/cpp/src/slice2swift/Slice2Swift.rc b/cpp/src/slice2swift/Slice2Swift.rc index fb477cf3117..c9cce7d9858 100644 --- a/cpp/src/slice2swift/Slice2Swift.rc +++ b/cpp/src/slice2swift/Slice2Swift.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../IceUtil/ResourceConfig.h" #define ICE_INTERNALNAME "slice2swift\0" #define ICE_ORIGINALFILENAME "slice2swift.exe\0" diff --git a/cpp/src/slice2swift/SwiftUtil.cpp b/cpp/src/slice2swift/SwiftUtil.cpp index cefd6210df3..8eb9d070fcd 100644 --- a/cpp/src/slice2swift/SwiftUtil.cpp +++ b/cpp/src/slice2swift/SwiftUtil.cpp @@ -3,8 +3,8 @@ // // -#include "IceUtil/OutputUtil.h" -#include "IceUtil/StringUtil.h" +#include "../IceUtil/OutputUtil.h" +#include "Ice/StringUtil.h" #include "../Slice/Util.h" @@ -330,10 +330,10 @@ SwiftGenerator::splitComment(const string& c) string::size_type nextPos; while ((nextPos = comment.find_first_of('\n', pos)) != string::npos) { - result.push_back(IceUtilInternal::trim(string(comment, pos, nextPos - pos))); + result.push_back(IceInternal::trim(string(comment, pos, nextPos - pos))); pos = nextPos + 1; } - string lastLine = IceUtilInternal::trim(string(comment, pos)); + string lastLine = IceInternal::trim(string(comment, pos)); if (!lastLine.empty()) { result.push_back(lastLine); @@ -400,7 +400,7 @@ SwiftGenerator::parseComment(const ContainedPtr& p) // First check metadata for a deprecated tag. if (auto reason = p->getDeprecationReason(false)) { - doc.deprecateReason.push_back(IceUtilInternal::trim(*reason)); + doc.deprecateReason.push_back(IceInternal::trim(*reason)); } // @@ -438,7 +438,7 @@ SwiftGenerator::parseComment(const ContainedPtr& p) const string seeTag = "@see"; for (; i != lines.end(); ++i) { - const string l = IceUtilInternal::trim(*i); + const string l = IceInternal::trim(*i); string line; if (parseCommentLine(l, paramTag, true, name, line)) { diff --git a/cpp/src/slice2swift/SwiftUtil.h b/cpp/src/slice2swift/SwiftUtil.h index ef81039c447..b61b8318175 100644 --- a/cpp/src/slice2swift/SwiftUtil.h +++ b/cpp/src/slice2swift/SwiftUtil.h @@ -5,8 +5,8 @@ #ifndef SWIFT_UTIL_H #define SWIFT_UTIL_H +#include "../IceUtil/OutputUtil.h" #include "../Slice/Parser.h" -#include "IceUtil/OutputUtil.h" typedef std::list> StringPairList; diff --git a/cpp/test/Common/TestHelper.cpp b/cpp/test/Common/TestHelper.cpp index 4a5ba06536b..6fe594883eb 100644 --- a/cpp/test/Common/TestHelper.cpp +++ b/cpp/test/Common/TestHelper.cpp @@ -4,8 +4,10 @@ #include "TestHelper.h" #include "Ice/Communicator.h" +#include "Ice/CtrlCHandler.h" #include "Ice/RegisterPlugins.h" -#include "IceUtil/CtrlCHandler.h" + +#include using namespace std; using namespace Test; @@ -339,7 +341,7 @@ Test::TestHelper::shutdownOnInterrupt() assert(!_ctrlCHandler); if (_ctrlCHandler == 0) { - _ctrlCHandler = new IceUtil::CtrlCHandler(); + _ctrlCHandler = new Ice::CtrlCHandler(); } _ctrlCHandler->setCallback(shutdownOnInterruptCallback); } diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index 29996c8213b..9919e42d615 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "Test.h" #include "TestHelper.h" diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp index 5abd267e2a5..488c3c1a95e 100644 --- a/cpp/test/Ice/background/AllTests.cpp +++ b/cpp/test/Ice/background/AllTests.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Configuration.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "PluginI.h" #include "Test.h" #include "TestHelper.h" diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp index eb14535310d..909cc474acd 100644 --- a/cpp/test/Ice/binding/AllTests.cpp +++ b/cpp/test/Ice/binding/AllTests.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "Test.h" #include "TestHelper.h" #include diff --git a/cpp/test/Ice/custom/CustomMap.h b/cpp/test/Ice/custom/CustomMap.h index 43414891bc0..8e9175b8767 100644 --- a/cpp/test/Ice/custom/CustomMap.h +++ b/cpp/test/Ice/custom/CustomMap.h @@ -5,7 +5,7 @@ #ifndef CUSTOM_MAP_H #define CUSTOM_MAP_H -#include "IceUtil/Config.h" +#include "Ice/Config.h" #include namespace Test diff --git a/cpp/test/Ice/executor/AllTests.cpp b/cpp/test/Ice/executor/AllTests.cpp index 2a9dafc7e97..40044ba3016 100644 --- a/cpp/test/Ice/executor/AllTests.cpp +++ b/cpp/test/Ice/executor/AllTests.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Executor.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "Test.h" #include "TestHelper.h" diff --git a/cpp/test/Ice/hash/Client.cpp b/cpp/test/Ice/hash/Client.cpp index 03cc6069fb6..a4e017d9ebd 100644 --- a/cpp/test/Ice/hash/Client.cpp +++ b/cpp/test/Ice/hash/Client.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "TestHelper.h" #if defined(__GNUC__) diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index cb67911bf95..e9c49ea72f8 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Random.h" #include "Ice/Ice.h" -#include "IceUtil/Random.h" #include "Test.h" #include "TestHelper.h" diff --git a/cpp/test/Ice/hold/Server.cpp b/cpp/test/Ice/hold/Server.cpp index e4935b06e23..67efa33ad94 100644 --- a/cpp/test/Ice/hold/Server.cpp +++ b/cpp/test/Ice/hold/Server.cpp @@ -22,7 +22,7 @@ Server::run(int argc, char** argv) initData.properties->setProperty("Ice.Connection.IdleTimeout", "1"); Ice::CommunicatorHolder communicator = initialize(argc, argv, initData); - IceUtil::TimerPtr timer = make_shared(); + Ice::TimerPtr timer = make_shared(); auto properties = communicator->getProperties(); properties->setProperty("TestAdapter1.Endpoints", getTestEndpoint()); diff --git a/cpp/test/Ice/hold/TestI.cpp b/cpp/test/Ice/hold/TestI.cpp index 3035130f499..2e6da6e5939 100644 --- a/cpp/test/Ice/hold/TestI.cpp +++ b/cpp/test/Ice/hold/TestI.cpp @@ -12,7 +12,7 @@ using namespace std; -HoldI::HoldI(const IceUtil::TimerPtr& timer, const Ice::ObjectAdapterPtr& adapter) +HoldI::HoldI(const Ice::TimerPtr& timer, const Ice::ObjectAdapterPtr& adapter) : _last(0), _timer(timer), _adapter(adapter) @@ -22,7 +22,7 @@ HoldI::HoldI(const IceUtil::TimerPtr& timer, const Ice::ObjectAdapterPtr& adapte void HoldI::putOnHold(int32_t milliSeconds, const Ice::Current&) { - class PutOnHold : public IceUtil::TimerTask + class PutOnHold : public Ice::TimerTask { public: PutOnHold(const Ice::ObjectAdapterPtr& adapter) : _adapter(adapter) {} @@ -72,7 +72,7 @@ HoldI::putOnHold(int32_t milliSeconds, const Ice::Current&) void HoldI::waitForHold(const Ice::Current& current) { - class WaitForHold final : public IceUtil::TimerTask + class WaitForHold final : public Ice::TimerTask { public: WaitForHold(const Ice::ObjectAdapterPtr& adapter) : _adapter(adapter) {} diff --git a/cpp/test/Ice/hold/TestI.h b/cpp/test/Ice/hold/TestI.h index e07d674e53a..c8b7cc97e23 100644 --- a/cpp/test/Ice/hold/TestI.h +++ b/cpp/test/Ice/hold/TestI.h @@ -10,7 +10,7 @@ class HoldI final : public Test::Hold { public: - HoldI(const IceUtil::TimerPtr&, const Ice::ObjectAdapterPtr&); + HoldI(const Ice::TimerPtr&, const Ice::ObjectAdapterPtr&); void putOnHold(std::int32_t, const Ice::Current&) final; void waitForHold(const Ice::Current&) final; @@ -20,7 +20,7 @@ class HoldI final : public Test::Hold private: int _last; - const IceUtil::TimerPtr _timer; + const Ice::TimerPtr _timer; const Ice::ObjectAdapterPtr _adapter; std::mutex _mutex; }; diff --git a/cpp/test/Ice/invoke/Server.cpp b/cpp/test/Ice/invoke/Server.cpp index 230fbc1fae0..6892978539b 100644 --- a/cpp/test/Ice/invoke/Server.cpp +++ b/cpp/test/Ice/invoke/Server.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "BlobjectI.h" #include "Ice/Ice.h" -#include "IceUtil/Options.h" #include "TestHelper.h" using namespace std; diff --git a/cpp/test/Ice/optional/CustomMap.h b/cpp/test/Ice/optional/CustomMap.h index 487f54199d5..9dd59b37014 100644 --- a/cpp/test/Ice/optional/CustomMap.h +++ b/cpp/test/Ice/optional/CustomMap.h @@ -5,7 +5,7 @@ #ifndef CUSTOM_MAP_H #define CUSTOM_MAP_H -#include "IceUtil/Config.h" +#include "Ice/Config.h" #include namespace Test diff --git a/cpp/test/Ice/optional/TestAMDI.cpp b/cpp/test/Ice/optional/TestAMDI.cpp index e82a11e88e6..8b05d8b47f8 100644 --- a/cpp/test/Ice/optional/TestAMDI.cpp +++ b/cpp/test/Ice/optional/TestAMDI.cpp @@ -6,7 +6,7 @@ #include "Ice/Ice.h" using namespace Test; -using namespace IceUtil; +using namespace Ice; using namespace Ice; using namespace std; diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index 567943ac83b..63afada14ed 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -6,7 +6,7 @@ #include "Ice/Ice.h" using namespace Test; -using namespace IceUtil; +using namespace Ice; using namespace Ice; using namespace std; diff --git a/cpp/test/IceGrid/deployer/Server.cpp b/cpp/test/IceGrid/deployer/Server.cpp index ff52abb2798..7bb0a4e13a9 100644 --- a/cpp/test/IceGrid/deployer/Server.cpp +++ b/cpp/test/IceGrid/deployer/Server.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/DisableWarnings.h" #include "Ice/Ice.h" -#include "IceUtil/DisableWarnings.h" #include "TestHelper.h" #include "TestI.h" #include diff --git a/cpp/test/IceStorm/federation2/Publisher.cpp b/cpp/test/IceStorm/federation2/Publisher.cpp index a25e440d1d2..56dc39d9260 100644 --- a/cpp/test/IceStorm/federation2/Publisher.cpp +++ b/cpp/test/IceStorm/federation2/Publisher.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Event.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "TestHelper.h" #include diff --git a/cpp/test/IceStorm/rep1/Publisher.cpp b/cpp/test/IceStorm/rep1/Publisher.cpp index b1fad4a7b0c..1e9689d5ea8 100644 --- a/cpp/test/IceStorm/rep1/Publisher.cpp +++ b/cpp/test/IceStorm/rep1/Publisher.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "Single.h" #include "TestHelper.h" diff --git a/cpp/test/IceStorm/rep1/Sub.cpp b/cpp/test/IceStorm/rep1/Sub.cpp index 6b8e3907b3c..4ab1e2cf955 100644 --- a/cpp/test/IceStorm/rep1/Sub.cpp +++ b/cpp/test/IceStorm/rep1/Sub.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "Single.h" #include "TestHelper.h" diff --git a/cpp/test/IceStorm/rep1/Subscriber.cpp b/cpp/test/IceStorm/rep1/Subscriber.cpp index 0a4fde97960..1e4d6e766f8 100644 --- a/cpp/test/IceStorm/rep1/Subscriber.cpp +++ b/cpp/test/IceStorm/rep1/Subscriber.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "Single.h" #include "TestHelper.h" diff --git a/cpp/test/IceStorm/stress/Publisher.cpp b/cpp/test/IceStorm/stress/Publisher.cpp index 8967eb8c7d1..d044672bd36 100644 --- a/cpp/test/IceStorm/stress/Publisher.cpp +++ b/cpp/test/IceStorm/stress/Publisher.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Event.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "TestHelper.h" #include diff --git a/cpp/test/IceStorm/stress/Subscriber.cpp b/cpp/test/IceStorm/stress/Subscriber.cpp index c3ea7ed5ef8..16d0f645c86 100644 --- a/cpp/test/IceStorm/stress/Subscriber.cpp +++ b/cpp/test/IceStorm/stress/Subscriber.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "../../src/IceUtil/Options.h" #include "Event.h" #include "Ice/Ice.h" #include "IceStorm/IceStorm.h" -#include "IceUtil/Options.h" #include "TestHelper.h" #include #include diff --git a/cpp/test/IceUtil/ctrlCHandler/Client.cpp b/cpp/test/IceUtil/ctrlCHandler/Client.cpp index 13aeb014c0e..64a0b243fe9 100644 --- a/cpp/test/IceUtil/ctrlCHandler/Client.cpp +++ b/cpp/test/IceUtil/ctrlCHandler/Client.cpp @@ -2,13 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/CtrlCHandler.h" +#include "Ice/CtrlCHandler.h" #include "TestHelper.h" #include #include -using namespace IceUtil; +using namespace Ice; using namespace std; void diff --git a/cpp/test/IceUtil/stacktrace/Client.cpp b/cpp/test/IceUtil/stacktrace/Client.cpp index a5110fe054e..684746592e6 100644 --- a/cpp/test/IceUtil/stacktrace/Client.cpp +++ b/cpp/test/IceUtil/stacktrace/Client.cpp @@ -2,14 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Exception.h" -#include "IceUtil/StringUtil.h" +#include "../../src/IceUtil/Exception.h" +#include "Ice/StringUtil.h" #include "TestHelper.h" #include #include -using namespace IceUtil; +using namespace Ice; using namespace std; namespace IceUtilInternal diff --git a/cpp/test/IceUtil/timer/Client.cpp b/cpp/test/IceUtil/timer/Client.cpp index 8de51d51133..097671d6fe7 100644 --- a/cpp/test/IceUtil/timer/Client.cpp +++ b/cpp/test/IceUtil/timer/Client.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Random.h" -#include "IceUtil/Timer.h" +#include "../../src/IceUtil/Random.h" +#include "Ice/Timer.h" #include "TestHelper.h" #include @@ -11,7 +11,7 @@ #include #include -using namespace IceUtil; +using namespace Ice; using namespace std; template struct TargetLess @@ -29,7 +29,7 @@ template struct TargetLess } }; -class TestTask : public IceUtil::TimerTask +class TestTask : public Ice::TimerTask { public: TestTask() : _count(0) {} @@ -93,10 +93,10 @@ class TestTask : public IceUtil::TimerTask }; using TestTaskPtr = std::shared_ptr; -class DestroyTask : public IceUtil::TimerTask +class DestroyTask : public Ice::TimerTask { public: - DestroyTask(const IceUtil::TimerPtr& timer) : _timer(timer), _run(false) {} + DestroyTask(const Ice::TimerPtr& timer) : _timer(timer), _run(false) {} virtual void runTimerTask() { @@ -119,7 +119,7 @@ class DestroyTask : public IceUtil::TimerTask } private: - IceUtil::TimerPtr _timer; + Ice::TimerPtr _timer; bool _run; mutable mutex _mutex; condition_variable _condition; @@ -137,7 +137,7 @@ Client::run(int, char*[]) { cout << "testing timer... " << flush; { - auto timer = make_shared(); + auto timer = make_shared(); { TestTaskPtr task = make_shared(); timer->schedule(task, chrono::seconds::zero()); @@ -221,7 +221,7 @@ Client::run(int, char*[]) cout << "testing timer destroy... " << flush; { { - auto timer = make_shared(); + auto timer = make_shared(); DestroyTaskPtr destroyTask = make_shared(timer); timer->schedule(destroyTask, chrono::seconds::zero()); destroyTask->waitForRun(); @@ -235,7 +235,7 @@ Client::run(int, char*[]) } } { - auto timer = make_shared(); + auto timer = make_shared(); TestTaskPtr testTask = make_shared(); timer->schedule(testTask, chrono::seconds::zero()); timer->destroy(); diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp index d3510ac0622..054eb198f2b 100644 --- a/cpp/test/IceUtil/unicode/Client.cpp +++ b/cpp/test/IceUtil/unicode/Client.cpp @@ -3,7 +3,7 @@ // #include "../../../src/Ice/Endian.h" -#include "IceUtil/StringConverter.h" +#include "Ice/StringConverter.h" #include "TestHelper.h" #ifdef _WIN32 @@ -21,7 +21,7 @@ // Uncomment to include performance testing // #define TEST_PERF -using namespace IceUtil; +using namespace Ice; using namespace std; // @@ -212,26 +212,26 @@ main(int argc, char* argv[]) cout << "ok" << endl; - cout << "testing IceUtilInternal::toUTF16, toUTF32 and fromUTF32... "; + cout << "testing IceInternal::toUTF16, toUTF32 and fromUTF32... "; vector u8 = vector( reinterpret_cast(ns.data()), reinterpret_cast(ns.data() + ns.length())); - vector u16 = IceUtilInternal::toUTF16(u8); + vector u16 = IceInternal::toUTF16(u8); test(u16.size() == 4); test(u16[0] == 0x20ac); test(u16[1] == 0x20ac); test(u16[2] == 0xd801); test(u16[3] == 0xdc37); - vector u32 = IceUtilInternal::toUTF32(u8); + vector u32 = IceInternal::toUTF32(u8); test(u32.size() == 3); test(u32[0] == 0x20ac); test(u32[1] == 0x20ac); test(u32[2] == 0x10437); - vector nu8 = IceUtilInternal::fromUTF32(u32); + vector nu8 = IceInternal::fromUTF32(u32); test(nu8 == u8); cout << "ok" << endl; diff --git a/cpp/test/IceUtil/uuid/Client.cpp b/cpp/test/IceUtil/uuid/Client.cpp index 7660d375739..5661d8d4b20 100644 --- a/cpp/test/IceUtil/uuid/Client.cpp +++ b/cpp/test/IceUtil/uuid/Client.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include "IceUtil/Random.h" -#include "IceUtil/UUID.h" +#include "../../src/IceUtil/Random.h" +#include "Ice/UUID.h" #include "TestHelper.h" #include @@ -11,7 +11,7 @@ #include #include -using namespace IceUtil; +using namespace Ice; using namespace std; namespace diff --git a/cpp/test/include/TestHelper.h b/cpp/test/include/TestHelper.h index 3c3b3f41799..f876924a5aa 100644 --- a/cpp/test/include/TestHelper.h +++ b/cpp/test/include/TestHelper.h @@ -6,12 +6,12 @@ #define TEST_HELPER_H #include "Ice/CommunicatorF.h" +#include "Ice/Config.h" #include "Ice/CtrlCHandler.h" #include "Ice/Initialize.h" #include "Ice/LocalException.h" #include "Ice/Logger.h" #include "Ice/ProxyF.h" -#include "IceUtil/Config.h" #if defined(_MSC_VER) && !defined(TEST_API_EXPORTS) # pragma comment(lib, ICE_LIBNAME("testcommon")) @@ -117,7 +117,7 @@ namespace Test ControllerHelper* _controllerHelper; Ice::CommunicatorPtr _communicator; #if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 - IceUtil::CtrlCHandler* _ctrlCHandler; + Ice::CtrlCHandler* _ctrlCHandler; #endif }; diff --git a/matlab/src/ice.h b/matlab/src/ice.h index 08a509374c3..569f43454f0 100644 --- a/matlab/src/ice.h +++ b/matlab/src/ice.h @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -// Don't include IceUtil/Config.h the MATLAB mex parser doesn't support C++ code +// Don't include Ice/Config.h the MATLAB mex parser doesn't support C++ code #ifdef _MSC_VER # ifndef ICE_MATLAB_API # if defined(ICE_MATLAB_API_EXPORTS) diff --git a/matlab/src/ice.rc b/matlab/src/ice.rc index 45d920c79cc..4606a1f9d0a 100644 --- a/matlab/src/ice.rc +++ b/matlab/src/ice.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../../cpp/src/IceUtil/ResourceConfig.h" #ifdef _DEBUG # define ICE_INTERNALNAME "ice\0" diff --git a/php/src/Communicator.cpp b/php/src/Communicator.cpp index c9ecc581415..2e73039d547 100644 --- a/php/src/Communicator.cpp +++ b/php/src/Communicator.cpp @@ -9,9 +9,9 @@ #include "Types.h" #include "Util.h" +#include "Ice/StringUtil.h" +#include "Ice/Timer.h" #include "IceUtil/Options.h" -#include "IceUtil/StringUtil.h" -#include "IceUtil/Timer.h" #include #include @@ -1636,7 +1636,7 @@ parseProfiles(const string& file) value = s.substr(beg, end - beg); // Check for quotes and remove them if present - string::size_type qpos = IceUtilInternal::checkQuote(value); + string::size_type qpos = IceInternal::checkQuote(value); if (qpos != string::npos) { value = value.substr(1, qpos - 1); diff --git a/php/src/Types.cpp b/php/src/Types.cpp index 12c0ba8b0f7..bac4c0fadea 100644 --- a/php/src/Types.cpp +++ b/php/src/Types.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace IcePHP; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; ZEND_EXTERN_MODULE_GLOBALS(ice) diff --git a/python/modules/IcePy/IcePy.rc b/python/modules/IcePy/IcePy.rc index 205de866d40..adbf3523d8d 100644 --- a/python/modules/IcePy/IcePy.rc +++ b/python/modules/IcePy/IcePy.rc @@ -1,4 +1,4 @@ -#include "IceUtil/ResourceConfig.h" +#include "../../cpp/src/IceUtil/ResourceConfig.h" #ifdef _DEBUG # define ICE_INTERNALNAME "IcePy_d\0" diff --git a/python/modules/IcePy/Types.cpp b/python/modules/IcePy/Types.cpp index 7d066301157..aad50d2648f 100644 --- a/python/modules/IcePy/Types.cpp +++ b/python/modules/IcePy/Types.cpp @@ -23,7 +23,7 @@ using namespace std; using namespace IcePy; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; typedef map> ClassInfoMap; diff --git a/ruby/src/IceRuby/Types.cpp b/ruby/src/IceRuby/Types.cpp index 42c072e981f..f3dd69fa1aa 100644 --- a/ruby/src/IceRuby/Types.cpp +++ b/ruby/src/IceRuby/Types.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace IceRuby; -using namespace IceUtil; +using namespace Ice; using namespace IceUtilInternal; static VALUE _typeInfoClass, _exceptionInfoClass, _unsetTypeClass; diff --git a/scripts/Component.py b/scripts/Component.py index 47806fe8f06..f51e423914b 100644 --- a/scripts/Component.py +++ b/scripts/Component.py @@ -243,7 +243,7 @@ def isCross(self, testId): def getSoVersion(self): with open( - os.path.join(Util.toplevel, "cpp", "include", "IceUtil", "Config.h"), "r" + os.path.join(Util.toplevel, "cpp", "include", "Ice", "Config.h"), "r" ) as config: intVersion = int( re.search("ICE_INT_VERSION ([0-9]*)", config.read()).group(1) diff --git a/swift/src/IceImpl/IceUtil.mm b/swift/src/IceImpl/IceUtil.mm index e23aad2adf5..801e2974e09 100644 --- a/swift/src/IceImpl/IceUtil.mm +++ b/swift/src/IceImpl/IceUtil.mm @@ -200,7 +200,7 @@ + (NSString*)escapeString:(NSString*)string + (NSString*)errorToString:(int32_t)error { - return toNSString(IceUtilInternal::errorToString(error)); + return toNSString(IceInternal::errorToString(error)); } + (NSString*)errorToStringDNS:(int32_t)error