latest changes from main repository; added eclipse cdt project files

This commit is contained in:
Guenter Obiltschnig 2007-04-29 14:25:52 +00:00
parent d740264009
commit a8990dca3f
11 changed files with 261 additions and 26 deletions

View File

@ -1,6 +1,6 @@
This is the changelog file for the POCO C++ Libraries.
Release 1.3-20070418 (2007-04-18)
Release 1.3-20070429 (2007-04-29)
=================================
- added HashMap, HashSet classes
@ -27,6 +27,17 @@ Release 1.3-20070418 (2007-04-18)
- Void now has a == and != operator
- Base64Encoder and HexBinaryEncoder now support an unlimited line length
(no newlines written), by specifying a line length of 0
- NumberParser now has stricter syntax requirements: garbage following a number leads to a SyntaxException
(Thanks to phireis@gmail.com for the suggestion)
- fixed SF# 1676830: Don't use -rpath in libraries
- fixed SF# 1670279: AbstractConfiguration::unckeckedExpand crash
- fixed a warning in Hashtable
- HTTPClientSession now uses a keepAliveTimeout for better persistent connection handling
- added DateTime::makeUTC() and DateTime::makeLocal()
- added another constructor to LocalDateTime
- POCO_WIN32_UTF8 is ignored on non-Windows platforms
- fixed a timeout bug (with NetSSL) in HTTPSession
- AsyncChannel is automatically opened with first log()\
- minor fix to NotificationQueue sample (reported by Laszlo Keresztfalvi)
- added File::canExecute() and File::setExecutable()
- added SharedMemory class to Foundation
@ -40,22 +51,25 @@ Release 1.3-20070418 (2007-04-18)
- replaced std::fstream with Poco::FileStream across POCO.
- added Poco::Checksum class to Foundation.
- fixed SF# 1700811: conflict in threadpool
Release 1.2.9b (2007-03-25)
===========================
- NumberParser now has stricter syntax requirements: garbage following a number leads to a SyntaxException
(Thanks to phireis@gmail.com for the suggestion)
- fixed SF# 1676830: Don't use -rpath in libraries
- fixed SF# 1670279: AbstractConfiguration::unckeckedExpand crash
- fixed a warning in Hashtable
- HTTPClientSession now uses a keepAliveTimeout for better persistent connection handling
- added DateTime::makeUTC() and DateTime::makeLocal()
- added another constructor to LocalDateTime
- POCO_WIN32_UTF8 is ignored on non-Windows platforms
- fixed a timeout bug (with NetSSL) in HTTPSession
- AsyncChannel is automatically opened with first log()\
- bugfix: File::moveTo() does not work if the target is a directory
- File::copyTo() and File::moveTo() now copy/move directories recursively
- refactored NetworkInterface (now using pimpl idiom);
added broadcast address and netmask support
- fixed SF# 1688982: POP3ClientSession fails when retrieving mails with attachment
- fixed SF# 1655104: Enhance Poco::TextEncoding functionality
- added Poco::Condition class, implementing a POSIX-style condition variable
- fixed a bug in File::create() for Windows
- added poco_static_assert (imported from boost)
- added Thread::join(timeout) and Thread::tryJoin()
- ClassLoader support for named manifests (see ClassLibrary.h - POCO_EXPORT_NAMED_MANIFEST)
- POCO_WIN32_UTF8: UNICODE #define is no longer required (and no longer
automatically defined in POCO_WIN32_UTF8 is defined)
- PCRE: upgraded to PCRE version 7.1
- fixed SF# 1682162: Suggestion on thread priority
- fixed SF# 1613460: MSVC/STLPort warnings
- fixed SF# 1709358: Format double percent std::String bug
- added WindowsConsoleChannel class to Foundation
- added AutoPtr::unsafeCast<>() and SharedPtr::unsafeCast<>()
Release 1.2.9 (2007-02-26)
@ -702,4 +716,4 @@ building the libraries.
--
$Id: //poco/Main/dist/CHANGELOG#47 $
$Id: //poco/Main/dist/CHANGELOG#51 $

View File

@ -1972,6 +1972,9 @@
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\WindowsConsoleChannel.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
@ -2063,6 +2066,9 @@
<File
RelativePath=".\include\Poco\SyslogChannel.h">
</File>
<File
RelativePath=".\include\Poco\WindowsConsoleChannel.h">
</File>
</Filter>
<Filter
Name="Message Files"

View File

@ -2563,6 +2563,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\WindowsConsoleChannel.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
@ -2683,6 +2687,10 @@
RelativePath=".\include\Poco\SyslogChannel.h"
>
</File>
<File
RelativePath=".\include\Poco\WindowsConsoleChannel.h"
>
</File>
</Filter>
<Filter
Name="Message Files"

View File

@ -1,7 +1,7 @@
//
// AutoPtr.h
//
// $Id: //poco/Main/Foundation/include/Poco/AutoPtr.h#6 $
// $Id: //poco/Main/Foundation/include/Poco/AutoPtr.h#7 $
//
// Library: Foundation
// Package: Core
@ -190,6 +190,18 @@ public:
return AutoPtr<Other>(pOther, true);
}
template <class Other>
AutoPtr<Other> unsafeCast() const
/// Casts the AutoPtr via a static cast to the given type.
/// Example: (assume class Sub: public Super)
/// AutoPtr<Super> super(new Sub());
/// AutoPtr<Sub> sub = super.unsafeCast<Sub>();
/// poco_assert (sub.get());
{
Other* pOther = static_cast<Other*>(_ptr);
return AutoPtr<Other>(pOther, true);
}
C* operator -> ()
{
if (_ptr)

View File

@ -1,7 +1,7 @@
//
// ClassLibrary.h
//
// $Id: //poco/Main/Foundation/include/Poco/ClassLibrary.h#4 $
// $Id: //poco/Main/Foundation/include/Poco/ClassLibrary.h#5 $
//
// Library: Foundation
// Package: SharedLibrary
@ -53,7 +53,7 @@
//
// the entry point for every class library
// the entry points for every class library
//
extern "C"
{
@ -100,7 +100,8 @@ extern "C" \
POCO_BEGIN_MANIFEST_IMPL(pocoBuildManifest, base)
#define POCO_BEGIN_NAMED_MANIFEST(name, base) \
#define POCO_BEGIN_NAMED_MANIFEST(name, base) \
POCO_DECLARE_NAMED_MANIFEST(name) \
POCO_BEGIN_MANIFEST_IMPL(POCO_JOIN(pocoBuildManifest, name), base)

View File

@ -1,7 +1,7 @@
//
// SharedPtr.h
//
// $Id: //poco/Main/Foundation/include/Poco/SharedPtr.h#10 $
// $Id: //poco/Main/Foundation/include/Poco/SharedPtr.h#11 $
//
// Library: Foundation
// Package: Core
@ -198,6 +198,18 @@ public:
return SharedPtr<Other>();
}
template <class Other>
SharedPtr<Other> unsafeCast() const
/// Casts the SharedPtr via a static cast to the given type.
/// Example: (assume class Sub: public Super)
/// SharedPtr<Super> super(new Sub());
/// SharedPtr<Sub> sub = super.unsafeCast<Sub>();
/// poco_assert (sub.get());
{
Other* pOther = static_cast<Other*>(_ptr);
return SharedPtr<Other>(_pCounter, pOther);
}
C* operator -> ()
{
return deref();

View File

@ -0,0 +1,89 @@
//
// WindowsConsoleChannel.h
//
// $Id: //poco/Main/Foundation/include/Poco/WindowsConsoleChannel.h#1 $
//
// Library: Foundation
// Package: Logging
// Module: WindowsConsoleChannel
//
// Definition of the WindowsConsoleChannel class.
//
// 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.
//
#ifndef Foundation_WindowsConsoleChannel_INCLUDED
#define Foundation_WindowsConsoleChannel_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Channel.h"
#include "Poco/Mutex.h"
#include <windows.h>
namespace Poco {
class Foundation_API WindowsConsoleChannel: public Channel
/// A channel that writes to the Windows console.
///
/// Only the message's text is written, followed
/// by a newline.
///
/// If POCO has been compiled with POCO_WIN32_UTF8,
/// log messages are assumed to be UTF-8 encoded, and
/// are converted to UTF-16 prior to writing them to the
/// console. This is the main difference to the ConsoleChannel
/// class, which cannot handle UTF-8 encoded messages on Windows.
///
/// Chain this channel to a FormattingChannel with an
/// appropriate Formatter to control what is contained
/// in the text.
///
/// Only available on Windows platforms.
{
public:
WindowsConsoleChannel();
/// Creates the WindowsConsoleChannel.
void log(const Message& msg);
/// Logs the given message to the channel's stream.
protected:
~WindowsConsoleChannel();
private:
HANDLE _hConsole;
bool _isFile;
};
} // namespace Poco
#endif // Foundation_WindowsConsoleChannel_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Format.cpp
//
// $Id: //poco/Main/Foundation/src/Format.cpp#7 $
// $Id: //poco/Main/Foundation/src/Format.cpp#8 $
//
// Library: Foundation
// Package: Core

View File

@ -1,7 +1,7 @@
//
// LoggingFactory.cpp
//
// $Id: //poco/Main/Foundation/src/LoggingFactory.cpp#7 $
// $Id: //poco/Main/Foundation/src/LoggingFactory.cpp#8 $
//
// Library: Foundation
// Package: Logging
@ -50,6 +50,7 @@
#endif
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/EventLogChannel.h"
#include "Poco/WindowsConsoleChannel.h"
#endif
#include "Poco/PatternFormatter.h"
@ -102,7 +103,11 @@ LoggingFactory& LoggingFactory::defaultFactory()
void LoggingFactory::registerBuiltins()
{
_channelFactory.registerClass("AsyncChannel", new Instantiator<AsyncChannel, Channel>);
#if defined(POCO_OS_FAMILY_WINDOWS)
_channelFactory.registerClass("ConsoleChannel", new Instantiator<WindowsConsoleChannel, Channel>);
#else
_channelFactory.registerClass("ConsoleChannel", new Instantiator<ConsoleChannel, Channel>);
#endif
_channelFactory.registerClass("FileChannel", new Instantiator<FileChannel, Channel>);
_channelFactory.registerClass("FormattingChannel", new Instantiator<FormattingChannel, Channel>);
_channelFactory.registerClass("SplitterChannel", new Instantiator<SplitterChannel, Channel>);

View File

@ -0,0 +1,88 @@
//
// WindowsConsoleChannel.cpp
//
// $Id: //poco/Main/Foundation/src/WindowsConsoleChannel.cpp#1 $
//
// Library: Foundation
// Package: Logging
// Module: WindowsConsoleChannel
//
// 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/WindowsConsoleChannel.h"
#include "Poco/Message.h"
#if defined(POCO_WIN32_UTF8)
#include "Poco/UnicodeConverter.h"
#endif
namespace Poco {
WindowsConsoleChannel::WindowsConsoleChannel():
_isFile(false),
_hConsole(INVALID_HANDLE_VALUE)
{
_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// check whether the console has been redirected
DWORD mode;
_isFile = (GetConsoleMode(_hConsole, &mode) == 0);
}
WindowsConsoleChannel::~WindowsConsoleChannel()
{
}
void WindowsConsoleChannel::log(const Message& msg)
{
std::string text = msg.getText();
text += "\r\n";
#if defined(POCO_WIN32_UTF8)
if (_isFile)
{
DWORD written;
WriteFile(_hConsole, text.data(), text.size(), &written, NULL);
}
else
{
std::wstring utext;
UnicodeConverter::toUTF16(text, utext);
DWORD written;
WriteConsoleW(_hConsole, utext.data(), utext.size(), &written, NULL);
}
#else
DWORD written;
WriteFile(_hConsole, text.data(), text.size(), &written, NULL);
#endif
}
} // namespace Poco

View File

@ -1,7 +1,7 @@
//
// FormatTest.cpp
//
// $Id: //poco/Main/Foundation/testsuite/src/FormatTest.cpp#6 $
// $Id: //poco/Main/Foundation/testsuite/src/FormatTest.cpp#7 $
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// All rights reserved.