From 7d7c02c579c2dfbf679c3731e99dcda68cbf384e Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Sun, 5 Feb 2012 12:16:58 +0000 Subject: [PATCH] trunk: backport eventing from 1.4.3 --- Foundation/include/Poco/AbstractDelegate.h | 64 ++- Foundation/include/Poco/AbstractEvent.h | 308 ++++++------- Foundation/include/Poco/AbstractObserver.h | 10 +- .../include/Poco/AbstractPriorityDelegate.h | 70 +-- .../include/Poco/AccessExpirationDecorator.h | 2 +- Foundation/include/Poco/ActiveDispatcher.h | 2 +- Foundation/include/Poco/ActiveResult.h | 2 +- Foundation/include/Poco/ActiveRunnable.h | 2 +- Foundation/include/Poco/ActiveStarter.h | 2 +- Foundation/include/Poco/Activity.h | 2 +- Foundation/include/Poco/Any.h | 246 +++++------ Foundation/include/Poco/ArchiveStrategy.h | 2 +- Foundation/include/Poco/AsyncChannel.h | 2 +- Foundation/include/Poco/AutoPtr.h | 2 +- Foundation/include/Poco/AutoReleasePool.h | 2 +- Foundation/include/Poco/Base64Decoder.h | 52 +-- Foundation/include/Poco/Base64Encoder.h | 52 +-- Foundation/include/Poco/BasicEvent.h | 29 +- Foundation/include/Poco/BinaryReader.h | 90 ++-- Foundation/include/Poco/Buffer.h | 276 ++++++------ Foundation/include/Poco/BufferAllocator.h | 2 +- .../Poco/BufferedBidirectionalStreamBuf.h | 2 +- Foundation/include/Poco/BufferedStreamBuf.h | 2 +- Foundation/include/Poco/Bugcheck.h | 8 +- Foundation/include/Poco/ByteOrder.h | 2 +- Foundation/include/Poco/Channel.h | 2 +- Foundation/include/Poco/Checksum.h | 2 +- Foundation/include/Poco/ClassLibrary.h | 2 +- Foundation/include/Poco/ClassLoader.h | 2 +- Foundation/include/Poco/Condition.h | 2 +- Foundation/include/Poco/Config.h | 2 +- Foundation/include/Poco/Configurable.h | 2 +- Foundation/include/Poco/ConsoleChannel.h | 2 +- Foundation/include/Poco/CountingStream.h | 2 +- Foundation/include/Poco/DateTime.h | 32 +- Foundation/include/Poco/DateTimeFormat.h | 2 +- Foundation/include/Poco/DateTimeFormatter.h | 24 +- Foundation/include/Poco/DateTimeParser.h | 2 +- Foundation/include/Poco/Debugger.h | 2 +- Foundation/include/Poco/DefaultStrategy.h | 162 +++---- Foundation/include/Poco/Delegate.h | 125 ++++-- Foundation/include/Poco/DigestEngine.h | 14 +- Foundation/include/Poco/DigestStream.h | 2 +- Foundation/include/Poco/DirectoryIterator.h | 2 +- .../include/Poco/DirectoryIterator_UNIX.h | 2 +- .../include/Poco/DirectoryIterator_VMS.h | 2 +- .../include/Poco/DirectoryIterator_WIN32.h | 2 +- .../include/Poco/DirectoryIterator_WIN32U.h | 2 +- Foundation/include/Poco/DynamicFactory.h | 2 +- Foundation/include/Poco/Environment.h | 34 +- Foundation/include/Poco/Environment_UNIX.h | 16 +- Foundation/include/Poco/Environment_VMS.h | 16 +- Foundation/include/Poco/Environment_VX.h | 16 +- Foundation/include/Poco/Environment_WIN32.h | 16 +- Foundation/include/Poco/Environment_WIN32U.h | 16 +- Foundation/include/Poco/Environment_WINCE.h | 16 +- Foundation/include/Poco/ErrorHandler.h | 16 +- Foundation/include/Poco/Event.h | 2 +- Foundation/include/Poco/EventLogChannel.h | 2 +- Foundation/include/Poco/Event_POSIX.h | 2 +- Foundation/include/Poco/Event_WIN32.h | 10 +- Foundation/include/Poco/Expire.h | 69 +-- Foundation/include/Poco/FIFOEvent.h | 40 +- Foundation/include/Poco/FIFOStrategy.h | 141 ++---- Foundation/include/Poco/FPEnvironment.h | 2 +- Foundation/include/Poco/FPEnvironment_C99.h | 2 +- Foundation/include/Poco/FPEnvironment_DEC.h | 2 +- Foundation/include/Poco/FPEnvironment_DUMMY.h | 2 +- Foundation/include/Poco/FPEnvironment_SUN.h | 2 +- Foundation/include/Poco/FPEnvironment_WIN32.h | 2 +- Foundation/include/Poco/File.h | 56 +-- Foundation/include/Poco/FileChannel.h | 48 +-- Foundation/include/Poco/FileStream.h | 2 +- Foundation/include/Poco/FileStreamFactory.h | 2 +- Foundation/include/Poco/FileStream_POSIX.h | 2 +- Foundation/include/Poco/FileStream_WIN32.h | 16 +- Foundation/include/Poco/File_UNIX.h | 2 +- Foundation/include/Poco/File_VMS.h | 2 +- Foundation/include/Poco/File_WIN32.h | 2 +- Foundation/include/Poco/File_WIN32U.h | 2 +- Foundation/include/Poco/Format.h | 26 +- Foundation/include/Poco/Formatter.h | 2 +- Foundation/include/Poco/FormattingChannel.h | 2 +- Foundation/include/Poco/FunctionDelegate.h | 162 ++++--- .../include/Poco/FunctionPriorityDelegate.h | 208 +++++---- Foundation/include/Poco/Glob.h | 2 +- Foundation/include/Poco/HMACEngine.h | 2 +- Foundation/include/Poco/Hash.h | 254 +++++------ Foundation/include/Poco/HashFunction.h | 2 +- Foundation/include/Poco/HashMap.h | 2 +- Foundation/include/Poco/HashSet.h | 2 +- Foundation/include/Poco/HashStatistic.h | 2 +- Foundation/include/Poco/HashTable.h | 26 +- Foundation/include/Poco/HexBinaryDecoder.h | 48 +-- Foundation/include/Poco/HexBinaryEncoder.h | 46 +- Foundation/include/Poco/Instantiator.h | 2 +- Foundation/include/Poco/KeyValueArgs.h | 2 +- Foundation/include/Poco/LRUCache.h | 8 +- Foundation/include/Poco/Latin9Encoding.h | 2 +- Foundation/include/Poco/LineEndingConverter.h | 2 +- Foundation/include/Poco/LinearHashTable.h | 2 +- Foundation/include/Poco/LocalDateTime.h | 2 +- Foundation/include/Poco/LogFile.h | 2 +- Foundation/include/Poco/LogFile_STD.h | 2 +- Foundation/include/Poco/LogFile_VMS.h | 2 +- Foundation/include/Poco/LogFile_WIN32.h | 2 +- Foundation/include/Poco/LogFile_WIN32U.h | 2 +- Foundation/include/Poco/LogStream.h | 2 +- Foundation/include/Poco/Logger.h | 46 +- Foundation/include/Poco/LoggingFactory.h | 2 +- Foundation/include/Poco/LoggingRegistry.h | 2 +- Foundation/include/Poco/MD2Engine.h | 112 ----- Foundation/include/Poco/MD4Engine.h | 2 +- Foundation/include/Poco/MD5Engine.h | 2 +- Foundation/include/Poco/Manifest.h | 2 +- Foundation/include/Poco/MemoryPool.h | 2 +- Foundation/include/Poco/Message.h | 2 +- Foundation/include/Poco/MetaObject.h | 2 +- Foundation/include/Poco/Mutex.h | 68 +-- Foundation/include/Poco/Mutex_POSIX.h | 3 +- Foundation/include/Poco/Mutex_WIN32.h | 14 +- Foundation/include/Poco/NamedEvent.h | 2 +- Foundation/include/Poco/NamedEvent_UNIX.h | 10 +- Foundation/include/Poco/NamedEvent_VMS.h | 2 +- Foundation/include/Poco/NamedEvent_WIN32.h | 2 +- Foundation/include/Poco/NamedEvent_WIN32U.h | 2 +- Foundation/include/Poco/NamedMutex_UNIX.h | 10 +- Foundation/include/Poco/NamedMutex_VMS.h | 2 +- Foundation/include/Poco/NamedMutex_WIN32.h | 2 +- Foundation/include/Poco/NamedMutex_WIN32U.h | 2 +- Foundation/include/Poco/NamedTuple.h | 2 +- .../include/Poco/NestedDiagnosticContext.h | 2 +- Foundation/include/Poco/Notification.h | 2 +- Foundation/include/Poco/NotificationCenter.h | 28 +- Foundation/include/Poco/NotificationQueue.h | 2 +- Foundation/include/Poco/NullChannel.h | 2 +- Foundation/include/Poco/NullStream.h | 2 +- Foundation/include/Poco/NumberFormatter.h | 34 +- Foundation/include/Poco/NumberParser.h | 34 +- Foundation/include/Poco/Observer.h | 62 +-- Foundation/include/Poco/OpcomChannel.h | 2 +- Foundation/include/Poco/Path.h | 94 ++-- Foundation/include/Poco/Path_UNIX.h | 2 +- Foundation/include/Poco/Path_VMS.h | 2 +- Foundation/include/Poco/Path_WIN32.h | 2 +- Foundation/include/Poco/Path_WIN32U.h | 2 +- Foundation/include/Poco/PatternFormatter.h | 44 +- Foundation/include/Poco/Pipe.h | 2 +- Foundation/include/Poco/PipeImpl_DUMMY.h | 2 +- Foundation/include/Poco/PipeImpl_POSIX.h | 2 +- Foundation/include/Poco/PipeImpl_WIN32.h | 2 +- Foundation/include/Poco/PipeStream.h | 2 +- Foundation/include/Poco/Platform.h | 6 +- Foundation/include/Poco/Platform_POSIX.h | 2 +- Foundation/include/Poco/Platform_VMS.h | 2 +- Foundation/include/Poco/Platform_WIN32.h | 12 +- Foundation/include/Poco/Poco.h | 2 +- Foundation/include/Poco/PriorityDelegate.h | 148 ++++--- Foundation/include/Poco/PriorityEvent.h | 48 +-- Foundation/include/Poco/PriorityExpire.h | 82 ++-- .../include/Poco/PriorityNotificationQueue.h | 360 ++++++++-------- Foundation/include/Poco/Process.h | 24 +- Foundation/include/Poco/Process_UNIX.h | 14 +- Foundation/include/Poco/Process_VMS.h | 13 +- Foundation/include/Poco/Process_VX.h | 14 +- Foundation/include/Poco/Process_WIN32.h | 28 +- Foundation/include/Poco/Process_WIN32U.h | 26 +- Foundation/include/Poco/Process_WINCE.h | 28 +- Foundation/include/Poco/PurgeStrategy.h | 2 +- Foundation/include/Poco/RWLock.h | 2 +- Foundation/include/Poco/RWLock_POSIX.h | 2 +- Foundation/include/Poco/RWLock_WIN32.h | 2 +- Foundation/include/Poco/Random.h | 2 +- Foundation/include/Poco/RandomStream.h | 2 +- Foundation/include/Poco/RefCountedObject.h | 2 +- Foundation/include/Poco/RegularExpression.h | 16 +- Foundation/include/Poco/RotateStrategy.h | 2 +- Foundation/include/Poco/Runnable.h | 4 +- Foundation/include/Poco/RunnableAdapter.h | 2 +- Foundation/include/Poco/SHA1Engine.h | 2 +- Foundation/include/Poco/ScopedLock.h | 80 ++-- Foundation/include/Poco/ScopedUnlock.h | 2 +- Foundation/include/Poco/Semaphore.h | 2 +- Foundation/include/Poco/Semaphore_POSIX.h | 2 +- Foundation/include/Poco/Semaphore_WIN32.h | 2 +- Foundation/include/Poco/SharedLibrary.h | 88 ++-- Foundation/include/Poco/SharedLibrary_HPUX.h | 14 +- Foundation/include/Poco/SharedLibrary_UNIX.h | 24 +- Foundation/include/Poco/SharedLibrary_VMS.h | 14 +- Foundation/include/Poco/SharedLibrary_VX.h | 14 +- Foundation/include/Poco/SharedLibrary_WIN32.h | 14 +- .../include/Poco/SharedLibrary_WIN32U.h | 14 +- Foundation/include/Poco/SharedMemory.h | 2 +- Foundation/include/Poco/SharedMemory_DUMMY.h | 2 +- Foundation/include/Poco/SharedMemory_POSIX.h | 2 +- Foundation/include/Poco/SharedMemory_WIN32.h | 2 +- Foundation/include/Poco/SignalHandler.h | 2 +- Foundation/include/Poco/SimpleFileChannel.h | 2 +- Foundation/include/Poco/SimpleHashTable.h | 2 +- Foundation/include/Poco/SingletonHolder.h | 2 +- Foundation/include/Poco/SplitterChannel.h | 2 +- Foundation/include/Poco/Stopwatch.h | 2 +- Foundation/include/Poco/StreamChannel.h | 2 +- Foundation/include/Poco/StreamConverter.h | 2 +- Foundation/include/Poco/StreamCopier.h | 58 +-- Foundation/include/Poco/StreamTokenizer.h | 2 +- Foundation/include/Poco/SynchronizedObject.h | 2 +- Foundation/include/Poco/SyslogChannel.h | 2 +- Foundation/include/Poco/Task.h | 2 +- Foundation/include/Poco/TaskManager.h | 2 +- Foundation/include/Poco/TaskNotification.h | 2 +- Foundation/include/Poco/TeeStream.h | 2 +- Foundation/include/Poco/TemporaryFile.h | 22 +- Foundation/include/Poco/TextConverter.h | 2 +- Foundation/include/Poco/TextEncoding.h | 2 +- Foundation/include/Poco/TextIterator.h | 34 +- Foundation/include/Poco/Thread.h | 12 +- Foundation/include/Poco/ThreadLocal.h | 2 +- Foundation/include/Poco/ThreadPool.h | 2 +- Foundation/include/Poco/Thread_POSIX.h | 2 +- .../include/Poco/TimedNotificationQueue.h | 310 ++++++------- Foundation/include/Poco/Timespan.h | 2 +- Foundation/include/Poco/Timestamp.h | 2 +- Foundation/include/Poco/Timezone.h | 2 +- Foundation/include/Poco/Token.h | 2 +- Foundation/include/Poco/Tuple.h | 2 +- Foundation/include/Poco/Types.h | 2 +- Foundation/include/Poco/URI.h | 2 +- Foundation/include/Poco/URIStreamFactory.h | 2 +- Foundation/include/Poco/URIStreamOpener.h | 2 +- Foundation/include/Poco/UTF16Encoding.h | 2 +- Foundation/include/Poco/UTF8Encoding.h | 2 +- Foundation/include/Poco/UTF8String.h | 2 +- Foundation/include/Poco/UUID.h | 2 +- Foundation/include/Poco/UUIDGenerator.h | 2 +- Foundation/include/Poco/UnbufferedStreamBuf.h | 2 +- Foundation/include/Poco/Unicode.h | 76 ++-- Foundation/include/Poco/UnicodeConverter.h | 2 +- .../include/Poco/UniqueAccessExpireCache.h | 2 +- Foundation/include/Poco/Version.h | 4 +- Foundation/include/Poco/Void.h | 2 +- Foundation/src/ASCIIEncoding.cpp | 2 +- Foundation/src/AbstractObserver.cpp | 2 +- Foundation/src/ActiveDispatcher.cpp | 2 +- Foundation/src/ArchiveStrategy.cpp | 2 +- Foundation/src/AsyncChannel.cpp | 2 +- Foundation/src/AtomicCounter.cpp | 14 +- Foundation/src/Bugcheck.cpp | 2 +- Foundation/src/ByteOrder.cpp | 2 +- Foundation/src/Channel.cpp | 2 +- Foundation/src/Checksum.cpp | 2 +- Foundation/src/Condition.cpp | 2 +- Foundation/src/Configurable.cpp | 2 +- Foundation/src/ConsoleChannel.cpp | 2 +- Foundation/src/CountingStream.cpp | 2 +- Foundation/src/DateTime.cpp | 14 +- Foundation/src/DateTimeFormat.cpp | 2 +- Foundation/src/DateTimeFormatter.cpp | 22 +- Foundation/src/DigestEngine.cpp | 64 +-- Foundation/src/DigestStream.cpp | 2 +- Foundation/src/DirectoryIterator.cpp | 2 +- Foundation/src/DirectoryIterator_UNIX.cpp | 2 +- Foundation/src/DirectoryIterator_VMS.cpp | 2 +- Foundation/src/DirectoryIterator_WIN32.cpp | 2 +- Foundation/src/DirectoryIterator_WIN32U.cpp | 2 +- Foundation/src/ErrorHandler.cpp | 2 +- Foundation/src/Event.cpp | 2 +- Foundation/src/EventArgs.cpp | 2 +- Foundation/src/EventLogChannel.cpp | 2 +- Foundation/src/Event_POSIX.cpp | 2 +- Foundation/src/Event_WIN32.cpp | 2 +- Foundation/src/Exception.cpp | 2 +- Foundation/src/FPEnvironment.cpp | 2 +- Foundation/src/FPEnvironment_C99.cpp | 2 +- Foundation/src/FPEnvironment_DEC.cpp | 2 +- Foundation/src/FPEnvironment_DUMMY.cpp | 2 +- Foundation/src/FPEnvironment_SUN.cpp | 4 +- Foundation/src/FPEnvironment_WIN32.cpp | 2 +- Foundation/src/File.cpp | 22 +- Foundation/src/FileChannel.cpp | 42 +- Foundation/src/FileStream.cpp | 2 +- Foundation/src/FileStreamFactory.cpp | 2 +- Foundation/src/FileStream_POSIX.cpp | 2 +- Foundation/src/File_UNIX.cpp | 14 +- Foundation/src/File_VMS.cpp | 2 +- Foundation/src/File_WIN32.cpp | 14 +- Foundation/src/File_WIN32U.cpp | 2 +- Foundation/src/Format.cpp | 40 +- Foundation/src/Formatter.cpp | 2 +- Foundation/src/FormattingChannel.cpp | 2 +- Foundation/src/Glob.cpp | 30 +- Foundation/src/Hash.cpp | 2 +- Foundation/src/HashStatistic.cpp | 2 +- Foundation/src/HexBinaryDecoder.cpp | 26 +- Foundation/src/Latin1Encoding.cpp | 2 +- Foundation/src/Latin9Encoding.cpp | 2 +- Foundation/src/LineEndingConverter.cpp | 2 +- Foundation/src/LocalDateTime.cpp | 18 +- Foundation/src/LogFile.cpp | 2 +- Foundation/src/LogFile_STD.cpp | 2 +- Foundation/src/LogFile_VMS.cpp | 2 +- Foundation/src/LogFile_WIN32.cpp | 3 +- Foundation/src/LogFile_WIN32U.cpp | 2 +- Foundation/src/LogStream.cpp | 2 +- Foundation/src/Logger.cpp | 44 +- Foundation/src/LoggingFactory.cpp | 2 +- Foundation/src/LoggingRegistry.cpp | 2 +- Foundation/src/MD4Engine.cpp | 2 +- Foundation/src/MD5Engine.cpp | 2 +- Foundation/src/Manifest.cpp | 2 +- Foundation/src/MemoryPool.cpp | 2 +- Foundation/src/Message.cpp | 2 +- Foundation/src/Mutex.cpp | 2 +- Foundation/src/Mutex_WIN32.cpp | 2 +- Foundation/src/NamedEvent.cpp | 2 +- Foundation/src/NamedEvent_UNIX.cpp | 42 +- Foundation/src/NamedEvent_VMS.cpp | 2 +- Foundation/src/NamedEvent_WIN32.cpp | 2 +- Foundation/src/NamedEvent_WIN32U.cpp | 2 +- Foundation/src/NamedMutex.cpp | 2 +- Foundation/src/NamedMutex_UNIX.cpp | 46 +- Foundation/src/NamedMutex_VMS.cpp | 2 +- Foundation/src/NamedMutex_WIN32.cpp | 2 +- Foundation/src/NamedMutex_WIN32U.cpp | 2 +- Foundation/src/NestedDiagnosticContext.cpp | 6 +- Foundation/src/Notification.cpp | 2 +- Foundation/src/NotificationQueue.cpp | 2 +- Foundation/src/NullChannel.cpp | 2 +- Foundation/src/NullStream.cpp | 2 +- Foundation/src/NumberFormatter.cpp | 2 +- Foundation/src/OpcomChannel.cpp | 2 +- Foundation/src/Path.cpp | 26 +- Foundation/src/Path_VMS.cpp | 2 +- Foundation/src/Path_WIN32.cpp | 16 +- Foundation/src/Path_WIN32U.cpp | 40 +- Foundation/src/Pipe.cpp | 2 +- Foundation/src/PipeImpl.cpp | 2 +- Foundation/src/PipeImpl_DUMMY.cpp | 2 +- Foundation/src/PipeImpl_POSIX.cpp | 2 +- Foundation/src/PipeImpl_WIN32.cpp | 2 +- Foundation/src/PipeStream.cpp | 2 +- Foundation/src/PriorityNotificationQueue.cpp | 6 +- Foundation/src/Process.cpp | 6 +- Foundation/src/Process_UNIX.cpp | 6 +- Foundation/src/Process_VMS.cpp | 6 +- Foundation/src/Process_VX.cpp | 6 +- Foundation/src/Process_WIN32.cpp | 20 +- Foundation/src/Process_WIN32U.cpp | 20 +- Foundation/src/Process_WINCE.cpp | 20 +- Foundation/src/PurgeStrategy.cpp | 2 +- Foundation/src/RWLock.cpp | 2 +- Foundation/src/RWLock_POSIX.cpp | 2 +- Foundation/src/RWLock_WIN32.cpp | 2 +- Foundation/src/Random.cpp | 2 +- Foundation/src/RandomStream.cpp | 2 +- Foundation/src/RefCountedObject.cpp | 2 +- Foundation/src/RegularExpression.cpp | 2 +- Foundation/src/RotateStrategy.cpp | 2 +- Foundation/src/Runnable.cpp | 2 +- Foundation/src/SHA1Engine.cpp | 2 +- Foundation/src/Semaphore.cpp | 2 +- Foundation/src/Semaphore_POSIX.cpp | 2 +- Foundation/src/Semaphore_WIN32.cpp | 2 +- Foundation/src/SharedLibrary.cpp | 10 +- Foundation/src/SharedLibrary_HPUX.cpp | 4 +- Foundation/src/SharedLibrary_UNIX.cpp | 24 +- Foundation/src/SharedLibrary_VMS.cpp | 4 +- Foundation/src/SharedLibrary_VX.cpp | 4 +- Foundation/src/SharedLibrary_WIN32.cpp | 4 +- Foundation/src/SharedLibrary_WIN32U.cpp | 4 +- Foundation/src/SharedMemory.cpp | 2 +- Foundation/src/SharedMemory_DUMMY.cpp | 2 +- Foundation/src/SharedMemory_POSIX.cpp | 24 +- Foundation/src/SharedMemory_WIN32.cpp | 2 +- Foundation/src/SignalHandler.cpp | 2 +- Foundation/src/SplitterChannel.cpp | 2 +- Foundation/src/Stopwatch.cpp | 2 +- Foundation/src/StreamChannel.cpp | 2 +- Foundation/src/StreamConverter.cpp | 2 +- Foundation/src/StreamTokenizer.cpp | 2 +- Foundation/src/String.cpp | 2 +- Foundation/src/StringTokenizer.cpp | 58 +-- Foundation/src/SynchronizedObject.cpp | 2 +- Foundation/src/SyslogChannel.cpp | 2 +- Foundation/src/Task.cpp | 2 +- Foundation/src/TaskManager.cpp | 2 +- Foundation/src/TaskNotification.cpp | 2 +- Foundation/src/TeeStream.cpp | 2 +- Foundation/src/TemporaryFile.cpp | 38 +- Foundation/src/TextEncoding.cpp | 24 +- Foundation/src/TextIterator.cpp | 2 +- Foundation/src/ThreadLocal.cpp | 2 +- Foundation/src/ThreadPool.cpp | 2 +- Foundation/src/Thread_POSIX.cpp | 14 +- Foundation/src/Thread_WIN32.cpp | 12 +- Foundation/src/TimedNotificationQueue.cpp | 406 +++++++++--------- Foundation/src/Timer.cpp | 2 +- Foundation/src/Timespan.cpp | 2 +- Foundation/src/Timezone_UNIX.cpp | 16 +- Foundation/src/Timezone_VX.cpp | 12 +- Foundation/src/URI.cpp | 158 +++---- Foundation/src/URIStreamFactory.cpp | 2 +- Foundation/src/UTF16Encoding.cpp | 2 +- Foundation/src/UTF8Encoding.cpp | 2 +- Foundation/src/UUID.cpp | 2 +- Foundation/src/Unicode.cpp | 154 +++---- Foundation/src/Void.cpp | 2 +- Foundation/src/compress.c | 2 +- Foundation/src/crc32.c | 2 +- Foundation/src/deflate.c | 2 +- Foundation/src/deflate.h | 2 +- Net/CMakeLists.txt | 1 - 412 files changed, 3564 insertions(+), 3634 deletions(-) diff --git a/Foundation/include/Poco/AbstractDelegate.h b/Foundation/include/Poco/AbstractDelegate.h index d63a8ce59..08ceb4162 100644 --- a/Foundation/include/Poco/AbstractDelegate.h +++ b/Foundation/include/Poco/AbstractDelegate.h @@ -1,7 +1,7 @@ // // AbstractDelegate.h // -// $Id: //poco/1.4/Foundation/include/Poco/AbstractDelegate.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/AbstractDelegate.h#4 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the AbstractDelegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -48,45 +48,41 @@ namespace Poco { template class AbstractDelegate - /// Interface for Delegate and Expire - /// Very similar to AbstractPriorityDelegate but having two separate files (no inheritance) - /// allows one to have compile-time checks when registering an observer - /// instead of run-time checks. + /// Base class for Delegate and Expire. { public: - AbstractDelegate(void* pTarget): _pTarget(pTarget) + AbstractDelegate() + { + } + + AbstractDelegate(const AbstractDelegate& del) + { + } + + virtual ~AbstractDelegate() { - poco_assert_dbg (_pTarget != 0); - } + } - AbstractDelegate(const AbstractDelegate& del): _pTarget(del._pTarget) - { - poco_assert_dbg (_pTarget != 0); - } + virtual bool notify(const void* sender, TArgs& arguments) = 0; + /// Invokes the delegate's callback function. + /// Returns true if successful, or false if the delegate + /// has been disabled or has expired. - virtual ~AbstractDelegate() - { - } + virtual bool equals(const AbstractDelegate& other) const = 0; + /// Compares the AbstractDelegate with the other one for equality. - virtual bool notify(const void* sender, TArgs& arguments) = 0; - /// Returns false, if the Delegate is no longer valid, thus indicating an expire. + virtual AbstractDelegate* clone() const = 0; + /// Returns a deep copy of the AbstractDelegate. - virtual AbstractDelegate* clone() const = 0; - /// Returns a deep-copy of the AbstractDelegate - - bool operator < (const AbstractDelegate& other) const - /// For comparing AbstractDelegates in a collection. - { - return _pTarget < other._pTarget; - } - - void* target() const - { - return _pTarget; - } - -protected: - void* _pTarget; + virtual void disable() = 0; + /// Disables the delegate, which is done prior to removal. + + virtual const AbstractDelegate* unwrap() const + /// Returns the unwrapped delegate. Must be overridden by decorators + /// like Expire. + { + return this; + } }; diff --git a/Foundation/include/Poco/AbstractEvent.h b/Foundation/include/Poco/AbstractEvent.h index 0761e07b7..38a51518f 100644 --- a/Foundation/include/Poco/AbstractEvent.h +++ b/Foundation/include/Poco/AbstractEvent.h @@ -1,7 +1,7 @@ // // AbstractEvent.h // -// $Id: //poco/1.4/Foundation/include/Poco/AbstractEvent.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/AbstractEvent.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Definition of the AbstractEvent class. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -53,74 +53,88 @@ namespace Poco { template class AbstractEvent - /// An AbstractEvent is the super-class of all events. - /// It works similar to the way C# handles notifications (aka events in C#). - /// Events can be used to send information to a set of observers - /// which are registered at the event. The type of the data is specified with - /// the template parameter TArgs. The TStrategy parameter must be a subclass - /// of NotificationStrategy. The parameter TDelegate can either be a subclass of AbstractDelegate - /// or of PriorityAbstractDelegate. - /// - /// Note that AbstractEvent should never be used directly. One ought to use - /// one of its subclasses which set the TStrategy and TDelegate template parameters - /// to fixed values. For most use-cases the BasicEvent template will be sufficient: - /// #include "Poco/BasicEvent.h" - /// #include "Poco/Delegate.h" - /// - /// If one requires delegates to be called in the order they registered, use FIFOEvent: - /// #include "Poco/FIFOEvent.h" - /// #include "Poco/Delegate.h" - /// - /// Both FIFOEvent and BasicEvent work with a standard delegate. They allow one object to register - /// exactly one delegate at an event. In contrast, a PriorityDelegate comes with an attached priority value - /// and allows one object to register for one priority value one delegate. Note that PriorityDelegates - /// only work with PriorityEvents: - /// #include "Poco/PriorityEvent.h" - /// #include "Poco/PriorityDelegate.h" - /// + /// An AbstractEvent is the base class of all events. + /// It works similar to the way C# handles notifications (aka events in C#). + /// + /// Events can be used to send information to a set of delegates + /// which are registered with the event. The type of the data is specified with + /// the template parameter TArgs. The TStrategy parameter must be a subclass + /// of NotificationStrategy. The parameter TDelegate can either be a subclass of AbstractDelegate + /// or of AbstractPriorityDelegate. + /// + /// Note that AbstractEvent should never be used directly. One ought to use + /// one of its subclasses which set the TStrategy and TDelegate template parameters + /// to fixed values. For most use-cases the BasicEvent template will be sufficient: + /// + /// #include "Poco/BasicEvent.h" + /// #include "Poco/Delegate.h" + /// + /// Note that as of release 1.4.2, the behavior of BasicEvent equals that of FIFOEvent, + /// so the FIFOEvent class is no longer necessary and provided for backwards compatibility + /// only. + /// + /// BasicEvent works with a standard delegate. They allow one object to register + /// onr or more delegates with an event. In contrast, a PriorityDelegate comes with an attached priority value + /// and allows one object to register for one priority value one or more delegates. Note that PriorityDelegates + /// only work with PriorityEvents: + /// + /// #include "Poco/PriorityEvent.h" + /// #include "Poco/PriorityDelegate.h" + /// /// Use events by adding them as public members to the object which is throwing notifications: /// - /// class MyData - /// { - /// public: - /// Poco::BasicEvent AgeChanged; - /// - /// MyData(); - /// ... - /// }; - /// - /// Throwing the event can be done either by the events notify() or notifyAsync() method: - /// - /// - /// Alternatively, instead of notify(), operator () can be used. - /// - /// void MyData::setAge(int i) - /// { - /// this->_age = i; - /// AgeChanged(this, this->_age); - /// } - /// - /// Note that notify and notifyAsync do not catch exceptions, i.e. in case a delegate - /// throws an exception, the notify is immediately aborted and the exception is thrown - /// back to the caller. - /// - /// Delegates can register methods at the event. In the case of a BasicEvent or FIFOEvent - /// the Delegate template is used, in case of an PriorityEvent a PriorityDelegate is used. - /// Mixing of observers, e.g. using a PriorityDelegate with a BasicEvent is not possible and - /// checked for during compile time. - /// Events require the observers to follow one of the following method signature: - /// - /// void onEvent(const void* pSender, TArgs& args); - /// void onEvent(TArgs& args); + /// class MyData + /// { + /// public: + /// Poco::BasicEvent dataChanged; + /// + /// MyData(); + /// ... + /// void setData(int i); + /// ... + /// private: + /// int _data; + /// }; + /// + /// Firing the event is done either by calling the event's notify() or notifyAsync() method: + /// + /// void MyData::setData(int i) + /// { + /// this->_data = i; + /// dataChanged.notify(this, this->_data); + /// } + /// + /// Alternatively, instead of notify(), operator () can be used. + /// + /// void MyData::setData(int i) + /// { + /// this->_data = i; + /// dataChanged(this, this->_data); + /// } + /// + /// Note that operator (), notify() and notifyAsync() do not catch exceptions, i.e. in case a + /// delegate throws an exception, notifying is immediately aborted and the exception is propagated + /// back to the caller. + /// + /// Delegates can register methods at the event. In the case of a BasicEvent + /// the Delegate template is used, in case of an PriorityEvent a PriorityDelegate is used. + /// Mixing of delegates, e.g. using a PriorityDelegate with a BasicEvent is not allowed and + /// can lead to compile-time and/or run-time errors. The standalone delegate() functions + /// can be used to construct Delegate objects. + /// + /// Events require the observers to have one of the following method signatures: + /// + /// void onEvent(const void* pSender, TArgs& args); + /// void onEvent(TArgs& args); /// static void onEvent(const void* pSender, TArgs& args); /// static void onEvent(void* pSender, TArgs& args); - /// static void onEvent(TArgs& args); - /// - /// For performance reasons arguments are always sent by reference. This also allows observers - /// to modify the sent argument. To prevent that, use as template - /// parameter. A non-conformant method signature leads to compile errors. - /// - /// Assuming that the observer meets the method signature requirement, it can register + /// static void onEvent(TArgs& args); + /// + /// For performance reasons arguments are always sent by reference. This also allows observers + /// to modify the event argument. To prevent that, use <[const TArg]> as template + /// parameter. A non-conformant method signature leads to compile errors. + /// + /// Assuming that the observer meets the method signature requirement, it can register /// this method with the += operator: /// /// class MyController @@ -131,34 +145,33 @@ class AbstractEvent /// void onDataChanged(void* pSender, int& data); /// ... /// }; - /// - /// MyController::MyController() - /// { - /// _data.AgeChanged += delegate(this, &MyController::onDataChanged); - /// } - /// - /// In some cases it might be desirable to work with automatically expiring registrations. Simply add - /// to delegate as 3rd parameter a expireValue (in milliseconds): - /// - /// _data.DataChanged += delegate(this, &MyController::onDataChanged, 1000); - /// - /// This will add a delegate to the event which will automatically be removed in 1000 millisecs. - /// + /// + /// MyController::MyController() + /// { + /// _data.dataChanged += delegate(this, &MyController::onDataChanged); + /// } + /// + /// In some cases it might be desirable to work with automatically expiring registrations. Simply add + /// to delegate as 3rd parameter a expireValue (in milliseconds): + /// + /// _data.dataChanged += delegate(this, &MyController::onDataChanged, 1000); + /// + /// This will add a delegate to the event which will automatically be removed in 1000 millisecs. + /// /// Unregistering happens via the -= operator. Forgetting to unregister a method will lead to /// segmentation faults later, when one tries to send a notify to a no longer existing object. - /// - /// MyController::~MyController() - /// { - /// _data.DataChanged -= delegate(this, &MyController::onDataChanged); - /// } - /// - /// Working with PriorityDelegates as similar to working with BasicEvent/FIFOEvent.Instead of ''delegate'' - /// simply use ''priorityDelegate''. - /// - /// For further examples refer to the event testsuites. + /// + /// MyController::~MyController() + /// { + /// _data.dataChanged -= delegate(this, &MyController::onDataChanged); + /// } + /// + /// Working with PriorityDelegate's as similar to working with BasicEvent. + /// Instead of delegate(), the priorityDelegate() function must be used + /// to create the PriorityDelegate. { public: - AbstractEvent(): + AbstractEvent(): _executeAsync(this, &AbstractEvent::executeAsyncImpl), _enabled(true) { @@ -173,44 +186,51 @@ public: virtual ~AbstractEvent() { - } + } - void operator += (const TDelegate& aDelegate) - /// Adds a delegate to the event. If the observer is equal to an - /// already existing one (determined by the < operator), - /// it will simply replace the existing observer. - /// This behavior is determined by the TStrategy. Current implementations - /// (DefaultStrategy, FIFOStrategy) follow that guideline but future ones - /// can deviate. - { - typename TMutex::ScopedLock lock(_mutex); - _strategy.add(aDelegate); - } - - void operator -= (const TDelegate& aDelegate) - /// Removes a delegate from the event. If the delegate is equal to an - /// already existing one is determined by the < operator. - /// If the observer is not found, the unregister will be ignored - { - typename TMutex::ScopedLock lock(_mutex); - _strategy.remove(aDelegate); - } - - void operator () (const void* pSender, TArgs& args) - { - notify(pSender, args); - } + void operator += (const TDelegate& aDelegate) + /// Adds a delegate to the event. + /// + /// Exact behavior is determined by the TStrategy. + { + typename TMutex::ScopedLock lock(_mutex); + _strategy.add(aDelegate); + } + + void operator -= (const TDelegate& aDelegate) + /// Removes a delegate from the event. + /// + /// If the delegate is not found, this function does nothing. + { + typename TMutex::ScopedLock lock(_mutex); + _strategy.remove(aDelegate); + } + + void operator () (const void* pSender, TArgs& args) + /// Shortcut for notify(pSender, args); + { + notify(pSender, args); + } + + void operator () (TArgs& args) + /// Shortcut for notify(args). + { + notify(0, args); + } - void notify(const void* pSender, TArgs& args) - /// Sends a notification to all registered delegates. The order is - /// determined by the TStrategy. This method is blocking. While executing, - /// other objects can change the list of delegates. These changes don't - /// influence the current active notifications but are activated with - /// the next notify. If one of the delegates throws an exception, the notify - /// method is immediately aborted and the exception is reported to the caller. - { - Poco::ScopedLockWithUnlock lock(_mutex); - + void notify(const void* pSender, TArgs& args) + /// Sends a notification to all registered delegates. The order is + /// determined by the TStrategy. This method is blocking. While executing, + /// the list of delegates may be modified. These changes don't + /// influence the current active notifications but are activated with + /// the next notify. If a delegate is removed during a notify(), the + /// delegate will no longer be invoked (unless it has already been + /// invoked prior to removal). If one of the delegates throws an exception, + /// the notify method is immediately aborted and the exception is propagated + /// to the caller. + { + Poco::ScopedLockWithUnlock lock(_mutex); + if (!_enabled) return; // thread-safeness: @@ -225,16 +245,17 @@ public: /// Sends a notification to all registered delegates. The order is /// determined by the TStrategy. This method is not blocking and will /// immediately return. The delegates are invoked in a seperate thread. - /// Call activeResult.wait() to wait until the notification has ended. - /// While executing, other objects can change the delegate list. These changes don't - /// influence the current active notifications but are activated with - /// the next notify. If one of the delegates throws an exception, the execution - /// is aborted and the exception is reported to the caller. - { - NotifyAsyncParams params(pSender, args); - - { - typename TMutex::ScopedLock lock(_mutex); + /// Call activeResult.wait() to wait until the notification has ended. + /// While executing, other objects can change the delegate list. These changes don't + /// influence the current active notifications but are activated with + /// the next notify. If a delegate is removed during a notify(), the + /// delegate will no longer be invoked (unless it has already been + /// invoked prior to removal). If one of the delegates throws an exception, + /// the execution is aborted and the exception is propagated to the caller. + { + NotifyAsyncParams params(pSender, args); + { + typename TMutex::ScopedLock lock(_mutex); // thread-safeness: // copy should be faster and safer than blocking until @@ -245,7 +266,6 @@ public: params.ptrStrat = SharedPtr(new TStrategy(_strategy)); params.enabled = _enabled; } - ActiveResult result = _executeAsync(params); return result; } @@ -291,13 +311,13 @@ protected: SharedPtr ptrStrat; const void* pSender; TArgs args; - bool enabled; - - NotifyAsyncParams(const void* pSend, const TArgs& a):ptrStrat(), pSender(pSend), args(a), enabled(true) - /// default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed. - { - } - }; + bool enabled; + + NotifyAsyncParams(const void* pSend, const TArgs& a):ptrStrat(), pSender(pSend), args(a), enabled(true) + /// Default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed. + { + } + }; ActiveMethod _executeAsync; diff --git a/Foundation/include/Poco/AbstractObserver.h b/Foundation/include/Poco/AbstractObserver.h index 3d26baeb9..21ab708dd 100644 --- a/Foundation/include/Poco/AbstractObserver.h +++ b/Foundation/include/Poco/AbstractObserver.h @@ -1,7 +1,7 @@ // // AbstractObserver.h // -// $Id: //poco/svn/Foundation/include/Poco/AbstractObserver.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/AbstractObserver.h#2 $ // // Library: Foundation // Package: Notifications @@ -59,10 +59,10 @@ public: AbstractObserver& operator = (const AbstractObserver& observer); virtual void notify(Notification* pNf) const = 0; - virtual bool equals(const AbstractObserver& observer) const = 0; - virtual bool accepts(Notification* pNf) const = 0; - virtual AbstractObserver* clone() const = 0; - virtual void disable() = 0; + virtual bool equals(const AbstractObserver& observer) const = 0; + virtual bool accepts(Notification* pNf) const = 0; + virtual AbstractObserver* clone() const = 0; + virtual void disable() = 0; }; diff --git a/Foundation/include/Poco/AbstractPriorityDelegate.h b/Foundation/include/Poco/AbstractPriorityDelegate.h index f4f99f335..7abef98e9 100644 --- a/Foundation/include/Poco/AbstractPriorityDelegate.h +++ b/Foundation/include/Poco/AbstractPriorityDelegate.h @@ -1,7 +1,7 @@ // // AbstractPriorityDelegate.h // -// $Id: //poco/1.4/Foundation/include/Poco/AbstractPriorityDelegate.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/AbstractPriorityDelegate.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the AbstractPriorityDelegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -41,65 +41,41 @@ #include "Poco/Foundation.h" +#include "Poco/AbstractDelegate.h" namespace Poco { template -class AbstractPriorityDelegate - /// Interface for PriorityDelegate and PriorityExpire. - /// Very similar to AbstractDelegate but having two separate files (no inheritance) - /// allows to have compile-time checks when registering an observer - /// instead of run-time checks. +class AbstractPriorityDelegate: public AbstractDelegate + /// Base class for PriorityDelegate and PriorityExpire. + /// + /// Extends AbstractDelegate with a priority value. { public: - AbstractPriorityDelegate(void* pTarget, int prio): - _pTarget(pTarget), - _priority(prio) - { - } + AbstractPriorityDelegate(int prio): + _priority(prio) + { + } - AbstractPriorityDelegate(const AbstractPriorityDelegate& del): - _pTarget(del._pTarget), - _priority(del._priority) - { - } + AbstractPriorityDelegate(const AbstractPriorityDelegate& del): + AbstractDelegate(del), + _priority(del._priority) + { + } virtual ~AbstractPriorityDelegate() - { - } + { + } - virtual bool notify(const void* sender, TArgs & arguments) = 0; - /// Returns false, if the Delegate is no longer valid, thus indicating an expire - - virtual AbstractPriorityDelegate* clone() const = 0; - // Returns a deep-copy of the object. - - bool operator < (const AbstractPriorityDelegate& other) const - /// Operator used for comparing AbstractPriorityDelegates in a collection. - { - if (_priority == other._priority) - { - return _pTarget < other._pTarget; - } - - return (_priority < other._priority); - } - - void* target() const - { - return _pTarget; - } - - int priority() const - { - return _priority; - } + int priority() const + { + return _priority; + } protected: - void* _pTarget; - int _priority; + int _priority; }; diff --git a/Foundation/include/Poco/AccessExpirationDecorator.h b/Foundation/include/Poco/AccessExpirationDecorator.h index a8b9a5254..a4b8399c3 100644 --- a/Foundation/include/Poco/AccessExpirationDecorator.h +++ b/Foundation/include/Poco/AccessExpirationDecorator.h @@ -1,7 +1,7 @@ // // AccessExpirationDecorator.h // -// $Id: //poco/1.4/Foundation/include/Poco/AccessExpirationDecorator.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/AccessExpirationDecorator.h#2 $ // // Library: Foundation // Package: Cache diff --git a/Foundation/include/Poco/ActiveDispatcher.h b/Foundation/include/Poco/ActiveDispatcher.h index eab2e3ad6..772c854b0 100644 --- a/Foundation/include/Poco/ActiveDispatcher.h +++ b/Foundation/include/Poco/ActiveDispatcher.h @@ -1,7 +1,7 @@ // // ActiveDispatcher.h // -// $Id: //poco/svn/Foundation/include/Poco/ActiveDispatcher.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ActiveDispatcher.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/ActiveResult.h b/Foundation/include/Poco/ActiveResult.h index 4ec456c34..bafaa9f67 100644 --- a/Foundation/include/Poco/ActiveResult.h +++ b/Foundation/include/Poco/ActiveResult.h @@ -1,7 +1,7 @@ // // ActiveResult.h // -// $Id: //poco/svn/Foundation/include/Poco/ActiveResult.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ActiveResult.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/ActiveRunnable.h b/Foundation/include/Poco/ActiveRunnable.h index a92bf0a73..228ff5189 100644 --- a/Foundation/include/Poco/ActiveRunnable.h +++ b/Foundation/include/Poco/ActiveRunnable.h @@ -1,7 +1,7 @@ // // ActiveRunnable.h // -// $Id: //poco/svn/Foundation/include/Poco/ActiveRunnable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ActiveRunnable.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/ActiveStarter.h b/Foundation/include/Poco/ActiveStarter.h index b48f2c2a2..ff036c766 100644 --- a/Foundation/include/Poco/ActiveStarter.h +++ b/Foundation/include/Poco/ActiveStarter.h @@ -1,7 +1,7 @@ // // ActiveStarter.h // -// $Id: //poco/svn/Foundation/include/Poco/ActiveStarter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ActiveStarter.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Activity.h b/Foundation/include/Poco/Activity.h index 66d05eec3..66c80d9ae 100644 --- a/Foundation/include/Poco/Activity.h +++ b/Foundation/include/Poco/Activity.h @@ -1,7 +1,7 @@ // // Activity.h // -// $Id: //poco/svn/Foundation/include/Poco/Activity.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Activity.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Any.h b/Foundation/include/Poco/Any.h index a9d2ce2b0..7bb96eff3 100644 --- a/Foundation/include/Poco/Any.h +++ b/Foundation/include/Poco/Any.h @@ -1,7 +1,7 @@ // // Any.h // -// $Id: //poco/svn/Foundation/include/Poco/Any.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Any.h#1 $ // // Library: Foundation // Package: Core @@ -54,151 +54,151 @@ class Any /// by Applied Informatics. { public: - Any(): + Any(): _content(0) /// Creates an empty any type. - { - } + { + } - template - Any(const ValueType& value): + template + Any(const ValueType& value): _content(new Holder(value)) /// Creates an any which stores the init parameter inside. /// /// Example: - /// Any a(13); - /// Any a(string("12345")); - { - } + /// Any a(13); + /// Any a(string("12345")); + { + } - Any(const Any& other): + Any(const Any& other): _content(other._content ? other._content->clone() : 0) /// Copy constructor, works with empty Anys and initialized Any values. - { - } + { + } - ~Any() - { - delete _content; - } + ~Any() + { + delete _content; + } - Any& swap(Any& rhs) + Any& swap(Any& rhs) /// Swaps the content of the two Anys. - { - std::swap(_content, rhs._content); - return *this; - } + { + std::swap(_content, rhs._content); + return *this; + } - template - Any& operator = (const ValueType& rhs) + template + Any& operator = (const ValueType& rhs) /// Assignment operator for all types != Any. /// /// Example: - /// Any a = 13; - /// Any a = string("12345"); - { - Any(rhs).swap(*this); - return *this; - } + /// Any a = 13; + /// Any a = string("12345"); + { + Any(rhs).swap(*this); + return *this; + } - Any& operator = (const Any& rhs) + Any& operator = (const Any& rhs) /// Assignment operator for Any. - { - Any(rhs).swap(*this); - return *this; - } + { + Any(rhs).swap(*this); + return *this; + } - bool empty() const + bool empty() const /// returns true if the Any is empty - { - return !_content; - } + { + return !_content; + } - const std::type_info& type() const + const std::type_info& type() const /// Returns the type information of the stored content. /// If the Any is empty typeid(void) is returned. /// It is suggested to always query an Any for its type info before trying to extract /// data via an AnyCast/RefAnyCast. - { - return _content ? _content->type() : typeid(void); - } + { + return _content ? _content->type() : typeid(void); + } private: - class Placeholder - { - public: - virtual ~Placeholder() - { - } + class Placeholder + { + public: + virtual ~Placeholder() + { + } - virtual const std::type_info& type() const = 0; - virtual Placeholder* clone() const = 0; - }; + virtual const std::type_info& type() const = 0; + virtual Placeholder* clone() const = 0; + }; - template - class Holder: public Placeholder - { - public: - Holder(const ValueType& value): + template + class Holder: public Placeholder + { + public: + Holder(const ValueType& value): _held(value) - { - } + { + } - virtual const std::type_info& type() const - { - return typeid(ValueType); - } + virtual const std::type_info& type() const + { + return typeid(ValueType); + } - virtual Placeholder* clone() const - { - return new Holder(_held); - } + virtual Placeholder* clone() const + { + return new Holder(_held); + } - ValueType _held; - }; + ValueType _held; + }; private: - template - friend ValueType* AnyCast(Any*); + template + friend ValueType* AnyCast(Any*); - template - friend ValueType* UnsafeAnyCast(Any*); + template + friend ValueType* UnsafeAnyCast(Any*); - template - friend ValueType& RefAnyCast(Any&); + template + friend ValueType& RefAnyCast(Any&); - template - friend const ValueType& RefAnyCast(const Any&); + template + friend const ValueType& RefAnyCast(const Any&); - Placeholder* _content; + Placeholder* _content; }; template inline ValueType* AnyCast(Any* operand) - /// AnyCast operator used to extract the ValueType from an Any*. Will return a pointer - /// to the stored value. - /// + /// AnyCast operator used to extract the ValueType from an Any*. Will return a pointer + /// to the stored value. + /// /// Example Usage: - /// MyType* pTmp = AnyCast(pAny). + /// MyType* pTmp = AnyCast(pAny). /// Will return NULL if the cast fails, i.e. types don't match. { - return operand && operand->type() == typeid(ValueType) - ? &static_cast*>(operand->_content)->_held - : 0; + return operand && operand->type() == typeid(ValueType) + ? &static_cast*>(operand->_content)->_held + : 0; } template inline const ValueType* AnyCast(const Any* operand) - /// AnyCast operator used to extract a const ValueType pointer from an const Any*. Will return a const pointer - /// to the stored value. - /// + /// AnyCast operator used to extract a const ValueType pointer from an const Any*. Will return a const pointer + /// to the stored value. + /// /// Example Usage: - /// const MyType* pTmp = AnyCast(pAny). + /// const MyType* pTmp = AnyCast(pAny). /// Will return NULL if the cast fails, i.e. types don't match. { - return AnyCast(const_cast(operand)); + return AnyCast(const_cast(operand)); } @@ -207,16 +207,16 @@ ValueType AnyCast(const Any& operand) /// AnyCast operator used to extract a copy of the ValueType from an const Any&. /// /// Example Usage: - /// MyType tmp = AnyCast(anAny). + /// MyType tmp = AnyCast(anAny). /// Will throw a BadCastException if the cast fails. /// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& = ... /// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in - /// these cases. + /// these cases. { - ValueType* result = AnyCast(const_cast(&operand)); - if (!result) - throw BadCastException("Failed to convert between const Any types"); - return *result; + ValueType* result = AnyCast(const_cast(&operand)); + if (!result) + throw BadCastException("Failed to convert between const Any types"); + return *result; } @@ -225,30 +225,30 @@ ValueType AnyCast(Any& operand) /// AnyCast operator used to extract a copy of the ValueType from an Any&. /// /// Example Usage: - /// MyType tmp = AnyCast(anAny). + /// MyType tmp = AnyCast(anAny). /// Will throw a BadCastException if the cast fails. /// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ... /// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in - /// these cases. + /// these cases. { - ValueType* result = AnyCast(&operand); - if (!result) - throw BadCastException("Failed to convert between Any types"); - return *result; + ValueType* result = AnyCast(&operand); + if (!result) + throw BadCastException("Failed to convert between Any types"); + return *result; } template -const ValueType& RefAnyCast(const Any& operand) +const ValueType& RefAnyCast(const Any & operand) /// AnyCast operator used to return a const reference to the internal data. /// - /// Example Usage: - /// const MyType& tmp = RefAnyCast(anAny); + /// Example Usage: + /// const MyType& tmp = RefAnyCast(anAny); { - if (operand.type() == typeid(ValueType)) - return static_cast*>(operand._content)->_held; - else - throw BadCastException("RefAnyCast: Failed to convert between const Any types"); + if (operand.type() == typeid(ValueType)) + return static_cast*>(operand._content)->_held; + else + throw BadCastException("RefAnyCast: Failed to convert between const Any types"); } @@ -256,37 +256,37 @@ template ValueType& RefAnyCast(Any& operand) /// AnyCast operator used to return a reference to the internal data. /// - /// Example Usage: - /// MyType& tmp = RefAnyCast(anAny); + /// Example Usage: + /// MyType& tmp = RefAnyCast(anAny); { - if (operand.type() == typeid(ValueType)) - return static_cast*>(operand._content)->_held; - else - throw BadCastException("RefAnyCast: Failed to convert between Any types"); + if (operand.type() == typeid(ValueType)) + return static_cast*>(operand._content)->_held; + else + throw BadCastException("RefAnyCast: Failed to convert between Any types"); } template inline ValueType* UnsafeAnyCast(Any* operand) - /// The "unsafe" versions of AnyCast are not part of the - /// public interface and may be removed at any time. They are - /// required where we know what type is stored in the any and can't + /// The "unsafe" versions of AnyCast are not part of the + /// public interface and may be removed at any time. They are + /// required where we know what type is stored in the any and can't /// use typeid() comparison, e.g., when our types may travel across /// different shared libraries. { - return &static_cast*>(operand->_content)->_held; + return &static_cast*>(operand->_content)->_held; } template inline const ValueType* UnsafeAnyCast(const Any* operand) - /// The "unsafe" versions of AnyCast are not part of the - /// public interface and may be removed at any time. They are - /// required where we know what type is stored in the any and can't + /// The "unsafe" versions of AnyCast are not part of the + /// public interface and may be removed at any time. They are + /// required where we know what type is stored in the any and can't /// use typeid() comparison, e.g., when our types may travel across /// different shared libraries. { - return AnyCast(const_cast(operand)); + return AnyCast(const_cast(operand)); } diff --git a/Foundation/include/Poco/ArchiveStrategy.h b/Foundation/include/Poco/ArchiveStrategy.h index b723c5cfd..681aa15cd 100644 --- a/Foundation/include/Poco/ArchiveStrategy.h +++ b/Foundation/include/Poco/ArchiveStrategy.h @@ -1,7 +1,7 @@ // // ArchiveStrategy.h // -// $Id: //poco/Main/Foundation/include/Poco/ArchiveStrategy.h#5 $ +// $Id: //poco/1.4/Foundation/include/Poco/ArchiveStrategy.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/AsyncChannel.h b/Foundation/include/Poco/AsyncChannel.h index 976e8097d..9ce5f2384 100644 --- a/Foundation/include/Poco/AsyncChannel.h +++ b/Foundation/include/Poco/AsyncChannel.h @@ -1,7 +1,7 @@ // // AsyncChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/AsyncChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/AsyncChannel.h#2 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/AutoPtr.h b/Foundation/include/Poco/AutoPtr.h index 26001039d..c349623cf 100644 --- a/Foundation/include/Poco/AutoPtr.h +++ b/Foundation/include/Poco/AutoPtr.h @@ -1,7 +1,7 @@ // // AutoPtr.h // -// $Id: //poco/svn/Foundation/include/Poco/AutoPtr.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/AutoPtr.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/AutoReleasePool.h b/Foundation/include/Poco/AutoReleasePool.h index 442b2f957..26faf734b 100644 --- a/Foundation/include/Poco/AutoReleasePool.h +++ b/Foundation/include/Poco/AutoReleasePool.h @@ -1,7 +1,7 @@ // // AutoReleasePool.h // -// $Id: //poco/svn/Foundation/include/Poco/AutoReleasePool.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/AutoReleasePool.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Base64Decoder.h b/Foundation/include/Poco/Base64Decoder.h index cc59c3ee7..1625ee1ef 100644 --- a/Foundation/include/Poco/Base64Decoder.h +++ b/Foundation/include/Poco/Base64Decoder.h @@ -1,7 +1,7 @@ // // Base64Decoder.h // -// $Id: //poco/svn/Foundation/include/Poco/Base64Decoder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Base64Decoder.h#2 $ // // Library: Foundation // Package: Streams @@ -49,30 +49,30 @@ namespace Poco { class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf - /// This streambuf base64-decodes all data read - /// from the istream connected to it. - /// - /// Note: For performance reasons, the characters - /// are read directly from the given istream's - /// underlying streambuf, so the state - /// of the istream will not reflect that of - /// its streambuf. + /// This streambuf base64-decodes all data read + /// from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. { public: - Base64DecoderBuf(std::istream& istr); + Base64DecoderBuf(std::istream& istr); ~Base64DecoderBuf(); private: int readFromDevice(); int readOne(); - unsigned char _group[3]; - int _groupLength; - int _groupIndex; - std::streambuf& _buf; - - static unsigned char IN_ENCODING[256]; - static bool IN_ENCODING_INIT; + unsigned char _group[3]; + int _groupLength; + int _groupIndex; + std::streambuf& _buf; + + static unsigned char IN_ENCODING[256]; + static bool IN_ENCODING_INIT; private: Base64DecoderBuf(const Base64DecoderBuf&); @@ -101,17 +101,17 @@ private: class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream - /// This istream base64-decodes all data - /// read from the istream connected to it. - /// - /// Note: For performance reasons, the characters - /// are read directly from the given istream's - /// underlying streambuf, so the state - /// of the istream will not reflect that of - /// its streambuf. + /// This istream base64-decodes all data + /// read from the istream connected to it. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. { public: - Base64Decoder(std::istream& istr); + Base64Decoder(std::istream& istr); ~Base64Decoder(); private: diff --git a/Foundation/include/Poco/Base64Encoder.h b/Foundation/include/Poco/Base64Encoder.h index 569773c39..3e75a90fd 100644 --- a/Foundation/include/Poco/Base64Encoder.h +++ b/Foundation/include/Poco/Base64Encoder.h @@ -1,7 +1,7 @@ // // Base64Encoder.h // -// $Id: //poco/svn/Foundation/include/Poco/Base64Encoder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Base64Encoder.h#2 $ // // Library: Foundation // Package: Streams @@ -49,17 +49,17 @@ namespace Poco { class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf - /// This streambuf base64-encodes all data written - /// to it and forwards it to a connected - /// ostream. - /// - /// Note: The characters are directly written - /// to the ostream's streambuf, thus bypassing - /// the ostream. The ostream's state is therefore - /// not updated to match the buffer's state. + /// This streambuf base64-encodes all data written + /// to it and forwards it to a connected + /// ostream. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. { public: - Base64EncoderBuf(std::ostream& ostr); + Base64EncoderBuf(std::ostream& ostr); ~Base64EncoderBuf(); int close(); @@ -80,13 +80,13 @@ private: int writeToDevice(char c); unsigned char _group[3]; - int _groupLength; - int _pos; - int _lineLength; - std::streambuf& _buf; - - static const unsigned char OUT_ENCODING[64]; - + int _groupLength; + int _pos; + int _lineLength; + std::streambuf& _buf; + + static const unsigned char OUT_ENCODING[64]; + friend class Base64DecoderBuf; Base64EncoderBuf(const Base64EncoderBuf&); @@ -119,17 +119,17 @@ class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream /// This ostream base64-encodes all data /// written to it and forwards it to /// a connected ostream. - /// Always call close() when done - /// writing data, to ensure proper - /// completion of the encoding operation. - /// - /// Note: The characters are directly written - /// to the ostream's streambuf, thus bypassing - /// the ostream. The ostream's state is therefore - /// not updated to match the buffer's state. + /// Always call close() when done + /// writing data, to ensure proper + /// completion of the encoding operation. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. { public: - Base64Encoder(std::ostream& ostr); + Base64Encoder(std::ostream& ostr); ~Base64Encoder(); private: diff --git a/Foundation/include/Poco/BasicEvent.h b/Foundation/include/Poco/BasicEvent.h index 02c2bc1eb..4c4362acc 100644 --- a/Foundation/include/Poco/BasicEvent.h +++ b/Foundation/include/Poco/BasicEvent.h @@ -1,7 +1,7 @@ // // BasicEvent.h // -// $Id: //poco/svn/Foundation/include/Poco/BasicEvent.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/BasicEvent.h#2 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the BasicEvent template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,14 +36,14 @@ // -#ifndef Foundation_BasicEvent_INCLUDED -#define Foundation_BasicEvent_INCLUDED +#ifndef Foundation_BasicEvent_INCLUDED +#define Foundation_BasicEvent_INCLUDED #include "Poco/AbstractEvent.h" #include "Poco/DefaultStrategy.h" #include "Poco/AbstractDelegate.h" -#include "Poco/CompareFunctions.h" +#include "Poco/Mutex.h" namespace Poco { @@ -51,22 +51,15 @@ namespace Poco { template class BasicEvent: public AbstractEvent < - TArgs, DefaultStrategy, p_less > >, + TArgs, DefaultStrategy >, AbstractDelegate, TMutex > - /// A BasicEvent uses internally a DefaultStrategy which - /// invokes delegates in an arbitrary manner. - /// Note that one object can only register one method to a BasicEvent. - /// Subsequent registrations will overwrite the existing delegate. - /// For example: - /// BasicEvent event; - /// MyClass myObject; - /// event += delegate(&myObject, &MyClass::myMethod1); - /// event += delegate(&myObject, &MyClass::myMethod2); + /// A BasicEvent uses the DefaultStrategy which + /// invokes delegates in the order they have been registered. /// - /// The second registration will overwrite the first one. The reason is simply that - /// function pointers can only be compared by equality but not by lower than. + /// Please see the AbstractEvent class template documentation + /// for more information. { public: BasicEvent() @@ -86,4 +79,4 @@ private: } // namespace Poco -#endif +#endif // Foundation_BasicEvent_INCLUDED diff --git a/Foundation/include/Poco/BinaryReader.h b/Foundation/include/Poco/BinaryReader.h index f4a8dacf9..d30f7e763 100644 --- a/Foundation/include/Poco/BinaryReader.h +++ b/Foundation/include/Poco/BinaryReader.h @@ -1,7 +1,7 @@ // // BinaryReader.h // -// $Id: //poco/svn/Foundation/include/Poco/BinaryReader.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/BinaryReader.h#3 $ // // Library: Foundation // Package: Streams @@ -53,11 +53,11 @@ class TextConverter; class Foundation_API BinaryReader - /// This class reads basic types (and std::vectors thereof) - /// in binary form into an input stream. - /// It provides an extractor-based interface similar to istream. - /// The reader also supports automatic conversion from big-endian - /// (network byte order) to little-endian and vice-versa. + /// This class reads basic types (and std::vectors thereof) + /// in binary form into an input stream. + /// It provides an extractor-based interface similar to istream. + /// The reader also supports automatic conversion from big-endian + /// (network byte order) to little-endian and vice-versa. /// Use a BinaryWriter to create a stream suitable for a BinaryReader. { public: @@ -70,17 +70,17 @@ public: UNSPECIFIED_BYTE_ORDER = 4 /// unknown, byte-order will be determined by reading the byte-order mark }; - BinaryReader(std::istream& istr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); - /// Creates the BinaryReader. + BinaryReader(std::istream& istr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryReader. - BinaryReader(std::istream& istr, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); - /// Creates the BinaryReader using the given TextEncoding. - /// - /// Strings will be converted from the specified encoding - /// to the currently set global encoding (see Poco::TextEncoding::global()). + BinaryReader(std::istream& istr, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER); + /// Creates the BinaryReader using the given TextEncoding. + /// + /// Strings will be converted from the specified encoding + /// to the currently set global encoding (see Poco::TextEncoding::global()). - ~BinaryReader(); - /// Destroys the BinaryReader. + ~BinaryReader(); + /// Destroys the BinaryReader. BinaryReader& operator >> (bool& value); BinaryReader& operator >> (char& value); @@ -100,46 +100,46 @@ public: BinaryReader& operator >> (UInt64& value); #endif - BinaryReader& operator >> (std::string& value); + BinaryReader& operator >> (std::string& value); - template - BinaryReader& operator >> (std::vector& value) - { - Poco::UInt32 size(0); - T elem; + template + BinaryReader& operator >> (std::vector& value) + { + Poco::UInt32 size(0); + T elem; - *this >> size; - if (!good()) return *this; - value.reserve(size); - while (this->good() && size-- > 0) - { - *this >> elem; - value.push_back(elem); - } - return *this; - } + *this >> size; + if (!good()) return *this; + value.reserve(size); + while (this->good() && size-- > 0) + { + *this >> elem; + value.push_back(elem); + } + return *this; + } - void read7BitEncoded(UInt32& value); - /// Reads a 32-bit unsigned integer in compressed format. - /// See BinaryWriter::write7BitEncoded() for a description + void read7BitEncoded(UInt32& value); + /// Reads a 32-bit unsigned integer in compressed format. + /// See BinaryWriter::write7BitEncoded() for a description /// of the compression algorithm. #if defined(POCO_HAVE_INT64) void read7BitEncoded(UInt64& value); /// Reads a 64-bit unsigned integer in compressed format. /// See BinaryWriter::write7BitEncoded() for a description - /// of the compression algorithm. + /// of the compression algorithm. #endif - void readRaw(std::streamsize length, std::string& value); - /// Reads length bytes of raw data into value. + void readRaw(std::streamsize length, std::string& value); + /// Reads length bytes of raw data into value. - void readRaw(char* buffer, std::streamsize length); - /// Reads length bytes of raw data into buffer. + void readRaw(char* buffer, std::streamsize length); + /// Reads length bytes of raw data into buffer. - void readBOM(); - /// Reads a byte-order mark from the stream and configures - /// the reader for the encountered byte order. + void readBOM(); + /// Reads a byte-order mark from the stream and configures + /// the reader for the encountered byte order. /// A byte-order mark is a 16-bit integer with a value of 0xFEFF, /// written in host byte order. @@ -163,9 +163,9 @@ public: /// either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER. private: - std::istream& _istr; - bool _flipBytes; - TextConverter* _pTextConverter; + std::istream& _istr; + bool _flipBytes; + TextConverter* _pTextConverter; }; diff --git a/Foundation/include/Poco/Buffer.h b/Foundation/include/Poco/Buffer.h index ed5c6fb5e..9b83deed8 100644 --- a/Foundation/include/Poco/Buffer.h +++ b/Foundation/include/Poco/Buffer.h @@ -1,7 +1,7 @@ // // Buffer.h // -// $Id: //poco/svn/Foundation/include/Poco/Buffer.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Buffer.h#2 $ // // Library: Foundation // Package: Core @@ -50,131 +50,131 @@ namespace Poco { template class Buffer - /// A buffer class that allocates a buffer of a given type and size. - /// Buffer can be zero-size, resized, copy-constructed and assigned. - /// Memory allocation, resizing and deallocation is managed automatically. - /// - /// This class is useful everywhere where a temporary buffer - /// is needed. + /// A buffer class that allocates a buffer of a given type and size. + /// Buffer can be zero-size, resized, copy-constructed and assigned. + /// Memory allocation, resizing and deallocation is managed automatically. + /// + /// This class is useful everywhere where a temporary buffer + /// is needed. { public: - Buffer(std::size_t size): - _size(size), - _ptr(size ? new T[size] : 0) - /// Creates and allocates the Buffer. - { - } - - Buffer(): _size(0), _ptr(0) - /// Creates the Buffer. - { - } + Buffer(std::size_t size): + _size(size), + _ptr(size ? new T[size] : 0) + /// Creates and allocates the Buffer. + { + } + + Buffer(): _size(0), _ptr(0) + /// Creates the Buffer. + { + } + + Buffer(const Buffer& other): + /// Copy constructor. + _size(other._size), + _ptr(other._size ? new T[other._size] : 0) + { + if (_size) + std::memcpy(_ptr, other._ptr, _size * sizeof(T)); + } - Buffer(const Buffer& other): - /// Copy constructor. - _size(other._size), - _ptr(other._size ? new T[other._size] : 0) - { - if (_size) - std::memcpy(_ptr, other._ptr, _size * sizeof(T)); - } + Buffer& operator = (const Buffer& other) + /// Assignment operator. + { + if (this != &other) + { + Buffer tmp(other); + swap(tmp); + } - Buffer& operator = (const Buffer& other) - /// Assignment operator. - { - if (this != &other) - { - Buffer tmp(other); - swap(tmp); - } + return *this; + } - return *this; - } - - ~Buffer() - /// Destroys the Buffer. - { - delete [] _ptr; - } - - void swap(Buffer& other) - /// Swaps the buffer with another one. - { - using std::swap; - - swap(_ptr, other._ptr); - swap(_size, other._size); - } - - std::size_t size() const + ~Buffer() + /// Destroys the Buffer. + { + delete [] _ptr; + } + + void swap(Buffer& other) + /// Swaps the buffer with another one. + { + using std::swap; + + swap(_ptr, other._ptr); + swap(_size, other._size); + } + + std::size_t size() const /// Returns the size of the buffer. { - return _size; - } - - void clear() - /// Sets the contents of the bufer to zero. - { - std::memset(_ptr, 0, _size * sizeof(T)); - } + return _size; + } + + void clear() + /// Sets the contents of the bufer to zero. + { + std::memset(_ptr, 0, _size * sizeof(T)); + } - void resize(std::size_t newSize, bool preserve = false) - /// Resizes the buffer. If preserve is true, the contents - /// of the buffer is preserved. If the newSize is smaller - /// than the current size, data truncation will occur. - /// - /// For efficiency sake, the default behavior is not to - /// preserve the contents. - { - if (preserve) - { - if (_size == newSize) return; - Buffer tmp; - tmp = *this; - recreate(newSize); - std::size_t size = _size < tmp._size ? _size : tmp._size; - std::memcpy(_ptr, tmp._ptr, size * sizeof(T)); - return; - } - else if (_size == newSize) - { - clear(); - return; - } + void resize(std::size_t newSize, bool preserve = false) + /// Resizes the buffer. If preserve is true, the contents + /// of the buffer is preserved. If the newSize is smaller + /// than the current size, data truncation will occur. + /// + /// For efficiency sake, the default behavior is not to + /// preserve the contents. + { + if (preserve) + { + if (_size == newSize) return; + Buffer tmp; + tmp = *this; + recreate(newSize); + std::size_t size = _size < tmp._size ? _size : tmp._size; + std::memcpy(_ptr, tmp._ptr, size * sizeof(T)); + return; + } + else if (_size == newSize) + { + clear(); + return; + } - recreate(newSize); - } + recreate(newSize); + } - void append(const T* buf, std::size_t sz) - /// Resizes this buffer and appends the argument buffer. - { - if (0 == sz) return; - std::size_t oldSize = _size; - resize(_size + sz, true); - std::memcpy(_ptr + oldSize, buf, sz); - } + void append(const T* buf, std::size_t sz) + /// Resizes this buffer and appends the argument buffer. + { + if (0 == sz) return; + std::size_t oldSize = _size; + resize(_size + sz, true); + std::memcpy(_ptr + oldSize, buf, sz); + } - void append(const Buffer& buf) - /// Resizes this buffer and appends the argument buffer. - { - append(buf.begin(), buf.size()); - } + void append(const Buffer& buf) + /// Resizes this buffer and appends the argument buffer. + { + append(buf.begin(), buf.size()); + } - std::size_t elementSize() const - /// Returns the size of the buffer element. - { - return sizeof(T); - } + std::size_t elementSize() const + /// Returns the size of the buffer element. + { + return sizeof(T); + } - std::size_t byteCount() const - /// Returns the total length of the buffer in bytes. - { - return _size * sizeof(T); - } + std::size_t byteCount() const + /// Returns the total length of the buffer in bytes. + { + return _size * sizeof(T); + } - T* begin() - /// Returns a pointer to the beginning of the buffer. - { + T* begin() + /// Returns a pointer to the beginning of the buffer. + { return _ptr; } @@ -193,18 +193,18 @@ public: const T* end() const /// Returns a pointer to the end of the buffer. { - return _ptr + _size; - } - - bool isEmpty() const - /// Return true if buffer is empty. - { - return 0 == _size; - } + return _ptr + _size; + } + + bool isEmpty() const + /// Return true if buffer is empty. + { + return 0 == _size; + } - T& operator [] (std::size_t index) - { - poco_assert (index < _size); + T& operator [] (std::size_t index) + { + poco_assert (index < _size); return _ptr[index]; } @@ -214,26 +214,26 @@ public: poco_assert (index < _size); return _ptr[index]; - } + } private: - void recreate(std::size_t newSize) - { - if (newSize != _size) - { - delete [] _ptr; - if (0 == newSize) - _ptr = 0; - else - _ptr = new T[newSize]; + void recreate(std::size_t newSize) + { + if (newSize != _size) + { + delete [] _ptr; + if (0 == newSize) + _ptr = 0; + else + _ptr = new T[newSize]; - _size = newSize; - } - } + _size = newSize; + } + } - std::size_t _size; - T* _ptr; + std::size_t _size; + T* _ptr; }; diff --git a/Foundation/include/Poco/BufferAllocator.h b/Foundation/include/Poco/BufferAllocator.h index 77000b389..dece69b4c 100644 --- a/Foundation/include/Poco/BufferAllocator.h +++ b/Foundation/include/Poco/BufferAllocator.h @@ -1,7 +1,7 @@ // // BufferAllocator.h // -// $Id: //poco/svn/Foundation/include/Poco/BufferAllocator.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/BufferAllocator.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h index 2401b6107..4730509b1 100644 --- a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h +++ b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h @@ -1,7 +1,7 @@ // // BufferedBidirectionalStreamBuf.h // -// $Id: //poco/Main/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h#7 $ +// $Id: //poco/1.4/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/BufferedStreamBuf.h b/Foundation/include/Poco/BufferedStreamBuf.h index 84671499b..f4cd31e91 100644 --- a/Foundation/include/Poco/BufferedStreamBuf.h +++ b/Foundation/include/Poco/BufferedStreamBuf.h @@ -1,7 +1,7 @@ // // BufferedStreamBuf.h // -// $Id: //poco/Main/Foundation/include/Poco/BufferedStreamBuf.h#6 $ +// $Id: //poco/1.4/Foundation/include/Poco/BufferedStreamBuf.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/Bugcheck.h b/Foundation/include/Poco/Bugcheck.h index 741a68285..d2170e026 100644 --- a/Foundation/include/Poco/Bugcheck.h +++ b/Foundation/include/Poco/Bugcheck.h @@ -1,7 +1,7 @@ // // Bugcheck.h // -// $Id: //poco/svn/Foundation/include/Poco/Bugcheck.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Bugcheck.h#1 $ // // Library: Foundation // Package: Core @@ -96,10 +96,10 @@ protected: // useful macros (these automatically supply line number and file name) // #if defined(_DEBUG) -# define poco_assert_dbg(cond) \ + #define poco_assert_dbg(cond) \ if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0 #else -# define poco_assert_dbg(cond) + #define poco_assert_dbg(cond) #endif @@ -129,7 +129,7 @@ protected: #if defined(_DEBUG) # define poco_stdout_dbg(outstr) \ - std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl; + std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl; #else # define poco_stdout_dbg(outstr) #endif diff --git a/Foundation/include/Poco/ByteOrder.h b/Foundation/include/Poco/ByteOrder.h index e6af1f5c9..b9f8daf08 100644 --- a/Foundation/include/Poco/ByteOrder.h +++ b/Foundation/include/Poco/ByteOrder.h @@ -1,7 +1,7 @@ // // ByteOrder.h // -// $Id: //poco/svn/Foundation/include/Poco/ByteOrder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ByteOrder.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Channel.h b/Foundation/include/Poco/Channel.h index ccd70c473..101310f32 100644 --- a/Foundation/include/Poco/Channel.h +++ b/Foundation/include/Poco/Channel.h @@ -1,7 +1,7 @@ // // Channel.h // -// $Id: //poco/svn/Foundation/include/Poco/Channel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Channel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Checksum.h b/Foundation/include/Poco/Checksum.h index c3c6e2190..3e9fbe470 100644 --- a/Foundation/include/Poco/Checksum.h +++ b/Foundation/include/Poco/Checksum.h @@ -1,7 +1,7 @@ // // Checksum.h // -// $Id: //poco/svn/Foundation/include/Poco/Checksum.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Checksum.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/ClassLibrary.h b/Foundation/include/Poco/ClassLibrary.h index c9c8de738..7118f0701 100644 --- a/Foundation/include/Poco/ClassLibrary.h +++ b/Foundation/include/Poco/ClassLibrary.h @@ -1,7 +1,7 @@ // // ClassLibrary.h // -// $Id: //poco/svn/Foundation/include/Poco/ClassLibrary.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ClassLibrary.h#1 $ // // Library: Foundation // Package: SharedLibrary diff --git a/Foundation/include/Poco/ClassLoader.h b/Foundation/include/Poco/ClassLoader.h index a94583244..f15085f99 100644 --- a/Foundation/include/Poco/ClassLoader.h +++ b/Foundation/include/Poco/ClassLoader.h @@ -1,7 +1,7 @@ // // ClassLoader.h // -// $Id: //poco/svn/Foundation/include/Poco/ClassLoader.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ClassLoader.h#1 $ // // Library: Foundation // Package: SharedLibrary diff --git a/Foundation/include/Poco/Condition.h b/Foundation/include/Poco/Condition.h index 3d5a47305..050584ded 100644 --- a/Foundation/include/Poco/Condition.h +++ b/Foundation/include/Poco/Condition.h @@ -1,7 +1,7 @@ // // Condition.h // -// $Id: //poco/svn/Foundation/include/Poco/Condition.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Condition.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h index 7a0e6d12d..c4c5b831b 100644 --- a/Foundation/include/Poco/Config.h +++ b/Foundation/include/Poco/Config.h @@ -1,7 +1,7 @@ // // Config.h // -// $Id: //poco/svn/Foundation/include/Poco/Config.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Config.h#3 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Configurable.h b/Foundation/include/Poco/Configurable.h index b20b34a79..872d91866 100644 --- a/Foundation/include/Poco/Configurable.h +++ b/Foundation/include/Poco/Configurable.h @@ -1,7 +1,7 @@ // // Configurable.h // -// $Id: //poco/svn/Foundation/include/Poco/Configurable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Configurable.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/ConsoleChannel.h b/Foundation/include/Poco/ConsoleChannel.h index fa1ed79da..5a4a98428 100644 --- a/Foundation/include/Poco/ConsoleChannel.h +++ b/Foundation/include/Poco/ConsoleChannel.h @@ -1,7 +1,7 @@ // // ConsoleChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/ConsoleChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ConsoleChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/CountingStream.h b/Foundation/include/Poco/CountingStream.h index cac2021e8..d7c836392 100644 --- a/Foundation/include/Poco/CountingStream.h +++ b/Foundation/include/Poco/CountingStream.h @@ -1,7 +1,7 @@ // // CountingStream.h // -// $Id: //poco/svn/Foundation/include/Poco/CountingStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/CountingStream.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/DateTime.h b/Foundation/include/Poco/DateTime.h index f55a6d91a..420563cc9 100644 --- a/Foundation/include/Poco/DateTime.h +++ b/Foundation/include/Poco/DateTime.h @@ -1,7 +1,7 @@ // // DateTime.h // -// $Id: //poco/svn/Foundation/include/Poco/DateTime.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DateTime.h#1 $ // // Library: Foundation // Package: DateTime @@ -52,16 +52,16 @@ class Foundation_API DateTime /// This class represents an instant in time, expressed /// in years, months, days, hours, minutes, seconds /// and milliseconds based on the Gregorian calendar. - /// The class is mainly useful for conversions between - /// UTC, Julian day and Gregorian calendar dates. - /// - /// The date and time stored in a DateTime is always in UTC - /// (Coordinated Universal Time) and thus independent of the - /// timezone in effect on the system. - /// - /// Conversion calculations are based on algorithms - /// collected and described by Peter Baum at - /// http://vsg.cape.com/~pbaum/date/date0.htm + /// The class is mainly useful for conversions between + /// UTC, Julian day and Gregorian calendar dates. + /// + /// The date and time stored in a DateTime is always in UTC + /// (Coordinated Universal Time) and thus independent of the + /// timezone in effect on the system. + /// + /// Conversion calculations are based on algorithms + /// collected and described by Peter Baum at + /// http://vsg.cape.com/~pbaum/date/date0.htm /// /// Internally, this class stores a date/time in two /// forms (UTC and broken down) for performance reasons. Only use @@ -431,16 +431,6 @@ inline void swap(DateTime& d1, DateTime& d2) } -inline void DateTime::checkLimit(short& lower, short& higher, short limit) -{ - if (lower >= limit) - { - higher += short(lower / limit); - lower = short(lower % limit); - } -} - - } // namespace Poco diff --git a/Foundation/include/Poco/DateTimeFormat.h b/Foundation/include/Poco/DateTimeFormat.h index b81159cfc..afb6ee06f 100644 --- a/Foundation/include/Poco/DateTimeFormat.h +++ b/Foundation/include/Poco/DateTimeFormat.h @@ -1,7 +1,7 @@ // // DateTimeFormat.h // -// $Id: //poco/svn/Foundation/include/Poco/DateTimeFormat.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DateTimeFormat.h#2 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/DateTimeFormatter.h b/Foundation/include/Poco/DateTimeFormatter.h index 9e9711714..eececaf8f 100644 --- a/Foundation/include/Poco/DateTimeFormatter.h +++ b/Foundation/include/Poco/DateTimeFormatter.h @@ -1,7 +1,7 @@ // // DateTimeFormatter.h // -// $Id: //poco/Main/Foundation/include/Poco/DateTimeFormatter.h#4 $ +// $Id: //poco/1.4/Foundation/include/Poco/DateTimeFormatter.h#2 $ // // Library: Foundation // Package: DateTime @@ -89,17 +89,17 @@ public: /// * %H - hour (00 .. 23) /// * %h - hour (00 .. 12) /// * %a - am/pm - /// * %A - AM/PM - /// * %M - minute (00 .. 59) - /// * %S - second (00 .. 59) - /// * %s - seconds and microseconds (equivalent to %S.%F) - /// * %i - millisecond (000 .. 999) - /// * %c - centisecond (0 .. 9) - /// * %F - fractional seconds/microseconds (000000 - 999999) - /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN) - /// * %Z - time zone differential in RFC format (GMT or +NNNN) - /// * %% - percent sign - /// + /// * %A - AM/PM + /// * %M - minute (00 .. 59) + /// * %S - second (00 .. 59) + /// * %s - seconds and microseconds (equivalent to %S.%F) + /// * %i - millisecond (000 .. 999) + /// * %c - centisecond (0 .. 9) + /// * %F - fractional seconds/microseconds (000000 - 999999) + /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN) + /// * %Z - time zone differential in RFC format (GMT or +NNNN) + /// * %% - percent sign + /// /// Class DateTimeFormat defines format strings for various standard date/time formats. static std::string format(const DateTime& dateTime, const std::string& fmt, int timeZoneDifferential = UTC); diff --git a/Foundation/include/Poco/DateTimeParser.h b/Foundation/include/Poco/DateTimeParser.h index 505862250..aac796b4a 100644 --- a/Foundation/include/Poco/DateTimeParser.h +++ b/Foundation/include/Poco/DateTimeParser.h @@ -1,7 +1,7 @@ // // DateTimeParser.h // -// $Id: //poco/Main/Foundation/include/Poco/DateTimeParser.h#4 $ +// $Id: //poco/1.4/Foundation/include/Poco/DateTimeParser.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/Debugger.h b/Foundation/include/Poco/Debugger.h index 36917c0a1..280b16c12 100644 --- a/Foundation/include/Poco/Debugger.h +++ b/Foundation/include/Poco/Debugger.h @@ -1,7 +1,7 @@ // // Debugger.h // -// $Id: //poco/svn/Foundation/include/Poco/Debugger.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Debugger.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/DefaultStrategy.h b/Foundation/include/Poco/DefaultStrategy.h index 6369198af..906f7179c 100644 --- a/Foundation/include/Poco/DefaultStrategy.h +++ b/Foundation/include/Poco/DefaultStrategy.h @@ -1,7 +1,7 @@ // // DefaultStrategy.h // -// $Id: //poco/Main/Foundation/include/Poco/DefaultStrategy.h#5 $ +// $Id: //poco/1.4/Foundation/include/Poco/DefaultStrategy.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the DefaultStrategy template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,124 +36,100 @@ // -#ifndef Foundation_DefaultStrategy_INCLUDED -#define Foundation_DefaultStrategy_INCLUDED +#ifndef Foundation_DefaultStrategy_INCLUDED +#define Foundation_DefaultStrategy_INCLUDED #include "Poco/NotificationStrategy.h" -#include -#include +#include "Poco/SharedPtr.h" #include namespace Poco { -template -class DefaultStrategy//: public NotificationStrategy - /// Default notification strategy. Allows one observer - /// to register exactly once. The observer must provide an - /// < (less-than) operator. +template +class DefaultStrategy: public NotificationStrategy + /// Default notification strategy. + /// + /// Internally, a std::vector<> is used to store + /// delegate objects. Delegates are invoked in the + /// order in which they have been registered. { public: - typedef std::set Delegates; - typedef typename Delegates::iterator Iterator; - typedef typename Delegates::const_iterator ConstIterator; + typedef SharedPtr DelegatePtr; + typedef std::vector Delegates; + typedef typename Delegates::iterator Iterator; public: - DefaultStrategy() - { - } + DefaultStrategy() + { + } - DefaultStrategy(const DefaultStrategy& s) - { - operator = (s); - } + DefaultStrategy(const DefaultStrategy& s): + _delegates(s._delegates) + { + } - ~DefaultStrategy() - { - clear(); - } + ~DefaultStrategy() + { + } - void notify(const void* sender, TArgs& arguments) - { - std::vector delMe; + void notify(const void* sender, TArgs& arguments) + { + for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) + { + (*it)->notify(sender, arguments); + } + } - for (Iterator it = _observers.begin(); it != _observers.end(); ++it) - { - if (!(*it)->notify(sender, arguments)) - { - // schedule for deletion - delMe.push_back(it); - } - } - - while (!delMe.empty()) - { - typename std::vector::iterator vit = delMe.end(); - --vit; - delete **vit; - _observers.erase(*vit); - delMe.pop_back(); - } - } + void add(const TDelegate& delegate) + { + _delegates.push_back(DelegatePtr(static_cast(delegate.clone()))); + } - void add(const TDelegate& delegate) - { - Iterator it = _observers.find(const_cast(&delegate)); - if (it != _observers.end()) - { - delete *it; - _observers.erase(it); - } - std::auto_ptr pDelegate(delegate.clone()); - bool tmp = _observers.insert(pDelegate.get()).second; - poco_assert (tmp); - pDelegate.release(); - } - - void remove(const TDelegate& delegate) - { - Iterator it = _observers.find(const_cast(&delegate)); - if (it != _observers.end()) - { - delete *it; - _observers.erase(it); - } - } + void remove(const TDelegate& delegate) + { + for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) + { + if (delegate.equals(**it)) + { + (*it)->disable(); + _delegates.erase(it); + return; + } + } + } DefaultStrategy& operator = (const DefaultStrategy& s) - { - if (this != &s) - { - for (ConstIterator it = s._observers.begin(); it != s._observers.end(); ++it) - { - add(**it); - } - } - return *this; - } + { + if (this != &s) + { + _delegates = s._delegates; + } + return *this; + } - void clear() - { - for (Iterator it = _observers.begin(); it != _observers.end(); ++it) - { - delete *it; - } - _observers.clear(); - } + void clear() + { + for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) + { + (*it)->disable(); + } + _delegates.clear(); + } - bool empty() const - { - return _observers.empty(); - } + bool empty() const + { + return _delegates.empty(); + } protected: - Delegates _observers; + Delegates _delegates; }; } // namespace Poco -#endif +#endif // Foundation_DefaultStrategy_INCLUDED diff --git a/Foundation/include/Poco/Delegate.h b/Foundation/include/Poco/Delegate.h index ff13521d3..9ee26b157 100644 --- a/Foundation/include/Poco/Delegate.h +++ b/Foundation/include/Poco/Delegate.h @@ -1,7 +1,7 @@ // // Delegate.h // -// $Id: //poco/1.4/Foundation/include/Poco/Delegate.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Delegate.h#5 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the Delegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -44,22 +44,22 @@ #include "Poco/AbstractDelegate.h" #include "Poco/FunctionDelegate.h" #include "Poco/Expire.h" +#include "Poco/Mutex.h" namespace Poco { -template +template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*, TArgs&); + typedef void (TObj::*NotifyMethod)(const void*, TArgs&); - Delegate(TObj* obj, NotifyMethod method): - AbstractDelegate(obj), - _receiverObject(obj), - _receiverMethod(method) - { + Delegate(TObj* obj, NotifyMethod method): + _receiverObject(obj), + _receiverMethod(method) + { } Delegate(const Delegate& delegate): @@ -74,33 +74,50 @@ public: } Delegate& operator = (const Delegate& delegate) - { - if (&delegate != this) - { - this->_pTarget = delegate._pTarget; - this->_receiverObject = delegate._receiverObject; - this->_receiverMethod = delegate._receiverMethod; - } + { + if (&delegate != this) + { + this->_receiverObject = delegate._receiverObject; + this->_receiverMethod = delegate._receiverMethod; + } return *this; } - bool notify(const void* sender, TArgs& arguments) - { - (_receiverObject->*_receiverMethod)(sender, arguments); - return true; // a "standard" delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverObject) + { + (_receiverObject->*_receiverMethod)(sender, arguments); + return true; + } + else return false; + } - AbstractDelegate* clone() const + bool equals(const AbstractDelegate& other) const + { + const Delegate* pOtherDelegate = reinterpret_cast(other.unwrap()); + return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const { - return new Delegate(*this); - } + return new Delegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverObject = 0; + } protected: - TObj* _receiverObject; - NotifyMethod _receiverMethod; + TObj* _receiverObject; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - Delegate(); + Delegate(); }; @@ -108,13 +125,12 @@ template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(TArgs&); + typedef void (TObj::*NotifyMethod)(TArgs&); - Delegate(TObj* obj, NotifyMethod method): - AbstractDelegate(obj), - _receiverObject(obj), - _receiverMethod(method) - { + Delegate(TObj* obj, NotifyMethod method): + _receiverObject(obj), + _receiverMethod(method) + { } Delegate(const Delegate& delegate): @@ -139,23 +155,41 @@ public: return *this; } - bool notify(const void*, TArgs& arguments) - { - (_receiverObject->*_receiverMethod)(arguments); - return true; // a "standard" delegate never expires - } + bool notify(const void*, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverObject) + { + (_receiverObject->*_receiverMethod)(arguments); + return true; + } + else return false; + } - AbstractDelegate* clone() const + bool equals(const AbstractDelegate& other) const + { + const Delegate* pOtherDelegate = reinterpret_cast(other.unwrap()); + return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const { - return new Delegate(*this); - } + return new Delegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverObject = 0; + } protected: - TObj* _receiverObject; - NotifyMethod _receiverMethod; + TObj* _receiverObject; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - Delegate(); + Delegate(); }; @@ -173,7 +207,6 @@ static Delegate delegate(TObj* pObj, void (TObj::*NotifyMeth } - template static Expire delegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&), Timestamp::TimeDiff expireMillisecs) { @@ -205,7 +238,7 @@ static Expire delegate(void (*NotifyMethod)(void*, TArgs&), Timestamp::Ti template static Expire delegate(void (*NotifyMethod)(TArgs&), Timestamp::TimeDiff expireMillisecs) { - return Expire(FunctionDelegate( NotifyMethod), expireMillisecs); + return Expire(FunctionDelegate(NotifyMethod), expireMillisecs); } diff --git a/Foundation/include/Poco/DigestEngine.h b/Foundation/include/Poco/DigestEngine.h index 78ed1feb7..28562c2a6 100644 --- a/Foundation/include/Poco/DigestEngine.h +++ b/Foundation/include/Poco/DigestEngine.h @@ -1,7 +1,7 @@ // // DigestEngine.h // -// $Id: //poco/Main/Foundation/include/Poco/DigestEngine.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/DigestEngine.h#1 $ // // Library: Foundation // Package: Crypt @@ -82,15 +82,15 @@ public: /// The returned reference is valid until the next /// time digest() is called, or the engine object is destroyed. - static std::string digestToHex(const Digest& bytes); - /// Converts a message digest into a string of hexadecimal numbers. + static std::string digestToHex(const Digest& bytes); + /// Converts a message digest into a string of hexadecimal numbers. - static Digest digestFromHex(const std::string& digest); - /// Converts a string created by digestToHex back to its Digest presentation + static Digest digestFromHex(const std::string& digest); + /// Converts a string created by digestToHex back to its Digest presentation protected: - virtual void updateImpl(const void* data, unsigned length) = 0; - /// Updates the digest with the given data. Must be implemented + virtual void updateImpl(const void* data, unsigned length) = 0; + /// Updates the digest with the given data. Must be implemented /// by subclasses. private: diff --git a/Foundation/include/Poco/DigestStream.h b/Foundation/include/Poco/DigestStream.h index 64f296bd8..fb4017c50 100644 --- a/Foundation/include/Poco/DigestStream.h +++ b/Foundation/include/Poco/DigestStream.h @@ -1,7 +1,7 @@ // // DigestStream.h // -// $Id: //poco/svn/Foundation/include/Poco/DigestStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DigestStream.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/DirectoryIterator.h b/Foundation/include/Poco/DirectoryIterator.h index 44452c26a..ece8102fb 100644 --- a/Foundation/include/Poco/DirectoryIterator.h +++ b/Foundation/include/Poco/DirectoryIterator.h @@ -1,7 +1,7 @@ // // DirectoryIterator.h // -// $Id: //poco/svn/Foundation/include/Poco/DirectoryIterator.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/DirectoryIterator_UNIX.h b/Foundation/include/Poco/DirectoryIterator_UNIX.h index 4372c254a..d0f7c5a17 100644 --- a/Foundation/include/Poco/DirectoryIterator_UNIX.h +++ b/Foundation/include/Poco/DirectoryIterator_UNIX.h @@ -1,7 +1,7 @@ // // DirectoryIterator_UNIX.h // -// $Id: //poco/svn/Foundation/include/Poco/DirectoryIterator_UNIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_UNIX.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/DirectoryIterator_VMS.h b/Foundation/include/Poco/DirectoryIterator_VMS.h index 7dc6b71e5..8ade4c89a 100644 --- a/Foundation/include/Poco/DirectoryIterator_VMS.h +++ b/Foundation/include/Poco/DirectoryIterator_VMS.h @@ -1,7 +1,7 @@ // // DirectoryIterator_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/DirectoryIterator_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_VMS.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/DirectoryIterator_WIN32.h b/Foundation/include/Poco/DirectoryIterator_WIN32.h index df09af035..6d02b93cf 100644 --- a/Foundation/include/Poco/DirectoryIterator_WIN32.h +++ b/Foundation/include/Poco/DirectoryIterator_WIN32.h @@ -1,7 +1,7 @@ // // DirectoryIterator_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/DirectoryIterator_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_WIN32.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/DirectoryIterator_WIN32U.h b/Foundation/include/Poco/DirectoryIterator_WIN32U.h index 888a8747a..2fc7dd478 100644 --- a/Foundation/include/Poco/DirectoryIterator_WIN32U.h +++ b/Foundation/include/Poco/DirectoryIterator_WIN32U.h @@ -1,7 +1,7 @@ // // DirectoryIterator_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/DirectoryIterator_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_WIN32U.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/DynamicFactory.h b/Foundation/include/Poco/DynamicFactory.h index 9ab40b36c..260d33f4e 100644 --- a/Foundation/include/Poco/DynamicFactory.h +++ b/Foundation/include/Poco/DynamicFactory.h @@ -1,7 +1,7 @@ // // DynamicFactory.h // -// $Id: //poco/svn/Foundation/include/Poco/DynamicFactory.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/DynamicFactory.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Environment.h b/Foundation/include/Poco/Environment.h index 8f81bf358..302df7543 100644 --- a/Foundation/include/Poco/Environment.h +++ b/Foundation/include/Poco/Environment.h @@ -1,7 +1,7 @@ // // Environment.h // -// $Id: //poco/1.3/Foundation/include/Poco/Environment.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment.h#2 $ // // Library: Foundation // Package: Core @@ -71,22 +71,22 @@ public: /// Sets the environment variable with the given name /// to the given value. - static std::string osName(); - /// Returns the operating system name. - - static std::string osDisplayName(); - /// Returns the operating system name in a - /// "user-friendly" way. - /// - /// Currently this is only implemented for - /// Windows. There it will return names like - /// "Windows XP" or "Windows 7/Server 2008 SP2". - /// On other platform, returns the same as - /// osName(). - - static std::string osVersion(); - /// Returns the operating system version. - + static std::string osName(); + /// Returns the operating system name. + + static std::string osDisplayName(); + /// Returns the operating system name in a + /// "user-friendly" way. + /// + /// Currently this is only implemented for + /// Windows. There it will return names like + /// "Windows XP" or "Windows 7/Server 2008 SP2". + /// On other platform, returns the same as + /// osName(). + + static std::string osVersion(); + /// Returns the operating system version. + static std::string osArchitecture(); /// Returns the operating system architecture. diff --git a/Foundation/include/Poco/Environment_UNIX.h b/Foundation/include/Poco/Environment_UNIX.h index e518d9994..71057c4ad 100644 --- a/Foundation/include/Poco/Environment_UNIX.h +++ b/Foundation/include/Poco/Environment_UNIX.h @@ -1,7 +1,7 @@ // // Environment_UNIX.h // -// $Id: //poco/1.3/Foundation/include/Poco/Environment_UNIX.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_UNIX.h#2 $ // // Library: Foundation // Package: Core @@ -54,13 +54,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); diff --git a/Foundation/include/Poco/Environment_VMS.h b/Foundation/include/Poco/Environment_VMS.h index 847ad0d4d..c3dbe966f 100644 --- a/Foundation/include/Poco/Environment_VMS.h +++ b/Foundation/include/Poco/Environment_VMS.h @@ -1,7 +1,7 @@ // // Environment_VMS.h // -// $Id: //poco/1.3/Foundation/include/Poco/Environment_VMS.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_VMS.h#2 $ // // Library: Foundation // Package: Core @@ -53,13 +53,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); diff --git a/Foundation/include/Poco/Environment_VX.h b/Foundation/include/Poco/Environment_VX.h index 51b0a3026..829d16e93 100644 --- a/Foundation/include/Poco/Environment_VX.h +++ b/Foundation/include/Poco/Environment_VX.h @@ -1,7 +1,7 @@ // // Environment_VX.h // -// $Id: //poco/1.4/Foundation/include/Poco/Environment_VX.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_VX.h#2 $ // // Library: Foundation // Package: Core @@ -54,13 +54,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); diff --git a/Foundation/include/Poco/Environment_WIN32.h b/Foundation/include/Poco/Environment_WIN32.h index c8de5236c..e2d6712da 100644 --- a/Foundation/include/Poco/Environment_WIN32.h +++ b/Foundation/include/Poco/Environment_WIN32.h @@ -1,7 +1,7 @@ // // Environment_WIN32.h // -// $Id: //poco/1.3/Foundation/include/Poco/Environment_WIN32.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_WIN32.h#2 $ // // Library: Foundation // Package: Core @@ -52,13 +52,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); }; diff --git a/Foundation/include/Poco/Environment_WIN32U.h b/Foundation/include/Poco/Environment_WIN32U.h index 666c8e9a7..1f7a73de3 100644 --- a/Foundation/include/Poco/Environment_WIN32U.h +++ b/Foundation/include/Poco/Environment_WIN32U.h @@ -1,7 +1,7 @@ // // Environment_WIN32U.h // -// $Id: //poco/1.3/Foundation/include/Poco/Environment_WIN32U.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_WIN32U.h#2 $ // // Library: Foundation // Package: Core @@ -52,13 +52,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); }; diff --git a/Foundation/include/Poco/Environment_WINCE.h b/Foundation/include/Poco/Environment_WINCE.h index 71f646a93..1310479d0 100644 --- a/Foundation/include/Poco/Environment_WINCE.h +++ b/Foundation/include/Poco/Environment_WINCE.h @@ -1,7 +1,7 @@ // // Environment_WINCE.h // -// $Id: //poco/1.4/Foundation/include/Poco/Environment_WINCE.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Environment_WINCE.h#2 $ // // Library: Foundation // Package: Core @@ -52,13 +52,13 @@ public: typedef UInt8 NodeId[6]; /// Ethernet address. static std::string getImpl(const std::string& name); - static bool hasImpl(const std::string& name); - static void setImpl(const std::string& name, const std::string& value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); + static bool hasImpl(const std::string& name); + static void setImpl(const std::string& name, const std::string& value); + static std::string osNameImpl(); + static std::string osDisplayNameImpl(); + static std::string osVersionImpl(); + static std::string osArchitectureImpl(); + static std::string nodeNameImpl(); static void nodeIdImpl(NodeId& id); static unsigned processorCountImpl(); diff --git a/Foundation/include/Poco/ErrorHandler.h b/Foundation/include/Poco/ErrorHandler.h index 409e027a5..ea69cd06a 100644 --- a/Foundation/include/Poco/ErrorHandler.h +++ b/Foundation/include/Poco/ErrorHandler.h @@ -1,7 +1,7 @@ // // ErrorHandler.h // -// $Id: //poco/svn/Foundation/include/Poco/ErrorHandler.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ErrorHandler.h#1 $ // // Library: Foundation // Package: Threading @@ -56,13 +56,13 @@ class Foundation_API ErrorHandler /// about it. /// /// The Thread class provides the possibility to register a - /// global ErrorHandler that is invoked whenever a thread has - /// been terminated by an unhandled exception. - /// The ErrorHandler must be derived from this class and can - /// provide implementations of all three handleException() overloads. - /// - /// The ErrorHandler is always invoked within the context of - /// the offending thread. + /// global ErrorHandler that is invoked whenever a thread has + /// been terminated by an unhandled exception. + /// The ErrorHandler must be derived from this class and can + /// provide implementations of all three exception() overloads. + /// + /// The ErrorHandler is always invoked within the context of + /// the offending thread. { public: ErrorHandler(); diff --git a/Foundation/include/Poco/Event.h b/Foundation/include/Poco/Event.h index d3a7edb14..ae56bbd21 100644 --- a/Foundation/include/Poco/Event.h +++ b/Foundation/include/Poco/Event.h @@ -1,7 +1,7 @@ // // Event.h // -// $Id: //poco/svn/Foundation/include/Poco/Event.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Event.h#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/EventLogChannel.h b/Foundation/include/Poco/EventLogChannel.h index 1f00772b4..d80efa6db 100644 --- a/Foundation/include/Poco/EventLogChannel.h +++ b/Foundation/include/Poco/EventLogChannel.h @@ -1,7 +1,7 @@ // // EventLogChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/EventLogChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/EventLogChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Event_POSIX.h b/Foundation/include/Poco/Event_POSIX.h index ac6f84c21..cf94d2441 100644 --- a/Foundation/include/Poco/Event_POSIX.h +++ b/Foundation/include/Poco/Event_POSIX.h @@ -1,7 +1,7 @@ // // Event_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/Event_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Event_POSIX.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Event_WIN32.h b/Foundation/include/Poco/Event_WIN32.h index e3d06305a..f3b4a3762 100644 --- a/Foundation/include/Poco/Event_WIN32.h +++ b/Foundation/include/Poco/Event_WIN32.h @@ -1,7 +1,7 @@ // // Event_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/Event_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Event_WIN32.h#1 $ // // Library: Foundation // Package: Threading @@ -51,10 +51,10 @@ namespace Poco { class Foundation_API EventImpl { protected: - EventImpl(bool autoReset = false); - ~EventImpl(); - void setImpl(); - void waitImpl(); + EventImpl(bool autoReset); + ~EventImpl(); + void setImpl(); + void waitImpl(); bool waitImpl(long milliseconds); void resetImpl(); diff --git a/Foundation/include/Poco/Expire.h b/Foundation/include/Poco/Expire.h index 2c998fc1a..367225bbd 100644 --- a/Foundation/include/Poco/Expire.h +++ b/Foundation/include/Poco/Expire.h @@ -1,7 +1,7 @@ // // Expire.h // -// $Id: //poco/svn/Foundation/include/Poco/Expire.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Expire.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the Expire template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,8 +36,8 @@ // -#ifndef Foundation_Expire_INCLUDED -#define Foundation_Expire_INCLUDED +#ifndef Foundation_Expire_INCLUDED +#define Foundation_Expire_INCLUDED #include "Poco/Foundation.h" @@ -50,15 +50,14 @@ namespace Poco { template class Expire: public AbstractDelegate - /// Decorator for AbstractDelegate adding automatic - /// expiring of registrations to AbstractDelegates. + /// Decorator for AbstractDelegate adding automatic + /// expiration of registrations to AbstractDelegate's. { public: - Expire(const AbstractDelegate& p, Timestamp::TimeDiff expireMillisecs): - AbstractDelegate(p), - _pDelegate(p.clone()), - _expire(expireMillisecs*1000) - { + Expire(const AbstractDelegate& p, Timestamp::TimeDiff expireMillisecs): + _pDelegate(p.clone()), + _expire(expireMillisecs*1000) + { } Expire(const Expire& expire): @@ -69,12 +68,12 @@ public: { } - ~Expire() - { - destroy(); - } - - Expire& operator = (const Expire& expire) + ~Expire() + { + delete _pDelegate; + } + + Expire& operator = (const Expire& expire) { if (&expire != this) { @@ -92,24 +91,28 @@ public: if (!expired()) return this->_pDelegate->notify(sender, arguments); else - return false; - } + return false; + } - AbstractDelegate* clone() const - { - return new Expire(*this); - } + bool equals(const AbstractDelegate& other) const + { + return other.equals(*_pDelegate); + } - void destroy() - { - delete this->_pDelegate; - this->_pDelegate = 0; - } + AbstractDelegate* clone() const + { + return new Expire(*this); + } + + void disable() + { + _pDelegate->disable(); + } - const AbstractDelegate& getDelegate() const - { - return *this->_pDelegate; - } + const AbstractDelegate* unwrap() const + { + return this->_pDelegate; + } protected: bool expired() const @@ -129,4 +132,4 @@ private: } // namespace Poco -#endif +#endif // Foundation_Expire_INCLUDED diff --git a/Foundation/include/Poco/FIFOEvent.h b/Foundation/include/Poco/FIFOEvent.h index 5f955c5de..6eed8874d 100644 --- a/Foundation/include/Poco/FIFOEvent.h +++ b/Foundation/include/Poco/FIFOEvent.h @@ -1,7 +1,7 @@ // // FIFOEvent.h // -// $Id: //poco/svn/Foundation/include/Poco/FIFOEvent.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FIFOEvent.h#2 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the FIFOEvent template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,42 +36,36 @@ // -#ifndef Foundation_FIFOEvent_INCLUDED -#define Foundation_FIFOEvent_INCLUDED +#ifndef Foundation_FIFOEvent_INCLUDED +#define Foundation_FIFOEvent_INCLUDED #include "Poco/AbstractEvent.h" #include "Poco/FIFOStrategy.h" #include "Poco/AbstractDelegate.h" -#include "Poco/CompareFunctions.h" namespace Poco { +//@ deprecated template class FIFOEvent: public AbstractEvent < - TArgs, - FIFOStrategy, p_less > >, - AbstractDelegate, - TMutex + TArgs, + FIFOStrategy >, + AbstractDelegate, + TMutex > /// A FIFOEvent uses internally a FIFOStrategy which guarantees - /// that delegates are invoked in the order they were added to - /// the event. - /// - /// Note that one object can only register one method to a FIFOEvent. - /// Subsequent registrations will overwrite the existing delegate. - /// For example: - /// FIFOEvent tmp; - /// MyClass myObject; - /// tmp += delegate(&myObject, &MyClass::myMethod1); - /// tmp += delegate(&myObject, &MyClass::myMethod2); - /// - /// The second registration will overwrite the first one. + /// that delegates are invoked in the order they were added to + /// the event. + /// + /// Note that as of release 1.4.2, this is the default behavior + /// implemented by BasicEvent, so this class is provided + /// for backwards compatibility only. { public: - FIFOEvent() + FIFOEvent() { } @@ -88,4 +82,4 @@ private: } // namespace Poco -#endif +#endif // Foundation_FIFOEvent_INCLUDED diff --git a/Foundation/include/Poco/FIFOStrategy.h b/Foundation/include/Poco/FIFOStrategy.h index 47fa196b4..93406c0a0 100644 --- a/Foundation/include/Poco/FIFOStrategy.h +++ b/Foundation/include/Poco/FIFOStrategy.h @@ -1,7 +1,7 @@ // // FIFOStrategy.h // -// $Id: //poco/svn/Foundation/include/Poco/FIFOStrategy.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FIFOStrategy.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the FIFOStrategy template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -35,132 +35,47 @@ // DEALINGS IN THE SOFTWARE. // -#ifndef Foundation_FIFOStrategy_INCLUDED -#define Foundation_FIFOStrategy_INCLUDED + +#ifndef Foundation_FIFOStrategy_INCLUDED +#define Foundation_FIFOStrategy_INCLUDED -#include "Poco/NotificationStrategy.h" -#include -#include -#include +#include "Poco/DefaultStrategy.h" namespace Poco { -template -class FIFOStrategy//: public NotificationStrategy +//@ deprecated +template +class FIFOStrategy: public DefaultStrategy + /// Note: As of release 1.4.2, DefaultStrategy already + /// implements FIFO behavior, so this class is provided + /// for backwards compatibility only. { public: - typedef std::list Delegates; - typedef typename Delegates::iterator Iterator; - typedef typename Delegates::const_iterator ConstIterator; - typedef std::map DelegateIndex; - typedef typename DelegateIndex::iterator IndexIterator; - typedef typename DelegateIndex::const_iterator ConstIndexIterator; + FIFOStrategy() + { + } - FIFOStrategy() - { - } + FIFOStrategy(const FIFOStrategy& s): + DefaultStrategy(s) + { + } - FIFOStrategy(const FIFOStrategy& s) - { - operator = (s); - } + ~FIFOStrategy() + { + } - ~FIFOStrategy() - { - clear(); - } - - void notify(const void* sender, TArgs& arguments) - { - std::vector delMe; - Iterator it = _observers.begin(); - Iterator itEnd = _observers.end(); - - for (; it != itEnd; ++it) - { - if (!(*it)->notify(sender, arguments)) - { - // schedule for deletion - delMe.push_back(it); - } - } - - while (!delMe.empty()) - { - typename std::vector::iterator vit = delMe.end(); - --vit; - delete **vit; - _observers.erase(*vit); - delMe.pop_back(); - } - } - - void add(const TDelegate& delegate) - { - IndexIterator it = _observerIndex.find(const_cast(&delegate)); - if (it != _observerIndex.end()) - { - delete *it->second; - _observers.erase(it->second); - _observerIndex.erase(it); - } - std::auto_ptr pDelegate(delegate.clone()); - _observers.push_back(pDelegate.get()); - bool tmp = _observerIndex.insert(make_pair(pDelegate.get(), --_observers.end())).second; - poco_assert (tmp); - pDelegate.release(); - } - - void remove(const TDelegate& delegate) - { - IndexIterator it = _observerIndex.find(const_cast(&delegate)); - - if (it != _observerIndex.end()) - { - delete *it->second; - _observers.erase(it->second); - _observerIndex.erase(it); - } - } - - FIFOStrategy& operator = (const FIFOStrategy& s) - { - if (this != &s) - { - for (ConstIterator it = s._observers.begin(); it != s._observers.end(); ++it) - { - add(**it); - } - } - return *this; - } - - void clear() - { - for (Iterator it = _observers.begin(); it != _observers.end(); ++it) - { - delete *it; - } - - _observers.clear(); - _observerIndex.clear(); - } - - bool empty() const - { - return _observers.empty(); - } - -protected: - Delegates _observers; /// Stores the delegates in the order they were added. - DelegateIndex _observerIndex; /// For faster lookup when add/remove is used. + FIFOStrategy& operator = (const FIFOStrategy& s) + { + DefaultStrategy::operator = (s); + return *this; + } }; } // namespace Poco -#endif +#endif // Foundation_FIFOStrategy_INCLUDED diff --git a/Foundation/include/Poco/FPEnvironment.h b/Foundation/include/Poco/FPEnvironment.h index 36bd31060..3620f2c6f 100644 --- a/Foundation/include/Poco/FPEnvironment.h +++ b/Foundation/include/Poco/FPEnvironment.h @@ -1,7 +1,7 @@ // // FPEnvironment.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/FPEnvironment_C99.h b/Foundation/include/Poco/FPEnvironment_C99.h index 6a2dc12d2..7da0e868c 100644 --- a/Foundation/include/Poco/FPEnvironment_C99.h +++ b/Foundation/include/Poco/FPEnvironment_C99.h @@ -1,7 +1,7 @@ // // FPEnvironment_C99.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment_C99.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment_C99.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/FPEnvironment_DEC.h b/Foundation/include/Poco/FPEnvironment_DEC.h index 726608dc8..f8c815337 100644 --- a/Foundation/include/Poco/FPEnvironment_DEC.h +++ b/Foundation/include/Poco/FPEnvironment_DEC.h @@ -1,7 +1,7 @@ // // FPEnvironment_DEC.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment_DEC.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment_DEC.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/FPEnvironment_DUMMY.h b/Foundation/include/Poco/FPEnvironment_DUMMY.h index e9392881b..284313f7f 100644 --- a/Foundation/include/Poco/FPEnvironment_DUMMY.h +++ b/Foundation/include/Poco/FPEnvironment_DUMMY.h @@ -1,7 +1,7 @@ // // FPEnvironment_DUMMY.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment_DUMMY.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment_DUMMY.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/FPEnvironment_SUN.h b/Foundation/include/Poco/FPEnvironment_SUN.h index 9d31689f9..4513d16f5 100644 --- a/Foundation/include/Poco/FPEnvironment_SUN.h +++ b/Foundation/include/Poco/FPEnvironment_SUN.h @@ -1,7 +1,7 @@ // // FPEnvironment_SUN.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment_SUN.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment_SUN.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/FPEnvironment_WIN32.h b/Foundation/include/Poco/FPEnvironment_WIN32.h index 9aa2b9b36..4536dcdd7 100644 --- a/Foundation/include/Poco/FPEnvironment_WIN32.h +++ b/Foundation/include/Poco/FPEnvironment_WIN32.h @@ -1,7 +1,7 @@ // // FPEnvironment_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/FPEnvironment_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FPEnvironment_WIN32.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/File.h b/Foundation/include/Poco/File.h index 76fbddccc..e5d48dabb 100644 --- a/Foundation/include/Poco/File.h +++ b/Foundation/include/Poco/File.h @@ -1,7 +1,7 @@ // // File.h // -// $Id: //poco/Main/Foundation/include/Poco/File.h#9 $ +// $Id: //poco/1.4/Foundation/include/Poco/File.h#3 $ // // Library: Foundation // Package: Filesystem @@ -157,33 +157,33 @@ public: /// On such platforms, created() returns /// the time of the last inode modification. - Timestamp getLastModified() const; - /// Returns the modification date of the file. - - File& setLastModified(const Timestamp& ts); - /// Sets the modification date of the file. - - FileSize getSize() const; - /// Returns the size of the file in bytes. - - File& setSize(FileSize size); - /// Sets the size of the file in bytes. Can be used - /// to truncate a file. - - File& setWriteable(bool flag = true); - /// Makes the file writeable (if flag is true), or - /// non-writeable (if flag is false) by setting the - /// file's flags in the filesystem accordingly. - - File& setReadOnly(bool flag = true); - /// Makes the file non-writeable (if flag is true), or - /// writeable (if flag is false) by setting the - /// file's flags in the filesystem accordingly. - - File& setExecutable(bool flag = true); - /// Makes the file executable (if flag is true), or - /// non-executable (if flag is false) by setting - /// the file's permission bits accordingly. + Timestamp getLastModified() const; + /// Returns the modification date of the file. + + File& setLastModified(const Timestamp& ts); + /// Sets the modification date of the file. + + FileSize getSize() const; + /// Returns the size of the file in bytes. + + File& setSize(FileSize size); + /// Sets the size of the file in bytes. Can be used + /// to truncate a file. + + File& setWriteable(bool flag = true); + /// Makes the file writeable (if flag is true), or + /// non-writeable (if flag is false) by setting the + /// file's flags in the filesystem accordingly. + + File& setReadOnly(bool flag = true); + /// Makes the file non-writeable (if flag is true), or + /// writeable (if flag is false) by setting the + /// file's flags in the filesystem accordingly. + + File& setExecutable(bool flag = true); + /// Makes the file executable (if flag is true), or + /// non-executable (if flag is false) by setting + /// the file's permission bits accordingly. /// /// Does nothing on Windows and OpenVMS. diff --git a/Foundation/include/Poco/FileChannel.h b/Foundation/include/Poco/FileChannel.h index ad0074f9a..17776acd1 100644 --- a/Foundation/include/Poco/FileChannel.h +++ b/Foundation/include/Poco/FileChannel.h @@ -1,7 +1,7 @@ // // FileChannel.h // -// $Id: //poco/1.3/Foundation/include/Poco/FileChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FileChannel.h#2 $ // // Library: Foundation // Package: Logging @@ -137,13 +137,13 @@ class Foundation_API FileChannel: public Channel /// for the "times" property are supported: /// /// * utc: Rotation strategy is based on UTC time (default). - /// * local: Rotation strategy is based on local time. - /// - /// Archived log files can be compressed using the gzip compression - /// method. Compressing can be controlled with the "compression" - /// property. The following values for the "compress" property - /// are supported: - /// + /// * local: Rotation strategy is based on local time. + /// + /// Archived log files can be compressed using the gzip compression + /// method. Compressing can be controlled with the "compression" + /// property. The following values for the "compress" property + /// are supported: + /// /// * true: Compress archived log files. /// * false: Do not compress archived log files. /// @@ -151,23 +151,23 @@ class Foundation_API FileChannel: public Channel /// they reach a certain age, or if the number of archived /// log files reaches a given maximum number. This is /// controlled by the purgeAge and purgeCount properties. - /// - /// The purgeAge property can have the following values: - /// - /// * "none" or "" no purging - /// * [seconds] the maximum age is seconds. - /// * minutes: the maximum age is minutes. - /// * hours: the maximum age is hours. + /// + /// The purgeAge property can have the following values: + /// + /// * "none" or "" no purging + /// * [seconds] the maximum age is seconds. + /// * minutes: the maximum age is minutes. + /// * hours: the maximum age is hours. /// * days: the maximum age is days. - /// * weeks: the maximum age is weeks. - /// * months: the maximum age is months, where a month has 30 days. - /// - /// The purgeCount property has an integer value that specifies the maximum number - /// of archived log files. If the number is exceeded, archived log files are - /// deleted, starting with the oldest. When "none" or empty string are - /// supplied, they reset purgeCount to none (no purging). - /// - /// For a more lightweight file channel class, see SimpleFileChannel. + /// * weeks: the maximum age is weeks. + /// * months: the maximum age is months, where a month has 30 days. + /// + /// The purgeCount property has an integer value that specifies the maximum number + /// of archived log files. If the number is exceeded, archived log files are + /// deleted, starting with the oldest. When "none" or empty string are + /// supplied, they reset purgeCount to none (no purging). + /// + /// For a more lightweight file channel class, see SimpleFileChannel. { public: FileChannel(); diff --git a/Foundation/include/Poco/FileStream.h b/Foundation/include/Poco/FileStream.h index 65938634a..cc8638e31 100644 --- a/Foundation/include/Poco/FileStream.h +++ b/Foundation/include/Poco/FileStream.h @@ -1,7 +1,7 @@ // // FileStream.h // -// $Id: //poco/svn/Foundation/include/Poco/FileStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FileStream.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/FileStreamFactory.h b/Foundation/include/Poco/FileStreamFactory.h index 7e626e382..c55bc9f09 100644 --- a/Foundation/include/Poco/FileStreamFactory.h +++ b/Foundation/include/Poco/FileStreamFactory.h @@ -1,7 +1,7 @@ // // FileStreamFactory.h // -// $Id: //poco/svn/Foundation/include/Poco/FileStreamFactory.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FileStreamFactory.h#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/include/Poco/FileStream_POSIX.h b/Foundation/include/Poco/FileStream_POSIX.h index 50556a5c2..e17ee967e 100644 --- a/Foundation/include/Poco/FileStream_POSIX.h +++ b/Foundation/include/Poco/FileStream_POSIX.h @@ -1,7 +1,7 @@ // // FileStream_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/FileStream_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FileStream_POSIX.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/FileStream_WIN32.h b/Foundation/include/Poco/FileStream_WIN32.h index a4182e8a1..8e5da49ab 100644 --- a/Foundation/include/Poco/FileStream_WIN32.h +++ b/Foundation/include/Poco/FileStream_WIN32.h @@ -1,7 +1,7 @@ // // FileStream_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/FileStream_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FileStream_WIN32.h#1 $ // // Library: Foundation // Package: Streams @@ -58,15 +58,15 @@ public: ~FileStreamBuf(); /// Destroys the FileStream. - void open(const std::string& path, std::ios::openmode mode); - /// Opens the given file in the given mode. + void open(const std::string& path, std::ios::openmode mode); + /// Opens the given file in the given mode. - bool close(); - /// Closes the File stream buffer. Returns true if successful, - /// false otherwise. + bool close(); + /// Closes the File stream buffer. Returns true if successful, + /// false otherwise. - std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out); - /// change position by offset, according to way and mode + std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out); + /// change position by offset, according to way and mode std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out); /// change to specified position, according to mode diff --git a/Foundation/include/Poco/File_UNIX.h b/Foundation/include/Poco/File_UNIX.h index ff205af0a..687433eae 100644 --- a/Foundation/include/Poco/File_UNIX.h +++ b/Foundation/include/Poco/File_UNIX.h @@ -1,7 +1,7 @@ // // File_UNIX.h // -// $Id: //poco/Main/Foundation/include/Poco/File_UNIX.h#6 $ +// $Id: //poco/1.4/Foundation/include/Poco/File_UNIX.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/File_VMS.h b/Foundation/include/Poco/File_VMS.h index 58f963f0a..1b3547590 100644 --- a/Foundation/include/Poco/File_VMS.h +++ b/Foundation/include/Poco/File_VMS.h @@ -1,7 +1,7 @@ // // File_VMS.h // -// $Id: //poco/Main/Foundation/include/Poco/File_VMS.h#6 $ +// $Id: //poco/1.4/Foundation/include/Poco/File_VMS.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/File_WIN32.h b/Foundation/include/Poco/File_WIN32.h index 6cd2ccdc7..fb39b7bfc 100644 --- a/Foundation/include/Poco/File_WIN32.h +++ b/Foundation/include/Poco/File_WIN32.h @@ -1,7 +1,7 @@ // // File_WIN32.h // -// $Id: //poco/Main/Foundation/include/Poco/File_WIN32.h#6 $ +// $Id: //poco/1.4/Foundation/include/Poco/File_WIN32.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/File_WIN32U.h b/Foundation/include/Poco/File_WIN32U.h index e74258c91..26f63f01a 100644 --- a/Foundation/include/Poco/File_WIN32U.h +++ b/Foundation/include/Poco/File_WIN32U.h @@ -1,7 +1,7 @@ // // File_WIN32U.h // -// $Id: //poco/Main/Foundation/include/Poco/File_WIN32U.h#6 $ +// $Id: //poco/1.4/Foundation/include/Poco/File_WIN32U.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/Format.h b/Foundation/include/Poco/Format.h index c385db82f..f53d0fabc 100644 --- a/Foundation/include/Poco/Format.h +++ b/Foundation/include/Poco/Format.h @@ -1,7 +1,7 @@ // // Format.h // -// $Id: //poco/1.4/Foundation/include/Poco/Format.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Format.h#2 $ // // Library: Foundation // Package: Core @@ -106,18 +106,18 @@ std::string Foundation_API format(const std::string& fmt, const Any& value); /// If the number of characters in the output value is less than the specified width, blanks or /// leading zeros are added, according to the specified flags (-, +, 0). /// - /// Precision is a nonnegative decimal integer, preceded by a period (.), which specifies the number of characters - /// to be printed, the number of decimal places, or the number of significant digits. - /// - /// Throws an InvalidArgumentException if an argument index is out of range. - /// - /// Starting with release 1.4.3, an argument that does not match the format - /// specifier no longer results in a BadCastException. The string [ERRFMT] is - /// written to the result string instead. - /// - /// If there are more format specifiers than values, the format specifiers without a corresponding value - /// are copied verbatim to output. - /// + /// Precision is a nonnegative decimal integer, preceded by a period (.), which specifies the number of characters + /// to be printed, the number of decimal places, or the number of significant digits. + /// + /// Throws an InvalidArgumentException if an argument index is out of range. + /// + /// Starting with release 1.4.3, an argument that does not match the format + /// specifier no longer results in a BadCastException. The string [ERRFMT] is + /// written to the result string instead. + /// + /// If there are more format specifiers than values, the format specifiers without a corresponding value + /// are copied verbatim to output. + /// /// If there are more values than format specifiers, the superfluous values are ignored. /// /// Usage Examples: diff --git a/Foundation/include/Poco/Formatter.h b/Foundation/include/Poco/Formatter.h index f93a21b28..5f78e9220 100644 --- a/Foundation/include/Poco/Formatter.h +++ b/Foundation/include/Poco/Formatter.h @@ -1,7 +1,7 @@ // // Formatter.h // -// $Id: //poco/svn/Foundation/include/Poco/Formatter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Formatter.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/FormattingChannel.h b/Foundation/include/Poco/FormattingChannel.h index 3b56055a8..dd5b32fcb 100644 --- a/Foundation/include/Poco/FormattingChannel.h +++ b/Foundation/include/Poco/FormattingChannel.h @@ -1,7 +1,7 @@ // // FormattingChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/FormattingChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FormattingChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/FunctionDelegate.h b/Foundation/include/Poco/FunctionDelegate.h index c344fb6a6..c7b6a98bc 100644 --- a/Foundation/include/Poco/FunctionDelegate.h +++ b/Foundation/include/Poco/FunctionDelegate.h @@ -1,7 +1,7 @@ // // FunctionDelegate.h // -// $Id: //poco/svn/Foundation/include/Poco/FunctionDelegate.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FunctionDelegate.h#4 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the FunctionDelegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,12 +36,13 @@ // -#ifndef Foundation_FunctionDelegate_INCLUDED -#define Foundation_FunctionDelegate_INCLUDED +#ifndef Foundation_FunctionDelegate_INCLUDED +#define Foundation_FunctionDelegate_INCLUDED #include "Poco/Foundation.h" #include "Poco/AbstractDelegate.h" +#include "Poco/Mutex.h" namespace Poco { @@ -49,17 +50,16 @@ namespace Poco { template class FunctionDelegate: public AbstractDelegate - /// Wraps a C style function (or a C++ static function) to be used as - /// a delegate + /// Wraps a freestanding function or static member function + /// for use as a Delegate. { public: - typedef void (*NotifyMethod)(const void*, TArgs&); + typedef void (*NotifyMethod)(const void*, TArgs&); - FunctionDelegate(NotifyMethod method): - AbstractDelegate(*reinterpret_cast(&method)), - _receiverMethod(method) - { - } + FunctionDelegate(NotifyMethod method): + _receiverMethod(method) + { + } FunctionDelegate(const FunctionDelegate& delegate): AbstractDelegate(delegate), @@ -81,22 +81,40 @@ public: return *this; } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(sender, arguments); - return true; // a "standard" delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(sender, arguments); + return true; + } + else return false; + } - AbstractDelegate* clone() const + bool equals(const AbstractDelegate& other) const + { + const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const { - return new FunctionDelegate(*this); - } + return new FunctionDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionDelegate(); + FunctionDelegate(); }; @@ -104,13 +122,12 @@ template class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyMethod)(void*, TArgs&); + typedef void (*NotifyMethod)(void*, TArgs&); - FunctionDelegate(NotifyMethod method): - AbstractDelegate(*reinterpret_cast(&method)), - _receiverMethod(method) - { - } + FunctionDelegate(NotifyMethod method): + _receiverMethod(method) + { + } FunctionDelegate(const FunctionDelegate& delegate): AbstractDelegate(delegate), @@ -132,22 +149,40 @@ public: return *this; } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(const_cast(sender), arguments); - return true; // a "standard" delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(const_cast(sender), arguments); + return true; + } + else return false; + } - AbstractDelegate* clone() const + bool equals(const AbstractDelegate& other) const + { + const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const { - return new FunctionDelegate(*this); - } + return new FunctionDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionDelegate(); + FunctionDelegate(); }; @@ -155,13 +190,12 @@ template class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyMethod)(TArgs&); + typedef void (*NotifyMethod)(TArgs&); - FunctionDelegate(NotifyMethod method): - AbstractDelegate(*reinterpret_cast(&method)), - _receiverMethod(method) - { - } + FunctionDelegate(NotifyMethod method): + _receiverMethod(method) + { + } FunctionDelegate(const FunctionDelegate& delegate): AbstractDelegate(delegate), @@ -183,26 +217,44 @@ public: return *this; } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(arguments); - return true; // a "standard" delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(arguments); + return true; + } + else return false; + } - AbstractDelegate* clone() const + bool equals(const AbstractDelegate& other) const + { + const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const { - return new FunctionDelegate(*this); - } + return new FunctionDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionDelegate(); + FunctionDelegate(); }; } // namespace Poco -#endif +#endif // Foundation_FunctionDelegate_INCLUDED diff --git a/Foundation/include/Poco/FunctionPriorityDelegate.h b/Foundation/include/Poco/FunctionPriorityDelegate.h index f567193d9..92a6c59d0 100644 --- a/Foundation/include/Poco/FunctionPriorityDelegate.h +++ b/Foundation/include/Poco/FunctionPriorityDelegate.h @@ -1,7 +1,7 @@ // // FunctionPriorityDelegate.h // -// $Id: //poco/svn/Foundation/include/Poco/FunctionPriorityDelegate.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/FunctionPriorityDelegate.h#5 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the FunctionPriorityDelegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,12 +36,13 @@ // -#ifndef Foundation_FunctionPriorityDelegate_INCLUDED -#define Foundation_FunctionPriorityDelegate_INCLUDED +#ifndef Foundation_FunctionPriorityDelegate_INCLUDED +#define Foundation_FunctionPriorityDelegate_INCLUDED #include "Poco/Foundation.h" #include "Poco/AbstractPriorityDelegate.h" +#include "Poco/Mutex.h" namespace Poco { @@ -49,23 +50,23 @@ namespace Poco { template class FunctionPriorityDelegate: public AbstractPriorityDelegate - /// Wraps a C style function (or a C++ static fucntion) to be used as - /// a priority delegate + /// Wraps a freestanding function or static member function + /// for use as a PriorityDelegate. { public: - typedef void (*NotifyMethod)(const void*, TArgs&); + typedef void (*NotifyMethod)(const void*, TArgs&); - FunctionPriorityDelegate(NotifyMethod method, int prio): - AbstractPriorityDelegate(*reinterpret_cast(&method), prio), - _receiverMethod(method) - { - } - - FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): - AbstractPriorityDelegate(delegate._pTarget, delegate._priority), - _receiverMethod(delegate._receiverMethod) - { - } + FunctionPriorityDelegate(NotifyMethod method, int prio): + AbstractPriorityDelegate(prio), + _receiverMethod(method) + { + } + + FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): + AbstractPriorityDelegate(delegate), + _receiverMethod(delegate._receiverMethod) + { + } FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) { @@ -82,22 +83,40 @@ public: { } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(sender, arguments); - return true; // per default the delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(sender, arguments); + return true; + } + else return false; + } - AbstractPriorityDelegate* clone() const - { - return new FunctionPriorityDelegate(*this); - } + bool equals(const AbstractDelegate& other) const + { + const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const + { + return new FunctionPriorityDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionPriorityDelegate(); + FunctionPriorityDelegate(); }; @@ -105,19 +124,19 @@ template class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyMethod)(void*, TArgs&); + typedef void (*NotifyMethod)(void*, TArgs&); - FunctionPriorityDelegate(NotifyMethod method, int prio): - AbstractPriorityDelegate(*reinterpret_cast(&method), prio), - _receiverMethod(method) - { - } - - FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): - AbstractPriorityDelegate(delegate._pTarget, delegate._priority), - _receiverMethod(delegate._receiverMethod) - { - } + FunctionPriorityDelegate(NotifyMethod method, int prio): + AbstractPriorityDelegate(prio), + _receiverMethod(method) + { + } + + FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): + AbstractPriorityDelegate(delegate), + _receiverMethod(delegate._receiverMethod) + { + } FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) { @@ -134,43 +153,60 @@ public: { } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(const_cast(sender), arguments); - return true; // per default the delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(const_cast(sender), arguments); + return true; + } + else return false; + } - AbstractPriorityDelegate* clone() const - { - return new FunctionPriorityDelegate(*this); - } + bool equals(const AbstractDelegate& other) const + { + const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const + { + return new FunctionPriorityDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionPriorityDelegate(); + FunctionPriorityDelegate(); }; - template class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyMethod)(TArgs&); + typedef void (*NotifyMethod)(TArgs&); - FunctionPriorityDelegate(NotifyMethod method, int prio): - AbstractPriorityDelegate(*reinterpret_cast(&method), prio), - _receiverMethod(method) - { - } - - FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): - AbstractPriorityDelegate(delegate._pTarget, delegate._priority), - _receiverMethod(delegate._receiverMethod) - { - } + FunctionPriorityDelegate(NotifyMethod method, int prio): + AbstractPriorityDelegate(prio), + _receiverMethod(method) + { + } + + FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): + AbstractPriorityDelegate(delegate), + _receiverMethod(delegate._receiverMethod) + { + } FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) { @@ -187,26 +223,44 @@ public: { } - bool notify(const void* sender, TArgs& arguments) - { - (*_receiverMethod)(arguments); - return true; // per default the delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverMethod) + { + (*_receiverMethod)(arguments); + return true; + } + else return false; + } - AbstractPriorityDelegate* clone() const - { - return new FunctionPriorityDelegate(*this); - } + bool equals(const AbstractDelegate& other) const + { + const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const + { + return new FunctionPriorityDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverMethod = 0; + } protected: - NotifyMethod _receiverMethod; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - FunctionPriorityDelegate(); + FunctionPriorityDelegate(); }; } // namespace Poco -#endif +#endif // Foundation_FunctionPriorityDelegate_INCLUDED diff --git a/Foundation/include/Poco/Glob.h b/Foundation/include/Poco/Glob.h index 9451482f3..838eddd6f 100644 --- a/Foundation/include/Poco/Glob.h +++ b/Foundation/include/Poco/Glob.h @@ -1,7 +1,7 @@ // // Glob.h // -// $Id: //poco/1.3/Foundation/include/Poco/Glob.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Glob.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/HMACEngine.h b/Foundation/include/Poco/HMACEngine.h index cb6f7586f..da3024d48 100644 --- a/Foundation/include/Poco/HMACEngine.h +++ b/Foundation/include/Poco/HMACEngine.h @@ -1,7 +1,7 @@ // // HMACEngine.h // -// $Id: //poco/svn/Foundation/include/Poco/HMACEngine.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HMACEngine.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/Hash.h b/Foundation/include/Poco/Hash.h index b73b81568..df6fc9cbb 100644 --- a/Foundation/include/Poco/Hash.h +++ b/Foundation/include/Poco/Hash.h @@ -1,127 +1,127 @@ -// -// Hash.h -// -// $Id: //poco/Main/Foundation/include/Poco/Hash.h#4 $ -// -// Library: Foundation -// Package: Hashing -// Module: Hash -// -// Definition of the Hash class. -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - - -#ifndef Foundation_Hash_INCLUDED -#define Foundation_Hash_INCLUDED - - -#include "Poco/Foundation.h" -#include - - -namespace Poco { - - -std::size_t Foundation_API hash(Int8 n); -std::size_t Foundation_API hash(UInt8 n); -std::size_t Foundation_API hash(Int16 n); -std::size_t Foundation_API hash(UInt16 n); -std::size_t Foundation_API hash(Int32 n); -std::size_t Foundation_API hash(UInt32 n); -std::size_t Foundation_API hash(Int64 n); -std::size_t Foundation_API hash(UInt64 n); -std::size_t Foundation_API hash(const std::string& str); - - -template -struct Hash - /// A generic hash function. -{ - std::size_t operator () (T value) const - /// Returns the hash for the given value. - { - return Poco::hash(value); - } -}; - - -// -// inlines -// -inline std::size_t hash(Int8 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(UInt8 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(Int16 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(UInt16 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(Int32 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(UInt32 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(Int64 n) -{ - return static_cast(n)*2654435761U; -} - - -inline std::size_t hash(UInt64 n) -{ - return static_cast(n)*2654435761U; -} - - -} // namespace Poco - - -#endif // Foundation_Hash_INCLUDED +// +// Hash.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Hash.h#1 $ +// +// Library: Foundation +// Package: Hashing +// Module: Hash +// +// Definition of the Hash class. +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software, unless such copies or derivative +// works are solely in the form of machine-executable object code generated by +// a source language processor. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + + +#ifndef Foundation_Hash_INCLUDED +#define Foundation_Hash_INCLUDED + + +#include "Poco/Foundation.h" +#include + + +namespace Poco { + + +std::size_t Foundation_API hash(Int8 n); +std::size_t Foundation_API hash(UInt8 n); +std::size_t Foundation_API hash(Int16 n); +std::size_t Foundation_API hash(UInt16 n); +std::size_t Foundation_API hash(Int32 n); +std::size_t Foundation_API hash(UInt32 n); +std::size_t Foundation_API hash(Int64 n); +std::size_t Foundation_API hash(UInt64 n); +std::size_t Foundation_API hash(const std::string& str); + + +template +struct Hash + /// A generic hash function. +{ + std::size_t operator () (T value) const + /// Returns the hash for the given value. + { + return Poco::hash(value); + } +}; + + +// +// inlines +// +inline std::size_t hash(Int8 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(UInt8 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(Int16 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(UInt16 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(Int32 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(UInt32 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(Int64 n) +{ + return static_cast(n)*2654435761U; +} + + +inline std::size_t hash(UInt64 n) +{ + return static_cast(n)*2654435761U; +} + + +} // namespace Poco + + +#endif // Foundation_Hash_INCLUDED diff --git a/Foundation/include/Poco/HashFunction.h b/Foundation/include/Poco/HashFunction.h index 83d3f2f28..1a4ae786f 100644 --- a/Foundation/include/Poco/HashFunction.h +++ b/Foundation/include/Poco/HashFunction.h @@ -1,7 +1,7 @@ // // HashFunction.h // -// $Id: //poco/Main/Foundation/include/Poco/HashFunction.h#5 $ +// $Id: //poco/1.4/Foundation/include/Poco/HashFunction.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/HashMap.h b/Foundation/include/Poco/HashMap.h index d72669038..3684c211c 100644 --- a/Foundation/include/Poco/HashMap.h +++ b/Foundation/include/Poco/HashMap.h @@ -1,7 +1,7 @@ // // HashMap.h // -// $Id: //poco/svn/Foundation/include/Poco/HashMap.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HashMap.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/HashSet.h b/Foundation/include/Poco/HashSet.h index d77f18523..211c00489 100644 --- a/Foundation/include/Poco/HashSet.h +++ b/Foundation/include/Poco/HashSet.h @@ -1,7 +1,7 @@ // // HashSet.h // -// $Id: //poco/svn/Foundation/include/Poco/HashSet.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HashSet.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/HashStatistic.h b/Foundation/include/Poco/HashStatistic.h index 3eee2e958..95a2c4c31 100644 --- a/Foundation/include/Poco/HashStatistic.h +++ b/Foundation/include/Poco/HashStatistic.h @@ -1,7 +1,7 @@ // // HashStatistic.h // -// $Id: //poco/svn/Foundation/include/Poco/HashStatistic.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HashStatistic.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/HashTable.h b/Foundation/include/Poco/HashTable.h index 738d34a04..b85924dd9 100644 --- a/Foundation/include/Poco/HashTable.h +++ b/Foundation/include/Poco/HashTable.h @@ -1,7 +1,7 @@ // // HashTable.h // -// $Id: //poco/svn/Foundation/include/Poco/HashTable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HashTable.h#1 $ // // Library: Foundation // Package: Hashing @@ -77,13 +77,13 @@ public: _entries(0), _size(0), _maxCapacity(initialSize) - /// Creates the HashTable. - { - _entries = new HashEntryMap*[initialSize]; - std::memset(_entries, '\0', sizeof(HashEntryMap*)*initialSize); - } + /// Creates the HashTable. + { + _entries = new HashEntryMap*[initialSize]; + std::memset(_entries, '\0', sizeof(HashEntryMap*)*initialSize); + } - HashTable(const HashTable& ht): + HashTable(const HashTable& ht): _entries(new HashEntryMap*[ht._maxCapacity]), _size(ht._size), _maxCapacity(ht._maxCapacity) @@ -312,13 +312,13 @@ public: { HashTableVector cpy = _entries; _entries = 0; - UInt32 oldSize = _maxCapacity; - _maxCapacity = newSize; - _entries = new HashEntryMap*[_maxCapacity]; - std::memset(_entries, '\0', sizeof(HashEntryMap*)*_maxCapacity); + UInt32 oldSize = _maxCapacity; + _maxCapacity = newSize; + _entries = new HashEntryMap*[_maxCapacity]; + std::memset(_entries, '\0', sizeof(HashEntryMap*)*_maxCapacity); - if (_size == 0) - { + if (_size == 0) + { // no data was yet inserted delete[] cpy; return; diff --git a/Foundation/include/Poco/HexBinaryDecoder.h b/Foundation/include/Poco/HexBinaryDecoder.h index 24cb27dd8..0ae2f4b5e 100644 --- a/Foundation/include/Poco/HexBinaryDecoder.h +++ b/Foundation/include/Poco/HexBinaryDecoder.h @@ -1,7 +1,7 @@ // // HexBinaryDecoder.h // -// $Id: //poco/svn/Foundation/include/Poco/HexBinaryDecoder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HexBinaryDecoder.h#2 $ // // Library: Foundation // Package: Streams @@ -52,25 +52,25 @@ class Foundation_API HexBinaryDecoderBuf: public UnbufferedStreamBuf /// This streambuf decodes all hexBinary-encoded data read /// from the istream connected to it. /// In hexBinary encoding, each binary octet is encoded as a character tuple, - /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. - /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), - /// section 3.2.15. - /// - /// Note: For performance reasons, the characters - /// are read directly from the given istream's - /// underlying streambuf, so the state - /// of the istream will not reflect that of - /// its streambuf. + /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. + /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), + /// section 3.2.15. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. { public: - HexBinaryDecoderBuf(std::istream& istr); + HexBinaryDecoderBuf(std::istream& istr); ~HexBinaryDecoderBuf(); private: - int readFromDevice(); - int readOne(); + int readFromDevice(); + int readOne(); - std::streambuf& _buf; + std::streambuf& _buf; }; @@ -94,18 +94,18 @@ class Foundation_API HexBinaryDecoder: public HexBinaryDecoderIOS, public std::i /// This istream decodes all hexBinary-encoded data read /// from the istream connected to it. /// In hexBinary encoding, each binary octet is encoded as a character tuple, - /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. - /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), - /// section 3.2.15. - /// - /// Note: For performance reasons, the characters - /// are read directly from the given istream's - /// underlying streambuf, so the state - /// of the istream will not reflect that of - /// its streambuf. + /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. + /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), + /// section 3.2.15. + /// + /// Note: For performance reasons, the characters + /// are read directly from the given istream's + /// underlying streambuf, so the state + /// of the istream will not reflect that of + /// its streambuf. { public: - HexBinaryDecoder(std::istream& istr); + HexBinaryDecoder(std::istream& istr); ~HexBinaryDecoder(); }; diff --git a/Foundation/include/Poco/HexBinaryEncoder.h b/Foundation/include/Poco/HexBinaryEncoder.h index 8854ea4c2..d6f39eb02 100644 --- a/Foundation/include/Poco/HexBinaryEncoder.h +++ b/Foundation/include/Poco/HexBinaryEncoder.h @@ -1,7 +1,7 @@ // // HexBinaryEncoder.h // -// $Id: //poco/svn/Foundation/include/Poco/HexBinaryEncoder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/HexBinaryEncoder.h#2 $ // // Library: Foundation // Package: Streams @@ -53,17 +53,17 @@ class Foundation_API HexBinaryEncoderBuf: public UnbufferedStreamBuf /// to it in hexBinary encoding and forwards it to a connected /// ostream. /// In hexBinary encoding, each binary octet is encoded as a character tuple, - /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. - /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), - /// section 3.2.15. - /// - /// Note: The characters are directly written - /// to the ostream's streambuf, thus bypassing - /// the ostream. The ostream's state is therefore - /// not updated to match the buffer's state. + /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. + /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), + /// section 3.2.15. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. { public: - HexBinaryEncoderBuf(std::ostream& ostr); + HexBinaryEncoderBuf(std::ostream& ostr); ~HexBinaryEncoderBuf(); int close(); @@ -86,10 +86,10 @@ public: private: int writeToDevice(char c); - int _pos; - int _lineLength; - int _uppercase; - std::streambuf& _buf; + int _pos; + int _lineLength; + int _uppercase; + std::streambuf& _buf; }; @@ -118,17 +118,17 @@ class Foundation_API HexBinaryEncoder: public HexBinaryEncoderIOS, public std::o /// writing data, to ensure proper /// completion of the encoding operation. /// In hexBinary encoding, each binary octet is encoded as a character tuple, - /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. - /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), - /// section 3.2.15. - /// - /// Note: The characters are directly written - /// to the ostream's streambuf, thus bypassing - /// the ostream. The ostream's state is therefore - /// not updated to match the buffer's state. + /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. + /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/), + /// section 3.2.15. + /// + /// Note: The characters are directly written + /// to the ostream's streambuf, thus bypassing + /// the ostream. The ostream's state is therefore + /// not updated to match the buffer's state. { public: - HexBinaryEncoder(std::ostream& ostr); + HexBinaryEncoder(std::ostream& ostr); ~HexBinaryEncoder(); }; diff --git a/Foundation/include/Poco/Instantiator.h b/Foundation/include/Poco/Instantiator.h index 91109d900..8d49b0c9c 100644 --- a/Foundation/include/Poco/Instantiator.h +++ b/Foundation/include/Poco/Instantiator.h @@ -1,7 +1,7 @@ // // Instantiator.h // -// $Id: //poco/svn/Foundation/include/Poco/Instantiator.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Instantiator.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/KeyValueArgs.h b/Foundation/include/Poco/KeyValueArgs.h index 3511f7678..4b9eda328 100644 --- a/Foundation/include/Poco/KeyValueArgs.h +++ b/Foundation/include/Poco/KeyValueArgs.h @@ -1,7 +1,7 @@ // // KeyValueArgs.h // -// $Id: //poco/svn/Foundation/include/Poco/KeyValueArgs.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/KeyValueArgs.h#1 $ // // Library: Foundation // Package: Cache diff --git a/Foundation/include/Poco/LRUCache.h b/Foundation/include/Poco/LRUCache.h index c01858a2f..f358c6078 100644 --- a/Foundation/include/Poco/LRUCache.h +++ b/Foundation/include/Poco/LRUCache.h @@ -1,7 +1,7 @@ // // LRUCache.h // -// $Id: //poco/svn/Foundation/include/Poco/LRUCache.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LRUCache.h#1 $ // // Library: Foundation // Package: Cache @@ -51,13 +51,13 @@ template < class TKey, class TValue, class TMutex = FastMutex, - class TEventMutex = FastMutex + class TEventMutex = FastMutex > class LRUCache: public AbstractCache, TMutex, TEventMutex> - /// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries. + /// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries. { public: - LRUCache(long size = 1024): + LRUCache(long size = 1024): AbstractCache, TMutex, TEventMutex>(LRUStrategy(size)) { } diff --git a/Foundation/include/Poco/Latin9Encoding.h b/Foundation/include/Poco/Latin9Encoding.h index ca4af92fe..728ae64d4 100644 --- a/Foundation/include/Poco/Latin9Encoding.h +++ b/Foundation/include/Poco/Latin9Encoding.h @@ -1,7 +1,7 @@ // // Latin9Encoding.h // -// $Id: //poco/svn/Foundation/include/Poco/Latin9Encoding.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Latin9Encoding.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/LineEndingConverter.h b/Foundation/include/Poco/LineEndingConverter.h index bc868c9d7..fd5c49b5c 100644 --- a/Foundation/include/Poco/LineEndingConverter.h +++ b/Foundation/include/Poco/LineEndingConverter.h @@ -1,7 +1,7 @@ // // LineEndingConverter.h // -// $Id: //poco/svn/Foundation/include/Poco/LineEndingConverter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LineEndingConverter.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/LinearHashTable.h b/Foundation/include/Poco/LinearHashTable.h index 7cbc6d5ca..21bc7e1cc 100644 --- a/Foundation/include/Poco/LinearHashTable.h +++ b/Foundation/include/Poco/LinearHashTable.h @@ -1,7 +1,7 @@ // // LinearHashTable.h // -// $Id: //poco/svn/Foundation/include/Poco/LinearHashTable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LinearHashTable.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/LocalDateTime.h b/Foundation/include/Poco/LocalDateTime.h index 1fe1904c3..b8840d613 100644 --- a/Foundation/include/Poco/LocalDateTime.h +++ b/Foundation/include/Poco/LocalDateTime.h @@ -1,7 +1,7 @@ // // LocalDateTime.h // -// $Id: //poco/svn/Foundation/include/Poco/LocalDateTime.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/LocalDateTime.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/LogFile.h b/Foundation/include/Poco/LogFile.h index e847091a1..102b7bc02 100644 --- a/Foundation/include/Poco/LogFile.h +++ b/Foundation/include/Poco/LogFile.h @@ -1,7 +1,7 @@ // // LogFile.h // -// $Id: //poco/svn/Foundation/include/Poco/LogFile.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogFile.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LogFile_STD.h b/Foundation/include/Poco/LogFile_STD.h index 9c0039838..0d5344cb2 100644 --- a/Foundation/include/Poco/LogFile_STD.h +++ b/Foundation/include/Poco/LogFile_STD.h @@ -1,7 +1,7 @@ // // LogFile_STD.h // -// $Id: //poco/svn/Foundation/include/Poco/LogFile_STD.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogFile_STD.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LogFile_VMS.h b/Foundation/include/Poco/LogFile_VMS.h index 753c39528..6ddf0d156 100644 --- a/Foundation/include/Poco/LogFile_VMS.h +++ b/Foundation/include/Poco/LogFile_VMS.h @@ -1,7 +1,7 @@ // // LogFile_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/LogFile_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogFile_VMS.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LogFile_WIN32.h b/Foundation/include/Poco/LogFile_WIN32.h index 3a1f5d800..0f743fced 100644 --- a/Foundation/include/Poco/LogFile_WIN32.h +++ b/Foundation/include/Poco/LogFile_WIN32.h @@ -1,7 +1,7 @@ // // LogFile_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/LogFile_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogFile_WIN32.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LogFile_WIN32U.h b/Foundation/include/Poco/LogFile_WIN32U.h index 1d7375a33..119eb97e8 100644 --- a/Foundation/include/Poco/LogFile_WIN32U.h +++ b/Foundation/include/Poco/LogFile_WIN32U.h @@ -1,7 +1,7 @@ // // LogFile_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/LogFile_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogFile_WIN32U.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LogStream.h b/Foundation/include/Poco/LogStream.h index 917ab72a3..bea9cb2ff 100644 --- a/Foundation/include/Poco/LogStream.h +++ b/Foundation/include/Poco/LogStream.h @@ -1,7 +1,7 @@ // // LogStream.h // -// $Id: //poco/svn/Foundation/include/Poco/LogStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LogStream.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Logger.h b/Foundation/include/Poco/Logger.h index 195c6d99f..8e065647f 100644 --- a/Foundation/include/Poco/Logger.h +++ b/Foundation/include/Poco/Logger.h @@ -1,7 +1,7 @@ // // Logger.h // -// $Id: //poco/1.4/Foundation/include/Poco/Logger.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Logger.h#5 $ // // Library: Foundation // Package: Logging @@ -396,28 +396,28 @@ public: /// Loggers. static void names(std::vector& names); - /// Fills the given vector with the names - /// of all currently defined loggers. - - static int parseLevel(const std::string& level); - /// Parses a symbolic log level from a string and - /// returns the resulting numeric level. - /// - /// Valid symbolic levels are: - /// - none (turns off logging) - /// - fatal - /// - critical - /// - error - /// - warning - /// - notice - /// - information - /// - debug - /// - trace - /// - /// The level is not case sensitive. - - static const std::string ROOT; /// The name of the root logger (""). - + /// Fills the given vector with the names + /// of all currently defined loggers. + + static int parseLevel(const std::string& level); + /// Parses a symbolic log level from a string and + /// returns the resulting numeric level. + /// + /// Valid symbolic levels are: + /// - none (turns off logging) + /// - fatal + /// - critical + /// - error + /// - warning + /// - notice + /// - information + /// - debug + /// - trace + /// + /// The level is not case sensitive. + + static const std::string ROOT; /// The name of the root logger (""). + protected: typedef std::map LoggerMap; diff --git a/Foundation/include/Poco/LoggingFactory.h b/Foundation/include/Poco/LoggingFactory.h index 94e59eea4..62ee6e1f1 100644 --- a/Foundation/include/Poco/LoggingFactory.h +++ b/Foundation/include/Poco/LoggingFactory.h @@ -1,7 +1,7 @@ // // LoggingFactory.h // -// $Id: //poco/svn/Foundation/include/Poco/LoggingFactory.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LoggingFactory.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/LoggingRegistry.h b/Foundation/include/Poco/LoggingRegistry.h index 7d288998e..febb59651 100644 --- a/Foundation/include/Poco/LoggingRegistry.h +++ b/Foundation/include/Poco/LoggingRegistry.h @@ -1,7 +1,7 @@ // // LoggingRegistry.h // -// $Id: //poco/svn/Foundation/include/Poco/LoggingRegistry.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/LoggingRegistry.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/MD2Engine.h b/Foundation/include/Poco/MD2Engine.h index f2657147b..e69de29bb 100644 --- a/Foundation/include/Poco/MD2Engine.h +++ b/Foundation/include/Poco/MD2Engine.h @@ -1,112 +0,0 @@ -// -// MD2Engine.h -// -// $Id: //poco/svn/Foundation/include/Poco/MD2Engine.h#2 $ -// -// Library: Foundation -// Package: Crypt -// Module: MD2Engine -// -// Definition of class MD2Engine. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// -// MD2 (RFC 1319) algorithm: -// Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All -// rights reserved. -// -// License to copy and use this software is granted for -// non-commercial Internet Privacy-Enhanced Mail provided that it is -// identified as the "RSA Data Security, Inc. MD2 Message Digest -// Algorithm" in all material mentioning or referencing this software -// or this function. -// -// RSA Data Security, Inc. makes no representations concerning either -// the merchantability of this software or the suitability of this -// software for any particular purpose. It is provided "as is" -// without express or implied warranty of any kind. -// -// These notices must be retained in any copies of any part of this -// documentation and/or software. -// - - -#ifndef Foundation_MD2Engine_INCLUDED -#define Foundation_MD2Engine_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/DigestEngine.h" - - -namespace Poco { - - -class Foundation_API MD2Engine: public DigestEngine - /// This class implementes the MD2 message digest algorithm, - /// described in RFC 1319. -{ -public: - enum - { - BLOCK_SIZE = 16, - DIGEST_SIZE = 16 - }; - - MD2Engine(); - ~MD2Engine(); - - unsigned digestLength() const; - void reset(); - const DigestEngine::Digest& digest(); - -protected: - void updateImpl(const void* data, unsigned length); - -private: - static void transform(unsigned char state[16], unsigned char checksum[16], const unsigned char block[16]); - - struct Context - { - unsigned char state[16]; // state - unsigned char checksum[16]; // checksum - unsigned int count; // number of bytes, modulo 16 - unsigned char buffer[16]; // input buffer - }; - - Context _context; - DigestEngine::Digest _digest; - - MD2Engine(const MD2Engine&); - MD2Engine& operator = (const MD2Engine&); -}; - - -} // namespace Poco - - -#endif // Foundation_MD2Engine_INCLUDED diff --git a/Foundation/include/Poco/MD4Engine.h b/Foundation/include/Poco/MD4Engine.h index 869f0e510..5f89fa208 100644 --- a/Foundation/include/Poco/MD4Engine.h +++ b/Foundation/include/Poco/MD4Engine.h @@ -1,7 +1,7 @@ // // MD4Engine.h // -// $Id: //poco/svn/Foundation/include/Poco/MD4Engine.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/MD4Engine.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/MD5Engine.h b/Foundation/include/Poco/MD5Engine.h index d4ebda530..26a81e8f1 100644 --- a/Foundation/include/Poco/MD5Engine.h +++ b/Foundation/include/Poco/MD5Engine.h @@ -1,7 +1,7 @@ // // MD5Engine.h // -// $Id: //poco/svn/Foundation/include/Poco/MD5Engine.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/MD5Engine.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/Manifest.h b/Foundation/include/Poco/Manifest.h index b8c1183d0..08d685d4d 100644 --- a/Foundation/include/Poco/Manifest.h +++ b/Foundation/include/Poco/Manifest.h @@ -1,7 +1,7 @@ // // Manifest.h // -// $Id: //poco/svn/Foundation/include/Poco/Manifest.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Manifest.h#1 $ // // Library: Foundation // Package: SharedLibrary diff --git a/Foundation/include/Poco/MemoryPool.h b/Foundation/include/Poco/MemoryPool.h index 7afd8230f..d4403168c 100644 --- a/Foundation/include/Poco/MemoryPool.h +++ b/Foundation/include/Poco/MemoryPool.h @@ -1,7 +1,7 @@ // // MemoryPool.h // -// $Id: //poco/svn/Foundation/include/Poco/MemoryPool.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/MemoryPool.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Message.h b/Foundation/include/Poco/Message.h index 1b4ef8b0c..b2352eeb1 100644 --- a/Foundation/include/Poco/Message.h +++ b/Foundation/include/Poco/Message.h @@ -1,7 +1,7 @@ // // Message.h // -// $Id: //poco/svn/Foundation/include/Poco/Message.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Message.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/MetaObject.h b/Foundation/include/Poco/MetaObject.h index 5a1df749a..643ee573b 100644 --- a/Foundation/include/Poco/MetaObject.h +++ b/Foundation/include/Poco/MetaObject.h @@ -1,7 +1,7 @@ // // MetaObject.h // -// $Id: //poco/svn/Foundation/include/Poco/MetaObject.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/MetaObject.h#1 $ // // Library: Foundation // Package: SharedLibrary diff --git a/Foundation/include/Poco/Mutex.h b/Foundation/include/Poco/Mutex.h index 1d1e56a1b..f56467cce 100644 --- a/Foundation/include/Poco/Mutex.h +++ b/Foundation/include/Poco/Mutex.h @@ -1,7 +1,7 @@ // // Mutex.h // -// $Id: //poco/svn/Foundation/include/Poco/Mutex.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Mutex.h#2 $ // // Library: Foundation // Package: Threading @@ -181,43 +181,43 @@ class Foundation_API NullMutex { public: typedef Poco::ScopedLock ScopedLock; - - NullMutex() - /// Creates the NullMutex. - { - } - - ~NullMutex() - /// Destroys the NullMutex. - { - } + + NullMutex() + /// Creates the NullMutex. + { + } + + ~NullMutex() + /// Destroys the NullMutex. + { + } - void lock() - /// Does nothing. - { - } - - void lock(long) - /// Does nothing. - { - } + void lock() + /// Does nothing. + { + } + + void lock(long) + /// Does nothing. + { + } - bool tryLock() - /// Does nothing and always returns true. - { - return true; - } + bool tryLock() + /// Does nothing and always returns true. + { + return true; + } - bool tryLock(long) - /// Does nothing and always returns true. - { - return true; - } + bool tryLock(long) + /// Does nothing and always returns true. + { + return true; + } - void unlock() - /// Does nothing. - { - } + void unlock() + /// Does nothing. + { + } }; diff --git a/Foundation/include/Poco/Mutex_POSIX.h b/Foundation/include/Poco/Mutex_POSIX.h index 87decb706..23e4682ab 100644 --- a/Foundation/include/Poco/Mutex_POSIX.h +++ b/Foundation/include/Poco/Mutex_POSIX.h @@ -1,7 +1,7 @@ // // Mutex_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/Mutex_POSIX.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Mutex_POSIX.h#2 $ // // Library: Foundation // Package: Threading @@ -92,7 +92,6 @@ inline bool MutexImpl::tryLockImpl() return false; else throw SystemException("cannot lock mutex"); - } diff --git a/Foundation/include/Poco/Mutex_WIN32.h b/Foundation/include/Poco/Mutex_WIN32.h index 2a0e3776c..9d137af7d 100644 --- a/Foundation/include/Poco/Mutex_WIN32.h +++ b/Foundation/include/Poco/Mutex_WIN32.h @@ -1,7 +1,7 @@ // // Mutex_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/Mutex_WIN32.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Mutex_WIN32.h#1 $ // // Library: Foundation // Package: Threading @@ -84,12 +84,12 @@ inline void MutexImpl::lockImpl() inline bool MutexImpl::tryLockImpl() { - try - { - return TryEnterCriticalSection(&_cs) != 0; - } - catch (...) - { + try + { + return TryEnterCriticalSection(&_cs) != 0; + } + catch (...) + { } throw SystemException("cannot lock mutex"); } diff --git a/Foundation/include/Poco/NamedEvent.h b/Foundation/include/Poco/NamedEvent.h index 69db86d3b..c0225db11 100644 --- a/Foundation/include/Poco/NamedEvent.h +++ b/Foundation/include/Poco/NamedEvent.h @@ -1,7 +1,7 @@ // // NamedEvent.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedEvent.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedEvent.h#2 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedEvent_UNIX.h b/Foundation/include/Poco/NamedEvent_UNIX.h index 44c9996b9..1f53a5127 100644 --- a/Foundation/include/Poco/NamedEvent_UNIX.h +++ b/Foundation/include/Poco/NamedEvent_UNIX.h @@ -1,7 +1,7 @@ // // NamedEvent_UNIX.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedEvent_UNIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_UNIX.h#1 $ // // Library: Foundation // Package: Processes @@ -58,13 +58,13 @@ protected: void waitImpl(); private: - std::string getFileName(); + std::string getFileName(); - std::string _name; + std::string _name; #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - sem_t* _sem; + sem_t* _sem; #else - int _lockfd; // lock file descriptor + int _lockfd; // lock file descriptor int _semfd; // file used to identify semaphore int _semid; // semaphore id #endif diff --git a/Foundation/include/Poco/NamedEvent_VMS.h b/Foundation/include/Poco/NamedEvent_VMS.h index 76a054051..09d196569 100644 --- a/Foundation/include/Poco/NamedEvent_VMS.h +++ b/Foundation/include/Poco/NamedEvent_VMS.h @@ -1,7 +1,7 @@ // // NamedEvent_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedEvent_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_VMS.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedEvent_WIN32.h b/Foundation/include/Poco/NamedEvent_WIN32.h index 862357a6a..d5d6f5a12 100644 --- a/Foundation/include/Poco/NamedEvent_WIN32.h +++ b/Foundation/include/Poco/NamedEvent_WIN32.h @@ -1,7 +1,7 @@ // // NamedEvent_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedEvent_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_WIN32.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedEvent_WIN32U.h b/Foundation/include/Poco/NamedEvent_WIN32U.h index 2b9865637..aff366cb6 100644 --- a/Foundation/include/Poco/NamedEvent_WIN32U.h +++ b/Foundation/include/Poco/NamedEvent_WIN32U.h @@ -1,7 +1,7 @@ // // NamedEvent_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedEvent_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_WIN32U.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedMutex_UNIX.h b/Foundation/include/Poco/NamedMutex_UNIX.h index 07ccd8cba..6bfe2f5e0 100644 --- a/Foundation/include/Poco/NamedMutex_UNIX.h +++ b/Foundation/include/Poco/NamedMutex_UNIX.h @@ -1,7 +1,7 @@ // // NamedMutex_UNIX.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedMutex_UNIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_UNIX.h#1 $ // // Library: Foundation // Package: Processes @@ -61,13 +61,13 @@ protected: void unlockImpl(); private: - std::string getFileName(); + std::string getFileName(); - std::string _name; + std::string _name; #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - sem_t* _sem; + sem_t* _sem; #else - int _lockfd; // lock file descriptor + int _lockfd; // lock file descriptor int _semfd; // file used to identify semaphore int _semid; // semaphore id #endif diff --git a/Foundation/include/Poco/NamedMutex_VMS.h b/Foundation/include/Poco/NamedMutex_VMS.h index 02831bb7b..1ae70fd21 100644 --- a/Foundation/include/Poco/NamedMutex_VMS.h +++ b/Foundation/include/Poco/NamedMutex_VMS.h @@ -1,7 +1,7 @@ // // NamedMutex_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedMutex_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_VMS.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedMutex_WIN32.h b/Foundation/include/Poco/NamedMutex_WIN32.h index b6d404c47..b35219807 100644 --- a/Foundation/include/Poco/NamedMutex_WIN32.h +++ b/Foundation/include/Poco/NamedMutex_WIN32.h @@ -1,7 +1,7 @@ // // NamedMutex_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedMutex_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_WIN32.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedMutex_WIN32U.h b/Foundation/include/Poco/NamedMutex_WIN32U.h index ec91f40df..bae45f991 100644 --- a/Foundation/include/Poco/NamedMutex_WIN32U.h +++ b/Foundation/include/Poco/NamedMutex_WIN32U.h @@ -1,7 +1,7 @@ // // NamedMutex_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedMutex_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_WIN32U.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/NamedTuple.h b/Foundation/include/Poco/NamedTuple.h index 8edeba528..1fd8b8393 100644 --- a/Foundation/include/Poco/NamedTuple.h +++ b/Foundation/include/Poco/NamedTuple.h @@ -1,7 +1,7 @@ // // NamedTuple.h // -// $Id: //poco/svn/Foundation/include/Poco/NamedTuple.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NamedTuple.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/NestedDiagnosticContext.h b/Foundation/include/Poco/NestedDiagnosticContext.h index 9654f1b7e..6c530b3f6 100644 --- a/Foundation/include/Poco/NestedDiagnosticContext.h +++ b/Foundation/include/Poco/NestedDiagnosticContext.h @@ -1,7 +1,7 @@ // // NestedDiagnosticContext.h // -// $Id: //poco/svn/Foundation/include/Poco/NestedDiagnosticContext.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NestedDiagnosticContext.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Notification.h b/Foundation/include/Poco/Notification.h index b33b906ac..92a002e0b 100644 --- a/Foundation/include/Poco/Notification.h +++ b/Foundation/include/Poco/Notification.h @@ -1,7 +1,7 @@ // // Notification.h // -// $Id: //poco/Main/Foundation/include/Poco/Notification.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Notification.h#1 $ // // Library: Foundation // Package: Notifications diff --git a/Foundation/include/Poco/NotificationCenter.h b/Foundation/include/Poco/NotificationCenter.h index e82955306..dc8b01bca 100644 --- a/Foundation/include/Poco/NotificationCenter.h +++ b/Foundation/include/Poco/NotificationCenter.h @@ -1,7 +1,7 @@ // // NotificationCenter.h // -// $Id: //poco/Main/Foundation/include/Poco/NotificationCenter.h#4 $ +// $Id: //poco/1.4/Foundation/include/Poco/NotificationCenter.h#2 $ // // Library: Foundation // Package: Notifications @@ -133,22 +133,22 @@ public: bool hasObservers() const; /// Returns true iff there is at least one registered observer. /// - /// Can be used to improve performance if an expensive notification - /// shall only be created and posted if there are any observers. - - std::size_t countObservers() const; - /// Returns the number of registered observers. - - static NotificationCenter& defaultCenter(); - /// Returns a reference to the default - /// NotificationCenter. + /// Can be used to improve performance if an expensive notification + /// shall only be created and posted if there are any observers. + + std::size_t countObservers() const; + /// Returns the number of registered observers. + + static NotificationCenter& defaultCenter(); + /// Returns a reference to the default + /// NotificationCenter. private: - typedef SharedPtr AbstractObserverPtr; - typedef std::vector ObserverList; + typedef SharedPtr AbstractObserverPtr; + typedef std::vector ObserverList; - ObserverList _observers; - mutable Mutex _mutex; + ObserverList _observers; + mutable Mutex _mutex; }; diff --git a/Foundation/include/Poco/NotificationQueue.h b/Foundation/include/Poco/NotificationQueue.h index 97d59d751..3ff497234 100644 --- a/Foundation/include/Poco/NotificationQueue.h +++ b/Foundation/include/Poco/NotificationQueue.h @@ -1,7 +1,7 @@ // // NotificationQueue.h // -// $Id: //poco/Main/Foundation/include/Poco/NotificationQueue.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/NotificationQueue.h#1 $ // // Library: Foundation // Package: Notifications diff --git a/Foundation/include/Poco/NullChannel.h b/Foundation/include/Poco/NullChannel.h index 11eab9533..0de520db8 100644 --- a/Foundation/include/Poco/NullChannel.h +++ b/Foundation/include/Poco/NullChannel.h @@ -1,7 +1,7 @@ // // NullChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/NullChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NullChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/NullStream.h b/Foundation/include/Poco/NullStream.h index dd0dd356a..487dcb4e0 100644 --- a/Foundation/include/Poco/NullStream.h +++ b/Foundation/include/Poco/NullStream.h @@ -1,7 +1,7 @@ // // NullStream.h // -// $Id: //poco/svn/Foundation/include/Poco/NullStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NullStream.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/NumberFormatter.h b/Foundation/include/Poco/NumberFormatter.h index 9e459bf38..4f65e5f9d 100644 --- a/Foundation/include/Poco/NumberFormatter.h +++ b/Foundation/include/Poco/NumberFormatter.h @@ -1,7 +1,7 @@ // // NumberFormatter.h // -// $Id: //poco/Main/Foundation/include/Poco/NumberFormatter.h#4 $ +// $Id: //poco/1.4/Foundation/include/Poco/NumberFormatter.h#1 $ // // Library: Foundation // Package: Core @@ -57,18 +57,18 @@ class Foundation_API NumberFormatter /// an existing string. /// /// Internally, std::sprintf() is used to do the actual - /// formatting. + /// formatting. { public: - enum BoolFormat - { - FMT_TRUE_FALSE, - FMT_YES_NO, - FMT_ON_OFF - }; + enum BoolFormat + { + FMT_TRUE_FALSE, + FMT_YES_NO, + FMT_ON_OFF + }; - static std::string format(int value); - /// Formats an integer value in decimal notation. + static std::string format(int value); + /// Formats an integer value in decimal notation. static std::string format(int value, int width); /// Formats an integer value in decimal notation, @@ -220,15 +220,15 @@ public: static std::string format(const void* ptr); /// Formats a pointer in an eight (32-bit architectures) or - /// sixteen (64-bit architectures) characters wide - /// field in hexadecimal notation. + /// sixteen (64-bit architectures) characters wide + /// field in hexadecimal notation. - static std::string format(bool value, BoolFormat format = FMT_TRUE_FALSE); - /// Formats a bool value in decimal/text notation, - /// according to format parameter. + static std::string format(bool value, BoolFormat format = FMT_TRUE_FALSE); + /// Formats a bool value in decimal/text notation, + /// according to format parameter. - static void append(std::string& str, int value); - /// Formats an integer value in decimal notation. + static void append(std::string& str, int value); + /// Formats an integer value in decimal notation. static void append(std::string& str, int value, int width); /// Formats an integer value in decimal notation, diff --git a/Foundation/include/Poco/NumberParser.h b/Foundation/include/Poco/NumberParser.h index ede0345ba..1d79241d6 100644 --- a/Foundation/include/Poco/NumberParser.h +++ b/Foundation/include/Poco/NumberParser.h @@ -1,7 +1,7 @@ // // NumberParser.h // -// $Id: //poco/svn/Foundation/include/Poco/NumberParser.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/NumberParser.h#1 $ // // Library: Foundation // Package: Core @@ -112,24 +112,24 @@ public: static bool tryParseFloat(const std::string& s, double& value); /// Parses a double value in decimal floating point notation - /// from the given string. - /// Returns true if a valid floating point number has been found, - /// false otherwise. + /// from the given string. + /// Returns true if a valid floating point number has been found, + /// false otherwise. - static bool parseBool(const std::string& s); - /// Parses a bool value in decimal or string notation - /// from the given string. - /// Valid forms are: "0", "1", "true", "on", false", "yes", "no", "off". - /// String forms are NOT case sensitive. - /// Throws a SyntaxException if the string does not hold a valid bool number + static bool parseBool(const std::string& s); + /// Parses a bool value in decimal or string notation + /// from the given string. + /// Valid forms are: "0", "1", "true", "on", false", "yes", "no", "off". + /// String forms are NOT case sensitive. + /// Throws a SyntaxException if the string does not hold a valid bool number - static bool tryParseBool(const std::string& s, bool& value); - /// Parses a bool value in decimal or string notation - /// from the given string. - /// Valid forms are: "0", "1", "true", "on", false", "yes", "no", "off". - /// String forms are NOT case sensitive. - /// Returns true if a valid bool number has been found, - /// false otherwise. + static bool tryParseBool(const std::string& s, bool& value); + /// Parses a bool value in decimal or string notation + /// from the given string. + /// Valid forms are: "0", "1", "true", "on", false", "yes", "no", "off". + /// String forms are NOT case sensitive. + /// Returns true if a valid bool number has been found, + /// false otherwise. }; diff --git a/Foundation/include/Poco/Observer.h b/Foundation/include/Poco/Observer.h index f240ce8aa..91db94531 100644 --- a/Foundation/include/Poco/Observer.h +++ b/Foundation/include/Poco/Observer.h @@ -1,7 +1,7 @@ // // Observer.h // -// $Id: //poco/svn/Foundation/include/Poco/Observer.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Observer.h#2 $ // // Library: Foundation // Package: Notifications @@ -92,24 +92,24 @@ public: } return *this; } - - void notify(Notification* pNf) const - { - Poco::Mutex::ScopedLock lock(_mutex); + + void notify(Notification* pNf) const + { + Poco::Mutex::ScopedLock lock(_mutex); - if (_pObject) - { - N* pCastNf = dynamic_cast(pNf); - if (pCastNf) - { + if (_pObject) + { + N* pCastNf = dynamic_cast(pNf); + if (pCastNf) + { pCastNf->duplicate(); - (_pObject->*_method)(pCastNf); - } - } - } - - bool equals(const AbstractObserver& abstractObserver) const - { + (_pObject->*_method)(pCastNf); + } + } + } + + bool equals(const AbstractObserver& abstractObserver) const + { const Observer* pObs = dynamic_cast(&abstractObserver); return pObs && pObs->_pObject == _pObject && pObs->_method == _method; } @@ -121,22 +121,22 @@ public: AbstractObserver* clone() const { - return new Observer(*this); - } - - void disable() - { - Poco::Mutex::ScopedLock lock(_mutex); - - _pObject = 0; - } - + return new Observer(*this); + } + + void disable() + { + Poco::Mutex::ScopedLock lock(_mutex); + + _pObject = 0; + } + private: - Observer(); + Observer(); - C* _pObject; - Callback _method; - mutable Poco::Mutex _mutex; + C* _pObject; + Callback _method; + mutable Poco::Mutex _mutex; }; diff --git a/Foundation/include/Poco/OpcomChannel.h b/Foundation/include/Poco/OpcomChannel.h index 0e0a01b14..f1f4ea040 100644 --- a/Foundation/include/Poco/OpcomChannel.h +++ b/Foundation/include/Poco/OpcomChannel.h @@ -1,7 +1,7 @@ // // OpcomChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/OpcomChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/OpcomChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Path.h b/Foundation/include/Poco/Path.h index 0be8f548f..49483f85e 100644 --- a/Foundation/include/Poco/Path.h +++ b/Foundation/include/Poco/Path.h @@ -1,7 +1,7 @@ // // Path.h // -// $Id: //poco/svn/Foundation/include/Poco/Path.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Path.h#3 $ // // Library: Foundation // Package: Filesystem @@ -206,21 +206,21 @@ public: /// (the filename part is empty). bool isFile() const; - /// Returns true iff the path references a file - /// (the filename part is not empty). - - Path& setNode(const std::string& node); - /// Sets the node name. - /// Setting a non-empty node automatically makes - /// the path an absolute one. + /// Returns true iff the path references a file + /// (the filename part is not empty). + + Path& setNode(const std::string& node); + /// Sets the node name. + /// Setting a non-empty node automatically makes + /// the path an absolute one. - const std::string& getNode() const; - /// Returns the node name. - - Path& setDevice(const std::string& device); - /// Sets the device name. - /// Setting a non-empty device automatically makes - /// the path an absolute one. + const std::string& getNode() const; + /// Returns the node name. + + Path& setDevice(const std::string& device); + /// Sets the device name. + /// Setting a non-empty device automatically makes + /// the path an absolute one. const std::string& getDevice() const; /// Returns the device name. @@ -233,45 +233,45 @@ public: /// If n == depth(), returns the filename. const std::string& operator [] (int n) const; - /// Returns the n'th directory in the directory list. - /// If n == depth(), returns the filename. - - Path& pushDirectory(const std::string& dir); - /// Adds a directory to the directory list. - - Path& popDirectory(); - /// Removes the last directory from the directory list. - - Path& popFrontDirectory(); - /// Removes the first directory from the directory list. - - Path& setFileName(const std::string& name); - /// Sets the filename. - - const std::string& getFileName() const; - /// Returns the filename. + /// Returns the n'th directory in the directory list. + /// If n == depth(), returns the filename. + + Path& pushDirectory(const std::string& dir); + /// Adds a directory to the directory list. + + Path& popDirectory(); + /// Removes the last directory from the directory list. + + Path& popFrontDirectory(); + /// Removes the first directory from the directory list. + + Path& setFileName(const std::string& name); + /// Sets the filename. + + const std::string& getFileName() const; + /// Returns the filename. - Path& setBaseName(const std::string& name); - /// Sets the basename part of the filename and - /// does not change the extension. + Path& setBaseName(const std::string& name); + /// Sets the basename part of the filename and + /// does not change the extension. std::string getBaseName() const; - /// Returns the basename (the filename sans - /// extension) of the path. + /// Returns the basename (the filename sans + /// extension) of the path. - Path& setExtension(const std::string& extension); - /// Sets the filename extension. - - std::string getExtension() const; + Path& setExtension(const std::string& extension); + /// Sets the filename extension. + + std::string getExtension() const; /// Returns the filename extension. - const std::string& version() const; - /// Returns the file version. VMS only. - - Path& clear(); - /// Clears all components. + const std::string& version() const; + /// Returns the file version. VMS only. + + Path& clear(); + /// Clears all components. - Path parent() const; + Path parent() const; /// Returns a path referring to the path's /// directory. diff --git a/Foundation/include/Poco/Path_UNIX.h b/Foundation/include/Poco/Path_UNIX.h index 4fe039b79..d591164cf 100644 --- a/Foundation/include/Poco/Path_UNIX.h +++ b/Foundation/include/Poco/Path_UNIX.h @@ -1,7 +1,7 @@ // // Path_UNIX.h // -// $Id: //poco/svn/Foundation/include/Poco/Path_UNIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Path_UNIX.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/Path_VMS.h b/Foundation/include/Poco/Path_VMS.h index d6ed5b4b9..d0907eb39 100644 --- a/Foundation/include/Poco/Path_VMS.h +++ b/Foundation/include/Poco/Path_VMS.h @@ -1,7 +1,7 @@ // // Path_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/Path_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Path_VMS.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/Path_WIN32.h b/Foundation/include/Poco/Path_WIN32.h index 7fe59aab0..956b6ae19 100644 --- a/Foundation/include/Poco/Path_WIN32.h +++ b/Foundation/include/Poco/Path_WIN32.h @@ -1,7 +1,7 @@ // // Path_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/Path_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Path_WIN32.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/Path_WIN32U.h b/Foundation/include/Poco/Path_WIN32U.h index 91b5c835b..ac05a4629 100644 --- a/Foundation/include/Poco/Path_WIN32U.h +++ b/Foundation/include/Poco/Path_WIN32U.h @@ -1,7 +1,7 @@ // // Path_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/Path_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Path_WIN32U.h#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/include/Poco/PatternFormatter.h b/Foundation/include/Poco/PatternFormatter.h index c656b26e1..9f19ff294 100644 --- a/Foundation/include/Poco/PatternFormatter.h +++ b/Foundation/include/Poco/PatternFormatter.h @@ -1,7 +1,7 @@ // // PatternFormatter.h // -// $Id: //poco/Main/Foundation/include/Poco/PatternFormatter.h#4 $ +// $Id: //poco/1.4/Foundation/include/Poco/PatternFormatter.h#2 $ // // Library: Foundation // Package: Logging @@ -62,14 +62,14 @@ class Foundation_API PatternFormatter: public Formatter /// * %p - message priority (Fatal, Critical, Error, Warning, Notice, Information, Debug, Trace) /// * %q - abbreviated message priority (F, C, E, W, N, I, D, T) /// * %P - message process identifier - /// * %T - message thread name - /// * %I - message thread identifier (numeric) - /// * %N - node or host name - /// * %U - message source file path (empty string if not set) - /// * %u - message source line number (0 if not set) - /// * %w - message date/time abbreviated weekday (Mon, Tue, ...) - /// * %W - message date/time full weekday (Monday, Tuesday, ...) - /// * %b - message date/time abbreviated month (Jan, Feb, ...) + /// * %T - message thread name + /// * %I - message thread identifier (numeric) + /// * %N - node or host name + /// * %U - message source file path (empty string if not set) + /// * %u - message source line number (0 if not set) + /// * %w - message date/time abbreviated weekday (Mon, Tue, ...) + /// * %W - message date/time full weekday (Monday, Tuesday, ...) + /// * %b - message date/time abbreviated month (Jan, Feb, ...) /// * %B - message date/time full month (January, February, ...) /// * %d - message date/time zero-padded day of month (01 .. 31) /// * %e - message date/time day of month (1 .. 31) @@ -85,14 +85,14 @@ class Foundation_API PatternFormatter: public Formatter /// * %A - message date/time AM/PM /// * %M - message date/time minute (00 .. 59) /// * %S - message date/time second (00 .. 59) - /// * %i - message date/time millisecond (000 .. 999) - /// * %c - message date/time centisecond (0 .. 9) - /// * %F - message date/time fractional seconds/microseconds (000000 - 999999) - /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN) - /// * %Z - time zone differential in RFC format (GMT or +NNNN) - /// * %E - epoch time (UTC, seconds since midnight, January 1, 1970) - /// * %[name] - the value of the message parameter with the given name - /// * %% - percent sign + /// * %i - message date/time millisecond (000 .. 999) + /// * %c - message date/time centisecond (0 .. 9) + /// * %F - message date/time fractional seconds/microseconds (000000 - 999999) + /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN) + /// * %Z - time zone differential in RFC format (GMT or +NNNN) + /// * %E - epoch time (UTC, seconds since midnight, January 1, 1970) + /// * %[name] - the value of the message parameter with the given name + /// * %% - percent sign { public: @@ -134,12 +134,12 @@ public: static const std::string PROP_TIMES; protected: - static const std::string& getPriorityName(int); - /// Returns a string for the given priority value. - + static const std::string& getPriorityName(int); + /// Returns a string for the given priority value. + private: - bool _localTime; - std::string _pattern; + bool _localTime; + std::string _pattern; }; diff --git a/Foundation/include/Poco/Pipe.h b/Foundation/include/Poco/Pipe.h index 46b479fd4..67fd97705 100644 --- a/Foundation/include/Poco/Pipe.h +++ b/Foundation/include/Poco/Pipe.h @@ -1,7 +1,7 @@ // // Pipe.h // -// $Id: //poco/svn/Foundation/include/Poco/Pipe.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Pipe.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/PipeImpl_DUMMY.h b/Foundation/include/Poco/PipeImpl_DUMMY.h index 2d6f1d87e..aeeafb23e 100644 --- a/Foundation/include/Poco/PipeImpl_DUMMY.h +++ b/Foundation/include/Poco/PipeImpl_DUMMY.h @@ -1,7 +1,7 @@ // // PipeImpl_DUMMY.h // -// $Id: //poco/svn/Foundation/include/Poco/PipeImpl_DUMMY.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_DUMMY.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/PipeImpl_POSIX.h b/Foundation/include/Poco/PipeImpl_POSIX.h index 6d2e29ef0..2ad6625f7 100644 --- a/Foundation/include/Poco/PipeImpl_POSIX.h +++ b/Foundation/include/Poco/PipeImpl_POSIX.h @@ -1,7 +1,7 @@ // // PipeImpl_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/PipeImpl_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_POSIX.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/PipeImpl_WIN32.h b/Foundation/include/Poco/PipeImpl_WIN32.h index 857dd3e35..74e90161d 100644 --- a/Foundation/include/Poco/PipeImpl_WIN32.h +++ b/Foundation/include/Poco/PipeImpl_WIN32.h @@ -1,7 +1,7 @@ // // PipeImpl_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/PipeImpl_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_WIN32.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/PipeStream.h b/Foundation/include/Poco/PipeStream.h index e52256073..9e1fb18b0 100644 --- a/Foundation/include/Poco/PipeStream.h +++ b/Foundation/include/Poco/PipeStream.h @@ -1,7 +1,7 @@ // // PipeStream.h // -// $Id: //poco/svn/Foundation/include/Poco/PipeStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PipeStream.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h index 12d64ca44..c3c63a83b 100644 --- a/Foundation/include/Poco/Platform.h +++ b/Foundation/include/Poco/Platform.h @@ -202,9 +202,9 @@ #endif //TODO: determine all platforms having poll() call - #if (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_LINUX) - #define POCO_HAVE_FD_POLL 1 - #endif + if (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_LINUX) + define POCO_HAVE_FD_POLL 1 + endif #elif defined (nios2) || defined(__nios2) || defined(__nios2__) #define POCO_ARCH POCO_ARCH_NIOS2 diff --git a/Foundation/include/Poco/Platform_POSIX.h b/Foundation/include/Poco/Platform_POSIX.h index 47cf2cd56..ff1e6c83a 100644 --- a/Foundation/include/Poco/Platform_POSIX.h +++ b/Foundation/include/Poco/Platform_POSIX.h @@ -1,7 +1,7 @@ // // Platform_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/Platform_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Platform_POSIX.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Platform_VMS.h b/Foundation/include/Poco/Platform_VMS.h index 3af7daf8d..c304abd2c 100644 --- a/Foundation/include/Poco/Platform_VMS.h +++ b/Foundation/include/Poco/Platform_VMS.h @@ -1,7 +1,7 @@ // // Platform_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/Platform_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Platform_VMS.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Platform_WIN32.h b/Foundation/include/Poco/Platform_WIN32.h index d7d82a3f9..58c9a7a41 100644 --- a/Foundation/include/Poco/Platform_WIN32.h +++ b/Foundation/include/Poco/Platform_WIN32.h @@ -1,7 +1,7 @@ // // Platform_WIN32.h // -// $Id: //poco/1.4/Foundation/include/Poco/Platform_WIN32.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Platform_WIN32.h#2 $ // // Library: Foundation // Package: Core @@ -56,11 +56,11 @@ // Reduce bloat imported by "Poco/UnWindows.h" #if defined(_WIN32) - #if !defined(_WIN32_WINNT) - #define _WIN32_WINNT 0x0501 - #endif - #if !defined(WIN32_LEAN_AND_MEAN) && !defined(POCO_BLOATED_WIN32) - #define WIN32_LEAN_AND_MEAN + #if !defined(_WIN32_WINNT) + #define _WIN32_WINNT 0x0501 + #endif + #if !defined(WIN32_LEAN_AND_MEAN) && !defined(POCO_BLOATED_WIN32) + #define WIN32_LEAN_AND_MEAN #endif #endif diff --git a/Foundation/include/Poco/Poco.h b/Foundation/include/Poco/Poco.h index 0509995e0..4ec6db6b8 100644 --- a/Foundation/include/Poco/Poco.h +++ b/Foundation/include/Poco/Poco.h @@ -1,7 +1,7 @@ // // Poco.h // -// $Id: //poco/svn/Foundation/include/Poco/Poco.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Poco.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/PriorityDelegate.h b/Foundation/include/Poco/PriorityDelegate.h index 9eb1d5210..91d0ef890 100644 --- a/Foundation/include/Poco/PriorityDelegate.h +++ b/Foundation/include/Poco/PriorityDelegate.h @@ -1,7 +1,7 @@ // // PriorityDelegate.h // -// $Id: //poco/svn/Foundation/include/Poco/PriorityDelegate.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PriorityDelegate.h#5 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the PriorityDelegate template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,14 +36,15 @@ // -#ifndef Foundation_PriorityDelegate_INCLUDED -#define Foundation_PriorityDelegate_INCLUDED +#ifndef Foundation_PriorityDelegate_INCLUDED +#define Foundation_PriorityDelegate_INCLUDED #include "Poco/Foundation.h" #include "Poco/AbstractPriorityDelegate.h" #include "Poco/PriorityExpire.h" #include "Poco/FunctionPriorityDelegate.h" +#include "Poco/Mutex.h" namespace Poco { @@ -53,20 +54,20 @@ template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*, TArgs&); + typedef void (TObj::*NotifyMethod)(const void*, TArgs&); - PriorityDelegate(TObj* obj, NotifyMethod method, int prio): - AbstractPriorityDelegate(obj, prio), - _receiverObject(obj), - _receiverMethod(method) - { - } - - PriorityDelegate(const PriorityDelegate& delegate): - AbstractPriorityDelegate(delegate._pTarget, delegate._priority), - _receiverObject(delegate._receiverObject), - _receiverMethod(delegate._receiverMethod) - { + PriorityDelegate(TObj* obj, NotifyMethod method, int prio): + AbstractPriorityDelegate(prio), + _receiverObject(obj), + _receiverMethod(method) + { + } + + PriorityDelegate(const PriorityDelegate& delegate): + AbstractPriorityDelegate(delegate), + _receiverObject(delegate._receiverObject), + _receiverMethod(delegate._receiverMethod) + { } PriorityDelegate& operator = (const PriorityDelegate& delegate) @@ -85,45 +86,62 @@ public: { } - bool notify(const void* sender, TArgs& arguments) - { - (_receiverObject->*_receiverMethod)(sender, arguments); - return true; // per default the delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverObject) + { + (_receiverObject->*_receiverMethod)(sender, arguments); + return true; + } + else return false; + } - AbstractPriorityDelegate* clone() const - { - return new PriorityDelegate(*this); - } + bool equals(const AbstractDelegate& other) const + { + const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; + } + AbstractDelegate* clone() const + { + return new PriorityDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverObject = 0; + } + protected: - TObj* _receiverObject; - NotifyMethod _receiverMethod; + TObj* _receiverObject; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - PriorityDelegate(); + PriorityDelegate(); }; - template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(TArgs&); + typedef void (TObj::*NotifyMethod)(TArgs&); - PriorityDelegate(TObj* obj, NotifyMethod method, int prio): - AbstractPriorityDelegate(obj, prio), - _receiverObject(obj), - _receiverMethod(method) - { - } - - PriorityDelegate(const PriorityDelegate& delegate): - AbstractPriorityDelegate(delegate._pTarget, delegate._priority), - _receiverObject(delegate._receiverObject), - _receiverMethod(delegate._receiverMethod) - { + PriorityDelegate(TObj* obj, NotifyMethod method, int prio): + AbstractPriorityDelegate(prio), + _receiverObject(obj), + _receiverMethod(method) + { + } + + PriorityDelegate(const PriorityDelegate& delegate): + AbstractPriorityDelegate(delegate), + _receiverObject(delegate._receiverObject), + _receiverMethod(delegate._receiverMethod) + { } PriorityDelegate& operator = (const PriorityDelegate& delegate) @@ -142,23 +160,41 @@ public: { } - bool notify(const void* sender, TArgs& arguments) - { - (_receiverObject->*_receiverMethod)(arguments); - return true; // per default the delegate never expires - } + bool notify(const void* sender, TArgs& arguments) + { + Mutex::ScopedLock lock(_mutex); + if (_receiverObject) + { + (_receiverObject->*_receiverMethod)(arguments); + return true; + } + return false; + } - AbstractPriorityDelegate* clone() const - { - return new PriorityDelegate(*this); - } + bool equals(const AbstractDelegate& other) const + { + const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); + return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; + } + + AbstractDelegate* clone() const + { + return new PriorityDelegate(*this); + } + + void disable() + { + Mutex::ScopedLock lock(_mutex); + _receiverObject = 0; + } protected: - TObj* _receiverObject; - NotifyMethod _receiverMethod; + TObj* _receiverObject; + NotifyMethod _receiverMethod; + Mutex _mutex; private: - PriorityDelegate(); + PriorityDelegate(); }; @@ -235,4 +271,4 @@ static FunctionPriorityDelegate priorityDelegate(void (*NotifyMeth } // namespace Poco -#endif +#endif // Foundation_PriorityDelegate_INCLUDED diff --git a/Foundation/include/Poco/PriorityEvent.h b/Foundation/include/Poco/PriorityEvent.h index 94e6466dd..3d08052bf 100644 --- a/Foundation/include/Poco/PriorityEvent.h +++ b/Foundation/include/Poco/PriorityEvent.h @@ -1,7 +1,7 @@ // // PriorityEvent.h // -// $Id: //poco/svn/Foundation/include/Poco/PriorityEvent.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PriorityEvent.h#2 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the PriorityEvent template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,14 +36,13 @@ // -#ifndef Foundation_PriorityEvent_INCLUDED -#define Foundation_PriorityEvent_INCLUDED +#ifndef Foundation_PriorityEvent_INCLUDED +#define Foundation_PriorityEvent_INCLUDED #include "Poco/AbstractEvent.h" -#include "Poco/DefaultStrategy.h" +#include "Poco/PriorityStrategy.h" #include "Poco/AbstractPriorityDelegate.h" -#include "Poco/CompareFunctions.h" namespace Poco { @@ -51,41 +50,34 @@ namespace Poco { template class PriorityEvent: public AbstractEvent < - TArgs, - DefaultStrategy, p_less > >, - AbstractPriorityDelegate, - TMutex + TArgs, + PriorityStrategy >, + AbstractPriorityDelegate, + TMutex > - /// A PriorityEvent uses internally a DefaultStrategy which - /// invokes delegates in a manner determined by the priority field - /// in the PriorityDelegates (lower priorities first). - /// PriorityEvents can only be used together with PriorityDelegates. - /// PriorityDelegates are sorted according to the priority value, when - /// two delegates have the same priority, they are invoked in - /// an arbitrary manner. - /// Note that one object can register several methods as long as they differ - /// in their priority value: - /// PriorityEvent tmp; - /// MyClass myObject; - /// tmp += priorityDelegate(&myObject, &MyClass::myMethod1, 1); - /// tmp += priorityDelegate(&myObject, &MyClass::myMethod2, 2); + /// A PriorityEvent uses internally a PriorityStrategy which + /// invokes delegates in order of priority (lower priorities first). + /// PriorityEvent's can only be used together with PriorityDelegate's. + /// PriorityDelegate's are sorted according to the priority value, when + /// two delegates have the same priority, they are invoked in + /// an arbitrary manner. { public: - PriorityEvent() + PriorityEvent() { } ~PriorityEvent() { - } + } private: - PriorityEvent(const PriorityEvent& e); - PriorityEvent& operator = (const PriorityEvent& e); + PriorityEvent(const PriorityEvent&); + PriorityEvent& operator = (const PriorityEvent&); }; } // namespace Poco -#endif +#endif // Foundation_PriorityEvent_INCLUDED diff --git a/Foundation/include/Poco/PriorityExpire.h b/Foundation/include/Poco/PriorityExpire.h index f5a989a9c..31f586473 100644 --- a/Foundation/include/Poco/PriorityExpire.h +++ b/Foundation/include/Poco/PriorityExpire.h @@ -1,7 +1,7 @@ // // PriorityExpire.h // -// $Id: //poco/svn/Foundation/include/Poco/PriorityExpire.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PriorityExpire.h#3 $ // // Library: Foundation // Package: Events @@ -9,7 +9,7 @@ // // Implementation of the PriorityExpire template. // -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization @@ -36,8 +36,8 @@ // -#ifndef Foundation_PriorityExpire_INCLUDED -#define Foundation_PriorityExpire_INCLUDED +#ifndef Foundation_PriorityExpire_INCLUDED +#define Foundation_PriorityExpire_INCLUDED #include "Poco/Foundation.h" @@ -54,27 +54,27 @@ class PriorityExpire: public AbstractPriorityDelegate /// expiring of registrations to AbstractPriorityDelegate. { public: - PriorityExpire(const AbstractPriorityDelegate& p, Timestamp::TimeDiff expireMilliSec): - AbstractPriorityDelegate(p), - _pDelegate(p.clone()), - _expire(expireMilliSec*1000) - { - } - - PriorityExpire(const PriorityExpire& expire): - AbstractPriorityDelegate(expire), - _pDelegate(expire._pDelegate->clone()), - _expire(expire._expire), - _creationTime(expire._creationTime) - { + PriorityExpire(const AbstractPriorityDelegate& p, Timestamp::TimeDiff expireMilliSec): + AbstractPriorityDelegate(p), + _pDelegate(static_cast*>(p.clone())), + _expire(expireMilliSec*1000) + { + } + + PriorityExpire(const PriorityExpire& expire): + AbstractPriorityDelegate(expire), + _pDelegate(static_cast*>(expire._pDelegate->clone())), + _expire(expire._expire), + _creationTime(expire._creationTime) + { } - ~PriorityExpire() - { - destroy(); - } - - PriorityExpire& operator = (const PriorityExpire& expire) + ~PriorityExpire() + { + delete _pDelegate; + } + + PriorityExpire& operator = (const PriorityExpire& expire) { if (&expire != this) { @@ -92,24 +92,28 @@ public: if (!expired()) return this->_pDelegate->notify(sender, arguments); else - return false; - } + return false; + } - AbstractPriorityDelegate* clone() const - { - return new PriorityExpire(*this); - } + bool equals(const AbstractDelegate& other) const + { + return other.equals(*_pDelegate); + } - void destroy() - { - delete this->_pDelegate; - this->_pDelegate = 0; - } + AbstractPriorityDelegate* clone() const + { + return new PriorityExpire(*this); + } - const AbstractPriorityDelegate& getDelegate() const - { - return *this->_pDelegate; - } + void disable() + { + _pDelegate->disable(); + } + + const AbstractPriorityDelegate* unwrap() const + { + return this->_pDelegate; + } protected: bool expired() const @@ -129,4 +133,4 @@ private: } // namespace Poco -#endif +#endif // Foundation_PriorityExpire_INCLUDED diff --git a/Foundation/include/Poco/PriorityNotificationQueue.h b/Foundation/include/Poco/PriorityNotificationQueue.h index 5b9710e84..61836b308 100644 --- a/Foundation/include/Poco/PriorityNotificationQueue.h +++ b/Foundation/include/Poco/PriorityNotificationQueue.h @@ -1,180 +1,180 @@ -// -// PriorityNotificationQueue.h -// -// $Id: //poco/Main/Foundation/include/Poco/PriorityNotificationQueue.h#1 $ -// -// Library: Foundation -// Package: Notifications -// Module: PriorityNotificationQueue -// -// Definition of the PriorityNotificationQueue class. -// -// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - - -#ifndef Foundation_PriorityNotificationQueue_INCLUDED -#define Foundation_PriorityNotificationQueue_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Notification.h" -#include "Poco/Mutex.h" -#include "Poco/Event.h" -#include -#include - - -namespace Poco { - - -class NotificationCenter; - - -class Foundation_API PriorityNotificationQueue - /// A PriorityNotificationQueue object provides a way to implement asynchronous - /// notifications. This is especially useful for sending notifications - /// from one thread to another, for example from a background thread to - /// the main (user interface) thread. - /// - /// The PriorityNotificationQueue is quite similar to the NotificationQueue class. - /// The only difference to NotificationQueue is that each Notification is tagged - /// with a priority value. When inserting a Notification into the queue, the - /// Notification is inserted according to the given priority value, with - /// lower priority values being inserted before higher priority - /// values. Therefore, the lower the numerical priority value, the higher - /// the actual notification priority. - /// - /// Notifications are dequeued in order of their priority. - /// - /// The PriorityNotificationQueue can also be used to distribute work from - /// a controlling thread to one or more worker threads. Each worker thread - /// repeatedly calls waitDequeueNotification() and processes the - /// returned notification. Special care must be taken when shutting - /// down a queue with worker threads waiting for notifications. - /// The recommended sequence to shut down and destroy the queue is to - /// 1. set a termination flag for every worker thread - /// 2. call the wakeUpAll() method - /// 3. join each worker thread - /// 4. destroy the notification queue. -{ -public: - PriorityNotificationQueue(); - /// Creates the PriorityNotificationQueue. - - ~PriorityNotificationQueue(); - /// Destroys the PriorityNotificationQueue. - - void enqueueNotification(Notification::Ptr pNotification, int priority); - /// Enqueues the given notification by adding it to - /// the queue according to the given priority. - /// Lower priority values are inserted before higher priority values. - /// The queue takes ownership of the notification, thus - /// a call like - /// notificationQueue.enqueueNotification(new MyNotification, 1); - /// does not result in a memory leak. - - Notification* dequeueNotification(); - /// Dequeues the next pending notification. - /// Returns 0 (null) if no notification is available. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - Notification* waitDequeueNotification(); - /// Dequeues the next pending notification. - /// If no notification is available, waits for a notification - /// to be enqueued. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// This method returns 0 (null) if wakeUpWaitingThreads() - /// has been called by another thread. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - Notification* waitDequeueNotification(long milliseconds); - /// Dequeues the next pending notification. - /// If no notification is available, waits for a notification - /// to be enqueued up to the specified time. - /// Returns 0 (null) if no notification is available. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - void dispatch(NotificationCenter& notificationCenter); - /// Dispatches all queued notifications to the given - /// notification center. - - void wakeUpAll(); - /// Wakes up all threads that wait for a notification. - - bool empty() const; - /// Returns true iff the queue is empty. - - int size() const; - /// Returns the number of notifications in the queue. - - void clear(); - /// Removes all notifications from the queue. - - bool hasIdleThreads() const; - /// Returns true if the queue has at least one thread waiting - /// for a notification. - - static PriorityNotificationQueue& defaultQueue(); - /// Returns a reference to the default - /// PriorityNotificationQueue. - -protected: - Notification::Ptr dequeueOne(); - -private: - typedef std::multimap NfQueue; - struct WaitInfo - { - Notification::Ptr pNf; - Event nfAvailable; - }; - typedef std::deque WaitQueue; - - NfQueue _nfQueue; - WaitQueue _waitQueue; - mutable FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_PriorityNotificationQueue_INCLUDED +// +// PriorityNotificationQueue.h +// +// $Id: //poco/1.4/Foundation/include/Poco/PriorityNotificationQueue.h#1 $ +// +// Library: Foundation +// Package: Notifications +// Module: PriorityNotificationQueue +// +// Definition of the PriorityNotificationQueue class. +// +// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software, unless such copies or derivative +// works are solely in the form of machine-executable object code generated by +// a source language processor. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + + +#ifndef Foundation_PriorityNotificationQueue_INCLUDED +#define Foundation_PriorityNotificationQueue_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Notification.h" +#include "Poco/Mutex.h" +#include "Poco/Event.h" +#include +#include + + +namespace Poco { + + +class NotificationCenter; + + +class Foundation_API PriorityNotificationQueue + /// A PriorityNotificationQueue object provides a way to implement asynchronous + /// notifications. This is especially useful for sending notifications + /// from one thread to another, for example from a background thread to + /// the main (user interface) thread. + /// + /// The PriorityNotificationQueue is quite similar to the NotificationQueue class. + /// The only difference to NotificationQueue is that each Notification is tagged + /// with a priority value. When inserting a Notification into the queue, the + /// Notification is inserted according to the given priority value, with + /// lower priority values being inserted before higher priority + /// values. Therefore, the lower the numerical priority value, the higher + /// the actual notification priority. + /// + /// Notifications are dequeued in order of their priority. + /// + /// The PriorityNotificationQueue can also be used to distribute work from + /// a controlling thread to one or more worker threads. Each worker thread + /// repeatedly calls waitDequeueNotification() and processes the + /// returned notification. Special care must be taken when shutting + /// down a queue with worker threads waiting for notifications. + /// The recommended sequence to shut down and destroy the queue is to + /// 1. set a termination flag for every worker thread + /// 2. call the wakeUpAll() method + /// 3. join each worker thread + /// 4. destroy the notification queue. +{ +public: + PriorityNotificationQueue(); + /// Creates the PriorityNotificationQueue. + + ~PriorityNotificationQueue(); + /// Destroys the PriorityNotificationQueue. + + void enqueueNotification(Notification::Ptr pNotification, int priority); + /// Enqueues the given notification by adding it to + /// the queue according to the given priority. + /// Lower priority values are inserted before higher priority values. + /// The queue takes ownership of the notification, thus + /// a call like + /// notificationQueue.enqueueNotification(new MyNotification, 1); + /// does not result in a memory leak. + + Notification* dequeueNotification(); + /// Dequeues the next pending notification. + /// Returns 0 (null) if no notification is available. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + Notification* waitDequeueNotification(); + /// Dequeues the next pending notification. + /// If no notification is available, waits for a notification + /// to be enqueued. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// This method returns 0 (null) if wakeUpAll() + /// has been called by another thread. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + Notification* waitDequeueNotification(long milliseconds); + /// Dequeues the next pending notification. + /// If no notification is available, waits for a notification + /// to be enqueued up to the specified time. + /// Returns 0 (null) if no notification is available. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + void dispatch(NotificationCenter& notificationCenter); + /// Dispatches all queued notifications to the given + /// notification center. + + void wakeUpAll(); + /// Wakes up all threads that wait for a notification. + + bool empty() const; + /// Returns true iff the queue is empty. + + int size() const; + /// Returns the number of notifications in the queue. + + void clear(); + /// Removes all notifications from the queue. + + bool hasIdleThreads() const; + /// Returns true if the queue has at least one thread waiting + /// for a notification. + + static PriorityNotificationQueue& defaultQueue(); + /// Returns a reference to the default + /// PriorityNotificationQueue. + +protected: + Notification::Ptr dequeueOne(); + +private: + typedef std::multimap NfQueue; + struct WaitInfo + { + Notification::Ptr pNf; + Event nfAvailable; + }; + typedef std::deque WaitQueue; + + NfQueue _nfQueue; + WaitQueue _waitQueue; + mutable FastMutex _mutex; +}; + + +} // namespace Poco + + +#endif // Foundation_PriorityNotificationQueue_INCLUDED diff --git a/Foundation/include/Poco/Process.h b/Foundation/include/Poco/Process.h index 3c0ce82fe..129fe1b0b 100644 --- a/Foundation/include/Poco/Process.h +++ b/Foundation/include/Poco/Process.h @@ -1,7 +1,7 @@ // // Process.h // -// $Id: //poco/1.4/Foundation/include/Poco/Process.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process.h#3 $ // // Library: Foundation // Package: Processes @@ -151,18 +151,18 @@ public: /// int rc = ph.wait(); static int wait(const ProcessHandle& handle); - /// Waits for the process specified by handle to terminate - /// and returns the exit code of the process. - - static void kill(const ProcessHandle& handle); - /// Kills the process specified by handle. - /// - /// This is preferable on Windows where process IDs - /// may be reused. + /// Waits for the process specified by handle to terminate + /// and returns the exit code of the process. + + static void kill(const ProcessHandle& handle); + /// Kills the process specified by handle. + /// + /// This is preferable on Windows where process IDs + /// may be reused. - static void kill(PID pid); - /// Kills the process with the given pid. - + static void kill(PID pid); + /// Kills the process with the given pid. + static void requestTermination(PID pid); /// Requests termination of the process with the give PID. /// diff --git a/Foundation/include/Poco/Process_UNIX.h b/Foundation/include/Poco/Process_UNIX.h index 7bd1eafa6..a02033b4b 100644 --- a/Foundation/include/Poco/Process_UNIX.h +++ b/Foundation/include/Poco/Process_UNIX.h @@ -1,7 +1,7 @@ // // Process_UNIX.h // -// $Id: //poco/1.4/Foundation/include/Poco/Process_UNIX.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_UNIX.h#2 $ // // Library: Foundation // Package: Processes @@ -72,12 +72,12 @@ public: typedef pid_t PIDImpl; typedef std::vector ArgsImpl; - static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static void killImpl(const ProcessHandleImpl& handle); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); + static PIDImpl idImpl(); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); }; diff --git a/Foundation/include/Poco/Process_VMS.h b/Foundation/include/Poco/Process_VMS.h index f0cbe0408..612ecb94d 100644 --- a/Foundation/include/Poco/Process_VMS.h +++ b/Foundation/include/Poco/Process_VMS.h @@ -1,7 +1,7 @@ // // Process_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/Process_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_VMS.h#2 $ // // Library: Foundation // Package: Processes @@ -73,11 +73,12 @@ public: typedef std::vector ArgsImpl; static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static int waitImpl(PIDImpl pid); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static int waitImpl(PIDImpl pid); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); }; diff --git a/Foundation/include/Poco/Process_VX.h b/Foundation/include/Poco/Process_VX.h index 3d6a48c2f..7d510900d 100644 --- a/Foundation/include/Poco/Process_VX.h +++ b/Foundation/include/Poco/Process_VX.h @@ -1,7 +1,7 @@ // // Process_VX.h // -// $Id: //poco/1.4/Foundation/include/Poco/Process_VX.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_VX.h#2 $ // // Library: Foundation // Package: Processes @@ -74,12 +74,12 @@ public: typedef int PIDImpl; typedef std::vector ArgsImpl; - static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static void killImpl(const ProcessHandleImpl& handle); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); + static PIDImpl idImpl(); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); }; diff --git a/Foundation/include/Poco/Process_WIN32.h b/Foundation/include/Poco/Process_WIN32.h index 6ca4d04eb..321668405 100644 --- a/Foundation/include/Poco/Process_WIN32.h +++ b/Foundation/include/Poco/Process_WIN32.h @@ -1,7 +1,7 @@ // // Process_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/Process_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_WIN32.h#2 $ // // Library: Foundation // Package: Processes @@ -56,12 +56,12 @@ class Foundation_API ProcessHandleImpl: public RefCountedObject { public: ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; - + ~ProcessHandleImpl(); + + UInt32 id() const; + HANDLE process() const; + int wait() const; + private: HANDLE _hProcess; UInt32 _pid; @@ -77,13 +77,13 @@ public: typedef UInt32 PIDImpl; typedef std::vector ArgsImpl; - static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static void killImpl(const ProcessHandleImpl& handle); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); + static PIDImpl idImpl(); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); + static std::string terminationEventName(PIDImpl pid); }; diff --git a/Foundation/include/Poco/Process_WIN32U.h b/Foundation/include/Poco/Process_WIN32U.h index 737daf60b..ef94483c0 100644 --- a/Foundation/include/Poco/Process_WIN32U.h +++ b/Foundation/include/Poco/Process_WIN32U.h @@ -1,7 +1,7 @@ // // Process_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/Process_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_WIN32U.h#2 $ // // Library: Foundation // Package: Processes @@ -56,11 +56,11 @@ class Foundation_API ProcessHandleImpl: public RefCountedObject { public: ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; + ~ProcessHandleImpl(); + + UInt32 id() const; + HANDLE process() const; + int wait() const; private: HANDLE _hProcess; @@ -77,13 +77,13 @@ public: typedef UInt32 PIDImpl; typedef std::vector ArgsImpl; - static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static void killImpl(const ProcessHandleImpl& handle); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); + static PIDImpl idImpl(); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); + static std::string terminationEventName(PIDImpl pid); }; diff --git a/Foundation/include/Poco/Process_WINCE.h b/Foundation/include/Poco/Process_WINCE.h index 909b1b48a..eb075dbd4 100644 --- a/Foundation/include/Poco/Process_WINCE.h +++ b/Foundation/include/Poco/Process_WINCE.h @@ -1,7 +1,7 @@ // // Process_WINCE.h // -// $Id: //poco/1.4/Foundation/include/Poco/Process_WINCE.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/Process_WINCE.h#2 $ // // Library: Foundation // Package: Processes @@ -56,12 +56,12 @@ class Foundation_API ProcessHandleImpl: public RefCountedObject { public: ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; - + ~ProcessHandleImpl(); + + UInt32 id() const; + HANDLE process() const; + int wait() const; + private: HANDLE _hProcess; UInt32 _pid; @@ -77,13 +77,13 @@ public: typedef UInt32 PIDImpl; typedef std::vector ArgsImpl; - static PIDImpl idImpl(); - static void timesImpl(long& userTime, long& kernelTime); - static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); - static void killImpl(const ProcessHandleImpl& handle); - static void killImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); + static PIDImpl idImpl(); + static void timesImpl(long& userTime, long& kernelTime); + static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); + static void killImpl(const ProcessHandleImpl& handle); + static void killImpl(PIDImpl pid); + static void requestTerminationImpl(PIDImpl pid); + static std::string terminationEventName(PIDImpl pid); }; diff --git a/Foundation/include/Poco/PurgeStrategy.h b/Foundation/include/Poco/PurgeStrategy.h index 533a74063..05889e4df 100644 --- a/Foundation/include/Poco/PurgeStrategy.h +++ b/Foundation/include/Poco/PurgeStrategy.h @@ -1,7 +1,7 @@ // // PurgeStrategy.h // -// $Id: //poco/svn/Foundation/include/Poco/PurgeStrategy.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/PurgeStrategy.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/RWLock.h b/Foundation/include/Poco/RWLock.h index 5c0681794..aa5a82684 100644 --- a/Foundation/include/Poco/RWLock.h +++ b/Foundation/include/Poco/RWLock.h @@ -1,7 +1,7 @@ // // RWLock.h // -// $Id: //poco/svn/Foundation/include/Poco/RWLock.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RWLock.h#3 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/RWLock_POSIX.h b/Foundation/include/Poco/RWLock_POSIX.h index f55f7fa33..4e1f92355 100644 --- a/Foundation/include/Poco/RWLock_POSIX.h +++ b/Foundation/include/Poco/RWLock_POSIX.h @@ -1,7 +1,7 @@ // // RWLock_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/RWLock_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RWLock_POSIX.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/RWLock_WIN32.h b/Foundation/include/Poco/RWLock_WIN32.h index 75917f1e9..3586f5c9c 100644 --- a/Foundation/include/Poco/RWLock_WIN32.h +++ b/Foundation/include/Poco/RWLock_WIN32.h @@ -1,7 +1,7 @@ // // RWLock_WIN32.h // -// $Id: //poco/1.3/Foundation/include/Poco/RWLock_WIN32.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/RWLock_WIN32.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Random.h b/Foundation/include/Poco/Random.h index 18c3530af..80f00676e 100644 --- a/Foundation/include/Poco/Random.h +++ b/Foundation/include/Poco/Random.h @@ -1,7 +1,7 @@ // // Random.h // -// $Id: //poco/svn/Foundation/include/Poco/Random.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Random.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/RandomStream.h b/Foundation/include/Poco/RandomStream.h index 471cfc11d..0f93a6404 100644 --- a/Foundation/include/Poco/RandomStream.h +++ b/Foundation/include/Poco/RandomStream.h @@ -1,7 +1,7 @@ // // RandomStream.h // -// $Id: //poco/svn/Foundation/include/Poco/RandomStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RandomStream.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/RefCountedObject.h b/Foundation/include/Poco/RefCountedObject.h index 17266965a..0e1b06a53 100644 --- a/Foundation/include/Poco/RefCountedObject.h +++ b/Foundation/include/Poco/RefCountedObject.h @@ -1,7 +1,7 @@ // // RefCountedObject.h // -// $Id: //poco/svn/Foundation/include/Poco/RefCountedObject.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RefCountedObject.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/RegularExpression.h b/Foundation/include/Poco/RegularExpression.h index 11586545e..c813a8c5e 100644 --- a/Foundation/include/Poco/RegularExpression.h +++ b/Foundation/include/Poco/RegularExpression.h @@ -1,7 +1,7 @@ // // RegularExpression.h // -// $Id: //poco/svn/Foundation/include/Poco/RegularExpression.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RegularExpression.h#2 $ // // Library: Foundation // Package: RegExp @@ -80,13 +80,13 @@ public: /// /// See the PCRE documentation for more information. { - RE_CASELESS = 0x00000001, /// case insensitive matching (/i) [ctor] - RE_MULTILINE = 0x00000002, /// enable multi-line mode; affects ^ and $ (/m) [ctor] - RE_DOTALL = 0x00000004, /// dot matches all characters, including newline (/s) [ctor] - RE_EXTENDED = 0x00000008, /// totally ignore whitespace (/x) [ctor] - RE_ANCHORED = 0x00000010, /// treat pattern as if it starts with a ^ [ctor, match] - RE_DOLLAR_ENDONLY = 0x00000020, /// dollar matches end-of-string only, not last newline in string [ctor] - RE_EXTRA = 0x00000040, /// enable optional PCRE functionality [ctor] + RE_CASELESS = 0x00000001, /// case insensitive matching (/i) [ctor] + RE_MULTILINE = 0x00000002, /// enable multi-line mode; affects ^ and $ (/m) [ctor] + RE_DOTALL = 0x00000004, /// dot matches all characters, including newline (/s) [ctor] + RE_EXTENDED = 0x00000008, /// totally ignore whitespace (/x) [ctor] + RE_ANCHORED = 0x00000010, /// treat pattern as if it starts with a ^ [ctor, match] + RE_DOLLAR_ENDONLY = 0x00000020, /// dollar matches end-of-string only, not last newline in string [ctor] + RE_EXTRA = 0x00000040, /// enable optional PCRE functionality [ctor] RE_NOTBOL = 0x00000080, /// circumflex does not match beginning of string [match] RE_NOTEOL = 0x00000100, /// $ does not match end of string [match] RE_UNGREEDY = 0x00000200, /// make quantifiers ungreedy [ctor] diff --git a/Foundation/include/Poco/RotateStrategy.h b/Foundation/include/Poco/RotateStrategy.h index 2afd6c2c1..5fa61e384 100644 --- a/Foundation/include/Poco/RotateStrategy.h +++ b/Foundation/include/Poco/RotateStrategy.h @@ -1,7 +1,7 @@ // // RotateStrategy.h // -// $Id: //poco/1.3/Foundation/include/Poco/RotateStrategy.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/RotateStrategy.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Runnable.h b/Foundation/include/Poco/Runnable.h index 17d7d9c9c..17c78b0f1 100644 --- a/Foundation/include/Poco/Runnable.h +++ b/Foundation/include/Poco/Runnable.h @@ -1,7 +1,7 @@ // // Runnable.h // -// $Id: //poco/svn/Foundation/include/Poco/Runnable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Runnable.h#1 $ // // Library: Foundation // Package: Threading @@ -51,7 +51,7 @@ class Foundation_API Runnable /// must be implemented by classes that provide /// an entry point for a thread. { -public: +public: Runnable(); virtual ~Runnable(); diff --git a/Foundation/include/Poco/RunnableAdapter.h b/Foundation/include/Poco/RunnableAdapter.h index 74ff43979..6b2a63fe0 100644 --- a/Foundation/include/Poco/RunnableAdapter.h +++ b/Foundation/include/Poco/RunnableAdapter.h @@ -1,7 +1,7 @@ // // RunnableAdapter.h // -// $Id: //poco/svn/Foundation/include/Poco/RunnableAdapter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/RunnableAdapter.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/SHA1Engine.h b/Foundation/include/Poco/SHA1Engine.h index cb0f36d8b..f85a1a8d4 100644 --- a/Foundation/include/Poco/SHA1Engine.h +++ b/Foundation/include/Poco/SHA1Engine.h @@ -1,7 +1,7 @@ // // SHA1Engine.h // -// $Id: //poco/svn/Foundation/include/Poco/SHA1Engine.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SHA1Engine.h#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/include/Poco/ScopedLock.h b/Foundation/include/Poco/ScopedLock.h index 11652f133..2b48d560b 100644 --- a/Foundation/include/Poco/ScopedLock.h +++ b/Foundation/include/Poco/ScopedLock.h @@ -1,7 +1,7 @@ // // ScopedLock.h // -// $Id: //poco/svn/Foundation/include/Poco/ScopedLock.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ScopedLock.h#3 $ // // Library: Foundation // Package: Threading @@ -48,27 +48,27 @@ namespace Poco { template class ScopedLock - /// A class that simplifies thread synchronization - /// with a mutex. - /// The constructor accepts a Mutex (and optionally - /// a timeout value in milliseconds) and locks it. - /// The destructor unlocks the mutex. + /// A class that simplifies thread synchronization + /// with a mutex. + /// The constructor accepts a Mutex (and optionally + /// a timeout value in milliseconds) and locks it. + /// The destructor unlocks the mutex. { public: - explicit ScopedLock(M& mutex): _mutex(mutex) - { - _mutex.lock(); - } - - ScopedLock(M& mutex, long milliseconds): _mutex(mutex) - { - _mutex.lock(milliseconds); - } - - ~ScopedLock() - { - _mutex.unlock(); - } + explicit ScopedLock(M& mutex): _mutex(mutex) + { + _mutex.lock(); + } + + ScopedLock(M& mutex, long milliseconds): _mutex(mutex) + { + _mutex.lock(milliseconds); + } + + ~ScopedLock() + { + _mutex.unlock(); + } private: M& _mutex; @@ -81,28 +81,28 @@ private: template class ScopedLockWithUnlock - /// A class that simplifies thread synchronization - /// with a mutex. - /// The constructor accepts a Mutex (and optionally - /// a timeout value in milliseconds) and locks it. - /// The destructor unlocks the mutex. - /// The unlock() member function allows for manual - /// unlocking of the mutex. + /// A class that simplifies thread synchronization + /// with a mutex. + /// The constructor accepts a Mutex (and optionally + /// a timeout value in milliseconds) and locks it. + /// The destructor unlocks the mutex. + /// The unlock() member function allows for manual + /// unlocking of the mutex. { public: - explicit ScopedLockWithUnlock(M& mutex): _pMutex(&mutex) - { - _pMutex->lock(); - } - - ScopedLockWithUnlock(M& mutex, long milliseconds): _pMutex(&mutex) - { - _pMutex->lock(milliseconds); - } - - ~ScopedLockWithUnlock() - { - unlock(); + explicit ScopedLockWithUnlock(M& mutex): _pMutex(&mutex) + { + _pMutex->lock(); + } + + ScopedLockWithUnlock(M& mutex, long milliseconds): _pMutex(&mutex) + { + _pMutex->lock(milliseconds); + } + + ~ScopedLockWithUnlock() + { + unlock(); } void unlock() diff --git a/Foundation/include/Poco/ScopedUnlock.h b/Foundation/include/Poco/ScopedUnlock.h index b43ec02b1..72ed894b1 100644 --- a/Foundation/include/Poco/ScopedUnlock.h +++ b/Foundation/include/Poco/ScopedUnlock.h @@ -1,7 +1,7 @@ // // ScopedUnlock.h // -// $Id: //poco/svn/Foundation/include/Poco/ScopedUnlock.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ScopedUnlock.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Semaphore.h b/Foundation/include/Poco/Semaphore.h index 77169e811..d3f2285ab 100644 --- a/Foundation/include/Poco/Semaphore.h +++ b/Foundation/include/Poco/Semaphore.h @@ -1,7 +1,7 @@ // // Semaphore.h // -// $Id: //poco/svn/Foundation/include/Poco/Semaphore.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Semaphore.h#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Semaphore_POSIX.h b/Foundation/include/Poco/Semaphore_POSIX.h index cff116d4c..b4430965c 100644 --- a/Foundation/include/Poco/Semaphore_POSIX.h +++ b/Foundation/include/Poco/Semaphore_POSIX.h @@ -1,7 +1,7 @@ // // Semaphore_POSIX.h // -// $Id: //poco/svn/Foundation/include/Poco/Semaphore_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Semaphore_POSIX.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Semaphore_WIN32.h b/Foundation/include/Poco/Semaphore_WIN32.h index fb9be86cc..09a8bdb34 100644 --- a/Foundation/include/Poco/Semaphore_WIN32.h +++ b/Foundation/include/Poco/Semaphore_WIN32.h @@ -1,7 +1,7 @@ // // Semaphore_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/Semaphore_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Semaphore_WIN32.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/SharedLibrary.h b/Foundation/include/Poco/SharedLibrary.h index 3bfb54824..357343b5b 100644 --- a/Foundation/include/Poco/SharedLibrary.h +++ b/Foundation/include/Poco/SharedLibrary.h @@ -1,7 +1,7 @@ // // SharedLibrary.h // -// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary.h#3 $ // // Library: Foundation // Package: SharedLibrary @@ -63,60 +63,60 @@ namespace Poco { class Foundation_API SharedLibrary: private SharedLibraryImpl /// The SharedLibrary class dynamically - /// loads shared libraries at run-time. + /// loads shared libraries at run-time. { public: - enum Flags - { - SHLIB_GLOBAL = 1, - /// On platforms that use dlopen(), use RTLD_GLOBAL. This is the default - /// if no flags are given. - /// - /// This flag is ignored on platforms that do not use dlopen(). + enum Flags + { + SHLIB_GLOBAL = 1, + /// On platforms that use dlopen(), use RTLD_GLOBAL. This is the default + /// if no flags are given. + /// + /// This flag is ignored on platforms that do not use dlopen(). - SHLIB_LOCAL = 2 - /// On platforms that use dlopen(), use RTLD_LOCAL instead of RTLD_GLOBAL. - /// - /// Note that if this flag is specified, RTTI (including dynamic_cast and throw) will - /// not work for types defined in the shared library with GCC and possibly other - /// compilers as well. See http://gcc.gnu.org/faq.html#dso for more information. - /// - /// This flag is ignored on platforms that do not use dlopen(). - }; - - SharedLibrary(); - /// Creates a SharedLibrary object. - + SHLIB_LOCAL = 2 + /// On platforms that use dlopen(), use RTLD_LOCAL instead of RTLD_GLOBAL. + /// + /// Note that if this flag is specified, RTTI (including dynamic_cast and throw) will + /// not work for types defined in the shared library with GCC and possibly other + /// compilers as well. See http://gcc.gnu.org/faq.html#dso for more information. + /// + /// This flag is ignored on platforms that do not use dlopen(). + }; + + SharedLibrary(); + /// Creates a SharedLibrary object. + SharedLibrary(const std::string& path); - /// Creates a SharedLibrary object and loads a library - /// from the given path. + /// Creates a SharedLibrary object and loads a library + /// from the given path. - SharedLibrary(const std::string& path, int flags); - /// Creates a SharedLibrary object and loads a library - /// from the given path, using the given flags. - /// See the Flags enumeration for valid values. + SharedLibrary(const std::string& path, int flags); + /// Creates a SharedLibrary object and loads a library + /// from the given path, using the given flags. + /// See the Flags enumeration for valid values. - virtual ~SharedLibrary(); - /// Destroys the SharedLibrary. The actual library - /// remains loaded. + virtual ~SharedLibrary(); + /// Destroys the SharedLibrary. The actual library + /// remains loaded. void load(const std::string& path); /// Loads a shared library from the given path. - /// Throws a LibraryAlreadyLoadedException if - /// a library has already been loaded. - /// Throws a LibraryLoadException if the library - /// cannot be loaded. + /// Throws a LibraryAlreadyLoadedException if + /// a library has already been loaded. + /// Throws a LibraryLoadException if the library + /// cannot be loaded. - void load(const std::string& path, int flags); - /// Loads a shared library from the given path, - /// using the given flags. See the Flags enumeration - /// for valid values. - /// Throws a LibraryAlreadyLoadedException if - /// a library has already been loaded. - /// Throws a LibraryLoadException if the library - /// cannot be loaded. + void load(const std::string& path, int flags); + /// Loads a shared library from the given path, + /// using the given flags. See the Flags enumeration + /// for valid values. + /// Throws a LibraryAlreadyLoadedException if + /// a library has already been loaded. + /// Throws a LibraryLoadException if the library + /// cannot be loaded. - void unload(); + void unload(); /// Unloads a shared library. bool isLoaded() const; diff --git a/Foundation/include/Poco/SharedLibrary_HPUX.h b/Foundation/include/Poco/SharedLibrary_HPUX.h index f349cdfc1..d67c17890 100644 --- a/Foundation/include/Poco/SharedLibrary_HPUX.h +++ b/Foundation/include/Poco/SharedLibrary_HPUX.h @@ -1,7 +1,7 @@ // // SharedLibrary_HPUX.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedLibrary_HPUX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_HPUX.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -51,12 +51,12 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedLibrary_UNIX.h b/Foundation/include/Poco/SharedLibrary_UNIX.h index 4339c42b8..a1b186157 100644 --- a/Foundation/include/Poco/SharedLibrary_UNIX.h +++ b/Foundation/include/Poco/SharedLibrary_UNIX.h @@ -1,7 +1,7 @@ // // SharedLibrary_UNIX.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedLibrary_UNIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_UNIX.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -50,18 +50,18 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - enum Flags - { - SHLIB_GLOBAL_IMPL = 1, - SHLIB_LOCAL_IMPL = 2 - }; + enum Flags + { + SHLIB_GLOBAL_IMPL = 1, + SHLIB_LOCAL_IMPL = 2 + }; - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedLibrary_VMS.h b/Foundation/include/Poco/SharedLibrary_VMS.h index 87fdb5396..96b6d261c 100644 --- a/Foundation/include/Poco/SharedLibrary_VMS.h +++ b/Foundation/include/Poco/SharedLibrary_VMS.h @@ -1,7 +1,7 @@ // // SharedLibrary_VMS.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedLibrary_VMS.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_VMS.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -50,12 +50,12 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedLibrary_VX.h b/Foundation/include/Poco/SharedLibrary_VX.h index 1ca91a46f..089a26c55 100644 --- a/Foundation/include/Poco/SharedLibrary_VX.h +++ b/Foundation/include/Poco/SharedLibrary_VX.h @@ -1,7 +1,7 @@ // // SharedLibrary_VX.h // -// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_VX.h#1 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_VX.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -51,12 +51,12 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedLibrary_WIN32.h b/Foundation/include/Poco/SharedLibrary_WIN32.h index ba6d781f9..a3e22bb1a 100644 --- a/Foundation/include/Poco/SharedLibrary_WIN32.h +++ b/Foundation/include/Poco/SharedLibrary_WIN32.h @@ -1,7 +1,7 @@ // // SharedLibrary_WIN32.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedLibrary_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_WIN32.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -50,12 +50,12 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedLibrary_WIN32U.h b/Foundation/include/Poco/SharedLibrary_WIN32U.h index a41ca494e..fb5a288f4 100644 --- a/Foundation/include/Poco/SharedLibrary_WIN32U.h +++ b/Foundation/include/Poco/SharedLibrary_WIN32U.h @@ -1,7 +1,7 @@ // // SharedLibrary_WIN32U.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedLibrary_WIN32U.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_WIN32U.h#2 $ // // Library: Foundation // Package: SharedLibrary @@ -50,12 +50,12 @@ namespace Poco { class Foundation_API SharedLibraryImpl { protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string& path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void* findSymbolImpl(const std::string& name); + SharedLibraryImpl(); + ~SharedLibraryImpl(); + void loadImpl(const std::string& path, int flags); + void unloadImpl(); + bool isLoadedImpl() const; + void* findSymbolImpl(const std::string& name); const std::string& getPathImpl() const; static std::string suffixImpl(); diff --git a/Foundation/include/Poco/SharedMemory.h b/Foundation/include/Poco/SharedMemory.h index 980d92528..dcb4fc2ad 100644 --- a/Foundation/include/Poco/SharedMemory.h +++ b/Foundation/include/Poco/SharedMemory.h @@ -1,7 +1,7 @@ // // SharedMemory.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedMemory.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedMemory.h#2 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/SharedMemory_DUMMY.h b/Foundation/include/Poco/SharedMemory_DUMMY.h index 11fc09c46..d363a37e1 100644 --- a/Foundation/include/Poco/SharedMemory_DUMMY.h +++ b/Foundation/include/Poco/SharedMemory_DUMMY.h @@ -1,7 +1,7 @@ // // SharedMemoryImpl.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedMemory_DUMMY.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedMemory_DUMMY.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/SharedMemory_POSIX.h b/Foundation/include/Poco/SharedMemory_POSIX.h index ae4893a5d..91a8d7356 100644 --- a/Foundation/include/Poco/SharedMemory_POSIX.h +++ b/Foundation/include/Poco/SharedMemory_POSIX.h @@ -1,7 +1,7 @@ // // SharedMemoryImpl.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedMemory_POSIX.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedMemory_POSIX.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/SharedMemory_WIN32.h b/Foundation/include/Poco/SharedMemory_WIN32.h index a0c426657..f4cc4ea8c 100644 --- a/Foundation/include/Poco/SharedMemory_WIN32.h +++ b/Foundation/include/Poco/SharedMemory_WIN32.h @@ -1,7 +1,7 @@ // // SharedMemoryImpl.h // -// $Id: //poco/svn/Foundation/include/Poco/SharedMemory_WIN32.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SharedMemory_WIN32.h#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/include/Poco/SignalHandler.h b/Foundation/include/Poco/SignalHandler.h index 987c91d6d..d3400f90f 100644 --- a/Foundation/include/Poco/SignalHandler.h +++ b/Foundation/include/Poco/SignalHandler.h @@ -1,7 +1,7 @@ // // SignalHandler.h // -// $Id: //poco/1.3/Foundation/include/Poco/SignalHandler.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SignalHandler.h#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/SimpleFileChannel.h b/Foundation/include/Poco/SimpleFileChannel.h index 3c0c07fb9..f787a10f6 100644 --- a/Foundation/include/Poco/SimpleFileChannel.h +++ b/Foundation/include/Poco/SimpleFileChannel.h @@ -1,7 +1,7 @@ // // SimpleFileChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/SimpleFileChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SimpleFileChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/SimpleHashTable.h b/Foundation/include/Poco/SimpleHashTable.h index c12afd05e..2fc4895da 100644 --- a/Foundation/include/Poco/SimpleHashTable.h +++ b/Foundation/include/Poco/SimpleHashTable.h @@ -1,7 +1,7 @@ // // SimpleHashTable.h // -// $Id: //poco/svn/Foundation/include/Poco/SimpleHashTable.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SimpleHashTable.h#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/include/Poco/SingletonHolder.h b/Foundation/include/Poco/SingletonHolder.h index 32e118534..58d40e2be 100644 --- a/Foundation/include/Poco/SingletonHolder.h +++ b/Foundation/include/Poco/SingletonHolder.h @@ -1,7 +1,7 @@ // // SingletonHolder.h // -// $Id: //poco/svn/Foundation/include/Poco/SingletonHolder.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SingletonHolder.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/SplitterChannel.h b/Foundation/include/Poco/SplitterChannel.h index dd3774ff5..d0a34e290 100644 --- a/Foundation/include/Poco/SplitterChannel.h +++ b/Foundation/include/Poco/SplitterChannel.h @@ -1,7 +1,7 @@ // // SplitterChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/SplitterChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SplitterChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Stopwatch.h b/Foundation/include/Poco/Stopwatch.h index 4e19776f5..0af87347a 100644 --- a/Foundation/include/Poco/Stopwatch.h +++ b/Foundation/include/Poco/Stopwatch.h @@ -1,7 +1,7 @@ // // Stopwatch.h // -// $Id: //poco/Main/Foundation/include/Poco/Stopwatch.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/Stopwatch.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/StreamChannel.h b/Foundation/include/Poco/StreamChannel.h index 42af45e07..6aee9c834 100644 --- a/Foundation/include/Poco/StreamChannel.h +++ b/Foundation/include/Poco/StreamChannel.h @@ -1,7 +1,7 @@ // // StreamChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/StreamChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/StreamChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/StreamConverter.h b/Foundation/include/Poco/StreamConverter.h index fc7623f96..5599ea833 100644 --- a/Foundation/include/Poco/StreamConverter.h +++ b/Foundation/include/Poco/StreamConverter.h @@ -1,7 +1,7 @@ // // StreamConverter.h // -// $Id: //poco/svn/Foundation/include/Poco/StreamConverter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/StreamConverter.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/StreamCopier.h b/Foundation/include/Poco/StreamCopier.h index 9fa604bf0..9067f76a9 100644 --- a/Foundation/include/Poco/StreamCopier.h +++ b/Foundation/include/Poco/StreamCopier.h @@ -1,7 +1,7 @@ // // StreamCopier.h // -// $Id: //poco/svn/Foundation/include/Poco/StreamCopier.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/StreamCopier.h#2 $ // // Library: Foundation // Package: Streams @@ -51,52 +51,52 @@ namespace Poco { class Foundation_API StreamCopier /// This class provides static methods to copy the contents from one stream - /// into another. + /// into another. { public: static std::streamsize copyStream(std::istream& istr, std::ostream& ostr, std::size_t bufferSize = 8192); - /// Writes all bytes readable from istr to ostr, using an internal buffer. - /// - /// Returns the number of bytes copied. + /// Writes all bytes readable from istr to ostr, using an internal buffer. + /// + /// Returns the number of bytes copied. #if defined(POCO_HAVE_INT64) static Poco::UInt64 copyStream64(std::istream& istr, std::ostream& ostr, std::size_t bufferSize = 8192); - /// Writes all bytes readable from istr to ostr, using an internal buffer. - /// - /// Returns the number of bytes copied as a 64-bit unsigned integer. - /// - /// Note: the only difference to copyStream() is that a 64-bit unsigned - /// integer is used to count the number of bytes copied. + /// Writes all bytes readable from istr to ostr, using an internal buffer. + /// + /// Returns the number of bytes copied as a 64-bit unsigned integer. + /// + /// Note: the only difference to copyStream() is that a 64-bit unsigned + /// integer is used to count the number of bytes copied. #endif static std::streamsize copyStreamUnbuffered(std::istream& istr, std::ostream& ostr); - /// Writes all bytes readable from istr to ostr. - /// - /// Returns the number of bytes copied. + /// Writes all bytes readable from istr to ostr. + /// + /// Returns the number of bytes copied. #if defined(POCO_HAVE_INT64) static Poco::UInt64 copyStreamUnbuffered64(std::istream& istr, std::ostream& ostr); - /// Writes all bytes readable from istr to ostr. - /// - /// Returns the number of bytes copied as a 64-bit unsigned integer. - /// - /// Note: the only difference to copyStreamUnbuffered() is that a 64-bit unsigned - /// integer is used to count the number of bytes copied. + /// Writes all bytes readable from istr to ostr. + /// + /// Returns the number of bytes copied as a 64-bit unsigned integer. + /// + /// Note: the only difference to copyStreamUnbuffered() is that a 64-bit unsigned + /// integer is used to count the number of bytes copied. #endif static std::streamsize copyToString(std::istream& istr, std::string& str, std::size_t bufferSize = 8192); - /// Appends all bytes readable from istr to the given string, using an internal buffer. - /// - /// Returns the number of bytes copied. + /// Appends all bytes readable from istr to the given string, using an internal buffer. + /// + /// Returns the number of bytes copied. #if defined(POCO_HAVE_INT64) static Poco::UInt64 copyToString64(std::istream& istr, std::string& str, std::size_t bufferSize = 8192); - /// Appends all bytes readable from istr to the given string, using an internal buffer. - /// - /// Returns the number of bytes copied as a 64-bit unsigned integer. - /// - /// Note: the only difference to copyToString() is that a 64-bit unsigned - /// integer is used to count the number of bytes copied. + /// Appends all bytes readable from istr to the given string, using an internal buffer. + /// + /// Returns the number of bytes copied as a 64-bit unsigned integer. + /// + /// Note: the only difference to copyToString() is that a 64-bit unsigned + /// integer is used to count the number of bytes copied. #endif }; diff --git a/Foundation/include/Poco/StreamTokenizer.h b/Foundation/include/Poco/StreamTokenizer.h index 166eb30e7..e19382395 100644 --- a/Foundation/include/Poco/StreamTokenizer.h +++ b/Foundation/include/Poco/StreamTokenizer.h @@ -1,7 +1,7 @@ // // StreamTokenizer.h // -// $Id: //poco/svn/Foundation/include/Poco/StreamTokenizer.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/StreamTokenizer.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/SynchronizedObject.h b/Foundation/include/Poco/SynchronizedObject.h index 9c809070c..6d1b14ba1 100644 --- a/Foundation/include/Poco/SynchronizedObject.h +++ b/Foundation/include/Poco/SynchronizedObject.h @@ -1,7 +1,7 @@ // // SynchronizedObject.h // -// $Id: //poco/svn/Foundation/include/Poco/SynchronizedObject.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SynchronizedObject.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/SyslogChannel.h b/Foundation/include/Poco/SyslogChannel.h index a728a65ba..c5a63b4b8 100644 --- a/Foundation/include/Poco/SyslogChannel.h +++ b/Foundation/include/Poco/SyslogChannel.h @@ -1,7 +1,7 @@ // // SyslogChannel.h // -// $Id: //poco/svn/Foundation/include/Poco/SyslogChannel.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/SyslogChannel.h#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/include/Poco/Task.h b/Foundation/include/Poco/Task.h index 9e0d059f8..b9ace3e00 100644 --- a/Foundation/include/Poco/Task.h +++ b/Foundation/include/Poco/Task.h @@ -1,7 +1,7 @@ // // Task.h // -// $Id: //poco/svn/Foundation/include/Poco/Task.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Task.h#2 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/include/Poco/TaskManager.h b/Foundation/include/Poco/TaskManager.h index 26ec4d299..f1b170c06 100644 --- a/Foundation/include/Poco/TaskManager.h +++ b/Foundation/include/Poco/TaskManager.h @@ -1,7 +1,7 @@ // // TaskManager.h // -// $Id: //poco/svn/Foundation/include/Poco/TaskManager.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TaskManager.h#2 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/include/Poco/TaskNotification.h b/Foundation/include/Poco/TaskNotification.h index b192d6a89..56a208bb2 100644 --- a/Foundation/include/Poco/TaskNotification.h +++ b/Foundation/include/Poco/TaskNotification.h @@ -1,7 +1,7 @@ // // TaskNotification.h // -// $Id: //poco/svn/Foundation/include/Poco/TaskNotification.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TaskNotification.h#1 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/include/Poco/TeeStream.h b/Foundation/include/Poco/TeeStream.h index 279bec452..e1dec37bd 100644 --- a/Foundation/include/Poco/TeeStream.h +++ b/Foundation/include/Poco/TeeStream.h @@ -1,7 +1,7 @@ // // TeeStream.h // -// $Id: //poco/svn/Foundation/include/Poco/TeeStream.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TeeStream.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/TemporaryFile.h b/Foundation/include/Poco/TemporaryFile.h index e070bb9e8..69b02d1df 100644 --- a/Foundation/include/Poco/TemporaryFile.h +++ b/Foundation/include/Poco/TemporaryFile.h @@ -1,7 +1,7 @@ // // TemporaryFile.h // -// $Id: //poco/svn/Foundation/include/Poco/TemporaryFile.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TemporaryFile.h#2 $ // // Library: Foundation // Package: Filesystem @@ -65,13 +65,13 @@ class Foundation_API TemporaryFile: public File { public: TemporaryFile(); - /// Creates the TemporaryFile. + /// Creates the TemporaryFile. TemporaryFile(const std::string& tempDir); - /// Creates the TemporaryFile using the given directory. + /// Creates the TemporaryFile using the given directory. - ~TemporaryFile(); - /// Destroys the TemporaryFile and + ~TemporaryFile(); + /// Destroys the TemporaryFile and /// deletes the corresponding file on /// disk unless keep() or keepUntilExit() /// has been called. @@ -89,14 +89,14 @@ public: /// Registers the given file for deletion /// at process termination. - static std::string tempName(const std::string& tempDir = ""); - /// Returns a unique path name for a temporary - /// file in the system's scratch directory (see Path::temp()) - /// if tempDir is empty or in the directory specified in tempDir - /// otherwise. + static std::string tempName(const std::string& tempDir = ""); + /// Returns a unique path name for a temporary + /// file in the system's scratch directory (see Path::temp()) + /// if tempDir is empty or in the directory specified in tempDir + /// otherwise. private: - bool _keep; + bool _keep; }; diff --git a/Foundation/include/Poco/TextConverter.h b/Foundation/include/Poco/TextConverter.h index 87923330f..95b5a27ad 100644 --- a/Foundation/include/Poco/TextConverter.h +++ b/Foundation/include/Poco/TextConverter.h @@ -1,7 +1,7 @@ // // TextConverter.h // -// $Id: //poco/svn/Foundation/include/Poco/TextConverter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TextConverter.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/TextEncoding.h b/Foundation/include/Poco/TextEncoding.h index 82608cd1b..f722a881c 100644 --- a/Foundation/include/Poco/TextEncoding.h +++ b/Foundation/include/Poco/TextEncoding.h @@ -1,7 +1,7 @@ // // TextEncoding.h // -// $Id: //poco/svn/Foundation/include/Poco/TextEncoding.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TextEncoding.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/TextIterator.h b/Foundation/include/Poco/TextIterator.h index c99cc0a84..44b2aa03f 100644 --- a/Foundation/include/Poco/TextIterator.h +++ b/Foundation/include/Poco/TextIterator.h @@ -1,7 +1,7 @@ // // TextIterator.h // -// $Id: //poco/svn/Foundation/include/Poco/TextIterator.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/TextIterator.h#1 $ // // Library: Foundation // Package: Text @@ -64,14 +64,14 @@ class Foundation_API TextIterator /// int n = 0; /// while (it != end) { ++n; ++it; } /// - /// NOTE: When an UTF-16 encoding is used, surrogate pairs will be - /// reported as two separate characters, due to restrictions of - /// the TextEncoding class. - /// - /// For iterating over char buffers, see the TextBufferIterator class. + /// NOTE: When an UTF-16 encoding is used, surrogate pairs will be + /// reported as two separate characters, due to restrictions of + /// the TextEncoding class. + /// + /// For iterating over char buffers, see the TextBufferIterator class. { public: - TextIterator(); + TextIterator(); /// Creates an uninitialized TextIterator. TextIterator(const std::string& str, const TextEncoding& encoding); @@ -116,16 +116,16 @@ public: bool operator == (const TextIterator& it) const; /// Compares two iterators for equality. - bool operator != (const TextIterator& it) const; - /// Compares two iterators for inequality. - - TextIterator end() const; - /// Returns the end iterator for the range handled - /// by the iterator. - + bool operator != (const TextIterator& it) const; + /// Compares two iterators for inequality. + + TextIterator end() const; + /// Returns the end iterator for the range handled + /// by the iterator. + private: - const TextEncoding* _pEncoding; - std::string::const_iterator _it; + const TextEncoding* _pEncoding; + std::string::const_iterator _it; std::string::const_iterator _end; }; @@ -153,7 +153,7 @@ inline void swap(TextIterator& it1, TextIterator& it2) inline TextIterator TextIterator::end() const { - return TextIterator(_end); + return TextIterator(_end); } diff --git a/Foundation/include/Poco/Thread.h b/Foundation/include/Poco/Thread.h index 3da8ab840..68f4e4de3 100644 --- a/Foundation/include/Poco/Thread.h +++ b/Foundation/include/Poco/Thread.h @@ -1,7 +1,7 @@ // // Thread.h // -// $Id: //poco/Main/Foundation/include/Poco/Thread.h#7 $ +// $Id: //poco/1.4/Foundation/include/Poco/Thread.h#3 $ // // Library: Foundation // Package: Threading @@ -104,13 +104,13 @@ public: /// Returns the native thread ID of the thread. std::string name() const; - /// Returns the name of the thread. + /// Returns the name of the thread. - std::string getName() const; - /// Returns the name of the thread. + std::string getName() const; + /// Returns the name of the thread. - void setName(const std::string& name); - /// Sets the name of the thread. + void setName(const std::string& name); + /// Sets the name of the thread. void setPriority(Priority prio); /// Sets the thread's priority. diff --git a/Foundation/include/Poco/ThreadLocal.h b/Foundation/include/Poco/ThreadLocal.h index 189d57841..d9358616c 100644 --- a/Foundation/include/Poco/ThreadLocal.h +++ b/Foundation/include/Poco/ThreadLocal.h @@ -1,7 +1,7 @@ // // ThreadLocal.h // -// $Id: //poco/svn/Foundation/include/Poco/ThreadLocal.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/ThreadLocal.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/ThreadPool.h b/Foundation/include/Poco/ThreadPool.h index 0fc1c5567..4aae08bbc 100644 --- a/Foundation/include/Poco/ThreadPool.h +++ b/Foundation/include/Poco/ThreadPool.h @@ -1,7 +1,7 @@ // // ThreadPool.h // -// $Id: //poco/Main/Foundation/include/Poco/ThreadPool.h#5 $ +// $Id: //poco/1.4/Foundation/include/Poco/ThreadPool.h#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/Thread_POSIX.h b/Foundation/include/Poco/Thread_POSIX.h index 099974ef5..09d2b28db 100644 --- a/Foundation/include/Poco/Thread_POSIX.h +++ b/Foundation/include/Poco/Thread_POSIX.h @@ -1,7 +1,7 @@ // // Thread_POSIX.h // -// $Id: //poco/Main/Foundation/include/Poco/Thread_POSIX.h#8 $ +// $Id: //poco/1.4/Foundation/include/Poco/Thread_POSIX.h#3 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/include/Poco/TimedNotificationQueue.h b/Foundation/include/Poco/TimedNotificationQueue.h index 85cdb0333..cfbdaa619 100644 --- a/Foundation/include/Poco/TimedNotificationQueue.h +++ b/Foundation/include/Poco/TimedNotificationQueue.h @@ -1,155 +1,155 @@ -// -// TimedNotificationQueue.h -// -// $Id: //poco/Main/Foundation/include/Poco/TimedNotificationQueue.h#1 $ -// -// Library: Foundation -// Package: Notifications -// Module: TimedNotificationQueue -// -// Definition of the TimedNotificationQueue class. -// -// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - - -#ifndef Foundation_TimedNotificationQueue_INCLUDED -#define Foundation_TimedNotificationQueue_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Notification.h" -#include "Poco/Mutex.h" -#include "Poco/Event.h" -#include "Poco/Timestamp.h" -#include - - -namespace Poco { - - -class Foundation_API TimedNotificationQueue - /// A TimedNotificationQueue object provides a way to implement timed, asynchronous - /// notifications. This is especially useful for sending notifications - /// from one thread to another, for example from a background thread to - /// the main (user interface) thread. - /// - /// The TimedNotificationQueue is quite similar to the NotificationQueue class. - /// The only difference to NotificationQueue is that each Notification is tagged - /// with a Timestamp. When inserting a Notification into the queue, the - /// Notification is inserted according to the given Timestamp, with - /// lower Timestamp values being inserted before higher ones. - /// - /// Notifications are dequeued in order of their timestamps. - /// - /// TimedNotificationQueue has some restrictions regarding multithreaded use. - /// While multiple threads may enqueue notifications, only one thread at a - /// time may dequeue notifications from the queue. - /// - /// If two threads try to dequeue a notification simultaneously, the results - /// are undefined. -{ -public: - TimedNotificationQueue(); - /// Creates the TimedNotificationQueue. - - ~TimedNotificationQueue(); - /// Destroys the TimedNotificationQueue. - - void enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp); - /// Enqueues the given notification by adding it to - /// the queue according to the given timestamp. - /// Lower timestamp values are inserted before higher ones. - /// The queue takes ownership of the notification, thus - /// a call like - /// notificationQueue.enqueueNotification(new MyNotification, someTime); - /// does not result in a memory leak. - - Notification* dequeueNotification(); - /// Dequeues the next pending notification with a timestamp - /// less than or equal to the current time. - /// Returns 0 (null) if no notification is available. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - Notification* waitDequeueNotification(); - /// Dequeues the next pending notification. - /// If no notification is available, waits for a notification - /// to be enqueued. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// This method returns 0 (null) if wakeUpWaitingThreads() - /// has been called by another thread. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - Notification* waitDequeueNotification(long milliseconds); - /// Dequeues the next pending notification. - /// If no notification is available, waits for a notification - /// to be enqueued up to the specified time. - /// Returns 0 (null) if no notification is available. - /// The caller gains ownership of the notification and - /// is expected to release it when done with it. - /// - /// It is highly recommended that the result is immediately - /// assigned to a Notification::Ptr, to avoid potential - /// memory management issues. - - bool empty() const; - /// Returns true iff the queue is empty. - - int size() const; - /// Returns the number of notifications in the queue. - - void clear(); - /// Removes all notifications from the queue. - /// - /// Calling clear() while another thread executes one of - /// the dequeue member functions will result in undefined - /// behavior. - -protected: - typedef std::multimap NfQueue; - Notification::Ptr dequeueOne(NfQueue::iterator& it); - bool wait(Timestamp::TimeDiff interval); - -private: - NfQueue _nfQueue; - Event _nfAvailable; - mutable FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_TimedNotificationQueue_INCLUDED +// +// TimedNotificationQueue.h +// +// $Id: //poco/1.4/Foundation/include/Poco/TimedNotificationQueue.h#1 $ +// +// Library: Foundation +// Package: Notifications +// Module: TimedNotificationQueue +// +// Definition of the TimedNotificationQueue class. +// +// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software, unless such copies or derivative +// works are solely in the form of machine-executable object code generated by +// a source language processor. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + + +#ifndef Foundation_TimedNotificationQueue_INCLUDED +#define Foundation_TimedNotificationQueue_INCLUDED + + +#include "Poco/Foundation.h" +#include "Poco/Notification.h" +#include "Poco/Mutex.h" +#include "Poco/Event.h" +#include "Poco/Timestamp.h" +#include + + +namespace Poco { + + +class Foundation_API TimedNotificationQueue + /// A TimedNotificationQueue object provides a way to implement timed, asynchronous + /// notifications. This is especially useful for sending notifications + /// from one thread to another, for example from a background thread to + /// the main (user interface) thread. + /// + /// The TimedNotificationQueue is quite similar to the NotificationQueue class. + /// The only difference to NotificationQueue is that each Notification is tagged + /// with a Timestamp. When inserting a Notification into the queue, the + /// Notification is inserted according to the given Timestamp, with + /// lower Timestamp values being inserted before higher ones. + /// + /// Notifications are dequeued in order of their timestamps. + /// + /// TimedNotificationQueue has some restrictions regarding multithreaded use. + /// While multiple threads may enqueue notifications, only one thread at a + /// time may dequeue notifications from the queue. + /// + /// If two threads try to dequeue a notification simultaneously, the results + /// are undefined. +{ +public: + TimedNotificationQueue(); + /// Creates the TimedNotificationQueue. + + ~TimedNotificationQueue(); + /// Destroys the TimedNotificationQueue. + + void enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp); + /// Enqueues the given notification by adding it to + /// the queue according to the given timestamp. + /// Lower timestamp values are inserted before higher ones. + /// The queue takes ownership of the notification, thus + /// a call like + /// notificationQueue.enqueueNotification(new MyNotification, someTime); + /// does not result in a memory leak. + + Notification* dequeueNotification(); + /// Dequeues the next pending notification with a timestamp + /// less than or equal to the current time. + /// Returns 0 (null) if no notification is available. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + Notification* waitDequeueNotification(); + /// Dequeues the next pending notification. + /// If no notification is available, waits for a notification + /// to be enqueued. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// This method returns 0 (null) if wakeUpWaitingThreads() + /// has been called by another thread. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + Notification* waitDequeueNotification(long milliseconds); + /// Dequeues the next pending notification. + /// If no notification is available, waits for a notification + /// to be enqueued up to the specified time. + /// Returns 0 (null) if no notification is available. + /// The caller gains ownership of the notification and + /// is expected to release it when done with it. + /// + /// It is highly recommended that the result is immediately + /// assigned to a Notification::Ptr, to avoid potential + /// memory management issues. + + bool empty() const; + /// Returns true iff the queue is empty. + + int size() const; + /// Returns the number of notifications in the queue. + + void clear(); + /// Removes all notifications from the queue. + /// + /// Calling clear() while another thread executes one of + /// the dequeue member functions will result in undefined + /// behavior. + +protected: + typedef std::multimap NfQueue; + Notification::Ptr dequeueOne(NfQueue::iterator& it); + bool wait(Timestamp::TimeDiff interval); + +private: + NfQueue _nfQueue; + Event _nfAvailable; + mutable FastMutex _mutex; +}; + + +} // namespace Poco + + +#endif // Foundation_TimedNotificationQueue_INCLUDED diff --git a/Foundation/include/Poco/Timespan.h b/Foundation/include/Poco/Timespan.h index a0421e229..9263755b0 100644 --- a/Foundation/include/Poco/Timespan.h +++ b/Foundation/include/Poco/Timespan.h @@ -1,7 +1,7 @@ // // Timespan.h // -// $Id: //poco/svn/Foundation/include/Poco/Timespan.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Timespan.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/Timestamp.h b/Foundation/include/Poco/Timestamp.h index b8717a0e8..d2c7aa594 100644 --- a/Foundation/include/Poco/Timestamp.h +++ b/Foundation/include/Poco/Timestamp.h @@ -1,7 +1,7 @@ // // Timestamp.h // -// $Id: //poco/svn/Foundation/include/Poco/Timestamp.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Timestamp.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/Timezone.h b/Foundation/include/Poco/Timezone.h index 7c4fb804f..1e5608b5f 100644 --- a/Foundation/include/Poco/Timezone.h +++ b/Foundation/include/Poco/Timezone.h @@ -1,7 +1,7 @@ // // Timezone.h // -// $Id: //poco/svn/Foundation/include/Poco/Timezone.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Timezone.h#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/include/Poco/Token.h b/Foundation/include/Poco/Token.h index c1d8d8aab..fb1a910be 100644 --- a/Foundation/include/Poco/Token.h +++ b/Foundation/include/Poco/Token.h @@ -1,7 +1,7 @@ // // Token.h // -// $Id: //poco/svn/Foundation/include/Poco/Token.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Token.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/Tuple.h b/Foundation/include/Poco/Tuple.h index 39a54ccaa..97437a7b4 100644 --- a/Foundation/include/Poco/Tuple.h +++ b/Foundation/include/Poco/Tuple.h @@ -1,7 +1,7 @@ // // Tuple.h // -// $Id: //poco/svn/Foundation/include/Poco/Tuple.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Tuple.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/Types.h b/Foundation/include/Poco/Types.h index c8ea424ab..6f1c41a27 100644 --- a/Foundation/include/Poco/Types.h +++ b/Foundation/include/Poco/Types.h @@ -1,7 +1,7 @@ // // Types.h // -// $Id: //poco/svn/Foundation/include/Poco/Types.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Types.h#2 $ // // Library: Foundation // Package: Core diff --git a/Foundation/include/Poco/URI.h b/Foundation/include/Poco/URI.h index d361e29d1..944b84cc5 100644 --- a/Foundation/include/Poco/URI.h +++ b/Foundation/include/Poco/URI.h @@ -1,7 +1,7 @@ // // URI.h // -// $Id: //poco/svn/Foundation/include/Poco/URI.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/URI.h#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/include/Poco/URIStreamFactory.h b/Foundation/include/Poco/URIStreamFactory.h index 9f0866f41..a60f8e3c7 100644 --- a/Foundation/include/Poco/URIStreamFactory.h +++ b/Foundation/include/Poco/URIStreamFactory.h @@ -1,7 +1,7 @@ // // URIStreamFactory.h // -// $Id: //poco/svn/Foundation/include/Poco/URIStreamFactory.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/URIStreamFactory.h#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/include/Poco/URIStreamOpener.h b/Foundation/include/Poco/URIStreamOpener.h index 15b4b84e6..29e068011 100644 --- a/Foundation/include/Poco/URIStreamOpener.h +++ b/Foundation/include/Poco/URIStreamOpener.h @@ -1,7 +1,7 @@ // // URIStreamOpener.h // -// $Id: //poco/svn/Foundation/include/Poco/URIStreamOpener.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/URIStreamOpener.h#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/include/Poco/UTF16Encoding.h b/Foundation/include/Poco/UTF16Encoding.h index cd2bdf8f5..1cc0c11b4 100644 --- a/Foundation/include/Poco/UTF16Encoding.h +++ b/Foundation/include/Poco/UTF16Encoding.h @@ -1,7 +1,7 @@ // // UTF16Encoding.h // -// $Id: //poco/svn/Foundation/include/Poco/UTF16Encoding.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UTF16Encoding.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/UTF8Encoding.h b/Foundation/include/Poco/UTF8Encoding.h index b90e4cb25..4f9f9ceab 100644 --- a/Foundation/include/Poco/UTF8Encoding.h +++ b/Foundation/include/Poco/UTF8Encoding.h @@ -1,7 +1,7 @@ // // UTF8Encoding.h // -// $Id: //poco/svn/Foundation/include/Poco/UTF8Encoding.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UTF8Encoding.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/UTF8String.h b/Foundation/include/Poco/UTF8String.h index 3d1dad1ef..1b1a3d616 100644 --- a/Foundation/include/Poco/UTF8String.h +++ b/Foundation/include/Poco/UTF8String.h @@ -1,7 +1,7 @@ // // UTF8String.h // -// $Id: //poco/svn/Foundation/include/Poco/UTF8String.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UTF8String.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/UUID.h b/Foundation/include/Poco/UUID.h index db0f532e5..6e5d84460 100644 --- a/Foundation/include/Poco/UUID.h +++ b/Foundation/include/Poco/UUID.h @@ -1,7 +1,7 @@ // // UUID.h // -// $Id: //poco/svn/Foundation/include/Poco/UUID.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UUID.h#1 $ // // Library: Foundation // Package: UUID diff --git a/Foundation/include/Poco/UUIDGenerator.h b/Foundation/include/Poco/UUIDGenerator.h index fcff505c0..a2d68bd06 100644 --- a/Foundation/include/Poco/UUIDGenerator.h +++ b/Foundation/include/Poco/UUIDGenerator.h @@ -1,7 +1,7 @@ // // UUIDGenerator.h // -// $Id: //poco/1.3/Foundation/include/Poco/UUIDGenerator.h#3 $ +// $Id: //poco/1.4/Foundation/include/Poco/UUIDGenerator.h#1 $ // // Library: Foundation // Package: UUID diff --git a/Foundation/include/Poco/UnbufferedStreamBuf.h b/Foundation/include/Poco/UnbufferedStreamBuf.h index 4115074f9..8cdd07c45 100644 --- a/Foundation/include/Poco/UnbufferedStreamBuf.h +++ b/Foundation/include/Poco/UnbufferedStreamBuf.h @@ -1,7 +1,7 @@ // // UnufferedStreamBuf.h // -// $Id: //poco/svn/Foundation/include/Poco/UnbufferedStreamBuf.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UnbufferedStreamBuf.h#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/include/Poco/Unicode.h b/Foundation/include/Poco/Unicode.h index d3d067995..f3f22faae 100644 --- a/Foundation/include/Poco/Unicode.h +++ b/Foundation/include/Poco/Unicode.h @@ -1,7 +1,7 @@ // // Unicode.h // -// $Id: //poco/1.3/Foundation/include/Poco/Unicode.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Unicode.h#1 $ // // Library: Foundation // Package: Text @@ -198,24 +198,24 @@ public: }; static void properties(int ch, CharacterProperties& props); - /// Return the Unicode character properties for the - /// character with the given Unicode value. - - static bool isSpace(int ch); - /// Returns true iff the given character is a separator. - - static bool isDigit(int ch); - /// Returns true iff the given character is a numeric character. - - static bool isPunct(int ch); - /// Returns true iff the given character is a punctuation character. - - static bool isAlpha(int ch); - /// Returns true iff the given character is a letter. - - static bool isLower(int ch); - /// Returns true iff the given character is a lowercase - /// character. + /// Return the Unicode character properties for the + /// character with the given Unicode value. + + static bool isSpace(int ch); + /// Returns true iff the given character is a separator. + + static bool isDigit(int ch); + /// Returns true iff the given character is a numeric character. + + static bool isPunct(int ch); + /// Returns true iff the given character is a punctuation character. + + static bool isAlpha(int ch); + /// Returns true iff the given character is a letter. + + static bool isLower(int ch); + /// Returns true iff the given character is a lowercase + /// character. static bool isUpper(int ch); /// Returns true iff the given character is an uppercase @@ -238,49 +238,49 @@ public: // inline bool Unicode::isSpace(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_SEPARATOR; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_SEPARATOR; } inline bool Unicode::isDigit(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_NUMBER; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_NUMBER; } inline bool Unicode::isPunct(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_PUNCTUATION; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_PUNCTUATION; } inline bool Unicode::isAlpha(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_LETTER; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_LETTER; } inline bool Unicode::isLower(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_LETTER && props.type == UCP_LOWER_CASE_LETTER; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_LETTER && props.type == UCP_LOWER_CASE_LETTER; } - + inline bool Unicode::isUpper(int ch) { - CharacterProperties props; - properties(ch, props); - return props.category == UCP_LETTER && props.type == UCP_UPPER_CASE_LETTER; + CharacterProperties props; + properties(ch, props); + return props.category == UCP_LETTER && props.type == UCP_UPPER_CASE_LETTER; } diff --git a/Foundation/include/Poco/UnicodeConverter.h b/Foundation/include/Poco/UnicodeConverter.h index ab7e264f7..e2377d6bd 100644 --- a/Foundation/include/Poco/UnicodeConverter.h +++ b/Foundation/include/Poco/UnicodeConverter.h @@ -1,7 +1,7 @@ // // UnicodeConverter.h // -// $Id: //poco/svn/Foundation/include/Poco/UnicodeConverter.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UnicodeConverter.h#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/include/Poco/UniqueAccessExpireCache.h b/Foundation/include/Poco/UniqueAccessExpireCache.h index 6f9b732ba..5094fde5b 100644 --- a/Foundation/include/Poco/UniqueAccessExpireCache.h +++ b/Foundation/include/Poco/UniqueAccessExpireCache.h @@ -1,7 +1,7 @@ // // UniqueAccessExpireCache.h // -// $Id: //poco/svn/Foundation/include/Poco/UniqueAccessExpireCache.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/UniqueAccessExpireCache.h#1 $ // // Library: Foundation // Package: Cache diff --git a/Foundation/include/Poco/Version.h b/Foundation/include/Poco/Version.h index 6935aeee4..2ebd54cfb 100644 --- a/Foundation/include/Poco/Version.h +++ b/Foundation/include/Poco/Version.h @@ -1,7 +1,7 @@ // // Version.h // -// $Id: //poco/1.4/Foundation/include/Poco/Version.h#5 $ +// $Id: //poco/1.4/Foundation/include/Poco/Version.h#9 $ // // Library: Foundation // Package: Core @@ -9,7 +9,7 @@ // // Version information for the POCO C++ Libraries. // -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2004-2012, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization diff --git a/Foundation/include/Poco/Void.h b/Foundation/include/Poco/Void.h index f8894c0b6..6590d7dc9 100644 --- a/Foundation/include/Poco/Void.h +++ b/Foundation/include/Poco/Void.h @@ -1,7 +1,7 @@ // // Void.h // -// $Id: //poco/svn/Foundation/include/Poco/Void.h#2 $ +// $Id: //poco/1.4/Foundation/include/Poco/Void.h#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/ASCIIEncoding.cpp b/Foundation/src/ASCIIEncoding.cpp index 430e0d7bc..3c00fb607 100644 --- a/Foundation/src/ASCIIEncoding.cpp +++ b/Foundation/src/ASCIIEncoding.cpp @@ -1,7 +1,7 @@ // // ASCIIEncoding.cpp // -// $Id: //poco/svn/Foundation/src/ASCIIEncoding.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ASCIIEncoding.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/AbstractObserver.cpp b/Foundation/src/AbstractObserver.cpp index f1d104eaa..166b3e95d 100644 --- a/Foundation/src/AbstractObserver.cpp +++ b/Foundation/src/AbstractObserver.cpp @@ -1,7 +1,7 @@ // // AbstractObserver.cpp // -// $Id: //poco/svn/Foundation/src/AbstractObserver.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/AbstractObserver.cpp#1 $ // // Library: Foundation // Package: Notifications diff --git a/Foundation/src/ActiveDispatcher.cpp b/Foundation/src/ActiveDispatcher.cpp index 492aefe69..de1ef3a8e 100644 --- a/Foundation/src/ActiveDispatcher.cpp +++ b/Foundation/src/ActiveDispatcher.cpp @@ -1,7 +1,7 @@ // // ActiveDispatcher.cpp // -// $Id: //poco/svn/Foundation/src/ActiveDispatcher.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ActiveDispatcher.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/ArchiveStrategy.cpp b/Foundation/src/ArchiveStrategy.cpp index 8bc52a4bd..8903dcc74 100644 --- a/Foundation/src/ArchiveStrategy.cpp +++ b/Foundation/src/ArchiveStrategy.cpp @@ -1,7 +1,7 @@ // // ArchiveStrategy.cpp // -// $Id: //poco/Main/Foundation/src/ArchiveStrategy.cpp#9 $ +// $Id: //poco/1.4/Foundation/src/ArchiveStrategy.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/AsyncChannel.cpp b/Foundation/src/AsyncChannel.cpp index 645515770..bb61ad08c 100644 --- a/Foundation/src/AsyncChannel.cpp +++ b/Foundation/src/AsyncChannel.cpp @@ -1,7 +1,7 @@ // // AsyncChannel.cpp // -// $Id: //poco/svn/Foundation/src/AsyncChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/AsyncChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/AtomicCounter.cpp b/Foundation/src/AtomicCounter.cpp index 4bde11dd9..a82074dbb 100644 --- a/Foundation/src/AtomicCounter.cpp +++ b/Foundation/src/AtomicCounter.cpp @@ -1,7 +1,7 @@ // // AtomicCounter.cpp // -// $Id: //poco/1.4/Foundation/src/AtomicCounter.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/AtomicCounter.cpp#2 $ // // Library: Foundation // Package: Core @@ -127,7 +127,7 @@ AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value) // GCC 4.1+ atomic builtins. // AtomicCounter::AtomicCounter(): - _counter(0) + _counter(0) { } @@ -151,15 +151,15 @@ AtomicCounter::~AtomicCounter() AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter) { - __sync_lock_test_and_set(&_counter, counter.value()); - return *this; + __sync_lock_test_and_set(&_counter, counter.value()); + return *this; } - + AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value) { - __sync_lock_test_and_set(&_counter, value); - return *this; + __sync_lock_test_and_set(&_counter, value); + return *this; } diff --git a/Foundation/src/Bugcheck.cpp b/Foundation/src/Bugcheck.cpp index a7d9894fc..0d4c3f511 100644 --- a/Foundation/src/Bugcheck.cpp +++ b/Foundation/src/Bugcheck.cpp @@ -1,7 +1,7 @@ // // Bugcheck.cpp // -// $Id: //poco/svn/Foundation/src/Bugcheck.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Bugcheck.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/ByteOrder.cpp b/Foundation/src/ByteOrder.cpp index f4bb9c882..c0b1b01b0 100644 --- a/Foundation/src/ByteOrder.cpp +++ b/Foundation/src/ByteOrder.cpp @@ -1,7 +1,7 @@ // // ByteOrder.cpp // -// $Id: //poco/svn/Foundation/src/ByteOrder.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ByteOrder.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/Channel.cpp b/Foundation/src/Channel.cpp index b24dbdabd..100adefeb 100644 --- a/Foundation/src/Channel.cpp +++ b/Foundation/src/Channel.cpp @@ -1,7 +1,7 @@ // // Channel.cpp // -// $Id: //poco/svn/Foundation/src/Channel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Channel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Checksum.cpp b/Foundation/src/Checksum.cpp index 65e0246e4..2065eeab0 100644 --- a/Foundation/src/Checksum.cpp +++ b/Foundation/src/Checksum.cpp @@ -1,7 +1,7 @@ // // Checksum.cpp // -// $Id: //poco/svn/Foundation/src/Checksum.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Checksum.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/Condition.cpp b/Foundation/src/Condition.cpp index c653580ad..5bc7e251c 100644 --- a/Foundation/src/Condition.cpp +++ b/Foundation/src/Condition.cpp @@ -1,7 +1,7 @@ // // Condition.cpp // -// $Id: //poco/svn/Foundation/src/Condition.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Condition.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Configurable.cpp b/Foundation/src/Configurable.cpp index 8fc493d7e..c0e8ae161 100644 --- a/Foundation/src/Configurable.cpp +++ b/Foundation/src/Configurable.cpp @@ -1,7 +1,7 @@ // // Configurable.cpp // -// $Id: //poco/svn/Foundation/src/Configurable.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Configurable.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/ConsoleChannel.cpp b/Foundation/src/ConsoleChannel.cpp index b3ecc7bd2..55b2940de 100644 --- a/Foundation/src/ConsoleChannel.cpp +++ b/Foundation/src/ConsoleChannel.cpp @@ -1,7 +1,7 @@ // // ConsoleChannel.cpp // -// $Id: //poco/svn/Foundation/src/ConsoleChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ConsoleChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/CountingStream.cpp b/Foundation/src/CountingStream.cpp index 7c65cba39..4a2645ebf 100644 --- a/Foundation/src/CountingStream.cpp +++ b/Foundation/src/CountingStream.cpp @@ -1,7 +1,7 @@ // // CountingStream.cpp // -// $Id: //poco/svn/Foundation/src/CountingStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/CountingStream.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/DateTime.cpp b/Foundation/src/DateTime.cpp index b5bc9e3e3..881da6d97 100644 --- a/Foundation/src/DateTime.cpp +++ b/Foundation/src/DateTime.cpp @@ -1,7 +1,7 @@ // // DateTime.cpp // -// $Id: //poco/svn/Foundation/src/DateTime.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DateTime.cpp#1 $ // // Library: Foundation // Package: DateTime @@ -335,9 +335,19 @@ double DateTime::toJulianDay(int year, int month, int day, int hour, int minute, } +void DateTime::checkLimit(short& lower, short& higher, short limit) +{ + if (lower >= limit) + { + higher += short(lower / limit); + lower = short(lower % limit); + } +} + + void DateTime::normalize() { - checkLimit(_microsecond, _millisecond, 1000); + checkLimit(_microsecond, _millisecond, 1000); checkLimit(_millisecond, _second, 1000); checkLimit(_second, _minute, 60); checkLimit(_minute, _hour, 60); diff --git a/Foundation/src/DateTimeFormat.cpp b/Foundation/src/DateTimeFormat.cpp index 9c94bb099..b310ecb63 100644 --- a/Foundation/src/DateTimeFormat.cpp +++ b/Foundation/src/DateTimeFormat.cpp @@ -1,7 +1,7 @@ // // DateTimeFormat.cpp // -// $Id: //poco/svn/Foundation/src/DateTimeFormat.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DateTimeFormat.cpp#2 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/src/DateTimeFormatter.cpp b/Foundation/src/DateTimeFormatter.cpp index 42bdb4285..1b5084cf9 100644 --- a/Foundation/src/DateTimeFormatter.cpp +++ b/Foundation/src/DateTimeFormatter.cpp @@ -1,7 +1,7 @@ // // DateTimeFormatter.cpp // -// $Id: //poco/Main/Foundation/src/DateTimeFormatter.cpp#14 $ +// $Id: //poco/1.4/Foundation/src/DateTimeFormatter.cpp#3 $ // // Library: Foundation // Package: DateTime @@ -76,16 +76,16 @@ void DateTimeFormatter::append(std::string& str, const DateTime& dateTime, const case 'H': NumberFormatter::append0(str, dateTime.hour(), 2); break; case 'h': NumberFormatter::append0(str, dateTime.hourAMPM(), 2); break; case 'a': str.append(dateTime.isAM() ? "am" : "pm"); break; - case 'A': str.append(dateTime.isAM() ? "AM" : "PM"); break; - case 'M': NumberFormatter::append0(str, dateTime.minute(), 2); break; - case 'S': NumberFormatter::append0(str, dateTime.second(), 2); break; - case 's': NumberFormatter::append0(str, dateTime.second(), 2); - str += '.'; - NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); - break; - case 'i': NumberFormatter::append0(str, dateTime.millisecond(), 3); break; - case 'c': NumberFormatter::append(str, dateTime.millisecond()/100); break; - case 'F': NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); break; + case 'A': str.append(dateTime.isAM() ? "AM" : "PM"); break; + case 'M': NumberFormatter::append0(str, dateTime.minute(), 2); break; + case 'S': NumberFormatter::append0(str, dateTime.second(), 2); break; + case 's': NumberFormatter::append0(str, dateTime.second(), 2); + str += '.'; + NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); + break; + case 'i': NumberFormatter::append0(str, dateTime.millisecond(), 3); break; + case 'c': NumberFormatter::append(str, dateTime.millisecond()/100); break; + case 'F': NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); break; case 'z': tzdISO(str, timeZoneDifferential); break; case 'Z': tzdRFC(str, timeZoneDifferential); break; default: str += *it; diff --git a/Foundation/src/DigestEngine.cpp b/Foundation/src/DigestEngine.cpp index 7c5691184..7d606a8e1 100644 --- a/Foundation/src/DigestEngine.cpp +++ b/Foundation/src/DigestEngine.cpp @@ -1,7 +1,7 @@ // // DigestEngine.cpp // -// $Id: //poco/Main/Foundation/src/DigestEngine.cpp#11 $ +// $Id: //poco/1.4/Foundation/src/DigestEngine.cpp#1 $ // // Library: Foundation // Package: Crypt @@ -61,43 +61,43 @@ std::string DigestEngine::digestToHex(const Digest& bytes) unsigned char c = *it; result += digits[(c >> 4) & 0xF]; result += digits[c & 0xF]; - } - return result; + } + return result; } DigestEngine::Digest DigestEngine::digestFromHex(const std::string& digest) { - if (digest.size() % 2 != 0) - throw DataFormatException(); - Digest result; - result.reserve(digest.size()/2); - for (std::size_t i = 0; i < digest.size(); ++i) - { - int c = 0; - // first upper 4 bits - if (digest[i] >= '0' && digest[i] <= '9') - c = digest[i] - '0'; - else if (digest[i] >= 'a' && digest[i] <= 'f') - c = digest[i] - 'a'+10; - else if (digest[i] >= 'A' && digest[i] <= 'F') - c = digest[i] - 'A'+10; - else - throw DataFormatException(); - c <<= 4; - ++i; - if (digest[i] >= '0' && digest[i] <= '9') - c += digest[i] - '0'; - else if (digest[i] >= 'a' && digest[i] <= 'f') - c += digest[i] - 'a'+10; - else if (digest[i] >= 'A' && digest[i] <= 'F') - c += digest[i] - 'A'+10; - else - throw DataFormatException(); + if (digest.size() % 2 != 0) + throw DataFormatException(); + Digest result; + result.reserve(digest.size()/2); + for (std::size_t i = 0; i < digest.size(); ++i) + { + int c = 0; + // first upper 4 bits + if (digest[i] >= '0' && digest[i] <= '9') + c = digest[i] - '0'; + else if (digest[i] >= 'a' && digest[i] <= 'f') + c = digest[i] - 'a'+10; + else if (digest[i] >= 'A' && digest[i] <= 'F') + c = digest[i] - 'A'+10; + else + throw DataFormatException(); + c <<= 4; + ++i; + if (digest[i] >= '0' && digest[i] <= '9') + c += digest[i] - '0'; + else if (digest[i] >= 'a' && digest[i] <= 'f') + c += digest[i] - 'a'+10; + else if (digest[i] >= 'A' && digest[i] <= 'F') + c += digest[i] - 'A'+10; + else + throw DataFormatException(); - result.push_back(static_cast(c)); - } - return result; + result.push_back(static_cast(c)); + } + return result; } diff --git a/Foundation/src/DigestStream.cpp b/Foundation/src/DigestStream.cpp index 5ed0a8b5d..85480d974 100644 --- a/Foundation/src/DigestStream.cpp +++ b/Foundation/src/DigestStream.cpp @@ -1,7 +1,7 @@ // // DigestStream.cpp // -// $Id: //poco/svn/Foundation/src/DigestStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DigestStream.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/DirectoryIterator.cpp b/Foundation/src/DirectoryIterator.cpp index 9e78a97b5..f688f4c10 100644 --- a/Foundation/src/DirectoryIterator.cpp +++ b/Foundation/src/DirectoryIterator.cpp @@ -1,7 +1,7 @@ // // DirectoryIterator.cpp // -// $Id: //poco/svn/Foundation/src/DirectoryIterator.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DirectoryIterator.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/DirectoryIterator_UNIX.cpp b/Foundation/src/DirectoryIterator_UNIX.cpp index ab8900036..ce852bf99 100644 --- a/Foundation/src/DirectoryIterator_UNIX.cpp +++ b/Foundation/src/DirectoryIterator_UNIX.cpp @@ -1,7 +1,7 @@ // // DirectoryIterator_UNIX.cpp // -// $Id: //poco/svn/Foundation/src/DirectoryIterator_UNIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DirectoryIterator_UNIX.cpp#2 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/DirectoryIterator_VMS.cpp b/Foundation/src/DirectoryIterator_VMS.cpp index b7625da89..f8b5b6d46 100644 --- a/Foundation/src/DirectoryIterator_VMS.cpp +++ b/Foundation/src/DirectoryIterator_VMS.cpp @@ -1,7 +1,7 @@ // // DirectoryIterator_VMS.cpp // -// $Id: //poco/svn/Foundation/src/DirectoryIterator_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DirectoryIterator_VMS.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/DirectoryIterator_WIN32.cpp b/Foundation/src/DirectoryIterator_WIN32.cpp index 78aba8189..33297ffe1 100644 --- a/Foundation/src/DirectoryIterator_WIN32.cpp +++ b/Foundation/src/DirectoryIterator_WIN32.cpp @@ -1,7 +1,7 @@ // // DirectoryIterator_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/DirectoryIterator_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DirectoryIterator_WIN32.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/DirectoryIterator_WIN32U.cpp b/Foundation/src/DirectoryIterator_WIN32U.cpp index cf3894b96..2b8a29395 100644 --- a/Foundation/src/DirectoryIterator_WIN32U.cpp +++ b/Foundation/src/DirectoryIterator_WIN32U.cpp @@ -1,7 +1,7 @@ // // DirectoryIterator_WIN32U.cpp // -// $Id: //poco/svn/Foundation/src/DirectoryIterator_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/DirectoryIterator_WIN32U.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/ErrorHandler.cpp b/Foundation/src/ErrorHandler.cpp index 3d0004c88..b49258d53 100644 --- a/Foundation/src/ErrorHandler.cpp +++ b/Foundation/src/ErrorHandler.cpp @@ -1,7 +1,7 @@ // // ErrorHandler.cpp // -// $Id: //poco/svn/Foundation/src/ErrorHandler.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ErrorHandler.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Event.cpp b/Foundation/src/Event.cpp index 13e7b6582..4e5ee4027 100644 --- a/Foundation/src/Event.cpp +++ b/Foundation/src/Event.cpp @@ -1,7 +1,7 @@ // // Event.cpp // -// $Id: //poco/svn/Foundation/src/Event.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Event.cpp#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/EventArgs.cpp b/Foundation/src/EventArgs.cpp index b8a9eeb46..83c872986 100644 --- a/Foundation/src/EventArgs.cpp +++ b/Foundation/src/EventArgs.cpp @@ -1,7 +1,7 @@ // // EventArgs.cpp // -// $Id: //poco/svn/Foundation/src/EventArgs.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/EventArgs.cpp#1 $ // // Library: Foundation // Package: Events diff --git a/Foundation/src/EventLogChannel.cpp b/Foundation/src/EventLogChannel.cpp index 57ba852d5..5105b68e6 100644 --- a/Foundation/src/EventLogChannel.cpp +++ b/Foundation/src/EventLogChannel.cpp @@ -1,7 +1,7 @@ // // EventLogChannel.cpp // -// $Id: //poco/1.3/Foundation/src/EventLogChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/EventLogChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Event_POSIX.cpp b/Foundation/src/Event_POSIX.cpp index 111ccb98d..bc8007c02 100644 --- a/Foundation/src/Event_POSIX.cpp +++ b/Foundation/src/Event_POSIX.cpp @@ -1,7 +1,7 @@ // // Event_POSIX.cpp // -// $Id: //poco/svn/Foundation/src/Event_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Event_POSIX.cpp#3 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Event_WIN32.cpp b/Foundation/src/Event_WIN32.cpp index 178e2a8d4..d071d95e2 100644 --- a/Foundation/src/Event_WIN32.cpp +++ b/Foundation/src/Event_WIN32.cpp @@ -1,7 +1,7 @@ // // Event_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/Event_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Event_WIN32.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Exception.cpp b/Foundation/src/Exception.cpp index 4c9b211cd..627d6e501 100644 --- a/Foundation/src/Exception.cpp +++ b/Foundation/src/Exception.cpp @@ -1,7 +1,7 @@ // // Exception.cpp // -// $Id: //poco/svn/Foundation/src/Exception.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/Exception.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/FPEnvironment.cpp b/Foundation/src/FPEnvironment.cpp index b062aab08..e6171ba66 100644 --- a/Foundation/src/FPEnvironment.cpp +++ b/Foundation/src/FPEnvironment.cpp @@ -1,7 +1,7 @@ // // FPEnvironment.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/FPEnvironment_C99.cpp b/Foundation/src/FPEnvironment_C99.cpp index da107d473..fc968acea 100644 --- a/Foundation/src/FPEnvironment_C99.cpp +++ b/Foundation/src/FPEnvironment_C99.cpp @@ -1,7 +1,7 @@ // // FPEnvironment_C99.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment_C99.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment_C99.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/FPEnvironment_DEC.cpp b/Foundation/src/FPEnvironment_DEC.cpp index 04fa59cf1..10b194ba5 100644 --- a/Foundation/src/FPEnvironment_DEC.cpp +++ b/Foundation/src/FPEnvironment_DEC.cpp @@ -1,7 +1,7 @@ // // FPEnvironment_DEC.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment_DEC.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment_DEC.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/FPEnvironment_DUMMY.cpp b/Foundation/src/FPEnvironment_DUMMY.cpp index 39dea8f93..0e486d957 100644 --- a/Foundation/src/FPEnvironment_DUMMY.cpp +++ b/Foundation/src/FPEnvironment_DUMMY.cpp @@ -1,7 +1,7 @@ // // FPEnvironment_C99.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment_DUMMY.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment_DUMMY.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/FPEnvironment_SUN.cpp b/Foundation/src/FPEnvironment_SUN.cpp index 2b6bb8d7c..a5afb83e7 100644 --- a/Foundation/src/FPEnvironment_SUN.cpp +++ b/Foundation/src/FPEnvironment_SUN.cpp @@ -1,7 +1,7 @@ // // FPEnvironment_SUN.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment_SUN.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment_SUN.cpp#1 $ // // Library: Foundation // Package: Core @@ -34,7 +34,7 @@ // #ifndef __EXTENSIONS__ -# define __EXTENSIONS__ +# define __EXTENSIONS__ #endif #include #include "Poco/FPEnvironment_SUN.h" diff --git a/Foundation/src/FPEnvironment_WIN32.cpp b/Foundation/src/FPEnvironment_WIN32.cpp index e3cc4f581..cd31bea91 100644 --- a/Foundation/src/FPEnvironment_WIN32.cpp +++ b/Foundation/src/FPEnvironment_WIN32.cpp @@ -1,7 +1,7 @@ // // FPEnvironment_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/FPEnvironment_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FPEnvironment_WIN32.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/File.cpp b/Foundation/src/File.cpp index d8156494e..8e7dc77a1 100644 --- a/Foundation/src/File.cpp +++ b/Foundation/src/File.cpp @@ -1,7 +1,7 @@ // // File.cpp // -// $Id: //poco/Main/Foundation/src/File.cpp#22 $ +// $Id: //poco/1.4/Foundation/src/File.cpp#3 $ // // Library: Foundation // Package: Filesystem @@ -189,48 +189,48 @@ Timestamp File::getLastModified() const return getLastModifiedImpl(); } - + File& File::setLastModified(const Timestamp& ts) { - setLastModifiedImpl(ts); + setLastModifiedImpl(ts); return *this; } - + File::FileSize File::getSize() const { return getSizeImpl(); } - + File& File::setSize(FileSizeImpl size) { - setSizeImpl(size); + setSizeImpl(size); return *this; } - + File& File::setWriteable(bool flag) { - setWriteableImpl(flag); + setWriteableImpl(flag); return *this; } File& File::setReadOnly(bool flag) { - setWriteableImpl(!flag); + setWriteableImpl(!flag); return *this; } File& File::setExecutable(bool flag) { - setExecutableImpl(flag); + setExecutableImpl(flag); return *this; } - + void File::copyTo(const std::string& path) const { Path src(getPathImpl()); diff --git a/Foundation/src/FileChannel.cpp b/Foundation/src/FileChannel.cpp index d8daa1135..5c5650c91 100644 --- a/Foundation/src/FileChannel.cpp +++ b/Foundation/src/FileChannel.cpp @@ -1,7 +1,7 @@ // // FileChannel.cpp // -// $Id: //poco/1.3/Foundation/src/FileChannel.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/FileChannel.cpp#1 $ // // Library: Foundation // Package: Logging @@ -217,17 +217,17 @@ const std::string& FileChannel::path() const void FileChannel::setRotation(const std::string& rotation) { - std::string::const_iterator it = rotation.begin(); - std::string::const_iterator end = rotation.end(); - int n = 0; - while (it != end && Ascii::isSpace(*it)) ++it; - while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; } - while (it != end && Ascii::isSpace(*it)) ++it; - std::string unit; - while (it != end && Ascii::isAlpha(*it)) unit += *it++; - - RotateStrategy* pStrategy = 0; - if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos)) + std::string::const_iterator it = rotation.begin(); + std::string::const_iterator end = rotation.end(); + int n = 0; + while (it != end && Ascii::isSpace(*it)) ++it; + while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; } + while (it != end && Ascii::isSpace(*it)) ++it; + std::string unit; + while (it != end && Ascii::isAlpha(*it)) unit += *it++; + + RotateStrategy* pStrategy = 0; + if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos)) { if (_times == "utc") pStrategy = new RotateAtTimeStrategy(rotation); @@ -313,12 +313,12 @@ void FileChannel::setPurgeAge(const std::string& age) int n = 0; while (it != end && Ascii::isSpace(*it)) ++it; while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; } - while (it != end && Ascii::isSpace(*it)) ++it; - std::string unit; - while (it != end && Ascii::isAlpha(*it)) unit += *it++; - - Timespan::TimeDiff factor = Timespan::SECONDS; - if (unit == "minutes") + while (it != end && Ascii::isSpace(*it)) ++it; + std::string unit; + while (it != end && Ascii::isAlpha(*it)) unit += *it++; + + Timespan::TimeDiff factor = Timespan::SECONDS; + if (unit == "minutes") factor = Timespan::MINUTES; else if (unit == "hours") factor = Timespan::HOURS; @@ -350,9 +350,9 @@ void FileChannel::setPurgeCount(const std::string& count) std::string::const_iterator it = count.begin(); std::string::const_iterator end = count.end(); - while (it != end && Ascii::isSpace(*it)) ++it; - while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; } - while (it != end && Ascii::isSpace(*it)) ++it; + while (it != end && Ascii::isSpace(*it)) ++it; + while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; } + while (it != end && Ascii::isSpace(*it)) ++it; if (0 == n) throw InvalidArgumentException("Zero is not valid purge count."); diff --git a/Foundation/src/FileStream.cpp b/Foundation/src/FileStream.cpp index 7ed9e5236..13073cbf1 100644 --- a/Foundation/src/FileStream.cpp +++ b/Foundation/src/FileStream.cpp @@ -1,7 +1,7 @@ // // FileStream.cpp // -// $Id: //poco/svn/Foundation/src/FileStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FileStream.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/FileStreamFactory.cpp b/Foundation/src/FileStreamFactory.cpp index 1fd5044be..4f1d63b9f 100644 --- a/Foundation/src/FileStreamFactory.cpp +++ b/Foundation/src/FileStreamFactory.cpp @@ -1,7 +1,7 @@ // // FileStreamFactory.cpp // -// $Id: //poco/svn/Foundation/src/FileStreamFactory.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FileStreamFactory.cpp#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/src/FileStream_POSIX.cpp b/Foundation/src/FileStream_POSIX.cpp index f8d668614..8654c8ede 100644 --- a/Foundation/src/FileStream_POSIX.cpp +++ b/Foundation/src/FileStream_POSIX.cpp @@ -1,7 +1,7 @@ // // FileStream_POSIX.cpp // -// $Id: //poco/svn/Foundation/src/FileStream_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FileStream_POSIX.cpp#2 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/File_UNIX.cpp b/Foundation/src/File_UNIX.cpp index 3dda9e317..c14f013d1 100644 --- a/Foundation/src/File_UNIX.cpp +++ b/Foundation/src/File_UNIX.cpp @@ -1,7 +1,7 @@ // // File_UNIX.cpp // -// $Id: //poco/Main/Foundation/src/File_UNIX.cpp#26 $ +// $Id: //poco/1.4/Foundation/src/File_UNIX.cpp#1 $ // // Library: Foundation // Package: Filesystem @@ -404,12 +404,12 @@ void FileImpl::removeImpl() bool FileImpl::createFileImpl() { - poco_assert (!_path.empty()); - - int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - if (n != -1) - { - close(n); + poco_assert (!_path.empty()); + + int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (n != -1) + { + close(n); return true; } if (n == -1 && errno == EEXIST) diff --git a/Foundation/src/File_VMS.cpp b/Foundation/src/File_VMS.cpp index d3c3192f8..bc92543f6 100644 --- a/Foundation/src/File_VMS.cpp +++ b/Foundation/src/File_VMS.cpp @@ -1,7 +1,7 @@ // // File_VMS.cpp // -// $Id: //poco/Main/Foundation/src/File_VMS.cpp#18 $ +// $Id: //poco/1.4/Foundation/src/File_VMS.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/File_WIN32.cpp b/Foundation/src/File_WIN32.cpp index 0e71c2ae8..c4a86e4f6 100644 --- a/Foundation/src/File_WIN32.cpp +++ b/Foundation/src/File_WIN32.cpp @@ -1,7 +1,7 @@ // // File_WIN32.cpp // -// $Id: //poco/Main/Foundation/src/File_WIN32.cpp#24 $ +// $Id: //poco/1.4/Foundation/src/File_WIN32.cpp#1 $ // // Library: Foundation // Package: Filesystem @@ -46,12 +46,12 @@ namespace Poco { class FileHandle { public: - FileHandle(const std::string& path, DWORD access, DWORD share, DWORD disp) - { - _h = CreateFileA(path.c_str(), access, share, 0, disp, 0, 0); - if (_h == INVALID_HANDLE_VALUE) - { - FileImpl::handleLastErrorImpl(path); + FileHandle(const std::string& path, DWORD access, DWORD share, DWORD disp) + { + _h = CreateFileA(path.c_str(), access, share, 0, disp, 0, 0); + if (_h == INVALID_HANDLE_VALUE) + { + FileImpl::handleLastErrorImpl(path); } } diff --git a/Foundation/src/File_WIN32U.cpp b/Foundation/src/File_WIN32U.cpp index 2874cac5f..2ede71e3f 100644 --- a/Foundation/src/File_WIN32U.cpp +++ b/Foundation/src/File_WIN32U.cpp @@ -1,7 +1,7 @@ // // File_WIN32U.cpp // -// $Id: //poco/Main/Foundation/src/File_WIN32U.cpp#17 $ +// $Id: //poco/1.4/Foundation/src/File_WIN32U.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/Format.cpp b/Foundation/src/Format.cpp index 09adf4d33..eb752d335 100644 --- a/Foundation/src/Format.cpp +++ b/Foundation/src/Format.cpp @@ -1,7 +1,7 @@ // // Format.cpp // -// $Id: //poco/1.4/Foundation/src/Format.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Format.cpp#5 $ // // Library: Foundation // Package: Core @@ -166,17 +166,17 @@ namespace } - void formatOne(std::string& result, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt, std::vector::const_iterator& itVal) - { - std::ostringstream str; + void formatOne(std::string& result, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt, std::vector::const_iterator& itVal) + { + std::ostringstream str; #if !defined(POCO_NO_LOCALE) - str.imbue(std::locale::classic()); + str.imbue(std::locale::classic()); #endif - try - { - parseFlags(str, itFmt, endFmt); - parseWidth(str, itFmt, endFmt); - parsePrec(str, itFmt, endFmt); + try + { + parseFlags(str, itFmt, endFmt); + parseWidth(str, itFmt, endFmt); + parsePrec(str, itFmt, endFmt); char mod = parseMod(itFmt, endFmt); if (itFmt != endFmt) { @@ -234,16 +234,16 @@ namespace case 'I': case 'D': default: - str << type; - } - } - } - catch (Poco::BadCastException&) - { - str << "[ERRFMT]"; - } - result.append(str.str()); - } + str << type; + } + } + } + catch (Poco::BadCastException&) + { + str << "[ERRFMT]"; + } + result.append(str.str()); + } } diff --git a/Foundation/src/Formatter.cpp b/Foundation/src/Formatter.cpp index 2971579dc..926fea0f4 100644 --- a/Foundation/src/Formatter.cpp +++ b/Foundation/src/Formatter.cpp @@ -1,7 +1,7 @@ // // Formatter.cpp // -// $Id: //poco/svn/Foundation/src/Formatter.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Formatter.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/FormattingChannel.cpp b/Foundation/src/FormattingChannel.cpp index 4152132cc..37bbc9f20 100644 --- a/Foundation/src/FormattingChannel.cpp +++ b/Foundation/src/FormattingChannel.cpp @@ -1,7 +1,7 @@ // // FormattingChannel.cpp // -// $Id: //poco/svn/Foundation/src/FormattingChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/FormattingChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Glob.cpp b/Foundation/src/Glob.cpp index 1af2c5dd8..268df8fb6 100644 --- a/Foundation/src/Glob.cpp +++ b/Foundation/src/Glob.cpp @@ -1,7 +1,7 @@ // // Glob.cpp // -// $Id: //poco/1.3/Foundation/src/Glob.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/Glob.cpp#2 $ // // Library: Foundation // Package: Filesystem @@ -259,20 +259,20 @@ void Glob::collect(const Path& pathPattern, const Path& base, const Path& curren bool Glob::isDirectory(const Path& path, bool followSymlink) { - File f(path); - bool isDir = false; - try - { - isDir = f.isDirectory(); - } - catch (Poco::Exception&) - { - return false; - } - if (isDir) - { - return true; - } + File f(path); + bool isDir = false; + try + { + isDir = f.isDirectory(); + } + catch (Poco::Exception&) + { + return false; + } + if (isDir) + { + return true; + } else if (followSymlink && f.isLink()) { try diff --git a/Foundation/src/Hash.cpp b/Foundation/src/Hash.cpp index f0b30ac2e..060be7a87 100644 --- a/Foundation/src/Hash.cpp +++ b/Foundation/src/Hash.cpp @@ -1,7 +1,7 @@ // // Hash.cpp // -// $Id: //poco/svn/Foundation/src/Hash.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Hash.cpp#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/src/HashStatistic.cpp b/Foundation/src/HashStatistic.cpp index 01edc055e..2a430c03c 100644 --- a/Foundation/src/HashStatistic.cpp +++ b/Foundation/src/HashStatistic.cpp @@ -1,7 +1,7 @@ // // HashStatistic.cpp // -// $Id: //poco/svn/Foundation/src/HashStatistic.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/HashStatistic.cpp#1 $ // // Library: Foundation // Package: Hashing diff --git a/Foundation/src/HexBinaryDecoder.cpp b/Foundation/src/HexBinaryDecoder.cpp index 82c463a50..969f6e9d7 100644 --- a/Foundation/src/HexBinaryDecoder.cpp +++ b/Foundation/src/HexBinaryDecoder.cpp @@ -1,7 +1,7 @@ // // HexBinaryDecoder.cpp // -// $Id: //poco/svn/Foundation/src/HexBinaryDecoder.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/HexBinaryDecoder.cpp#2 $ // // Library: Foundation // Package: Streams @@ -42,7 +42,7 @@ namespace Poco { HexBinaryDecoderBuf::HexBinaryDecoderBuf(std::istream& istr): - _buf(*istr.rdbuf()) + _buf(*istr.rdbuf()) { } @@ -62,13 +62,13 @@ int HexBinaryDecoderBuf::readFromDevice() else if (n >= 'A' && n <= 'F') c = n - 'A' + 10; else if (n >= 'a' && n <= 'f') - c = n - 'a' + 10; - else throw DataFormatException(); - c <<= 4; - if ((n = readOne()) == -1) throw DataFormatException(); - if (n >= '0' && n <= '9') - c |= n - '0'; - else if (n >= 'A' && n <= 'F') + c = n - 'a' + 10; + else throw DataFormatException(); + c <<= 4; + if ((n = readOne()) == -1) throw DataFormatException(); + if (n >= '0' && n <= '9') + c |= n - '0'; + else if (n >= 'A' && n <= 'F') c |= n - 'A' + 10; else if (n >= 'a' && n <= 'f') c |= n - 'a' + 10; @@ -79,10 +79,10 @@ int HexBinaryDecoderBuf::readFromDevice() int HexBinaryDecoderBuf::readOne() { - int ch = _buf.sbumpc(); - while (ch == ' ' || ch == '\r' || ch == '\t' || ch == '\n') - ch = _buf.sbumpc(); - return ch; + int ch = _buf.sbumpc(); + while (ch == ' ' || ch == '\r' || ch == '\t' || ch == '\n') + ch = _buf.sbumpc(); + return ch; } diff --git a/Foundation/src/Latin1Encoding.cpp b/Foundation/src/Latin1Encoding.cpp index dce5c9475..bdb4b407f 100644 --- a/Foundation/src/Latin1Encoding.cpp +++ b/Foundation/src/Latin1Encoding.cpp @@ -1,7 +1,7 @@ // // Latin1Encoding.cpp // -// $Id: //poco/svn/Foundation/src/Latin1Encoding.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Latin1Encoding.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/Latin9Encoding.cpp b/Foundation/src/Latin9Encoding.cpp index c2f2f0de8..e478ee18f 100644 --- a/Foundation/src/Latin9Encoding.cpp +++ b/Foundation/src/Latin9Encoding.cpp @@ -1,7 +1,7 @@ // // Latin9Encoding.cpp // -// $Id: //poco/Main/Foundation/src/Latin9Encoding.cpp#12 $ +// $Id: //poco/1.4/Foundation/src/Latin9Encoding.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/LineEndingConverter.cpp b/Foundation/src/LineEndingConverter.cpp index c171be149..396e8f45d 100644 --- a/Foundation/src/LineEndingConverter.cpp +++ b/Foundation/src/LineEndingConverter.cpp @@ -1,7 +1,7 @@ // // LineEndingConverter.cpp // -// $Id: //poco/svn/Foundation/src/LineEndingConverter.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LineEndingConverter.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/LocalDateTime.cpp b/Foundation/src/LocalDateTime.cpp index e8349f505..ca1fe5cb0 100644 --- a/Foundation/src/LocalDateTime.cpp +++ b/Foundation/src/LocalDateTime.cpp @@ -1,7 +1,7 @@ // // LocalDateTime.cpp // -// $Id: //poco/svn/Foundation/src/LocalDateTime.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/LocalDateTime.cpp#2 $ // // Library: Foundation // Package: DateTime @@ -289,19 +289,19 @@ void LocalDateTime::determineTzd(bool adjust) std::tm* broken = std::localtime(&epochTime); #endif if (!broken) throw Poco::SystemException("cannot get local time"); - _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); + _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); #else - std::tm broken; + std::tm broken; #if defined(POCO_VXWORKS) - if (localtime_r(&epochTime, &broken) != OK) - throw Poco::SystemException("cannot get local time"); + if (localtime_r(&epochTime, &broken) != OK) + throw Poco::SystemException("cannot get local time"); #else - if (!localtime_r(&epochTime, &broken)) - throw Poco::SystemException("cannot get local time"); + if (!localtime_r(&epochTime, &broken)) + throw Poco::SystemException("cannot get local time"); #endif - _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); + _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); #endif - adjustForTzd(); + adjustForTzd(); } else { diff --git a/Foundation/src/LogFile.cpp b/Foundation/src/LogFile.cpp index 239af0063..97080ed0e 100644 --- a/Foundation/src/LogFile.cpp +++ b/Foundation/src/LogFile.cpp @@ -1,7 +1,7 @@ // // LogFile.cpp // -// $Id: //poco/svn/Foundation/src/LogFile.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogFile.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/LogFile_STD.cpp b/Foundation/src/LogFile_STD.cpp index 731efdba0..2a3f677f2 100644 --- a/Foundation/src/LogFile_STD.cpp +++ b/Foundation/src/LogFile_STD.cpp @@ -1,7 +1,7 @@ // // LogFile_STD.cpp // -// $Id: //poco/svn/Foundation/src/LogFile_STD.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogFile_STD.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/LogFile_VMS.cpp b/Foundation/src/LogFile_VMS.cpp index e9b08b4e7..d90c2f205 100644 --- a/Foundation/src/LogFile_VMS.cpp +++ b/Foundation/src/LogFile_VMS.cpp @@ -1,7 +1,7 @@ // // LogFile_VMS.cpp // -// $Id: //poco/svn/Foundation/src/LogFile_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogFile_VMS.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/LogFile_WIN32.cpp b/Foundation/src/LogFile_WIN32.cpp index f17679a8c..7ecf7435d 100644 --- a/Foundation/src/LogFile_WIN32.cpp +++ b/Foundation/src/LogFile_WIN32.cpp @@ -1,7 +1,7 @@ // // LogFile_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/LogFile_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogFile_WIN32.cpp#1 $ // // Library: Foundation // Package: Logging @@ -127,5 +127,4 @@ void LogFileImpl::createFile() _creationDate = File(_path).created(); } - } // namespace Poco diff --git a/Foundation/src/LogFile_WIN32U.cpp b/Foundation/src/LogFile_WIN32U.cpp index da55325f6..6f14441fc 100644 --- a/Foundation/src/LogFile_WIN32U.cpp +++ b/Foundation/src/LogFile_WIN32U.cpp @@ -1,7 +1,7 @@ // // LogFile_WIN32U.cpp // -// $Id: //poco/svn/Foundation/src/LogFile_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogFile_WIN32U.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/LogStream.cpp b/Foundation/src/LogStream.cpp index c5a3ead94..00d127fe5 100644 --- a/Foundation/src/LogStream.cpp +++ b/Foundation/src/LogStream.cpp @@ -1,7 +1,7 @@ // // LogStream.cpp // -// $Id: //poco/svn/Foundation/src/LogStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LogStream.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Logger.cpp b/Foundation/src/Logger.cpp index 15447e12a..6037bf921 100644 --- a/Foundation/src/Logger.cpp +++ b/Foundation/src/Logger.cpp @@ -1,7 +1,7 @@ // // Logger.cpp // -// $Id: //poco/svn/Foundation/src/Logger.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Logger.cpp#4 $ // // Library: Foundation // Package: Logging @@ -84,7 +84,7 @@ void Logger::setLevel(int level) void Logger::setLevel(const std::string& level) { - setLevel(parseLevel(level)); + setLevel(parseLevel(level)); } @@ -433,26 +433,26 @@ Logger& Logger::parent(const std::string& name) int Logger::parseLevel(const std::string& level) { - if (icompare(level, "none") == 0) - return 0; - else if (icompare(level, "fatal") == 0) - return Message::PRIO_FATAL; - else if (icompare(level, "critical") == 0) - return Message::PRIO_CRITICAL; - else if (icompare(level, "error") == 0) - return Message::PRIO_ERROR; - else if (icompare(level, "warning") == 0) - return Message::PRIO_WARNING; - else if (icompare(level, "notice") == 0) - return Message::PRIO_NOTICE; - else if (icompare(level, "information") == 0) - return Message::PRIO_INFORMATION; - else if (icompare(level, "debug") == 0) - return Message::PRIO_DEBUG; - else if (icompare(level, "trace") == 0) - return Message::PRIO_TRACE; - else - throw InvalidArgumentException("Not a valid log level", level); + if (icompare(level, "none") == 0) + return 0; + else if (icompare(level, "fatal") == 0) + return Message::PRIO_FATAL; + else if (icompare(level, "critical") == 0) + return Message::PRIO_CRITICAL; + else if (icompare(level, "error") == 0) + return Message::PRIO_ERROR; + else if (icompare(level, "warning") == 0) + return Message::PRIO_WARNING; + else if (icompare(level, "notice") == 0) + return Message::PRIO_NOTICE; + else if (icompare(level, "information") == 0) + return Message::PRIO_INFORMATION; + else if (icompare(level, "debug") == 0) + return Message::PRIO_DEBUG; + else if (icompare(level, "trace") == 0) + return Message::PRIO_TRACE; + else + throw InvalidArgumentException("Not a valid log level", level); } diff --git a/Foundation/src/LoggingFactory.cpp b/Foundation/src/LoggingFactory.cpp index 3805f03c3..c10528965 100644 --- a/Foundation/src/LoggingFactory.cpp +++ b/Foundation/src/LoggingFactory.cpp @@ -1,7 +1,7 @@ // // LoggingFactory.cpp // -// $Id: //poco/svn/Foundation/src/LoggingFactory.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LoggingFactory.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/LoggingRegistry.cpp b/Foundation/src/LoggingRegistry.cpp index 7c697be35..0372bd997 100644 --- a/Foundation/src/LoggingRegistry.cpp +++ b/Foundation/src/LoggingRegistry.cpp @@ -1,7 +1,7 @@ // // LoggingRegistry.cpp // -// $Id: //poco/svn/Foundation/src/LoggingRegistry.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/LoggingRegistry.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/MD4Engine.cpp b/Foundation/src/MD4Engine.cpp index f506a691a..4bd241d99 100644 --- a/Foundation/src/MD4Engine.cpp +++ b/Foundation/src/MD4Engine.cpp @@ -1,7 +1,7 @@ // // MD4Engine.cpp // -// $Id: //poco/svn/Foundation/src/MD4Engine.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/MD4Engine.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/MD5Engine.cpp b/Foundation/src/MD5Engine.cpp index 41c7379f9..49bf49522 100644 --- a/Foundation/src/MD5Engine.cpp +++ b/Foundation/src/MD5Engine.cpp @@ -1,7 +1,7 @@ // // MD5Engine.cpp // -// $Id: //poco/svn/Foundation/src/MD5Engine.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/MD5Engine.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/Manifest.cpp b/Foundation/src/Manifest.cpp index f30b7f089..c072840b1 100644 --- a/Foundation/src/Manifest.cpp +++ b/Foundation/src/Manifest.cpp @@ -1,7 +1,7 @@ // // Manifest.cpp // -// $Id: //poco/svn/Foundation/src/Manifest.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Manifest.cpp#1 $ // // Library: Foundation // Package: SharedLibrary diff --git a/Foundation/src/MemoryPool.cpp b/Foundation/src/MemoryPool.cpp index 68e665e0d..8e3f4b03d 100644 --- a/Foundation/src/MemoryPool.cpp +++ b/Foundation/src/MemoryPool.cpp @@ -1,7 +1,7 @@ // // MemoryPool.cpp // -// $Id: //poco/svn/Foundation/src/MemoryPool.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/MemoryPool.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/Message.cpp b/Foundation/src/Message.cpp index 731aa7de9..5f941b7d0 100644 --- a/Foundation/src/Message.cpp +++ b/Foundation/src/Message.cpp @@ -1,7 +1,7 @@ // // Message.cpp // -// $Id: //poco/svn/Foundation/src/Message.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/Message.cpp#2 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Mutex.cpp b/Foundation/src/Mutex.cpp index db2c5141a..51b03c006 100644 --- a/Foundation/src/Mutex.cpp +++ b/Foundation/src/Mutex.cpp @@ -1,7 +1,7 @@ // // Mutex.cpp // -// $Id: //poco/svn/Foundation/src/Mutex.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/Mutex.cpp#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Mutex_WIN32.cpp b/Foundation/src/Mutex_WIN32.cpp index ef84bea2c..410869bca 100644 --- a/Foundation/src/Mutex_WIN32.cpp +++ b/Foundation/src/Mutex_WIN32.cpp @@ -1,7 +1,7 @@ // // Mutex_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/Mutex_WIN32.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/Mutex_WIN32.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/NamedEvent.cpp b/Foundation/src/NamedEvent.cpp index 0419aad36..d141ba1db 100644 --- a/Foundation/src/NamedEvent.cpp +++ b/Foundation/src/NamedEvent.cpp @@ -1,7 +1,7 @@ // // NamedEvent.cpp // -// $Id: //poco/svn/Foundation/src/NamedEvent.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedEvent.cpp#2 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedEvent_UNIX.cpp b/Foundation/src/NamedEvent_UNIX.cpp index 8229cdc6d..52359dca5 100644 --- a/Foundation/src/NamedEvent_UNIX.cpp +++ b/Foundation/src/NamedEvent_UNIX.cpp @@ -1,7 +1,7 @@ // // NamedEvent_UNIX.cpp // -// $Id: //poco/svn/Foundation/src/NamedEvent_UNIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedEvent_UNIX.cpp#1 $ // // Library: Foundation // Package: Processes @@ -57,13 +57,13 @@ namespace Poco { { int val; struct semid_ds* buf; - unsigned short int* array; - struct seminfo* __buf; - }; + unsigned short int* array; + struct seminfo* __buf; + }; #elif defined(__hpux) - union semun - { - int val; + union semun + { + int val; struct semid_ds* buf; ushort* array; }; @@ -71,13 +71,13 @@ namespace Poco { NamedEventImpl::NamedEventImpl(const std::string& name): - _name(name) + _name(name) { - std::string fileName = getFileName(); + std::string fileName = getFileName(); #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0); - if ((long) _sem == (long) SEM_FAILED) - throw SystemException("cannot create named event (sem_open() failed)", _name); + _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0); + if ((long) _sem == (long) SEM_FAILED) + throw SystemException("cannot create named event (sem_open() failed)", _name); #else int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd != -1) @@ -96,9 +96,9 @@ NamedEventImpl::NamedEventImpl(const std::string& name): } else if (errno == EEXIST) { - _semid = semget(key, 1, 0); - } - else throw SystemException("cannot create named event (semget() failed)", _name); + _semid = semget(key, 1, 0); + } + else throw SystemException("cannot create named event (semget() failed)", _name); #endif // defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) } @@ -106,7 +106,7 @@ NamedEventImpl::NamedEventImpl(const std::string& name): NamedEventImpl::~NamedEventImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - sem_close(_sem); + sem_close(_sem); #endif } @@ -114,8 +114,8 @@ NamedEventImpl::~NamedEventImpl() void NamedEventImpl::setImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - if (sem_post(_sem) != 0) - throw SystemException("cannot set named event", _name); + if (sem_post(_sem) != 0) + throw SystemException("cannot set named event", _name); #else struct sembuf op; op.sem_num = 0; @@ -130,9 +130,9 @@ void NamedEventImpl::setImpl() void NamedEventImpl::waitImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - int err; - do - { + int err; + do + { err = sem_wait(_sem); } while (err && errno == EINTR); diff --git a/Foundation/src/NamedEvent_VMS.cpp b/Foundation/src/NamedEvent_VMS.cpp index 92818966b..826b55969 100644 --- a/Foundation/src/NamedEvent_VMS.cpp +++ b/Foundation/src/NamedEvent_VMS.cpp @@ -1,7 +1,7 @@ // // NamedEvent_VMS.cpp // -// $Id: //poco/svn/Foundation/src/NamedEvent_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedEvent_VMS.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedEvent_WIN32.cpp b/Foundation/src/NamedEvent_WIN32.cpp index 631027a3f..2755d6b92 100644 --- a/Foundation/src/NamedEvent_WIN32.cpp +++ b/Foundation/src/NamedEvent_WIN32.cpp @@ -1,7 +1,7 @@ // // NamedEvent_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/NamedEvent_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedEvent_WIN32.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedEvent_WIN32U.cpp b/Foundation/src/NamedEvent_WIN32U.cpp index 1adb61a4d..6742da22a 100644 --- a/Foundation/src/NamedEvent_WIN32U.cpp +++ b/Foundation/src/NamedEvent_WIN32U.cpp @@ -1,7 +1,7 @@ // // NamedEvent_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/NamedEvent_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedEvent_WIN32U.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedMutex.cpp b/Foundation/src/NamedMutex.cpp index 81283a89d..d5a10e21d 100644 --- a/Foundation/src/NamedMutex.cpp +++ b/Foundation/src/NamedMutex.cpp @@ -1,7 +1,7 @@ // // NamedMutex.cpp // -// $Id: //poco/svn/Foundation/src/NamedMutex.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedMutex.cpp#2 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedMutex_UNIX.cpp b/Foundation/src/NamedMutex_UNIX.cpp index abef6cec3..5a6758742 100644 --- a/Foundation/src/NamedMutex_UNIX.cpp +++ b/Foundation/src/NamedMutex_UNIX.cpp @@ -1,7 +1,7 @@ // // NamedMutex_UNIX.cpp // -// $Id: //poco/svn/Foundation/src/NamedMutex_UNIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedMutex_UNIX.cpp#1 $ // // Library: Foundation // Package: Processes @@ -57,13 +57,13 @@ namespace Poco { { int val; struct semid_ds* buf; - unsigned short int* array; - struct seminfo* __buf; - }; + unsigned short int* array; + struct seminfo* __buf; + }; #elif defined(__hpux) - union semun - { - int val; + union semun + { + int val; struct semid_ds* buf; ushort* array; }; @@ -71,13 +71,13 @@ namespace Poco { NamedMutexImpl::NamedMutexImpl(const std::string& name): - _name(name) + _name(name) { - std::string fileName = getFileName(); + std::string fileName = getFileName(); #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1); - if ((long) _sem == (long) SEM_FAILED) - throw SystemException("cannot create named mutex (sem_open() failed)", _name); + _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1); + if ((long) _sem == (long) SEM_FAILED) + throw SystemException("cannot create named mutex (sem_open() failed)", _name); #else int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd != -1) @@ -96,9 +96,9 @@ NamedMutexImpl::NamedMutexImpl(const std::string& name): } else if (errno == EEXIST) { - _semid = semget(key, 1, 0); - } - else throw SystemException("cannot create named mutex (semget() failed)", _name); + _semid = semget(key, 1, 0); + } + else throw SystemException("cannot create named mutex (semget() failed)", _name); #endif // defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) } @@ -106,7 +106,7 @@ NamedMutexImpl::NamedMutexImpl(const std::string& name): NamedMutexImpl::~NamedMutexImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - sem_close(_sem); + sem_close(_sem); #endif } @@ -114,9 +114,9 @@ NamedMutexImpl::~NamedMutexImpl() void NamedMutexImpl::lockImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - int err; - do - { + int err; + do + { err = sem_wait(_sem); } while (err && errno == EINTR); @@ -140,9 +140,9 @@ void NamedMutexImpl::lockImpl() bool NamedMutexImpl::tryLockImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - return sem_trywait(_sem) == 0; + return sem_trywait(_sem) == 0; #else - struct sembuf op; + struct sembuf op; op.sem_num = 0; op.sem_op = -1; op.sem_flg = SEM_UNDO | IPC_NOWAIT; @@ -154,8 +154,8 @@ bool NamedMutexImpl::tryLockImpl() void NamedMutexImpl::unlockImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) - if (sem_post(_sem) != 0) - throw SystemException("cannot unlock named mutex", _name); + if (sem_post(_sem) != 0) + throw SystemException("cannot unlock named mutex", _name); #else struct sembuf op; op.sem_num = 0; diff --git a/Foundation/src/NamedMutex_VMS.cpp b/Foundation/src/NamedMutex_VMS.cpp index 4d3faa08d..8a5e2213a 100644 --- a/Foundation/src/NamedMutex_VMS.cpp +++ b/Foundation/src/NamedMutex_VMS.cpp @@ -1,7 +1,7 @@ // // NamedMutex_VMS.cpp // -// $Id: //poco/svn/Foundation/src/NamedMutex_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedMutex_VMS.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedMutex_WIN32.cpp b/Foundation/src/NamedMutex_WIN32.cpp index 3f074697e..3bf7c17a6 100644 --- a/Foundation/src/NamedMutex_WIN32.cpp +++ b/Foundation/src/NamedMutex_WIN32.cpp @@ -1,7 +1,7 @@ // // NamedMutex_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/NamedMutex_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedMutex_WIN32.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NamedMutex_WIN32U.cpp b/Foundation/src/NamedMutex_WIN32U.cpp index bf7fde5ad..ecc381d51 100644 --- a/Foundation/src/NamedMutex_WIN32U.cpp +++ b/Foundation/src/NamedMutex_WIN32U.cpp @@ -1,7 +1,7 @@ // // NamedMutex_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/NamedMutex_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NamedMutex_WIN32U.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/NestedDiagnosticContext.cpp b/Foundation/src/NestedDiagnosticContext.cpp index 5cdaa1bf6..e479136af 100644 --- a/Foundation/src/NestedDiagnosticContext.cpp +++ b/Foundation/src/NestedDiagnosticContext.cpp @@ -1,7 +1,7 @@ // // NestedDiagnosticContext.cpp // -// $Id: //poco/svn/Foundation/src/NestedDiagnosticContext.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NestedDiagnosticContext.cpp#1 $ // // Library: Foundation // Package: Core @@ -138,13 +138,13 @@ void NestedDiagnosticContext::clear() namespace { - static ThreadLocal ndc; + static ThreadLocal ndc; } NestedDiagnosticContext& NestedDiagnosticContext::current() { - return ndc.get(); + return ndc.get(); } diff --git a/Foundation/src/Notification.cpp b/Foundation/src/Notification.cpp index 8fc75e114..7c3581702 100644 --- a/Foundation/src/Notification.cpp +++ b/Foundation/src/Notification.cpp @@ -1,7 +1,7 @@ // // Notification.cpp // -// $Id: //poco/svn/Foundation/src/Notification.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Notification.cpp#1 $ // // Library: Foundation // Package: Notifications diff --git a/Foundation/src/NotificationQueue.cpp b/Foundation/src/NotificationQueue.cpp index 894935caa..f45364b3d 100644 --- a/Foundation/src/NotificationQueue.cpp +++ b/Foundation/src/NotificationQueue.cpp @@ -1,7 +1,7 @@ // // NotificationQueue.cpp // -// $Id: //poco/Main/Foundation/src/NotificationQueue.cpp#15 $ +// $Id: //poco/1.4/Foundation/src/NotificationQueue.cpp#1 $ // // Library: Foundation // Package: Notifications diff --git a/Foundation/src/NullChannel.cpp b/Foundation/src/NullChannel.cpp index a6022e45d..0a737f200 100644 --- a/Foundation/src/NullChannel.cpp +++ b/Foundation/src/NullChannel.cpp @@ -1,7 +1,7 @@ // // NullChannel.cpp // -// $Id: //poco/svn/Foundation/src/NullChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NullChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/NullStream.cpp b/Foundation/src/NullStream.cpp index 04a080622..81085b0c6 100644 --- a/Foundation/src/NullStream.cpp +++ b/Foundation/src/NullStream.cpp @@ -1,7 +1,7 @@ // // NullStream.cpp // -// $Id: //poco/svn/Foundation/src/NullStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/NullStream.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/NumberFormatter.cpp b/Foundation/src/NumberFormatter.cpp index 37bc7c57d..c5d68e4a3 100644 --- a/Foundation/src/NumberFormatter.cpp +++ b/Foundation/src/NumberFormatter.cpp @@ -1,7 +1,7 @@ // // NumberFormatter.cpp // -// $Id: //poco/Main/Foundation/src/NumberFormatter.cpp#13 $ +// $Id: //poco/1.4/Foundation/src/NumberFormatter.cpp#4 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/OpcomChannel.cpp b/Foundation/src/OpcomChannel.cpp index f2c9d3106..f175b1642 100644 --- a/Foundation/src/OpcomChannel.cpp +++ b/Foundation/src/OpcomChannel.cpp @@ -1,7 +1,7 @@ // // OpcomChannel.cpp // -// $Id: //poco/svn/Foundation/src/OpcomChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/OpcomChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Path.cpp b/Foundation/src/Path.cpp index e0cee28e3..acc19dfce 100644 --- a/Foundation/src/Path.cpp +++ b/Foundation/src/Path.cpp @@ -1,7 +1,7 @@ // // Path.cpp // -// $Id: //poco/svn/Foundation/src/Path.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Path.cpp#5 $ // // Library: Foundation // Package: Filesystem @@ -641,21 +641,21 @@ void Path::listRoots(std::vector& roots) bool Path::find(StringVec::const_iterator it, StringVec::const_iterator end, const std::string& name, Path& path) { - while (it != end) - { + while (it != end) + { #if defined(WIN32) - std::string cleanPath(*it); - if (cleanPath.size() > 1 && cleanPath[0] == '"' && cleanPath[cleanPath.size() - 1] == '"') - { - cleanPath = cleanPath.substr(1, cleanPath.size() - 2); - } - Path p(cleanPath); + std::string cleanPath(*it); + if (cleanPath.size() > 1 && cleanPath[0] == '"' && cleanPath[cleanPath.size() - 1] == '"') + { + cleanPath = cleanPath.substr(1, cleanPath.size() - 2); + } + Path p(cleanPath); #else - Path p(*it); + Path p(*it); #endif - p.makeDirectory(); - p.resolve(Path(name)); - File f(p); + p.makeDirectory(); + p.resolve(Path(name)); + File f(p); if (f.exists()) { path = p; diff --git a/Foundation/src/Path_VMS.cpp b/Foundation/src/Path_VMS.cpp index 1c1fce683..f7fc5f38b 100644 --- a/Foundation/src/Path_VMS.cpp +++ b/Foundation/src/Path_VMS.cpp @@ -1,7 +1,7 @@ // // Path_VMS.cpp // -// $Id: //poco/svn/Foundation/src/Path_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Path_VMS.cpp#1 $ // // Library: Foundation // Package: Filesystem diff --git a/Foundation/src/Path_WIN32.cpp b/Foundation/src/Path_WIN32.cpp index 76ee9d609..f38d6594a 100644 --- a/Foundation/src/Path_WIN32.cpp +++ b/Foundation/src/Path_WIN32.cpp @@ -1,7 +1,7 @@ // // Path_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/Path_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Path_WIN32.cpp#4 $ // // Library: Foundation // Package: Filesystem @@ -71,13 +71,13 @@ std::string PathImpl::homeImpl() std::string PathImpl::tempImpl() { char buffer[MAX_PATH]; - DWORD n = GetTempPathA(sizeof(buffer), buffer); - if (n > 0 && n < sizeof(buffer)) - { - n = GetLongPathNameA(buffer, buffer, static_cast(sizeof buffer)); - if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); - std::string result(buffer, n); - if (result[n - 1] != '\\') + DWORD n = GetTempPathA(sizeof(buffer), buffer); + if (n > 0 && n < sizeof(buffer)) + { + n = GetLongPathNameA(buffer, buffer, static_cast(sizeof buffer)); + if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); + std::string result(buffer, n); + if (result[n - 1] != '\\') result.append("\\"); return result; } diff --git a/Foundation/src/Path_WIN32U.cpp b/Foundation/src/Path_WIN32U.cpp index 2050fe655..d9fe50003 100644 --- a/Foundation/src/Path_WIN32U.cpp +++ b/Foundation/src/Path_WIN32U.cpp @@ -1,7 +1,7 @@ // // Path_WIN32U.cpp // -// $Id: //poco/svn/Foundation/src/Path_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Path_WIN32U.cpp#2 $ // // Library: Foundation // Package: Filesystem @@ -53,13 +53,13 @@ std::string PathImpl::currentImpl() { Buffer buffer(len); DWORD n = GetCurrentDirectoryW(len, buffer.begin()); - if (n > 0 && n <= len) - { - UnicodeConverter::toUTF8(buffer.begin(), result); - if (result[result.size() - 1] != '\\') - result.append("\\"); - return result; - } + if (n > 0 && n <= len) + { + UnicodeConverter::toUTF8(buffer.begin(), result); + if (result[result.size() - 1] != '\\') + result.append("\\"); + return result; + } } throw SystemException("Cannot get current directory"); } @@ -79,18 +79,18 @@ std::string PathImpl::homeImpl() std::string PathImpl::tempImpl() { Buffer buffer(MAX_PATH_LEN); - DWORD n = GetTempPathW(static_cast(buffer.size()), buffer.begin()); - if (n > 0) - { - n = GetLongPathNameW(buffer.begin(), buffer.begin(), static_cast(buffer.size())); - if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), result); - if (result[result.size() - 1] != '\\') - result.append("\\"); - return result; - } - throw SystemException("Cannot get temporary directory path"); + DWORD n = GetTempPathW(static_cast(buffer.size()), buffer.begin()); + if (n > 0) + { + n = GetLongPathNameW(buffer.begin(), buffer.begin(), static_cast(buffer.size())); + if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); + std::string result; + UnicodeConverter::toUTF8(buffer.begin(), result); + if (result[result.size() - 1] != '\\') + result.append("\\"); + return result; + } + throw SystemException("Cannot get temporary directory path"); } diff --git a/Foundation/src/Pipe.cpp b/Foundation/src/Pipe.cpp index 8ddd247e9..3c48a5865 100644 --- a/Foundation/src/Pipe.cpp +++ b/Foundation/src/Pipe.cpp @@ -1,7 +1,7 @@ // // Pipe.cpp // -// $Id: //poco/svn/Foundation/src/Pipe.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Pipe.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PipeImpl.cpp b/Foundation/src/PipeImpl.cpp index 81900b966..341556f7e 100644 --- a/Foundation/src/PipeImpl.cpp +++ b/Foundation/src/PipeImpl.cpp @@ -1,7 +1,7 @@ // // PipeImpl.cpp // -// $Id: //poco/svn/Foundation/src/PipeImpl.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PipeImpl.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PipeImpl_DUMMY.cpp b/Foundation/src/PipeImpl_DUMMY.cpp index 6e92f486a..cb251293b 100644 --- a/Foundation/src/PipeImpl_DUMMY.cpp +++ b/Foundation/src/PipeImpl_DUMMY.cpp @@ -1,7 +1,7 @@ // // PipeImpl_DUMMY.cpp // -// $Id: //poco/svn/Foundation/src/PipeImpl_DUMMY.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PipeImpl_DUMMY.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PipeImpl_POSIX.cpp b/Foundation/src/PipeImpl_POSIX.cpp index 4878c539c..e602a4af9 100644 --- a/Foundation/src/PipeImpl_POSIX.cpp +++ b/Foundation/src/PipeImpl_POSIX.cpp @@ -1,7 +1,7 @@ // // PipeImpl_POSIX.cpp // -// $Id: //poco/svn/Foundation/src/PipeImpl_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PipeImpl_POSIX.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PipeImpl_WIN32.cpp b/Foundation/src/PipeImpl_WIN32.cpp index 9f93a8193..4aae14a58 100644 --- a/Foundation/src/PipeImpl_WIN32.cpp +++ b/Foundation/src/PipeImpl_WIN32.cpp @@ -1,7 +1,7 @@ // // PipeImpl_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/PipeImpl_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PipeImpl_WIN32.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PipeStream.cpp b/Foundation/src/PipeStream.cpp index 53ccb1f67..10a9a711c 100644 --- a/Foundation/src/PipeStream.cpp +++ b/Foundation/src/PipeStream.cpp @@ -1,7 +1,7 @@ // // PipeStream.cpp // -// $Id: //poco/svn/Foundation/src/PipeStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PipeStream.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/PriorityNotificationQueue.cpp b/Foundation/src/PriorityNotificationQueue.cpp index f2ed9e004..489e3ef3e 100644 --- a/Foundation/src/PriorityNotificationQueue.cpp +++ b/Foundation/src/PriorityNotificationQueue.cpp @@ -1,7 +1,7 @@ // // PriorityNotificationQueue.cpp // -// $Id: //poco/Main/Foundation/src/PriorityNotificationQueue.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/PriorityNotificationQueue.cpp#1 $ // // Library: Foundation // Package: Notifications @@ -197,13 +197,13 @@ Notification::Ptr PriorityNotificationQueue::dequeueOne() namespace { - static SingletonHolder sh; + static SingletonHolder sh; } PriorityNotificationQueue& PriorityNotificationQueue::defaultQueue() { - return *sh.get(); + return *sh.get(); } diff --git a/Foundation/src/Process.cpp b/Foundation/src/Process.cpp index 387dbe857..f63c8acbb 100644 --- a/Foundation/src/Process.cpp +++ b/Foundation/src/Process.cpp @@ -1,7 +1,7 @@ // // Process.cpp // -// $Id: //poco/svn/Foundation/src/Process.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Process.cpp#3 $ // // Library: Foundation // Package: Processes @@ -129,13 +129,13 @@ int Process::wait(const ProcessHandle& handle) void Process::kill(const ProcessHandle& handle) { - killImpl(*handle._pImpl); + killImpl(*handle._pImpl); } void Process::kill(PID pid) { - killImpl(pid); + killImpl(pid); } diff --git a/Foundation/src/Process_UNIX.cpp b/Foundation/src/Process_UNIX.cpp index 63f321c58..90d496c41 100644 --- a/Foundation/src/Process_UNIX.cpp +++ b/Foundation/src/Process_UNIX.cpp @@ -1,7 +1,7 @@ // // Process_UNIX.cpp // -// $Id: //poco/svn/Foundation/src/Process_UNIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Process_UNIX.cpp#2 $ // // Library: Foundation // Package: Processes @@ -171,13 +171,13 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - killImpl(handle.id()); + killImpl(handle.id()); } void ProcessImpl::killImpl(PIDImpl pid) { - if (kill(pid, SIGKILL) != 0) + if (kill(pid, SIGKILL) != 0) { switch (errno) { diff --git a/Foundation/src/Process_VMS.cpp b/Foundation/src/Process_VMS.cpp index e5b01749f..1f999f3b6 100644 --- a/Foundation/src/Process_VMS.cpp +++ b/Foundation/src/Process_VMS.cpp @@ -1,7 +1,7 @@ // // Process_VMS.cpp // -// $Id: //poco/svn/Foundation/src/Process_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Process_VMS.cpp#2 $ // // Library: Foundation // Package: Processes @@ -127,13 +127,13 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - killImpl(handle.id()); + killImpl(handle.id()); } void ProcessImpl::killImpl(PIDImpl pid) { - if (kill(pid, SIGKILL) != 0) + if (kill(pid, SIGKILL) != 0) { switch (errno) { diff --git a/Foundation/src/Process_VX.cpp b/Foundation/src/Process_VX.cpp index c307ba172..686778fc6 100644 --- a/Foundation/src/Process_VX.cpp +++ b/Foundation/src/Process_VX.cpp @@ -1,7 +1,7 @@ // // Process_VX.cpp // -// $Id: //poco/1.4/Foundation/src/Process_VX.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/Process_VX.cpp#2 $ // // Library: Foundation // Package: Processes @@ -91,13 +91,13 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - throw Poco::NotImplementedException("Process::kill()"); + throw Poco::NotImplementedException("Process::kill()"); } void ProcessImpl::killImpl(PIDImpl pid) { - throw Poco::NotImplementedException("Process::kill()"); + throw Poco::NotImplementedException("Process::kill()"); } diff --git a/Foundation/src/Process_WIN32.cpp b/Foundation/src/Process_WIN32.cpp index 29e6b460b..e106adfbd 100644 --- a/Foundation/src/Process_WIN32.cpp +++ b/Foundation/src/Process_WIN32.cpp @@ -1,7 +1,7 @@ // // Process_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/Process_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Process_WIN32.cpp#2 $ // // Library: Foundation // Package: Processes @@ -68,13 +68,13 @@ UInt32 ProcessHandleImpl::id() const HANDLE ProcessHandleImpl::process() const { - return _hProcess; + return _hProcess; } int ProcessHandleImpl::wait() const { - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); + DWORD rc = WaitForSingleObject(_hProcess, INFINITE); if (rc != WAIT_OBJECT_0) throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); @@ -184,18 +184,18 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - if (TerminateProcess(handle.process(), 0) == 0) - { - CloseHandle(handle.process()); - throw SystemException("cannot kill process"); - } - CloseHandle(handle.process()); + if (TerminateProcess(handle.process(), 0) == 0) + { + CloseHandle(handle.process()); + throw SystemException("cannot kill process"); + } + CloseHandle(handle.process()); } void ProcessImpl::killImpl(PIDImpl pid) { - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (hProc) { if (TerminateProcess(hProc, 0) == 0) diff --git a/Foundation/src/Process_WIN32U.cpp b/Foundation/src/Process_WIN32U.cpp index 158a5e17a..dde875d3b 100644 --- a/Foundation/src/Process_WIN32U.cpp +++ b/Foundation/src/Process_WIN32U.cpp @@ -1,7 +1,7 @@ // // Process_WIN32U.cpp // -// $Id: //poco/svn/Foundation/src/Process_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Process_WIN32U.cpp#2 $ // // Library: Foundation // Package: Processes @@ -69,13 +69,13 @@ UInt32 ProcessHandleImpl::id() const HANDLE ProcessHandleImpl::process() const { - return _hProcess; + return _hProcess; } int ProcessHandleImpl::wait() const { - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); + DWORD rc = WaitForSingleObject(_hProcess, INFINITE); if (rc != WAIT_OBJECT_0) throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); @@ -188,18 +188,18 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - if (TerminateProcess(handle.process(), 0) == 0) - { - CloseHandle(handle.process()); - throw SystemException("cannot kill process"); - } - CloseHandle(handle.process()); + if (TerminateProcess(handle.process(), 0) == 0) + { + CloseHandle(handle.process()); + throw SystemException("cannot kill process"); + } + CloseHandle(handle.process()); } void ProcessImpl::killImpl(PIDImpl pid) { - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (hProc) { if (TerminateProcess(hProc, 0) == 0) diff --git a/Foundation/src/Process_WINCE.cpp b/Foundation/src/Process_WINCE.cpp index 1c1ab5f66..596201132 100644 --- a/Foundation/src/Process_WINCE.cpp +++ b/Foundation/src/Process_WINCE.cpp @@ -1,7 +1,7 @@ // // Process_WINCE.cpp // -// $Id: //poco/1.4/Foundation/src/Process_WINCE.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/Process_WINCE.cpp#2 $ // // Library: Foundation // Package: Processes @@ -69,13 +69,13 @@ UInt32 ProcessHandleImpl::id() const HANDLE ProcessHandleImpl::process() const { - return _hProcess; + return _hProcess; } int ProcessHandleImpl::wait() const { - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); + DWORD rc = WaitForSingleObject(_hProcess, INFINITE); if (rc != WAIT_OBJECT_0) throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); @@ -160,18 +160,18 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg void ProcessImpl::killImpl(const ProcessHandleImpl& handle) { - if (TerminateProcess(handle.process(), 0) == 0) - { - CloseHandle(handle.process()); - throw SystemException("cannot kill process"); - } - CloseHandle(handle.process()); + if (TerminateProcess(handle.process(), 0) == 0) + { + CloseHandle(handle.process()); + throw SystemException("cannot kill process"); + } + CloseHandle(handle.process()); } void ProcessImpl::killImpl(PIDImpl pid) { - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (hProc) { if (TerminateProcess(hProc, 0) == 0) diff --git a/Foundation/src/PurgeStrategy.cpp b/Foundation/src/PurgeStrategy.cpp index 571f22465..86fe86edd 100644 --- a/Foundation/src/PurgeStrategy.cpp +++ b/Foundation/src/PurgeStrategy.cpp @@ -1,7 +1,7 @@ // // PurgeStrategy.cpp // -// $Id: //poco/svn/Foundation/src/PurgeStrategy.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/PurgeStrategy.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/RWLock.cpp b/Foundation/src/RWLock.cpp index 3811f2fab..f56cb1e78 100644 --- a/Foundation/src/RWLock.cpp +++ b/Foundation/src/RWLock.cpp @@ -1,7 +1,7 @@ // // RWLock.cpp // -// $Id: //poco/svn/Foundation/src/RWLock.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/RWLock.cpp#3 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/RWLock_POSIX.cpp b/Foundation/src/RWLock_POSIX.cpp index 95055be87..ea3e0f7c6 100644 --- a/Foundation/src/RWLock_POSIX.cpp +++ b/Foundation/src/RWLock_POSIX.cpp @@ -1,7 +1,7 @@ // // RWLock_POSIX.cpp // -// $Id: //poco/svn/Foundation/src/RWLock_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/RWLock_POSIX.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/RWLock_WIN32.cpp b/Foundation/src/RWLock_WIN32.cpp index 68a2eef90..20dd6d69c 100644 --- a/Foundation/src/RWLock_WIN32.cpp +++ b/Foundation/src/RWLock_WIN32.cpp @@ -1,7 +1,7 @@ // // RWLock_WIN32.cpp // -// $Id: //poco/1.3/Foundation/src/RWLock_WIN32.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/RWLock_WIN32.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Random.cpp b/Foundation/src/Random.cpp index dc5ec3d6d..f264fd280 100644 --- a/Foundation/src/Random.cpp +++ b/Foundation/src/Random.cpp @@ -1,7 +1,7 @@ // // Random.cpp // -// $Id: //poco/svn/Foundation/src/Random.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Random.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/RandomStream.cpp b/Foundation/src/RandomStream.cpp index 56aa88786..1f60428f2 100644 --- a/Foundation/src/RandomStream.cpp +++ b/Foundation/src/RandomStream.cpp @@ -1,7 +1,7 @@ // // RandomStream.cpp // -// $Id: //poco/svn/Foundation/src/RandomStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/RandomStream.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/RefCountedObject.cpp b/Foundation/src/RefCountedObject.cpp index c1dc42b29..6057b8b14 100644 --- a/Foundation/src/RefCountedObject.cpp +++ b/Foundation/src/RefCountedObject.cpp @@ -1,7 +1,7 @@ // // RefCountedObject.cpp // -// $Id: //poco/svn/Foundation/src/RefCountedObject.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/RefCountedObject.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/RegularExpression.cpp b/Foundation/src/RegularExpression.cpp index 73514ae7f..ad9da8994 100644 --- a/Foundation/src/RegularExpression.cpp +++ b/Foundation/src/RegularExpression.cpp @@ -1,7 +1,7 @@ // // RegularExpression.h // -// $Id: //poco/svn/Foundation/src/RegularExpression.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/RegularExpression.cpp#1 $ // // Library: Foundation // Package: RegExp diff --git a/Foundation/src/RotateStrategy.cpp b/Foundation/src/RotateStrategy.cpp index 0b2fe0000..b00985ee6 100644 --- a/Foundation/src/RotateStrategy.cpp +++ b/Foundation/src/RotateStrategy.cpp @@ -1,7 +1,7 @@ // // RotateStrategy.cpp // -// $Id: //poco/Main/Foundation/src/RotateStrategy.cpp#8 $ +// $Id: //poco/1.4/Foundation/src/RotateStrategy.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Runnable.cpp b/Foundation/src/Runnable.cpp index 4a63d543d..7b64be628 100644 --- a/Foundation/src/Runnable.cpp +++ b/Foundation/src/Runnable.cpp @@ -1,7 +1,7 @@ // // Runnable.cpp // -// $Id: //poco/svn/Foundation/src/Runnable.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Runnable.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/SHA1Engine.cpp b/Foundation/src/SHA1Engine.cpp index 61edceae3..011882ec3 100644 --- a/Foundation/src/SHA1Engine.cpp +++ b/Foundation/src/SHA1Engine.cpp @@ -1,7 +1,7 @@ // // SHA1Engine.cpp // -// $Id: //poco/svn/Foundation/src/SHA1Engine.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SHA1Engine.cpp#1 $ // // Library: Foundation // Package: Crypt diff --git a/Foundation/src/Semaphore.cpp b/Foundation/src/Semaphore.cpp index 031b6eb96..d52192a7a 100644 --- a/Foundation/src/Semaphore.cpp +++ b/Foundation/src/Semaphore.cpp @@ -1,7 +1,7 @@ // // Semaphore.cpp // -// $Id: //poco/svn/Foundation/src/Semaphore.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Semaphore.cpp#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Semaphore_POSIX.cpp b/Foundation/src/Semaphore_POSIX.cpp index fc26ad062..1b9911e85 100644 --- a/Foundation/src/Semaphore_POSIX.cpp +++ b/Foundation/src/Semaphore_POSIX.cpp @@ -1,7 +1,7 @@ // // Semaphore_POSIX.cpp // -// $Id: //poco/svn/Foundation/src/Semaphore_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Semaphore_POSIX.cpp#3 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Semaphore_WIN32.cpp b/Foundation/src/Semaphore_WIN32.cpp index a3b9e4829..733269723 100644 --- a/Foundation/src/Semaphore_WIN32.cpp +++ b/Foundation/src/Semaphore_WIN32.cpp @@ -1,7 +1,7 @@ // // Semaphore_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/Semaphore_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Semaphore_WIN32.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/SharedLibrary.cpp b/Foundation/src/SharedLibrary.cpp index 308549439..23cfea731 100644 --- a/Foundation/src/SharedLibrary.cpp +++ b/Foundation/src/SharedLibrary.cpp @@ -1,7 +1,7 @@ // // SharedLibrary.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary.cpp#3 $ // // Library: Foundation // Package: SharedLibrary @@ -63,13 +63,13 @@ SharedLibrary::SharedLibrary() SharedLibrary::SharedLibrary(const std::string& path) { - loadImpl(path, 0); + loadImpl(path, 0); } SharedLibrary::SharedLibrary(const std::string& path, int flags) { - loadImpl(path, flags); + loadImpl(path, flags); } @@ -80,13 +80,13 @@ SharedLibrary::~SharedLibrary() void SharedLibrary::load(const std::string& path) { - loadImpl(path, 0); + loadImpl(path, 0); } void SharedLibrary::load(const std::string& path, int flags) { - loadImpl(path, flags); + loadImpl(path, flags); } diff --git a/Foundation/src/SharedLibrary_HPUX.cpp b/Foundation/src/SharedLibrary_HPUX.cpp index 55f506da2..e29d23bb3 100644 --- a/Foundation/src/SharedLibrary_HPUX.cpp +++ b/Foundation/src/SharedLibrary_HPUX.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_HPUX.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary_HPUX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_HPUX.cpp#2 $ // // Library: Foundation // Package: SharedLibrary @@ -57,7 +57,7 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); if (_handle) throw LibraryAlreadyLoadedException(path); _handle = shl_load(path.c_str(), BIND_DEFERRED, 0); diff --git a/Foundation/src/SharedLibrary_UNIX.cpp b/Foundation/src/SharedLibrary_UNIX.cpp index 26db845c9..ec3156075 100644 --- a/Foundation/src/SharedLibrary_UNIX.cpp +++ b/Foundation/src/SharedLibrary_UNIX.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_UNIX.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary_UNIX.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_UNIX.cpp#3 $ // // Library: Foundation // Package: SharedLibrary @@ -64,18 +64,18 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int flags) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); - if (_handle) throw LibraryAlreadyLoadedException(path); - int realFlags = RTLD_LAZY; - if (flags & SHLIB_LOCAL_IMPL) - realFlags |= RTLD_LOCAL; - else - realFlags |= RTLD_GLOBAL; - _handle = dlopen(path.c_str(), realFlags); - if (!_handle) - { - const char* err = dlerror(); + if (_handle) throw LibraryAlreadyLoadedException(path); + int realFlags = RTLD_LAZY; + if (flags & SHLIB_LOCAL_IMPL) + realFlags |= RTLD_LOCAL; + else + realFlags |= RTLD_GLOBAL; + _handle = dlopen(path.c_str(), realFlags); + if (!_handle) + { + const char* err = dlerror(); throw LibraryLoadException(err ? std::string(err) : path); } _path = path; diff --git a/Foundation/src/SharedLibrary_VMS.cpp b/Foundation/src/SharedLibrary_VMS.cpp index f0b10fc8e..40e3421ea 100644 --- a/Foundation/src/SharedLibrary_VMS.cpp +++ b/Foundation/src/SharedLibrary_VMS.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_VMS.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary_VMS.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_VMS.cpp#2 $ // // Library: Foundation // Package: SharedLibrary @@ -61,7 +61,7 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); if (!_path.empty()) throw LibraryAlreadyLoadedException(path); _path = path; diff --git a/Foundation/src/SharedLibrary_VX.cpp b/Foundation/src/SharedLibrary_VX.cpp index 3c31acbb6..c0122d9be 100644 --- a/Foundation/src/SharedLibrary_VX.cpp +++ b/Foundation/src/SharedLibrary_VX.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_VX.cpp // -// $Id: //poco/1.4/Foundation/src/SharedLibrary_VX.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_VX.cpp#2 $ // // Library: Foundation // Package: SharedLibrary @@ -84,7 +84,7 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); if (_moduleId) throw LibraryAlreadyLoadedException(path); int fd = open(const_cast(path.c_str()), O_RDONLY, 0); diff --git a/Foundation/src/SharedLibrary_WIN32.cpp b/Foundation/src/SharedLibrary_WIN32.cpp index 9a9920b2e..cd108f40a 100644 --- a/Foundation/src/SharedLibrary_WIN32.cpp +++ b/Foundation/src/SharedLibrary_WIN32.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_WIN32.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_WIN32.cpp#2 $ // // Library: Foundation // Package: SharedLibrary @@ -58,7 +58,7 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); if (_handle) throw LibraryAlreadyLoadedException(_path); DWORD flags(0); diff --git a/Foundation/src/SharedLibrary_WIN32U.cpp b/Foundation/src/SharedLibrary_WIN32U.cpp index 782419617..bb02e092a 100644 --- a/Foundation/src/SharedLibrary_WIN32U.cpp +++ b/Foundation/src/SharedLibrary_WIN32U.cpp @@ -1,7 +1,7 @@ // // SharedLibrary_WIN32U.cpp // -// $Id: //poco/svn/Foundation/src/SharedLibrary_WIN32U.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedLibrary_WIN32U.cpp#2 $ // // Library: Foundation // Package: SharedLibrary @@ -59,7 +59,7 @@ SharedLibraryImpl::~SharedLibraryImpl() void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) { - FastMutex::ScopedLock lock(_mutex); + FastMutex::ScopedLock lock(_mutex); if (_handle) throw LibraryAlreadyLoadedException(_path); DWORD flags(0); diff --git a/Foundation/src/SharedMemory.cpp b/Foundation/src/SharedMemory.cpp index 7320ed7b5..4fb8a8ae2 100644 --- a/Foundation/src/SharedMemory.cpp +++ b/Foundation/src/SharedMemory.cpp @@ -1,7 +1,7 @@ // // SharedMemory.cpp // -// $Id: //poco/svn/Foundation/src/SharedMemory.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/SharedMemory.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/SharedMemory_DUMMY.cpp b/Foundation/src/SharedMemory_DUMMY.cpp index b210150c3..881444f31 100644 --- a/Foundation/src/SharedMemory_DUMMY.cpp +++ b/Foundation/src/SharedMemory_DUMMY.cpp @@ -1,7 +1,7 @@ // // SharedMemoryImpl.cpp // -// $Id: //poco/svn/Foundation/src/SharedMemory_DUMMY.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedMemory_DUMMY.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/SharedMemory_POSIX.cpp b/Foundation/src/SharedMemory_POSIX.cpp index 02f9bae23..77395f16b 100644 --- a/Foundation/src/SharedMemory_POSIX.cpp +++ b/Foundation/src/SharedMemory_POSIX.cpp @@ -1,7 +1,7 @@ // // SharedMemoryImpl.cpp // -// $Id: //poco/svn/Foundation/src/SharedMemory_POSIX.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedMemory_POSIX.cpp#2 $ // // Library: Foundation // Package: Processes @@ -60,24 +60,24 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh _name.append("tmp/"); #endif - _name.append(name); + _name.append(name); - int flags = _server ? O_CREAT : 0; - if (_access == SharedMemory::AM_WRITE) - flags |= O_RDWR; - else + int flags = _server ? O_CREAT : 0; + if (_access == SharedMemory::AM_WRITE) + flags |= O_RDWR; + else flags |= O_RDONLY; // open the shared memory segment _fd = ::shm_open(_name.c_str(), flags, S_IRUSR | S_IWUSR); if (_fd == -1) - throw SystemException("Cannot create shared memory object", _name); + throw SystemException("Cannot create shared memory object", _name); - // now set the correct size for the segment - if (_server && -1 == ::ftruncate(_fd, size)) - { - ::close(_fd); - _fd = -1; + // now set the correct size for the segment + if (_server && -1 == ::ftruncate(_fd, size)) + { + ::close(_fd); + _fd = -1; ::shm_unlink(_name.c_str()); throw SystemException("Cannot resize shared memory object", _name); } diff --git a/Foundation/src/SharedMemory_WIN32.cpp b/Foundation/src/SharedMemory_WIN32.cpp index a949cd385..8f2d9a237 100644 --- a/Foundation/src/SharedMemory_WIN32.cpp +++ b/Foundation/src/SharedMemory_WIN32.cpp @@ -1,7 +1,7 @@ // // SharedMemoryImpl.cpp // -// $Id: //poco/svn/Foundation/src/SharedMemory_WIN32.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SharedMemory_WIN32.cpp#1 $ // // Library: Foundation // Package: Processes diff --git a/Foundation/src/SignalHandler.cpp b/Foundation/src/SignalHandler.cpp index 9abc54625..5299d9202 100644 --- a/Foundation/src/SignalHandler.cpp +++ b/Foundation/src/SignalHandler.cpp @@ -1,7 +1,7 @@ // // SignalHandler.cpp // -// $Id: //poco/1.3/Foundation/src/SignalHandler.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/SignalHandler.cpp#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/SplitterChannel.cpp b/Foundation/src/SplitterChannel.cpp index 7ae8fad5e..8ee6a1d36 100644 --- a/Foundation/src/SplitterChannel.cpp +++ b/Foundation/src/SplitterChannel.cpp @@ -1,7 +1,7 @@ // // SplitterChannel.cpp // -// $Id: //poco/svn/Foundation/src/SplitterChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SplitterChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Stopwatch.cpp b/Foundation/src/Stopwatch.cpp index 3dfc82122..bf1e6a2cb 100644 --- a/Foundation/src/Stopwatch.cpp +++ b/Foundation/src/Stopwatch.cpp @@ -1,7 +1,7 @@ // // Stopwatch.cpp // -// $Id: //poco/svn/Foundation/src/Stopwatch.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Stopwatch.cpp#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/src/StreamChannel.cpp b/Foundation/src/StreamChannel.cpp index a3f37b6d4..f57528af7 100644 --- a/Foundation/src/StreamChannel.cpp +++ b/Foundation/src/StreamChannel.cpp @@ -1,7 +1,7 @@ // // StreamChannel.cpp // -// $Id: //poco/svn/Foundation/src/StreamChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/StreamChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/StreamConverter.cpp b/Foundation/src/StreamConverter.cpp index c784d9ee3..fda9cc9b6 100644 --- a/Foundation/src/StreamConverter.cpp +++ b/Foundation/src/StreamConverter.cpp @@ -1,7 +1,7 @@ // // StreamConverter.cpp // -// $Id: //poco/svn/Foundation/src/StreamConverter.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/StreamConverter.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/StreamTokenizer.cpp b/Foundation/src/StreamTokenizer.cpp index 3d4e6d508..c5c6abb69 100644 --- a/Foundation/src/StreamTokenizer.cpp +++ b/Foundation/src/StreamTokenizer.cpp @@ -1,7 +1,7 @@ // // StreamTokenizer.cpp // -// $Id: //poco/svn/Foundation/src/StreamTokenizer.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/StreamTokenizer.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/String.cpp b/Foundation/src/String.cpp index 3f73c8e19..b89278062 100644 --- a/Foundation/src/String.cpp +++ b/Foundation/src/String.cpp @@ -1,7 +1,7 @@ // // String.h // -// $Id: //poco/svn/Foundation/src/String.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/String.cpp#1 $ // // Library: Foundation // Package: Core diff --git a/Foundation/src/StringTokenizer.cpp b/Foundation/src/StringTokenizer.cpp index 8f1e8d276..6be53cbb2 100644 --- a/Foundation/src/StringTokenizer.cpp +++ b/Foundation/src/StringTokenizer.cpp @@ -1,7 +1,7 @@ // // StringTokenizer.cpp // -// $Id: //poco/svn/Foundation/src/StringTokenizer.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/StringTokenizer.cpp#1 $ // // Library: Foundation // Package: Core @@ -85,53 +85,53 @@ StringTokenizer::~StringTokenizer() bool StringTokenizer::has(const std::string& token) const { - Iterator it = begin(); - Iterator stop = end(); - for (; it != stop; ++it) - if (*it == token) return true; + Iterator it = begin(); + Iterator stop = end(); + for (; it != stop; ++it) + if (*it == token) return true; - return false; + return false; } std::size_t StringTokenizer::find(const std::string& token, std::size_t pos) const { - Iterator it = begin(); - Iterator stop = end(); - for (it += pos; it != stop; ++it) - if (*it == token) return it - begin(); + Iterator it = begin(); + Iterator stop = end(); + for (it += pos; it != stop; ++it) + if (*it == token) return it - begin(); - throw NotFoundException(token); + throw NotFoundException(token); } std::size_t StringTokenizer::replace(const std::string& oldToken, const std::string& newToken, std::size_t pos) { - std::size_t count = 0; - TokenVec::iterator it = _tokens.begin(); - TokenVec::iterator stop = _tokens.end(); - for (it += pos; it != stop; ++it) - { - if (*it == oldToken) - { - *it = newToken; - ++count; - } - } + std::size_t count = 0; + TokenVec::iterator it = _tokens.begin(); + TokenVec::iterator stop = _tokens.end(); + for (it += pos; it != stop; ++it) + { + if (*it == oldToken) + { + *it = newToken; + ++count; + } + } - return count; + return count; } std::size_t StringTokenizer::count(const std::string& token) const { - std::size_t cnt = 0; - Iterator it = begin(); - Iterator stop = end(); - for (; it != stop; ++it) - if (*it == token) ++cnt; + std::size_t cnt = 0; + Iterator it = begin(); + Iterator stop = end(); + for (; it != stop; ++it) + if (*it == token) ++cnt; - return cnt; + return cnt; } diff --git a/Foundation/src/SynchronizedObject.cpp b/Foundation/src/SynchronizedObject.cpp index ed4ec7cb9..04c1b8022 100644 --- a/Foundation/src/SynchronizedObject.cpp +++ b/Foundation/src/SynchronizedObject.cpp @@ -1,7 +1,7 @@ // // SynchronizedObject.cpp // -// $Id: //poco/svn/Foundation/src/SynchronizedObject.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SynchronizedObject.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/SyslogChannel.cpp b/Foundation/src/SyslogChannel.cpp index d539565d9..f29761259 100644 --- a/Foundation/src/SyslogChannel.cpp +++ b/Foundation/src/SyslogChannel.cpp @@ -1,7 +1,7 @@ // // SyslogChannel.cpp // -// $Id: //poco/svn/Foundation/src/SyslogChannel.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/SyslogChannel.cpp#1 $ // // Library: Foundation // Package: Logging diff --git a/Foundation/src/Task.cpp b/Foundation/src/Task.cpp index dcbc8c79d..c69bb75ec 100644 --- a/Foundation/src/Task.cpp +++ b/Foundation/src/Task.cpp @@ -1,7 +1,7 @@ // // Task.cpp // -// $Id: //poco/svn/Foundation/src/Task.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Task.cpp#1 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/src/TaskManager.cpp b/Foundation/src/TaskManager.cpp index c047e472a..23fb53f66 100644 --- a/Foundation/src/TaskManager.cpp +++ b/Foundation/src/TaskManager.cpp @@ -1,7 +1,7 @@ // // TaskManager.cpp // -// $Id: //poco/svn/Foundation/src/TaskManager.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TaskManager.cpp#1 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/src/TaskNotification.cpp b/Foundation/src/TaskNotification.cpp index db010039d..3fd83421c 100644 --- a/Foundation/src/TaskNotification.cpp +++ b/Foundation/src/TaskNotification.cpp @@ -1,7 +1,7 @@ // // TaskNotification.cpp // -// $Id: //poco/svn/Foundation/src/TaskNotification.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TaskNotification.cpp#1 $ // // Library: Foundation // Package: Tasks diff --git a/Foundation/src/TeeStream.cpp b/Foundation/src/TeeStream.cpp index ea77db3ac..b87ad8815 100644 --- a/Foundation/src/TeeStream.cpp +++ b/Foundation/src/TeeStream.cpp @@ -1,7 +1,7 @@ // // TeeStream.cpp // -// $Id: //poco/svn/Foundation/src/TeeStream.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TeeStream.cpp#1 $ // // Library: Foundation // Package: Streams diff --git a/Foundation/src/TemporaryFile.cpp b/Foundation/src/TemporaryFile.cpp index c378c577a..87a7455df 100644 --- a/Foundation/src/TemporaryFile.cpp +++ b/Foundation/src/TemporaryFile.cpp @@ -1,7 +1,7 @@ // // TemporaryFile.cpp // -// $Id: //poco/svn/Foundation/src/TemporaryFile.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TemporaryFile.cpp#3 $ // // Library: Foundation // Package: Filesystem @@ -86,15 +86,15 @@ private: TemporaryFile::TemporaryFile(): - File(tempName()), - _keep(false) + File(tempName()), + _keep(false) { } TemporaryFile::TemporaryFile(const std::string& tempDir): - File(tempName(tempDir)), - _keep(false) + File(tempName(tempDir)), + _keep(false) { } @@ -130,38 +130,38 @@ void TemporaryFile::keepUntilExit() namespace { - static TempFileCollector fc; + static TempFileCollector fc; } void TemporaryFile::registerForDeletion(const std::string& path) { - fc.registerFile(path); + fc.registerFile(path); } namespace { - static FastMutex mutex; + static FastMutex mutex; } std::string TemporaryFile::tempName(const std::string& tempDir) { - std::ostringstream name; - static unsigned long count = 0; - mutex.lock(); - unsigned long n = count++; - mutex.unlock(); - name << (tempDir.empty() ? Path::temp() : tempDir); + std::ostringstream name; + static unsigned long count = 0; + mutex.lock(); + unsigned long n = count++; + mutex.unlock(); + name << (tempDir.empty() ? Path::temp() : tempDir); #if defined(POCO_VXWORKS) - name << "tmp"; + name << "tmp"; #else - name << "tmp" << Process::id(); + name << "tmp" << Process::id(); #endif - for (int i = 0; i < 6; ++i) - { - name << char('a' + (n % 26)); + for (int i = 0; i < 6; ++i) + { + name << char('a' + (n % 26)); n /= 26; } return name.str(); diff --git a/Foundation/src/TextEncoding.cpp b/Foundation/src/TextEncoding.cpp index d333e1920..a19053008 100644 --- a/Foundation/src/TextEncoding.cpp +++ b/Foundation/src/TextEncoding.cpp @@ -1,7 +1,7 @@ // // TextEncoding.cpp // -// $Id: //poco/svn/Foundation/src/TextEncoding.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TextEncoding.cpp#1 $ // // Library: Foundation // Package: Text @@ -67,17 +67,17 @@ public: TextEncoding::Ptr pUtf8Encoding(new UTF8Encoding); add(pUtf8Encoding, TextEncoding::GLOBAL); - add(new ASCIIEncoding); - add(new Latin1Encoding); - add(new Latin2Encoding); - add(new Latin9Encoding); - add(pUtf8Encoding); - add(new UTF16Encoding); - add(new Windows1250Encoding); - add(new Windows1251Encoding); - add(new Windows1252Encoding); - } - + add(new ASCIIEncoding); + add(new Latin1Encoding); + add(new Latin2Encoding); + add(new Latin9Encoding); + add(pUtf8Encoding); + add(new UTF16Encoding); + add(new Windows1250Encoding); + add(new Windows1251Encoding); + add(new Windows1252Encoding); + } + ~TextEncodingManager() { } diff --git a/Foundation/src/TextIterator.cpp b/Foundation/src/TextIterator.cpp index 6e1953d47..09c8efded 100644 --- a/Foundation/src/TextIterator.cpp +++ b/Foundation/src/TextIterator.cpp @@ -1,7 +1,7 @@ // // TextIterator.cpp // -// $Id: //poco/svn/Foundation/src/TextIterator.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/TextIterator.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/ThreadLocal.cpp b/Foundation/src/ThreadLocal.cpp index 4c4bec3cc..d14b6c74a 100644 --- a/Foundation/src/ThreadLocal.cpp +++ b/Foundation/src/ThreadLocal.cpp @@ -1,7 +1,7 @@ // // ThreadLocal.cpp // -// $Id: //poco/svn/Foundation/src/ThreadLocal.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ThreadLocal.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/ThreadPool.cpp b/Foundation/src/ThreadPool.cpp index bcb58cd90..4164f80ce 100644 --- a/Foundation/src/ThreadPool.cpp +++ b/Foundation/src/ThreadPool.cpp @@ -1,7 +1,7 @@ // // ThreadPool.cpp // -// $Id: //poco/svn/Foundation/src/ThreadPool.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/ThreadPool.cpp#2 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Thread_POSIX.cpp b/Foundation/src/Thread_POSIX.cpp index 2c5875ec7..ce3edd395 100644 --- a/Foundation/src/Thread_POSIX.cpp +++ b/Foundation/src/Thread_POSIX.cpp @@ -1,7 +1,7 @@ // // Thread_POSIX.cpp // -// $Id: //poco/Main/Foundation/src/Thread_POSIX.cpp#20 $ +// $Id: //poco/1.4/Foundation/src/Thread_POSIX.cpp#5 $ // // Library: Foundation // Package: Threading @@ -161,15 +161,15 @@ void ThreadImpl::setStackSizeImpl(int size) { #if defined(__APPLE__) // we must round up to a multiple of the memory page size - const int PAGE_SIZE = 4096; - size = ((size + PAGE_SIZE - 1)/PAGE_SIZE)*PAGE_SIZE; + const int PAGE_SIZE = 4096; + size = ((size + PAGE_SIZE - 1)/PAGE_SIZE)*PAGE_SIZE; #endif #if !defined(POCO_ANDROID) - if (size < PTHREAD_STACK_MIN) - size = PTHREAD_STACK_MIN; + if (size < PTHREAD_STACK_MIN) + size = PTHREAD_STACK_MIN; #endif - } - _pData->stackSize = size; + } + _pData->stackSize = size; #endif } diff --git a/Foundation/src/Thread_WIN32.cpp b/Foundation/src/Thread_WIN32.cpp index a46f27d60..4af1a0109 100644 --- a/Foundation/src/Thread_WIN32.cpp +++ b/Foundation/src/Thread_WIN32.cpp @@ -1,7 +1,7 @@ // // Thread_WIN32.h // -// $Id: //poco/Main/Foundation/src/Thread_WIN32.cpp#17 $ +// $Id: //poco/1.4/Foundation/src/Thread_WIN32.cpp#4 $ // // Library: Foundation // Package: Threading @@ -141,12 +141,12 @@ void ThreadImpl::startImpl(Runnable& target) void ThreadImpl::startImpl(Callable target, void* pData) { - if (isRunningImpl()) - throw SystemException("thread already running"); + if (isRunningImpl()) + throw SystemException("thread already running"); - threadCleanup(); - _callbackTarget.callback = target; - _callbackTarget.pData = pData; + threadCleanup(); + _callbackTarget.callback = target; + _callbackTarget.pData = pData; createImpl(callableEntry, this); } diff --git a/Foundation/src/TimedNotificationQueue.cpp b/Foundation/src/TimedNotificationQueue.cpp index b617b13ca..ef83d2a6f 100644 --- a/Foundation/src/TimedNotificationQueue.cpp +++ b/Foundation/src/TimedNotificationQueue.cpp @@ -1,203 +1,203 @@ -// -// TimedNotificationQueue.cpp -// -// $Id: //poco/1.3/Foundation/src/TimedNotificationQueue.cpp#5 $ -// -// Library: Foundation -// Package: Notifications -// Module: TimedNotificationQueue -// -// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - - -#include "Poco/TimedNotificationQueue.h" -#include "Poco/Notification.h" -#include - - -namespace Poco { - - -TimedNotificationQueue::TimedNotificationQueue() -{ -} - - -TimedNotificationQueue::~TimedNotificationQueue() -{ - clear(); -} - - -void TimedNotificationQueue::enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp) -{ - poco_check_ptr (pNotification); - - FastMutex::ScopedLock lock(_mutex); - _nfQueue.insert(NfQueue::value_type(timestamp, pNotification)); - _nfAvailable.set(); -} - - -Notification* TimedNotificationQueue::dequeueNotification() -{ - FastMutex::ScopedLock lock(_mutex); - - NfQueue::iterator it = _nfQueue.begin(); - if (it != _nfQueue.end()) - { - Timestamp::TimeDiff sleep = -it->first.elapsed(); - if (sleep <= 0) - { - Notification::Ptr pNf = it->second; - _nfQueue.erase(it); - return pNf.duplicate(); - } - } - return 0; -} - - -Notification* TimedNotificationQueue::waitDequeueNotification() -{ - for (;;) - { - _mutex.lock(); - NfQueue::iterator it = _nfQueue.begin(); - if (it != _nfQueue.end()) - { - _mutex.unlock(); - Timestamp::TimeDiff sleep = -it->first.elapsed(); - if (sleep <= 0) - { - return dequeueOne(it).duplicate(); - } - else if (!wait(sleep)) - { - return dequeueOne(it).duplicate(); - } - else continue; - } - else - { - _mutex.unlock(); - } - _nfAvailable.wait(); - } -} - - -Notification* TimedNotificationQueue::waitDequeueNotification(long milliseconds) -{ - while (milliseconds >= 0) - { - _mutex.lock(); - NfQueue::iterator it = _nfQueue.begin(); - if (it != _nfQueue.end()) - { - _mutex.unlock(); - Poco::Timestamp now; - Timestamp::TimeDiff sleep = it->first - now; - if (sleep <= 0) - { - return dequeueOne(it).duplicate(); - } - else if (sleep <= 1000*Timestamp::TimeDiff(milliseconds)) - { - if (!wait(sleep)) - { - return dequeueOne(it).duplicate(); - } - else - { - milliseconds -= static_cast((now.elapsed() + 999)/1000); - continue; - } - } - } - else - { - _mutex.unlock(); - } - if (milliseconds > 0) - { - Poco::Timestamp now; - _nfAvailable.tryWait(milliseconds); - milliseconds -= static_cast((now.elapsed() + 999)/1000); - } - else return 0; - } - return 0; -} - - -bool TimedNotificationQueue::wait(Timestamp::TimeDiff interval) -{ - const Timestamp::TimeDiff MAX_SLEEP = 8*60*60*Timestamp::TimeDiff(1000000); // sleep at most 8 hours at a time - while (interval > 0) - { - Timestamp now; - Timestamp::TimeDiff sleep = interval <= MAX_SLEEP ? interval : MAX_SLEEP; - if (_nfAvailable.tryWait(static_cast((sleep + 999)/1000))) - return true; - interval -= now.elapsed(); - } - return false; -} - - -bool TimedNotificationQueue::empty() const -{ - FastMutex::ScopedLock lock(_mutex); - return _nfQueue.empty(); -} - - -int TimedNotificationQueue::size() const -{ - FastMutex::ScopedLock lock(_mutex); - return static_cast(_nfQueue.size()); -} - - -void TimedNotificationQueue::clear() -{ - FastMutex::ScopedLock lock(_mutex); - _nfQueue.clear(); -} - - -Notification::Ptr TimedNotificationQueue::dequeueOne(NfQueue::iterator& it) -{ - FastMutex::ScopedLock lock(_mutex); - Notification::Ptr pNf = it->second; - _nfQueue.erase(it); - return pNf; -} - - -} // namespace Poco +// +// TimedNotificationQueue.cpp +// +// $Id: //poco/1.4/Foundation/src/TimedNotificationQueue.cpp#1 $ +// +// Library: Foundation +// Package: Notifications +// Module: TimedNotificationQueue +// +// Copyright (c) 2009, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software, unless such copies or derivative +// works are solely in the form of machine-executable object code generated by +// a source language processor. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + + +#include "Poco/TimedNotificationQueue.h" +#include "Poco/Notification.h" +#include + + +namespace Poco { + + +TimedNotificationQueue::TimedNotificationQueue() +{ +} + + +TimedNotificationQueue::~TimedNotificationQueue() +{ + clear(); +} + + +void TimedNotificationQueue::enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp) +{ + poco_check_ptr (pNotification); + + FastMutex::ScopedLock lock(_mutex); + _nfQueue.insert(NfQueue::value_type(timestamp, pNotification)); + _nfAvailable.set(); +} + + +Notification* TimedNotificationQueue::dequeueNotification() +{ + FastMutex::ScopedLock lock(_mutex); + + NfQueue::iterator it = _nfQueue.begin(); + if (it != _nfQueue.end()) + { + Timestamp::TimeDiff sleep = -it->first.elapsed(); + if (sleep <= 0) + { + Notification::Ptr pNf = it->second; + _nfQueue.erase(it); + return pNf.duplicate(); + } + } + return 0; +} + + +Notification* TimedNotificationQueue::waitDequeueNotification() +{ + for (;;) + { + _mutex.lock(); + NfQueue::iterator it = _nfQueue.begin(); + if (it != _nfQueue.end()) + { + _mutex.unlock(); + Timestamp::TimeDiff sleep = -it->first.elapsed(); + if (sleep <= 0) + { + return dequeueOne(it).duplicate(); + } + else if (!wait(sleep)) + { + return dequeueOne(it).duplicate(); + } + else continue; + } + else + { + _mutex.unlock(); + } + _nfAvailable.wait(); + } +} + + +Notification* TimedNotificationQueue::waitDequeueNotification(long milliseconds) +{ + while (milliseconds >= 0) + { + _mutex.lock(); + NfQueue::iterator it = _nfQueue.begin(); + if (it != _nfQueue.end()) + { + _mutex.unlock(); + Poco::Timestamp now; + Timestamp::TimeDiff sleep = it->first - now; + if (sleep <= 0) + { + return dequeueOne(it).duplicate(); + } + else if (sleep <= 1000*Timestamp::TimeDiff(milliseconds)) + { + if (!wait(sleep)) + { + return dequeueOne(it).duplicate(); + } + else + { + milliseconds -= static_cast((now.elapsed() + 999)/1000); + continue; + } + } + } + else + { + _mutex.unlock(); + } + if (milliseconds > 0) + { + Poco::Timestamp now; + _nfAvailable.tryWait(milliseconds); + milliseconds -= static_cast((now.elapsed() + 999)/1000); + } + else return 0; + } + return 0; +} + + +bool TimedNotificationQueue::wait(Timestamp::TimeDiff interval) +{ + const Timestamp::TimeDiff MAX_SLEEP = 8*60*60*Timestamp::TimeDiff(1000000); // sleep at most 8 hours at a time + while (interval > 0) + { + Timestamp now; + Timestamp::TimeDiff sleep = interval <= MAX_SLEEP ? interval : MAX_SLEEP; + if (_nfAvailable.tryWait(static_cast((sleep + 999)/1000))) + return true; + interval -= now.elapsed(); + } + return false; +} + + +bool TimedNotificationQueue::empty() const +{ + FastMutex::ScopedLock lock(_mutex); + return _nfQueue.empty(); +} + + +int TimedNotificationQueue::size() const +{ + FastMutex::ScopedLock lock(_mutex); + return static_cast(_nfQueue.size()); +} + + +void TimedNotificationQueue::clear() +{ + FastMutex::ScopedLock lock(_mutex); + _nfQueue.clear(); +} + + +Notification::Ptr TimedNotificationQueue::dequeueOne(NfQueue::iterator& it) +{ + FastMutex::ScopedLock lock(_mutex); + Notification::Ptr pNf = it->second; + _nfQueue.erase(it); + return pNf; +} + + +} // namespace Poco diff --git a/Foundation/src/Timer.cpp b/Foundation/src/Timer.cpp index c592eed0a..113a2a3a5 100644 --- a/Foundation/src/Timer.cpp +++ b/Foundation/src/Timer.cpp @@ -1,7 +1,7 @@ // // Timer.cpp // -// $Id: //poco/Main/Foundation/src/Timer.cpp#15 $ +// $Id: //poco/1.4/Foundation/src/Timer.cpp#1 $ // // Library: Foundation // Package: Threading diff --git a/Foundation/src/Timespan.cpp b/Foundation/src/Timespan.cpp index 19404754e..2d573339d 100644 --- a/Foundation/src/Timespan.cpp +++ b/Foundation/src/Timespan.cpp @@ -1,7 +1,7 @@ // // Timespan.cpp // -// $Id: //poco/svn/Foundation/src/Timespan.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/Timespan.cpp#1 $ // // Library: Foundation // Package: DateTime diff --git a/Foundation/src/Timezone_UNIX.cpp b/Foundation/src/Timezone_UNIX.cpp index ce8cfaa99..001ebdbb8 100644 --- a/Foundation/src/Timezone_UNIX.cpp +++ b/Foundation/src/Timezone_UNIX.cpp @@ -1,7 +1,7 @@ // // Timezone_UNIX.cpp // -// $Id: //poco/1.4/Foundation/src/Timezone_UNIX.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/Timezone_UNIX.cpp#2 $ // // Library: Foundation // Package: DateTime @@ -49,13 +49,13 @@ public: { tzset(); } - - int timeZone() - { - #if defined(__APPLE__) || defined(__FreeBSD__) || defined(POCO_ANDROID) // no timezone global var - std::time_t now = std::time(NULL); - struct std::tm t; - gmtime_r(&now, &t); + + int timeZone() + { + #if defined(__APPLE__) || defined(__FreeBSD__) || defined(POCO_ANDROID) // no timezone global var + std::time_t now = std::time(NULL); + struct std::tm t; + gmtime_r(&now, &t); std::time_t utc = std::mktime(&t); return now - utc; #elif defined(__CYGWIN__) diff --git a/Foundation/src/Timezone_VX.cpp b/Foundation/src/Timezone_VX.cpp index 419f9c206..63d3b3ae3 100644 --- a/Foundation/src/Timezone_VX.cpp +++ b/Foundation/src/Timezone_VX.cpp @@ -1,7 +1,7 @@ // // Timezone_VXX.cpp // -// $Id: //poco/1.4/Foundation/src/Timezone_VX.cpp#1 $ +// $Id: //poco/1.4/Foundation/src/Timezone_VX.cpp#2 $ // // Library: Foundation // Package: DateTime @@ -55,11 +55,11 @@ int Timezone::utcOffset() int Timezone::dst() { - std::time_t now = std::time(NULL); - struct std::tm t; - if (localtime_r(&now, &t) != OK) - throw Poco::SystemException("cannot get local time DST offset"); - return t.tm_isdst == 1 ? 3600 : 0; + std::time_t now = std::time(NULL); + struct std::tm t; + if (localtime_r(&now, &t) != OK) + throw Poco::SystemException("cannot get local time DST offset"); + return t.tm_isdst == 1 ? 3600 : 0; } diff --git a/Foundation/src/URI.cpp b/Foundation/src/URI.cpp index e6a135ab9..cb30ca429 100644 --- a/Foundation/src/URI.cpp +++ b/Foundation/src/URI.cpp @@ -1,7 +1,7 @@ // // URI.cpp // -// $Id: //poco/1.4/Foundation/src/URI.cpp#4 $ +// $Id: //poco/1.4/Foundation/src/URI.cpp#5 $ // // Library: Foundation // Package: URI @@ -226,16 +226,16 @@ std::string URI::toString() const if (!_path.empty()) { if (!auth.empty() && _path[0] != '/') - uri += '/'; - encode(_path, RESERVED_PATH, uri); - } - else if (!_query.empty() || !_fragment.empty()) - { - uri += '/'; - } - } - if (!_query.empty()) - { + uri += '/'; + encode(_path, RESERVED_PATH, uri); + } + else if (!_query.empty() || !_fragment.empty()) + { + uri += '/'; + } + } + if (!_query.empty()) + { uri += '?'; uri.append(_query); } @@ -290,19 +290,19 @@ std::string URI::getAuthority() const std::string auth; if (!_userInfo.empty()) { - auth.append(_userInfo); - auth += '@'; - } - if (_host.find(':') != std::string::npos) - { - auth += '['; - auth += _host; - auth += ']'; - } - else auth.append(_host); - if (_port && !isWellKnownPort()) - { - auth += ':'; + auth.append(_userInfo); + auth += '@'; + } + if (_host.find(':') != std::string::npos) + { + auth += '['; + auth += _host; + auth += ']'; + } + else auth.append(_host); + if (_port && !isWellKnownPort()) + { + auth += ':'; NumberFormatter::append(auth, _port); } return auth; @@ -370,13 +370,13 @@ std::string URI::getPathEtc() const { std::string pathEtc; encode(_path, RESERVED_PATH, pathEtc); - if (!_query.empty()) - { - pathEtc += '?'; - pathEtc += _query; - } - if (!_fragment.empty()) - { + if (!_query.empty()) + { + pathEtc += '?'; + pathEtc += _query; + } + if (!_fragment.empty()) + { pathEtc += '#'; encode(_fragment, RESERVED_FRAGMENT, pathEtc); } @@ -388,12 +388,12 @@ std::string URI::getPathAndQuery() const { std::string pathAndQuery; encode(_path, RESERVED_PATH, pathAndQuery); - if (!_query.empty()) - { - pathAndQuery += '?'; - pathAndQuery += _query; - } - return pathAndQuery; + if (!_query.empty()) + { + pathAndQuery += '?'; + pathAndQuery += _query; + } + return pathAndQuery; } @@ -448,8 +448,8 @@ void URI::resolve(const URI& relativeURI) _query = relativeURI._query; } } - } - _fragment = relativeURI._fragment; + } + _fragment = relativeURI._fragment; } @@ -574,15 +574,15 @@ void URI::getPathSegments(const std::string& path, std::vector& seg void URI::encode(const std::string& str, const std::string& reserved, std::string& encodedStr) { - for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) - { - char c = *it; - if ((c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - c == '-' || c == '_' || - c == '.' || c == '~') - { + for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) + { + char c = *it; + if ((c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + c == '-' || c == '_' || + c == '.' || c == '~') + { encodedStr += c; } else if (c <= 0x20 || c >= 0x7F || ILLEGAL.find(c) != std::string::npos || reserved.find(c) != std::string::npos) @@ -648,19 +648,19 @@ unsigned short URI::getWellKnownPort() const else if (_scheme == "nntp") return 119; else if (_scheme == "ldap") - return 389; - else if (_scheme == "https") - return 443; - else if (_scheme == "rtsp") - return 554; - else if (_scheme == "sip") - return 5060; - else if (_scheme == "sips") - return 5061; - else if (_scheme == "xmpp") - return 5222; - else - return 0; + return 389; + else if (_scheme == "https") + return 443; + else if (_scheme == "rtsp") + return 554; + else if (_scheme == "sip") + return 5060; + else if (_scheme == "sips") + return 5061; + else if (_scheme == "xmpp") + return 5222; + else + return 0; } @@ -725,16 +725,16 @@ void URI::parseHostAndPort(std::string::const_iterator& it, const std::string::c { if (it == end) return; std::string host; - if (*it == '[') - { - // IPv6 address - ++it; - while (it != end && *it != ']') host += *it++; - if (it == end) throw SyntaxException("unterminated IPv6 address"); - ++it; - } - else - { + if (*it == '[') + { + // IPv6 address + ++it; + while (it != end && *it != ']') host += *it++; + if (it == end) throw SyntaxException("unterminated IPv6 address"); + ++it; + } + else + { while (it != end && *it != ':') host += *it++; } if (it != end && *it == ':') @@ -810,14 +810,14 @@ void URI::mergePath(const std::string& path) bool endsWithSlash = *(_path.rbegin()) == '/'; if (!endsWithSlash && !segments.empty()) segments.pop_back(); - addLeadingSlash = _path[0] == '/'; - } - getPathSegments(path, segments); - addLeadingSlash = addLeadingSlash || (!path.empty() && path[0] == '/'); - bool hasTrailingSlash = (!path.empty() && *(path.rbegin()) == '/'); - bool addTrailingSlash = false; - for (std::vector::const_iterator it = segments.begin(); it != segments.end(); ++it) - { + addLeadingSlash = _path[0] == '/'; + } + getPathSegments(path, segments); + addLeadingSlash = addLeadingSlash || (!path.empty() && path[0] == '/'); + bool hasTrailingSlash = (!path.empty() && *(path.rbegin()) == '/'); + bool addTrailingSlash = false; + for (std::vector::const_iterator it = segments.begin(); it != segments.end(); ++it) + { if (*it == "..") { addTrailingSlash = true; diff --git a/Foundation/src/URIStreamFactory.cpp b/Foundation/src/URIStreamFactory.cpp index bd0125152..a323e75a8 100644 --- a/Foundation/src/URIStreamFactory.cpp +++ b/Foundation/src/URIStreamFactory.cpp @@ -1,7 +1,7 @@ // // URIStreamFactory.cpp // -// $Id: //poco/svn/Foundation/src/URIStreamFactory.cpp#3 $ +// $Id: //poco/1.4/Foundation/src/URIStreamFactory.cpp#1 $ // // Library: Foundation // Package: URI diff --git a/Foundation/src/UTF16Encoding.cpp b/Foundation/src/UTF16Encoding.cpp index 49e7ec3f3..eaddddf80 100644 --- a/Foundation/src/UTF16Encoding.cpp +++ b/Foundation/src/UTF16Encoding.cpp @@ -1,7 +1,7 @@ // // UTF16Encoding.cpp // -// $Id: //poco/svn/Foundation/src/UTF16Encoding.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/UTF16Encoding.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/UTF8Encoding.cpp b/Foundation/src/UTF8Encoding.cpp index e9d519870..fc4a53a55 100644 --- a/Foundation/src/UTF8Encoding.cpp +++ b/Foundation/src/UTF8Encoding.cpp @@ -1,7 +1,7 @@ // // UTF8Encoding.cpp // -// $Id: //poco/svn/Foundation/src/UTF8Encoding.cpp#2 $ +// $Id: //poco/1.4/Foundation/src/UTF8Encoding.cpp#1 $ // // Library: Foundation // Package: Text diff --git a/Foundation/src/UUID.cpp b/Foundation/src/UUID.cpp index aa8b210f1..9d7af1cd3 100644 --- a/Foundation/src/UUID.cpp +++ b/Foundation/src/UUID.cpp @@ -1,7 +1,7 @@ // // UUID.cpp // -// $Id: //poco/1.3/Foundation/src/UUID.cpp#4 $ +// $Id: //poco/1.4/Foundation/src/UUID.cpp#1 $ // // Library: Foundation // Package: UUID diff --git a/Foundation/src/Unicode.cpp b/Foundation/src/Unicode.cpp index 113b11ff5..5b9e5ef3c 100644 --- a/Foundation/src/Unicode.cpp +++ b/Foundation/src/Unicode.cpp @@ -1,77 +1,77 @@ -// -// Unicode.cpp -// -// $Id: //poco/1.3/Foundation/src/Unicode.cpp#2 $ -// -// Library: Foundation -// Package: Text -// Module: Unicode -// -// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// - - -#include "Poco/Unicode.h" - - -extern "C" -{ -#include "pcre_config.h" -#include "pcre_internal.h" -} - - -namespace Poco { - - -void Unicode::properties(int ch, CharacterProperties& props) -{ - const ucd_record* ucd = GET_UCD(ch); - props.category = static_cast(_pcre_ucp_gentype[ucd->chartype]); - props.type = static_cast(ucd->chartype); - props.script = static_cast