You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(622) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(303) |
Feb
(64) |
Mar
(5) |
Apr
(63) |
May
(82) |
Jun
(53) |
Jul
(50) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Christian P. <cp...@us...> - 2005-01-10 13:05:10
|
Update of /cvsroot/pclasses/pclasses2/plugins/LogTarget In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15363/plugins/LogTarget Added Files: Makefile.am Log Message: Added plugins subdirs. Added ConsoleLogTarget plugin. --- NEW FILE: Makefile.am --- SUBDIRS = Console |
From: Christian P. <cp...@us...> - 2005-01-10 13:02:18
|
Update of /cvsroot/pclasses/pclasses2/plugins/LogTarget/Console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14917/plugins/LogTarget/Console Log Message: Directory /cvsroot/pclasses/pclasses2/plugins/LogTarget/Console added to the repository |
From: Christian P. <cp...@us...> - 2005-01-10 13:02:05
|
Update of /cvsroot/pclasses/pclasses2/plugins/LogTarget In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14825/plugins/LogTarget Log Message: Directory /cvsroot/pclasses/pclasses2/plugins/LogTarget added to the repository |
From: Christian P. <cp...@us...> - 2005-01-10 13:01:37
|
Update of /cvsroot/pclasses/pclasses2/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14758/plugins Log Message: Directory /cvsroot/pclasses/pclasses2/plugins added to the repository |
From: Christian P. <cp...@us...> - 2005-01-10 13:01:09
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14506/include/pclasses Modified Files: Factory.h Log Message: Added some NamedTypeFactory / Plugin registering helper macros Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Factory.h 10 Jan 2005 02:41:37 -0000 1.18 +++ Factory.h 10 Jan 2005 13:00:56 -0000 1.19 @@ -458,6 +458,19 @@ virtual ~NamedTypeFactory(){} }; + /* + Two helper macros to register types with the plugin manager... + added by cproch + */ + + //! Register type with NamedTypeFactory + #define NAMEDTYPEFACTORY_REGISTER_TYPE(b, c) \ + P::NamedTypeFactory<b>::instance().registerType(#c, c()) + + //! Register type-alias with NamedTypeFactory + #define NAMEDTYPEFACTORY_REGISTER_ALIAS(b, n, c) \ + P::NamedTypeFactory<b>::instance().registerType(n, c()) + /** The CL namespace encapsulates P's classloader-related API. |
From: Christian P. <cp...@us...> - 2005-01-10 13:01:09
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14506/include/pclasses/Plugin Modified Files: Plugin.h Log Message: Added some NamedTypeFactory / Plugin registering helper macros Index: Plugin.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Plugin/Plugin.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Plugin.h 26 Dec 2004 06:01:52 -0000 1.12 +++ Plugin.h 10 Jan 2005 13:00:56 -0000 1.13 @@ -307,6 +307,30 @@ } // namespace Plugin +/* + The following two macros make plugin-developers life much easier ;-) + added by cproch +*/ + +//! Registers a type in the NamedTypeFactory on static initialization +/*! + \param b Basetype of the type to be registered + \param t Type to register +*/ +#define PLUGIN_REGISTER_TYPE(b, t) \ + void t##_Factory_init() { NAMEDTYPEFACTORY_REGISTER_TYPE(b, t); } \ + int t##_Factory_init_placeholder = ( t##_Factory_init(), 0 ); + +//! Registers a alias of a type in the NamedTypeFactory on static initialization +/*! + \param b Basetype of the type to be registered + \param a Type alias + \param t Type to register +*/ +#define PLUGIN_REGISTER_ALIAS(b, a, t) \ + void t##_Factory_init_##a() { NAMEDTYPEFACTORY_REGISTER_ALIAS(b, #a, t); } \ + int t##_Factory_init_placeholder_##a = ( t##_Factory_init_##a(), 0 ); + #ifndef PCLASSES_ENABLE_PLUGINS_FACTORY_HOOK # define PCLASSES_ENABLE_PLUGINS_FACTORY_HOOK 0 |
From: Christian P. <cp...@us...> - 2005-01-10 12:58:22
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13733/include/pclasses/Util Modified Files: StringTool.h Log Message: Made upperCase(), lowerCase() honor the global locale Added upperCase(), lowerCase() taking a locale Added faster versions of trimString() (trimLeft(), trimRight(), trim()) Index: StringTool.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/StringTool.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- StringTool.h 10 Jan 2005 02:36:16 -0000 1.6 +++ StringTool.h 10 Jan 2005 12:58:05 -0000 1.7 @@ -353,12 +353,33 @@ size_t expandDollarRefsInline( std::string & buffer, const EntityMap & src ); -//! Returns a copy of the string converted to uppercase letters +//! Strip leading white-speaces +void trimLeft(std::string& str); + +//! Strip trailing white-spaces +void trimRight(std::string& str); + +//! Strip leading and trailing white-spaces +void trim(std::string& str); + +//! Returns the string converted to uppercase letters std::string upperCase(const std::string& str); -//! Returns a copy of the string converted to lowercase letters +//! Returns the string converted to uppercase letters +/*! + Uses the given locale to do the conversion. +*/ +std::string upperCase(const std::string& str, const std::locale& loc); + +//! Returns the string converted to lowercase letters std::string lowerCase(const std::string& str); +//! Returns the string converted to lowercase letters +/*! + Uses the given locale to do the conversion. +*/ +std::string lowerCase(const std::string& str, const std::locale& loc); + }} // namespace P::StringTool |
From: Christian P. <cp...@us...> - 2005-01-10 12:58:18
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13733/src/Util Modified Files: StringTool.cpp Log Message: Made upperCase(), lowerCase() honor the global locale Added upperCase(), lowerCase() taking a locale Added faster versions of trimString() (trimLeft(), trimRight(), trim()) Index: StringTool.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/StringTool.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- StringTool.cpp 10 Jan 2005 02:36:15 -0000 1.8 +++ StringTool.cpp 10 Jan 2005 12:58:05 -0000 1.9 @@ -354,27 +354,75 @@ */ struct ToUpperTransform { - char operator() (char c) const { return std::toupper(c); } + const std::locale& _locale; + + ToUpperTransform(const std::locale& loc) + : _locale(loc) { } + + char operator() (char c) const { return std::toupper(c, _locale); } }; -std::string upperCase(const std::string& str) +std::string upperCase(const std::string& str, const std::locale& loc) { - std::string ret = str; - std::transform(ret.begin(), ret.end(), ret.begin(), ToUpperTransform()); + ToUpperTransform upper(loc); + std::string ret; + ret.resize(str.size()); + std::transform(str.begin(), str.end(), ret.begin(), upper); return ret; } +std::string upperCase(const std::string& str) +{ + return upperCase(str, std::locale()); +} + struct ToLowerTransform { - char operator() (char c) const { return std::tolower(c); } + const std::locale& _locale; + + ToLowerTransform(const std::locale& loc) + : _locale(loc) { } + + char operator() (char c) const { return std::tolower(c, _locale); } }; -std::string lowerCase(const std::string& str) +std::string lowerCase(const std::string& str, const std::locale& loc) { - std::string ret = str; - std::transform(ret.begin(), ret.end(), ret.begin(), ToLowerTransform()); + ToLowerTransform lower(loc); + std::string ret; + ret.resize(str.size()); + std::transform(str.begin(), str.end(), ret.begin(), lower); return ret; } + +std::string lowerCase(const std::string& str) +{ + return lowerCase(str, std::locale()); +} + +/* + I know ... we already have trimString() in here ... but i don't like + trimString()'s implementation. cproch +*/ + +void trimLeft(std::string& str) +{ + std::string::size_type nw = str.find_first_not_of(" \t\n\r"); + str.erase(0, nw); +} +void trimRight(std::string& str) +{ + std::string::size_type nw = str.find_last_not_of(" \t\n\r"); + str.erase(nw+1); +} + +void trim(std::string str) +{ + trimLeft(str); + trimRight(str); +} + + }} // P::StringTool |
From: Christian P. <cp...@us...> - 2005-01-10 02:55:13
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25507 Modified Files: configure.in Log Message: Added App subdirs Index: configure.in =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.in 23 Dec 2004 04:32:13 -0000 1.2 +++ configure.in 10 Jan 2005 02:54:48 -0000 1.3 @@ -168,6 +168,14 @@ AM_CONDITIONAL(WITH_POSIX_IO, true) AM_CONDITIONAL(WITH_WIN32_IO, false) + +dnl +dnl check for time support +dnl + +AM_CONDITIONAL(WITH_POSIX_TIME, true) +AM_CONDITIONAL(WITH_WIN32_TIME, false) + dnl dnl build with stl support? dnl @@ -198,12 +206,14 @@ include/pclasses/System/Makefile \ include/pclasses/Net/Makefile \ include/pclasses/Util/Makefile \ + include/pclasses/App/Makefile \ src/Makefile \ src/Unicode/Makefile \ src/IO/Makefile \ src/System/Makefile \ src/Net/Makefile \ src/Util/Makefile \ + src/App/Makefile \ test/Makefile \ m4/Makefile) |
From: Christian P. <cp...@us...> - 2005-01-10 02:51:30
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24799/include/pclasses Modified Files: Makefile.am Log Message: Added missing App subdir. Added Trace.h. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 6 Jan 2005 17:03:02 -0000 1.4 +++ Makefile.am 10 Jan 2005 02:51:21 -0000 1.5 @@ -1,4 +1,4 @@ -SUBDIRS = Unicode IO System Net Util +SUBDIRS = Unicode IO System Net Util App INCLUDES = METASOURCES = AUTO pkginclude_HEADERS = Exception.h IntTypes.h ScopedArrayPtr.h ScopedPtr.h \ @@ -6,4 +6,5 @@ ByteOrderTraits.h BasicTypes.h Vector.h Algorithm.h TypeTraits.h \ Stack.h LinkedItem.h Pair.h IntTypeLimits.h Queue.h IntrusivePtr.h \ CircularQueue.h List.h NonCopyable.h Phoenix.h Factory.h \ - Time.h Date.h DateTime.h TimeSpan.h Callback.h Signal.h + Time.h Date.h DateTime.h TimeSpan.h Callback.h Signal.h \ + Trace.h |
From: Christian P. <cp...@us...> - 2005-01-10 02:49:49
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24325/src Modified Files: Makefile.am Log Message: Added missing App subdir. Added Trace.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 27 Dec 2004 07:07:20 -0000 1.3 +++ Makefile.am 10 Jan 2005 02:49:40 -0000 1.4 @@ -8,6 +8,6 @@ lib_LTLIBRARIES = libpclasses.la libpclasses_la_SOURCES = Alloc.cpp Exception.cpp AtomicInt.gcc-x86.cpp \ ByteOrderTraits.cpp LinkedItem.cpp Time.cpp Date.cpp DateTime.cpp \ - TimeSpan.cpp + TimeSpan.cpp Trace.cpp -SUBDIRS = . Unicode IO System Net Util +SUBDIRS = . Unicode IO System Net Util App |
From: Christian P. <cp...@us...> - 2005-01-10 02:48:46
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24012/src Added Files: Trace.cpp Log Message: Add Trace support --- NEW FILE: Trace.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ |
From: Christian P. <cp...@us...> - 2005-01-10 02:48:46
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24012/include/pclasses Added Files: Trace.h Log Message: Add Trace support --- NEW FILE: Trace.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_Trace_h #define P_Trace_h namespace P { } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2005-01-10 02:48:05
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23772/src/IO Modified Files: Makefile.am Log Message: Added StringDevice.cpp. Fixed dependencies in Makefile.am: IO depends on Unicode. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 6 Jan 2005 19:22:24 -0000 1.6 +++ Makefile.am 10 Jan 2005 02:47:55 -0000 1.7 @@ -2,5 +2,5 @@ METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_io.la -libpclasses_io_la_SOURCES = IOError.cpp IODevice.cpp IOStream.cpp IOFilter.cpp URL.cpp ZLib.cpp ZLibIOFilter.cpp BZip2.cpp BZip2IOFilter.cpp -libpclasses_io_la_LIBADD = $(top_builddir)/src/libpclasses.la -lz -lbz2 +libpclasses_io_la_SOURCES = IOError.cpp IODevice.cpp IOStream.cpp IOFilter.cpp URL.cpp ZLib.cpp ZLibIOFilter.cpp BZip2.cpp BZip2IOFilter.cpp StringDevice.cpp +libpclasses_io_la_LIBADD = $(top_builddir)/src/libpclasses.la -lz -lbz2 $(top_builddir)/src/Unicode/libpclasses_unicode.la |
From: Christian P. <cp...@us...> - 2005-01-10 02:46:30
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23340/src/IO Modified Files: ZLibIOFilter.cpp Log Message: Fixed ZLibIOFilter exception handling. IOFilter's are only allowed to throw IOError's. Index: ZLibIOFilter.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/ZLibIOFilter.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ZLibIOFilter.cpp 6 Jan 2005 19:23:13 -0000 1.3 +++ ZLibIOFilter.cpp 10 Jan 2005 02:46:21 -0000 1.4 @@ -19,6 +19,7 @@ ***************************************************************************/ #include <pclasses/IO/ZLibIOFilter.h> +#include <errno.h> namespace P { @@ -86,23 +87,32 @@ return IOFilter::eof(); } -size_t ZLibIOFilter::read(char* buffer, size_t count) throw(IO::IOError) +size_t ZLibIOFilter::read(char* buffer, size_t count) throw(IOError) { if(!_strmIn) - _strmIn = new P::IO::ZLibInputStream(); + _strmIn = new ZLibInputStream(); if(_strmIn->bytesAvail() < count) { // refill output buffer ... char tmp[1024]; size_t got = IOFilter::read(tmp, sizeof(tmp)); - - size_t consumed = _strmIn->inflate(tmp, got); + + size_t consumed; + try + { + consumed = _strmIn->inflate(tmp, got); + } + catch(ZLibError& err) + { + throw IOError(EILSEQ, "Error decompressing data", P_SOURCEINFO); + } + if(consumed < sizeof(tmp)) { //@fixme: we need to buffer rememaining bytes we could not inflate } - + count = _strmIn->bytesAvail(); } @@ -113,29 +123,38 @@ return count; } -size_t ZLibIOFilter::write(const char* buffer, size_t count) throw(IO::IOError) +size_t ZLibIOFilter::write(const char* buffer, size_t count) throw(IOError) { if(!_strmOut) - _strmOut = new P::IO::ZLibOutputStream(9); + _strmOut = new ZLibOutputStream(9); - size_t consumed = _strmOut->deflate(buffer, count); + size_t consumed; + try + { + consumed = _strmOut->deflate(buffer, count); + } + catch(ZLibError& err) + { + throw IOError(EILSEQ, "Error compressing data", P_SOURCEINFO); + } + flushAvailBytes(); return consumed; } -size_t ZLibIOFilter::peek(char* buffer, size_t count) throw(IO::IOError) +size_t ZLibIOFilter::peek(char* buffer, size_t count) throw(IOError) { return 0; } -offset_t ZLibIOFilter::seek(offset_t offset, IO::IODevice::SeekMode mode) throw(IO::IOError) +offset_t ZLibIOFilter::seek(offset_t offset, IODevice::SeekMode mode) throw(IOError) { - throw IO::IOError(0, "Could not seek on device", P_SOURCEINFO); + throw IOError(0, "Could not seek on device", P_SOURCEINFO); return -1; } -offset_t ZLibIOFilter::size() const throw(IO::IOError) +offset_t ZLibIOFilter::size() const throw(IOError) { //@fixme!!! return IOFilter::size(); |
From: Christian P. <cp...@us...> - 2005-01-10 02:45:23
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23170/src/Util Modified Files: Makefile.am Log Message: Added missing file to Makefile.am Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 30 Dec 2004 16:46:31 -0000 1.4 +++ Makefile.am 10 Jan 2005 02:45:14 -0000 1.5 @@ -2,12 +2,12 @@ METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_util.la libpclasses_util_la_SOURCES = ManagedThread.cpp Prefs.cpp \ - SimpleArgvParser.cpp \ SimplePropertyStore.cpp \ StringTool.cpp \ ThreadPool.cpp \ Variant.cpp \ WorkQueue.cpp # ^^^^^^ is it legal to backslash-escape newlines in Automake? +# 12312004 cproch: it is ! libpclasses_util_la_LIBADD = $(top_builddir)/src/System/libpclasses_system.la \ $(top_builddir)/src/libpclasses.la |
From: Christian P. <cp...@us...> - 2005-01-10 02:44:47
|
Update of /cvsroot/pclasses/pclasses2/src/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23017/src/Net Modified Files: Makefile.am Log Message: AT Makefile fix: net depends on core, unicode, io, system Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Net/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 7 Jan 2005 13:43:54 -0000 1.2 +++ Makefile.am 10 Jan 2005 02:44:39 -0000 1.3 @@ -1,8 +1,15 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO + lib_LTLIBRARIES = libpclasses_net.la -libpclasses_net_la_LIBADD = $(top_builddir)/src/libpclasses.la $(top_builddir)/src/IO/libpclasses_io.la \ - $(top_builddir)/src/System/libpclasses_system.la $(SOCKET_LIBS) + +libpclasses_net_la_LIBADD = $(top_builddir)/src/libpclasses.la \ + $(top_builddir)/src/Unicode/libpclasses_unicode.la \ + $(top_builddir)/src/IO/libpclasses_io.la \ + $(top_builddir)/src/System/libpclasses_system.la \ + $(SOCKET_LIBS) + libpclasses_net_la_SOURCES = Socket.cpp NetworkAddress.cpp InetAddress.cpp \ InetSocket.cpp HTTPHeader.cpp HTTPClient.cpp + noinst_HEADERS = SocketOption.h |
From: Christian P. <cp...@us...> - 2005-01-10 02:43:49
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22813/src/System Modified Files: SystemClock.posix.cpp Log Message: Fixed tz_names[] index in SystemClock Index: SystemClock.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SystemClock.posix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SystemClock.posix.cpp 28 Dec 2004 20:08:30 -0000 1.1 +++ SystemClock.posix.cpp 10 Jan 2005 02:43:41 -0000 1.2 @@ -62,11 +62,11 @@ else if(tztime->tm_isdst == 0) { /* no daylight saving time */ - return tz_names[2]; + return tz_names[0]; } /* daylight saving time is unknown */ - return tz_names[3]; + return tz_names[2]; } DateTime SystemClock::now(NowMode mode) |
From: Christian P. <cp...@us...> - 2005-01-10 02:41:46
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22396/include/pclasses Modified Files: Factory.h Log Message: Added Factory::registerType(). Client code looks nicer when using it ;-) Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Factory.h 6 Jan 2005 17:01:15 -0000 1.17 +++ Factory.h 10 Jan 2005 02:41:37 -0000 1.18 @@ -369,6 +369,12 @@ factoryMap().insert( FactoryMap::value_type( key, fp ) ); } + template <typename TypeName> + void registerType( const key_type & key, TypeName ) + { + registerFactory( key, Hook::FactoryCreateHook<InterfaceT,TypeName>::create ); + } + /** Returns the internal key-to-factory map. It is safe for clients to modify this except in multi-threaded |
From: Christian P. <cp...@us...> - 2005-01-10 02:39:06
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21795/src/App Added Files: LogChannel.cpp LogManager.cpp LogMessage.cpp LogTarget.cpp Makefile.am Log Message: Added Logging framework --- NEW FILE: LogMessage.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/App/LogMessage.h" #include "pclasses/Util/StringTool.h" namespace P { namespace App { LogMessage::LogMessage(const DateTime& when, Level l, const Unicode::String& msg) : _when(when), _level(l), _msg(msg) { } LogMessage::~LogMessage() throw() { } const DateTime& LogMessage::when() const throw() { return _when; } LogMessage::Level LogMessage::level() const throw() { return _level; } const Unicode::String& LogMessage::msg() const throw() { return _msg; } std::string LogMessage::level2Str(Level l) { std::string str = "Unknown"; switch(l) { case Debug: str = "Debug"; break; case Info: str = "Info"; break; case Notice: str = "Notice"; break; case Warning: str = "Warning"; break; case Error: str = "Error"; break; case Critical: str = "Critical"; break; } return str; } LogMessage::Level LogMessage::str2Level(const std::string& sl) { std::string str = StringTool::upperCase(sl); Level l = Info; if(str == "DEBUG") l = Debug; else if(str == "INFO") l = Info; else if(str == "NOTICE") l = Notice; else if(str == "WARNING") l = Warning; else if(str == "ERROR") l = Error; else if(str == "CRITICAL") l = Critical; return l; } } // !namespace App } // !namespace P --- NEW FILE: LogTarget.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/App/LogTarget.h" namespace P { namespace App { LogTarget::LogTarget() { } LogTarget::~LogTarget() throw() { } LogMessage::Level LogTarget::logLevel() const throw() { return _logLevel; } void LogTarget::setLogLevel(LogMessage::Level l) throw() { _logLevel = l; } } // !namespace App } // !namespace P --- NEW FILE: LogManager.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/Phoenix.h" #include "pclasses/App/LogTarget.h" #include "pclasses/App/LogChannel.h" #include "pclasses/App/LogManager.h" namespace P { namespace App { LogManager::LogManager() { } LogManager::~LogManager() throw() { // delete our LogTargets ... TargetMap::iterator ti = _targets.begin(); while(ti != _targets.end()) { delete ti->second; TargetMap::iterator del = ti; ++ti; _targets.erase(del); } // delete our LogChannels ... ChannelMap::iterator ci = _channels.begin(); while(ci != _channels.end()) { delete ci->second; ChannelMap::iterator del = ci; ++ci; _channels.erase(del); } } void LogManager::reload() throw() { for(ChannelMap::const_iterator i = _channels.begin(); i != _channels.end(); ++i) { LogChannel* channel = i->second; channel->reload(); } } LogChannel* LogManager::addChannel(const std::string& name) { LogChannel* chan = channel(name); if(!chan) { chan = new LogChannel(); _channels[name] = chan; } return chan; } bool LogManager::removeChannel(const std::string& name) { ChannelMap::iterator i = _channels.find(name); if(i != _channels.end()) { LogChannel* chan = i->second; // delete all our LogTargets for this channel ... TargetMap::iterator ti = _targets.begin(); while(ti != _targets.end()) { if(ti->first.first == chan) { delete ti->second; TargetMap::iterator del = ti; ++ti; _targets.erase(del); } else { ++ti; } } _channels.erase(i); delete chan; return true; } return false; } LogTarget* LogManager::addTarget(LogChannel* channel, const std::string& name, const std::string& type) { LogTarget* target = LogTargetFactory::instance().create(type); if(target) { if(!channel->addTarget(name, target)) { delete target; target = 0; } _targets[make_pair(channel, name)] = target; } return target; } bool LogManager::removeTarget(LogChannel* channel, const std::string& name) { TargetMap::iterator i = _targets.find(make_pair(channel, name)); if(i != _targets.end()) { LogTarget* target = channel->removeTarget(name); delete target; _targets.erase(i); return true; } return false; } LogChannel* LogManager::channel(const std::string& name) const { LogChannel* chan = 0; ChannelMap::const_iterator i = _channels.find(name); if(i != _channels.end()) chan = i->second; return chan; } LogChannel& LogManager::operator()(const std::string& chanName) { LogChannel* chan = channel(chanName); if(!chan) chan = addChannel(chanName); return *chan; } struct LogManagerContext { }; LogManager& LogManager::instance() { return Phoenix<LogManager,LogManagerContext>::instance(); } } // !namespace App } // !namespace P --- NEW FILE: Makefile.am --- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_app.la libpclasses_app_la_SOURCES = AppDetails.cpp LogMessage.cpp LogTarget.cpp LogChannel.cpp LogManager.cpp libpclasses_app_la_LIBADD = $(top_builddir)/src/libpclasses.la \ $(top_builddir)/src/Unicode/libpclasses_unicode.la \ $(top_builddir)/src/IO/libpclasses_io.la \ $(top_builddir)/src/System/libpclasses_system.la \ $(top_builddir)/src/Util/libpclasses_util.la --- NEW FILE: LogChannel.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/System/SystemClock.h" #include "pclasses/App/LogTarget.h" #include "pclasses/App/LogChannel.h" #include "pclasses/App/LogMessage.h" #include <sstream> namespace P { namespace App { // LogStream buffer state (kept per thread) struct LogStreamState { DateTime when; LogMessage::Level level; std::ostringstream msg; bool empty; }; class LogStreamBuffer: public std::streambuf { public: LogStreamBuffer(LogChannel& chan); ~LogStreamBuffer(); void setMessageLevel(LogMessage::Level l); // streambuf related ... int overflow(int ch); int sync(); private: LogStreamState* state(); LogChannel& _channel; LogStreamState* _state; //@fixme _state must be a thread-local variable! }; LogStreamBuffer::LogStreamBuffer(LogChannel& chan) : _channel(chan), _state(0) { } LogStreamBuffer::~LogStreamBuffer() { sync(); } LogStreamState* LogStreamBuffer::state() { if(!_state) { _state = new LogStreamState; _state->empty = true; _state->level = LogMessage::Info; } return _state; } void LogStreamBuffer::setMessageLevel(LogMessage::Level l) { LogStreamState* s = state(); if(s->level != l) { overflow(traits_type::eof()); s->level = l; } } int LogStreamBuffer::sync() { return overflow(traits_type::eof()); } int LogStreamBuffer::overflow(int ch) { // get thread-local stream state ... LogStreamState* s = state(); if(ch == traits_type::eof() || ch == '\n') { if(!s->empty) { LogMessage msg(s->when, s->level, s->msg.str()); _channel.output(msg); s->msg.str(""); s->empty = true; } } else { if(s->empty) { s->when = System::SystemClock::now(); s->empty = false; } s->msg << (char)ch; } return ch; } LogChannel::LogChannel() : std::ostream(new LogStreamBuffer(*this)) { } LogChannel::~LogChannel() throw() { _targets.clear(); delete rdbuf(); } bool LogChannel::addTarget(const std::string& name, LogTarget* target) { TargetMap::const_iterator i = _targets.find(name); if(i != _targets.end()) return false; _targets[name] = target; return true; } LogTarget* LogChannel::removeTarget(const std::string& name) throw() { LogTarget* target = 0; TargetMap::iterator i = _targets.find(name); if(i != _targets.end()) { target = i->second; _targets.erase(i); } return target; } bool LogChannel::removeTarget(LogTarget* target) throw() { for(TargetMap::iterator i = _targets.begin(); i != _targets.end(); ++i) { if(i->second == target) { _targets.erase(i); return true; } } return false; } void LogChannel::reload() const throw() { for(TargetMap::const_iterator i = _targets.begin(); i != _targets.end(); ++i) { LogTarget* target = i->second; try { target->reload(); } catch(IO::IOError& err) { } } } void LogChannel::output(const LogMessage& msg) const throw() { if(msg.level() >= _logLevel) { // output to all registered LogTargets ... for(TargetMap::const_iterator i = _targets.begin(); i != _targets.end(); ++i) { LogTarget* target = i->second; try { if(target->valid()) target->output(msg); } // close target if output() did throw catch(IO::IOError& err) { try { target->close(); } catch(...) { } } } } } LogMessage::Level LogChannel::logLevel() const throw() { return _logLevel; } void LogChannel::setLogLevel(LogMessage::Level l) throw() { _logLevel = l; } LogChannel& LogChannel::operator()(LogMessage::Level l) throw() { static_cast<LogStreamBuffer*>(rdbuf())->setMessageLevel(l); return *this; } } // !namespace App } // !namespace P |
From: Christian P. <cp...@us...> - 2005-01-10 02:39:05
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21795/include/pclasses/App Added Files: LogChannel.h LogManager.h LogMessage.h LogTarget.h Makefile.am Log Message: Added Logging framework --- NEW FILE: LogMessage.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_LogMessage_h #define P_LogMessage_h #include <pclasses/DateTime.h> #include <pclasses/Unicode/String.h> #include <string> namespace P { namespace App { //! Log message class class LogMessage { public: //! Log message level enum Level { Debug, Info, Notice, Warning, Error, Critical }; LogMessage(const DateTime& when, Level l, const Unicode::String& msg); ~LogMessage() throw(); const DateTime& when() const throw(); Level level() const throw(); const Unicode::String& msg() const throw(); static std::string level2Str(Level l); static Level str2Level(const std::string& l); private: DateTime _when; Level _level; Unicode::String _msg; }; } // !namespace App } // !namespace P #endif --- NEW FILE: Makefile.am --- INCLUDES = METASOURCES = AUTO pkginclude_HEADERS = AppDetails.h LogMessage.h LogTarget.h LogChannel.h LogManager.h --- NEW FILE: LogTarget.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_LogTarget_h #define P_LogTarget_h #include <pclasses/Factory.h> #include <pclasses/IO/IOError.h> #include <pclasses/IO/URL.h> #include <pclasses/App/LogMessage.h> namespace P { namespace App { //! Log message target class LogTarget { public: LogTarget(); virtual ~LogTarget() throw(); //! Opens the logging target virtual void open(const IO::URL& url) throw(IO::IOError) = 0; //! Closes the logging target virtual void close() throw(IO::IOError) = 0; //! Close and re-open the logging target virtual void reload() throw(IO::IOError) = 0; //! Output log message to target virtual void output(const LogMessage& msg) throw(IO::IOError) = 0; //! Test if the target is valid virtual bool valid() const throw() = 0; //! Returns current log level LogMessage::Level logLevel() const throw(); //! Set log level void setLogLevel(LogMessage::Level l) throw(); private: LogMessage::Level _logLevel; }; //! LogTarget factory typedef NamedTypeFactory<LogTarget> LogTargetFactory; } // !namespace App } // !namespace P #endif --- NEW FILE: LogChannel.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_LogChannel_h #define P_LogChannel_h #include <pclasses/IO/IOError.h> #include <pclasses/App/LogMessage.h> #include <string> #include <map> #include <iostream> namespace P { namespace App { class LogTarget; //! Log message channel class LogChannel: public std::ostream { public: typedef std::map<std::string, LogTarget*> TargetMap; LogChannel(); ~LogChannel() throw(); //! Add a logging target bool addTarget(const std::string& name, LogTarget* target); //! Remove named logging target LogTarget* removeTarget(const std::string& name) throw(); //! Remove logging target by pointer bool removeTarget(LogTarget* target) throw(); //! Close and re-open all targets void reload() const throw(); //! Output log message to all targets void output(const LogMessage& msg) const throw(); //! Returns current log level LogMessage::Level logLevel() const throw(); //! Set log level void setLogLevel(LogMessage::Level l) throw(); //! Switch stream message level LogChannel& operator()(LogMessage::Level) throw(); private: TargetMap _targets; LogMessage::Level _logLevel; }; } // !namespace App } // !namespace P #endif --- NEW FILE: LogManager.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_LogManager_h #define P_LogManager_h #include <pclasses/App/LogTarget.h> #include <pclasses/App/LogChannel.h> #include <map> #include <string> namespace P { namespace App { //! Log manager class LogManager { public: //! Map of LogChannels typedef std::map<std::string,LogChannel*> ChannelMap; //! Map of owned LogTargets typedef std::map< std::pair<LogChannel*, std::string>, LogTarget* > TargetMap; LogManager(); ~LogManager() throw(); //! Close and re-open all LogTargets void reload() throw(); //! Add logging channel /*! Returns NULL if the named LogChannel already exists. The LogChannel is owned by the LogManager. */ LogChannel* addChannel(const std::string& name); //! Remove logging channel bool removeChannel(const std::string& name); //! Returns a pointer to the named LogChannel /*! Returns NULL if the named LogChannel does not exist. */ LogChannel* channel(const std::string& name) const; //! Add a logging target /*! Returns NULL if the target already exists, or the LogTarget type is not registered. The LogTarget is owned by the LogManager. */ LogTarget* addTarget(LogChannel* chan, const std::string& name, const std::string& type); //! Remove a logging target bool removeTarget(LogChannel* chan, const std::string& name); //! Returns a refernce to the named LogChannel /*! If the channel does not exist it is created. */ LogChannel& operator()(const std::string& channel); //! Returns the instance of the LogManager static LogManager& instance(); private: ChannelMap _channels; TargetMap _targets; }; } // !namespace App } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2005-01-10 02:36:25
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21451/src/Util Modified Files: StringTool.cpp Log Message: Added StringTool::upperCase(), StringTool::lowerCase() Index: StringTool.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/StringTool.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- StringTool.cpp 29 Dec 2004 19:55:07 -0000 1.7 +++ StringTool.cpp 10 Jan 2005 02:36:15 -0000 1.8 @@ -1,4 +1,6 @@ #include <pclasses/Util/StringTool.h> +#include <cctype> +#include <algorithm> //#include <pclasses/s11n/s11n_debuggering_macros.h> // CERR namespace P { @@ -347,5 +349,32 @@ } +/* + ^^^ above looks like hell ... please use tabs ... cproch +*/ + +struct ToUpperTransform { + char operator() (char c) const { return std::toupper(c); } +}; + +std::string upperCase(const std::string& str) +{ + std::string ret = str; + std::transform(ret.begin(), ret.end(), ret.begin(), ToUpperTransform()); + return ret; +} + +struct ToLowerTransform { + char operator() (char c) const { return std::tolower(c); } +}; + +std::string lowerCase(const std::string& str) +{ + std::string ret = str; + std::transform(ret.begin(), ret.end(), ret.begin(), ToLowerTransform()); + return ret; +} + + }} // P::StringTool |
From: Christian P. <cp...@us...> - 2005-01-10 02:36:25
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21451/include/pclasses/Util Modified Files: StringTool.h Log Message: Added StringTool::upperCase(), StringTool::lowerCase() Index: StringTool.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/StringTool.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StringTool.h 26 Dec 2004 13:11:01 -0000 1.5 +++ StringTool.h 10 Jan 2005 02:36:16 -0000 1.6 @@ -249,6 +249,8 @@ inline const EntityMap & defaultEscapesTranslations() { + //@@fixme 050110 cproch: + // why is this a Phoenix ? could be a simple statically allocated structure? typedef ::P::Phoenix<EntityMap, StrSharingContext<EntityMap>, defaultEscapesInitializer @@ -351,6 +353,11 @@ size_t expandDollarRefsInline( std::string & buffer, const EntityMap & src ); +//! Returns a copy of the string converted to uppercase letters +std::string upperCase(const std::string& str); + +//! Returns a copy of the string converted to lowercase letters +std::string lowerCase(const std::string& str); }} // namespace P::StringTool |
From: Christian P. <cp...@us...> - 2005-01-07 14:31:43
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16860 Modified Files: TODO Log Message: Added some ToDo's Index: TODO =================================================================== RCS file: /cvsroot/pclasses/pclasses2/TODO,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- TODO 22 Dec 2004 17:54:10 -0000 1.1.1.1 +++ TODO 7 Jan 2005 14:31:34 -0000 1.2 @@ -1 +1,37 @@ - \ No newline at end of file + +Core: +Date/Time/DateTime: +add TimeSpan add/sub operators +add TimeZone/TimeZoneDb + +IO: +ZLibIOFilter: add zlib "deflate" streaming (currently only supports "raw" streaming) +add GZipIOFilter ? + +Unicode: +Finish String +Finish TextStream + +System: +Add SerialDevice +Add RWLock +Add MemoryFile (mmap'd File) + +Net: +Add NetDb +Add FTPClient +Add Inet6Socket, Inet6Address +Add IPXSocket, IPXAddress +Add AppleTalkSocket, AppleTalkAddress + +XML: +Add XMLParser, HTMLParser, DOM + +SQL: +Add SQLDriver, SQLStatement, SQLResult, SQLField, ... + +App: +Logging, Config + +NetIO: +IOManager, ProtocolHandler, ... |
From: Christian P. <cp...@us...> - 2005-01-07 13:46:30
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5858 Modified Files: Makefile.am Added Files: HTTPClientTest.cpp Log Message: Added HTTPClientTest Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 6 Jan 2005 17:01:15 -0000 1.3 +++ Makefile.am 7 Jan 2005 13:46:21 -0000 1.4 @@ -5,7 +5,7 @@ PtrTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la $(top_builddir)/src/libpclasses.la noinst_HEADERS = Test.h noinst_PROGRAMS = QueueTest StackTest IntTypeTest ListTest ThreadTest \ - StringTest IOTest SignalTest + StringTest IOTest SignalTest HTTPClientTest QueueTest_SOURCES = QueueTest.cpp QueueTest_LDADD = $(top_builddir)/src/libpclasses.la StackTest_SOURCES = StackTest.cpp @@ -24,3 +24,6 @@ IOTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la \ $(top_builddir)/src/IO/libpclasses_io.la $(top_builddir)/src/libpclasses.la -lz SignalTest_SOURCES = SignalTest.cpp +HTTPClientTest_SOURCES = HTTPClientTest.cpp +HTTPClientTest_LDADD = $(top_builddir)/src/Net/libpclasses_net.la\ + $(top_builddir)/src/libpclasses.la --- NEW FILE: HTTPClientTest.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "Test.h" #include "pclasses/IO/URL.h" #include "pclasses/IO/ZLibIOFilter.h" #include "pclasses/Net/HTTPClient.h" #include "pclasses/Net/InetAddress.h" #include <limits.h> namespace P { class HTTPClientTest: public UnitTest { public: void run() throw() { Net::HTTPClient cl; cl.open(Net::Socket::Inet); std::cerr << "Connecting to 192.168.1.1..." << std::endl; cl.connect(Net::InetAddress("217.160.172.188"), 80); std::cerr << "Sending request ..." << std::endl; Net::HTTPRequest req(Net::HTTPRequest::GET, IO::URL("http://192.168.1.1/")); cl.sendRequest(req); std::cerr << "Reading response ..." << std::endl; Net::HTTPResponse resp = cl.readResponse(); std::cerr << "Response: " << resp.protocol() << ' ' << resp.responseCode() << ' ' << resp.response() << std::endl; while(!resp.eof()) { char tmp[1024]; size_t count = resp.read(tmp, 1024); std::cerr.write(tmp, count); } } }; } int main(int argc, char* argv[]) { P::HTTPClientTest httpct; httpct.run(); return 0; } |