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: stephan b. <sg...@us...> - 2004-12-30 19:35:58
|
Update of /cvsroot/pclasses/pclasses2/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28507/lib Modified Files: Makefile.toc Log Message: Added App module. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/lib/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 29 Dec 2004 20:55:36 -0000 1.4 +++ Makefile.toc 30 Dec 2004 19:35:47 -0000 1.5 @@ -10,14 +10,15 @@ ############# P Module libs: pliblist = $(addprefix $(plibp), \ + APP/lib$(LIBPAPP_BASENAME) \ + IO/lib$(LIBPIO_BASENAME) \ lib$(LIBPCORE_BASENAME) \ - System/lib$(LIBPSYSTEM_BASENAME) \ Net/lib$(LIBPNET_BASENAME) \ - IO/lib$(LIBPIO_BASENAME) \ - Unicode/lib$(LIBPUNICODE_BASENAME) \ - Util/lib$(LIBPUTIL_BASENAME) \ s11n/lib$(LIBPS11N_BASENAME) \ SIO/lib$(LIBPSIO_BASENAME) \ + System/lib$(LIBPSYSTEM_BASENAME) \ + Unicode/lib$(LIBPUNICODE_BASENAME) \ + Util/lib$(LIBPUTIL_BASENAME) \ ) pliblist := $(wildcard $(addsuffix .so*,$(pliblist))) |
From: stephan b. <sg...@us...> - 2004-12-30 19:32:38
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27934/src/s11n Modified Files: Makefile.toc Log Message: Tweaking. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/Makefile.toc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.toc 29 Dec 2004 20:55:37 -0000 1.15 +++ Makefile.toc 30 Dec 2004 19:32:27 -0000 1.16 @@ -5,19 +5,12 @@ SUBDIRS = io proxy -SOURCES = \ - data_node.cpp \ - s11n.cpp \ - s11n_node.cpp +SOURCES = $(wildcard *.cpp) HEADERS = $(wildcard *.h) -OBJECTS = $(addsuffix .o,\ - data_node \ - s11n \ - s11n_node \ - ) +OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES)) objects: $(OBJECTS) @@ -54,7 +47,7 @@ test_bin_LDADD = $(LIBP_TESTS_LDADD) $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) include $(TOC_MAKESDIR)/BIN_PROGRAMS.make -all: symlink-headers subdir-io SHARED_LIBS subdir-proxy +all: SYMLINK_HEADERS subdir-io SHARED_LIBS subdir-proxy # BIN_PROGRAMS |
From: stephan b. <sg...@us...> - 2004-12-30 19:29:48
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27214/src/IO Modified Files: Makefile.toc Log Message: Added missing SOURCES. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 26 Dec 2004 16:26:28 -0000 1.4 +++ Makefile.toc 30 Dec 2004 19:29:39 -0000 1.5 @@ -1,9 +1,7 @@ #!/usr/bin/make -f include toc.make -SOURCES = IODevice.cpp \ - IOError.cpp \ - URL.cpp +SOURCES = $(wildcard *.cpp) DIST_FILES += $(SOURCES) |
From: Christian P. <cp...@us...> - 2004-12-30 19:21:37
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25745/src/IO Modified Files: IOStream.cpp Log Message: Reading from IOStream should work now. Index: IOStream.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/IOStream.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IOStream.cpp 30 Dec 2004 17:10:34 -0000 1.1 +++ IOStream.cpp 30 Dec 2004 19:21:27 -0000 1.2 @@ -42,7 +42,8 @@ if(_inBufferSize > 0) { _inBuffer = new char[_inBufferSize]; - setg(_inBuffer, _inBuffer, _inBuffer + _inBufferSize); + //@fixme .. is this correct? + setg(_inBuffer, _inBuffer, _inBuffer); } else { @@ -52,6 +53,8 @@ IOStreamBuffer::~IOStreamBuffer() { + sync(); + if(_outBuffer) delete[] _outBuffer; @@ -125,8 +128,27 @@ int IOStreamBuffer::underflow() { - //@fixme - return traits_type::eof(); + int_type ret = traits_type::eof(); + + //unbuffered ? + if(!eback()) + { + char tmp[1]; + size_t read = _dev.read(tmp, 1); + if(read) + ret = traits_type::not_eof(tmp[0]); + } + else + { + size_t read = _dev.read(_inBuffer, _inBufferSize); + //@fixme .. is this correct? + setg(_inBuffer, _inBuffer, _inBuffer + read); + + if(read) + ret = traits_type::not_eof(_inBuffer[0]); + } + + return ret; } int IOStreamBuffer::sync() |
From: stephan b. <sg...@us...> - 2004-12-30 19:17:44
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25042 Added Files: proxyGen in.proxyGen Log Message: egg: experimental helper script to generate s11n proxies from a small description file --- NEW FILE: in.proxyGen --- # # format: # START CLASS: # CLASSNAME: # PROPERTIES: # = KEY GETTERFUNC SETTERFUNC # CHILDREN: # + KEY GETTERFUNC SETTERFUNC MyTestType: = name getName setName + license getLicenseText setLicenseText + authors getAuthors setAuthors + about getAboutText setAboutText --- NEW FILE: proxyGen --- #!/usr/bin/perl @sout = (); @dout = (); $classname = 'MyClass'; $SNS = "::P::s11n"; while(<>) { chomp; $orig = $_; $line = $_; next unless $line =~ m|\w|; # empty line next if( $line =~ m|^\s*#| ); # comment line if( $line =~ m|^\s*(\S+)\:\s*$| ) { # CLASSNAME: $classname = $1; $pname = $classname.'_s11n'; next; } $line =~ s|\s+| |g; $line =~ s|^\s*||; ($op,$key,$get,$set) = split( /\s+/, $line ); if( ! $set || !$get ) { die "Syntax error. Line:\n$orig\n"; } if( '=' eq $op ) { # property # print "Adding property '$key'\n"; push( @sout, "$SNS\::serialize_subnode( dest, \"$key\", src.$get\(\) ) || return false;" ); push( @gout, "$SNS\::deserialize_subnode( TR::get( src, \"$key\", dest.$get\(\) ) ) || return false" ); next; } if( '+' eq $op ) { # print "Adding child '$key'\n"; push( @sout, "TR::set( dest, \"$key\", src.$get\(\) );" ); push( @gout, "dest.$set\( TR::get( src, \"$key\", dest.$get\(\) ) );" ); next; } die "Unhandled input line:\n$line\n"; } $dser = "\t".join( "\n\t", @gout ); $sep = "\n\t\t"; print <<EOF struct $pname { // serialize template <typename NodeType> bool operator()( NodeType & dest, const $classname & src ) const { typedef $SNS\::node_traits<NodeType> TR; TR::class_name( dest, "$classname" ); EOF ; print "\t\t"; print join( $sep, @sout ); print "\n"; print <<EOF return true; } // deserialize template <typename NodeType> bool operator()( const NodeType & src, $classname & dest ) const { typedef $SNS\::node_traits<NodeType> TR; EOF ; print "\t\t"; print join( $sep, @gout ); print "\n"; print <<EOF return true; }; } EOF ; |
From: Christian P. <cp...@us...> - 2004-12-30 19:01:48
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22139/src/System Modified Files: Pipe.posix.cpp Log Message: Changed Pipe::Pair from P::Pair to std::pair. Index: Pipe.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Pipe.posix.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Pipe.posix.cpp 24 Dec 2004 17:15:51 -0000 1.4 +++ Pipe.posix.cpp 30 Dec 2004 19:01:38 -0000 1.5 @@ -66,7 +66,7 @@ Pipe readPipe((unsigned long)fds[0], true); Pipe writePipe((unsigned long)fds[1], false); - return Pair(readPipe, writePipe); + return std::make_pair(readPipe, writePipe); } void Pipe::close() throw(LogicError, IO::IOError) @@ -79,6 +79,7 @@ _handle = (unsigned long)-1; IODevice::setAccess(None); IODevice::setValid(false); + return; } throw LogicError("Pipe is not open", P_SOURCEINFO); |
From: Christian P. <cp...@us...> - 2004-12-30 19:01:47
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22139/include/pclasses/System Modified Files: Pipe.h Log Message: Changed Pipe::Pair from P::Pair to std::pair. Index: Pipe.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Pipe.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Pipe.h 23 Dec 2004 05:56:09 -0000 1.3 +++ Pipe.h 30 Dec 2004 19:01:37 -0000 1.4 @@ -21,8 +21,8 @@ #ifndef P_System_Pipe_h #define P_System_Pipe_h -#include <pclasses/Pair.h> #include <pclasses/IO/IODevice.h> +#include <memory> namespace P { @@ -31,7 +31,7 @@ //! Anonymous pipe device class Pipe: public IO::IODevice { public: - typedef P::Pair<Pipe> Pair; + typedef std::pair<Pipe,Pipe> Pair; Pipe(const Pipe& f) throw(IO::IOError); |
From: stephan b. <sg...@us...> - 2004-12-30 18:08:08
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10851/App Log Message: Directory /cvsroot/pclasses/pclasses2/src/App added to the repository |
From: stephan b. <sg...@us...> - 2004-12-30 18:03:23
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9816/test Modified Files: Makefile.toc Log Message: Removed the SIO dep on IOTest bin. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile.toc 30 Dec 2004 17:48:48 -0000 1.16 +++ Makefile.toc 30 Dec 2004 18:03:13 -0000 1.17 @@ -38,7 +38,11 @@ SimplePropertyStoreTest_bin_OBJECTS = SimplePropertyStoreTest.o SimpleArgvParserTest_bin_LDADD = $(s11nTest_bin_LDADD) SimpleArgvParserTest_bin_OBJECTS = SimpleArgvParserTest.o - IOTest_bin_LDADD = $(s11nTest_bin_LDADD) + IOTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) \ + $(LIBPUTIL_CLIENT_LDADD) \ + $(LIBPIO_CLIENT_LDADD) \ + $(LIBPCORE_CLIENT_LDADD) \ + $(LIBPUTIL_CLIENT_LDADD) IOTest_bin_OBJECTS = IOTest.o include $(TOC_MAKESDIR)/BIN_PROGRAMS.make endif |
From: stephan b. <sg...@us...> - 2004-12-30 17:49:01
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6787/test Modified Files: Makefile.toc Log Message: Added IOTest Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.toc 30 Dec 2004 16:40:40 -0000 1.15 +++ Makefile.toc 30 Dec 2004 17:48:48 -0000 1.16 @@ -17,12 +17,14 @@ build_bins = 1 ifeq (1,$(build_bins)) - BIN_PROGRAMS = PtrTest \ - StringToolTest \ + BIN_PROGRAMS = \ FactoryTest \ + IOTest \ + PtrTest \ s11nTest \ SimpleArgvParserTest \ - SimplePropertyStoreTest + SimplePropertyStoreTest \ + StringToolTest BIN_PROGRAMS_LDADD = $(LIBP_TESTS_LDADD) FactoryTest_bin_OBJECTS = FactoryTest.o registrations.o FactoryTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPSIO_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) @@ -36,6 +38,8 @@ SimplePropertyStoreTest_bin_OBJECTS = SimplePropertyStoreTest.o SimpleArgvParserTest_bin_LDADD = $(s11nTest_bin_LDADD) SimpleArgvParserTest_bin_OBJECTS = SimpleArgvParserTest.o + IOTest_bin_LDADD = $(s11nTest_bin_LDADD) + IOTest_bin_OBJECTS = IOTest.o include $(TOC_MAKESDIR)/BIN_PROGRAMS.make endif |
From: Christian P. <cp...@us...> - 2004-12-30 17:39:12
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4875/test Added Files: StringTest.cpp Log Message: Added StringTest.cpp --- NEW FILE: StringTest.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/Unicode/String.h" namespace P { class StringTest: public UnitTest { public: void run() throw() { Unicode::String s1(2); //P_TEST(s1.empty()); s1 = L"ba"; print(s1); s1.insert(1, Unicode::Char('-')); print(s1); P_TEST(s1[0] == Unicode::Char('b')); P_TEST(s1[1] == Unicode::Char('-')); P_TEST(s1[2] == Unicode::Char('a')); } void print(const Unicode::String& str) { for(size_t i = 0; i < str.length(); i++) std::cout << str.at(i).latin1(); std::cout << std::endl; } }; } int main(int argc, char* argv[]) { P::StringTest st; st.run(); return 0; } |
From: stephan b. <sg...@us...> - 2004-12-30 17:29:12
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/test Modified Files: s11nTest.cpp Log Message: Explicitely undef NDEBUG. Index: s11nTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/s11nTest.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- s11nTest.cpp 29 Dec 2004 20:11:21 -0000 1.8 +++ s11nTest.cpp 30 Dec 2004 17:28:52 -0000 1.9 @@ -1,3 +1,7 @@ +#ifdef NDEBUG +# undef NDEBUG +#endif + #include <pclasses/s11n/s11n_debuggering_macros.h> #include <pclasses/SIO/SIO.h> @@ -483,5 +487,14 @@ } +// size_t S1 = 7; +// ulong S2 = 7; +// int S3 = 7; +// char S4 = '7'; +// save( S1, std::cout ); +// save( S2, std::cout ); +// save( S3, std::cout ); +// save( S4, std::cout ); + return 0; } |
From: stephan b. <sg...@us...> - 2004-12-30 17:25:43
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1577/src/s11n Modified Files: pods_streamable.h Log Message: Removed size_t POD==>Serializable registration. It collides with ulong on 64bit AMD and probably on other 64b platforms. Index: pods_streamable.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/pods_streamable.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pods_streamable.h 26 Dec 2004 01:43:29 -0000 1.3 +++ pods_streamable.h 30 Dec 2004 17:25:33 -0000 1.4 @@ -20,7 +20,7 @@ #include "data_node_serialize.h" #include "data_node_functor.h" // s11n::streamable_type_serialization_proxy -#define PS11N_PODS_STREAMABLE_PROXY s11n::streamable_type_serialization_proxy +#define PS11N_PODS_STREAMABLE_PROXY ::P::s11n::streamable_type_serialization_proxy #define PS11N_TYPE char @@ -38,10 +38,10 @@ #define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define PS11N_TYPE size_t -#define PS11N_TYPE_NAME "size_t" -#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY -#include "reg_serializable_traits.h" +// #define PS11N_TYPE size_t +// #define PS11N_TYPE_NAME "size_t" +// #define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY +// #include "reg_serializable_traits.h" #define PS11N_TYPE float #define PS11N_TYPE_NAME "float" |
From: Christian P. <cp...@us...> - 2004-12-30 17:18:35
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32448/test Modified Files: Makefile.am Added Files: IOTest.cpp Log Message: Added IOTest --- NEW FILE: IOTest.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/IOStream.h" #include "pclasses/System/File.h" namespace P { using System::File; class FileTest: public UnitTest { public: void run() throw() { File file("pclasses_file_test.tmp", File::Write); P_TEST(file.write("test", 4) == 4); P_TEST(file.size() == 4); P_TEST(file.seek(0, File::SeekSet) == 0); //@fixme .. wtf ? why is errno==EBADF ? char tmp[4]; P_TEST(file.read(tmp, 4) == 4); } }; } int main(int argc, char* argv[]) { P::FileTest ft; ft.run(); return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile.am 22 Dec 2004 17:54:37 -0000 1.1.1.1 +++ Makefile.am 30 Dec 2004 17:18:26 -0000 1.2 @@ -4,7 +4,8 @@ PtrTest_SOURCES = PtrTest.cpp 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 +noinst_PROGRAMS = QueueTest StackTest IntTypeTest ListTest ThreadTest \ + StringTest IOTest QueueTest_SOURCES = QueueTest.cpp QueueTest_LDADD = $(top_builddir)/src/libpclasses.la StackTest_SOURCES = StackTest.cpp @@ -16,3 +17,10 @@ ThreadTest_SOURCES = ThreadTest.cpp ThreadTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la\ $(top_builddir)/src/libpclasses.la +StringTest_SOURCES = StringTest.cpp +StringTest_LDADD = $(top_builddir)/src/Unicode/libpclasses_unicode.la\ + $(top_builddir)/src/libpclasses.la +IOTest_SOURCES = IOTest.cpp +IOTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/IO/libpclasses_io.la\ + $(top_builddir)/src/libpclasses.la |
From: Christian P. <cp...@us...> - 2004-12-30 17:17:56
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32216/include/pclasses/IO Modified Files: Makefile.am Log Message: Added IOStream.[h|cpp], URL.[h|cpp] Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 23 Dec 2004 04:32:16 -0000 1.1 +++ Makefile.am 30 Dec 2004 17:17:41 -0000 1.2 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = IOError.h IODevice.h +pkginclude_HEADERS = IOError.h IODevice.h IOStream.h URL.h |
From: Christian P. <cp...@us...> - 2004-12-30 17:17:55
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32216/src/IO Modified Files: Makefile.am Log Message: Added IOStream.[h|cpp], URL.[h|cpp] Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 23 Dec 2004 04:32:17 -0000 1.1 +++ Makefile.am 30 Dec 2004 17:17:41 -0000 1.2 @@ -2,5 +2,5 @@ METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_io.la -libpclasses_io_la_SOURCES = IOError.cpp IODevice.cpp +libpclasses_io_la_SOURCES = IOError.cpp IODevice.cpp IOStream.cpp URL.cpp libpclasses_io_la_LIBADD = $(top_builddir)/src/libpclasses.la $(top_builddir)/src/Unicode/libpclasses_unicode.la |
From: Christian P. <cp...@us...> - 2004-12-30 17:10:44
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30316/src/IO Added Files: IOStream.cpp Log Message: Added IOStream, IOStreamBuffer --- NEW FILE: IOStream.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/IO/IOStream.h" namespace P { namespace IO { IOStreamBuffer::IOStreamBuffer(IODevice& dev, size_t outBufferSize, size_t inBufferSize) : _dev(dev) { _outBufferSize = outBufferSize; if(_outBufferSize > 0) { _outBuffer = new char[_outBufferSize]; setp(_outBuffer, _outBuffer + _outBufferSize); } else { _outBuffer = 0; } _inBufferSize = inBufferSize; if(_inBufferSize > 0) { _inBuffer = new char[_inBufferSize]; setg(_inBuffer, _inBuffer, _inBuffer + _inBufferSize); } else { _inBuffer = 0; } } IOStreamBuffer::~IOStreamBuffer() { if(_outBuffer) delete[] _outBuffer; if(_inBuffer) delete[] _inBuffer; } int IOStreamBuffer::overflow(int ch) { int_type ret = traits_type::eof(); if(traits_type::eq_int_type(ch, traits_type::eof())) { size_t count = pptr() - pbase(); // write out buffered chars ... if(count) { try { size_t written = _dev.write(pbase(), count); if(written == count) { setp(_outBuffer, _outBuffer + _outBufferSize); ret = traits_type::not_eof(ch); } } catch(...) { } } } else { // stream is unbuffered ? if(!pptr()) { char tmp[1]; tmp[0] = ch; try { size_t written = _dev.write(tmp, 1); if(written == 1) ret = traits_type::not_eof(ch); } catch(...) { } } else { // buffer full ? if(pptr() == epptr()) { ret = overflow(traits_type::eof()); if(ret == traits_type::eof()) return ret; } // put char into buffer traits_type::assign(*pptr(), traits_type::to_char_type(ch)); pbump(1); ret = traits_type::not_eof(ch); } } return ret; } int IOStreamBuffer::underflow() { //@fixme return traits_type::eof(); } int IOStreamBuffer::sync() { int ret = 0; if(overflow(traits_type::eof()) == traits_type::eof()) ret = -1; return ret; } IOStream::IOStream(IODevice& dev) : std::iostream(new IOStreamBuffer(dev)) { } IOStream::~IOStream() { delete rdbuf(); } IOStreamBuffer& IOStream::buffer() const { return *static_cast<IOStreamBuffer*>(rdbuf()); } } } |
From: Christian P. <cp...@us...> - 2004-12-30 17:10:43
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30316/include/pclasses/IO Added Files: IOStream.h Log Message: Added IOStream, IOStreamBuffer --- NEW FILE: IOStream.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. * ***************************************************************************/ #include <pclasses/IO/IODevice.h> #include <iostream> namespace P { namespace IO { class IOStreamBuffer: public std::streambuf { public: IOStreamBuffer(IODevice& dev, size_t outBufferSize = 64, size_t inBufferSize = 64); ~IOStreamBuffer(); int overflow(int ch); int underflow(); int sync(); private: IODevice& _dev; char* _outBuffer; size_t _outBufferSize; char* _inBuffer; size_t _inBufferSize; }; class IOStream: public std::iostream { public: IOStream(IODevice& dev); ~IOStream(); IOStreamBuffer& buffer() const; }; } // !namespace IO } // !namespace P |
From: stephan b. <sg...@us...> - 2004-12-30 17:08:42
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29733 Modified Files: Makefile.toc Log Message: Removed AT and m4 dirs. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/Makefile.toc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.toc 30 Dec 2004 15:39:23 -0000 1.5 +++ Makefile.toc 30 Dec 2004 17:08:31 -0000 1.6 @@ -1,6 +1,6 @@ #!/usr/bin/make -f include toc.make -SUBDIRS = AT include m4 src lib test doc toc templates +SUBDIRS = include src lib test doc toc templates DIST_FILES += COPYING.LIB COPYING README \ NEWS \ ChangeLog \ |
From: Christian P. <cp...@us...> - 2004-12-30 17:07:11
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29275/include/pclasses/System Modified Files: File.h Log Message: Reordered ctor/open() args. Removed std::string ctor/open() method. Added default args for ctor and open(). Index: File.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/File.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- File.h 25 Dec 2004 16:04:21 -0000 1.4 +++ File.h 30 Dec 2004 17:06:59 -0000 1.5 @@ -42,30 +42,17 @@ /** Creates a file with the given name and access modes. Throws on error. */ - File(const Unicode::String& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(IO::IOError); - - /** - Creates a file with the given name and access modes. Throws on error. - */ - File(const std::string& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(IO::IOError); + File(const Unicode::String& name, AccessMode amode, + OpenMode omode = OpenCreate, + ShareMode smode = AllowNone) throw(IO::IOError); ~File() throw(); /** */ - void open(const Unicode::String& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(LogicError, IO::IOError); - - /** - Opens this file. - - @fixme: does this reopen using the new name if open() an already-open()ed - File? - */ - void open(const std::string& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(LogicError, IO::IOError); + void open(const Unicode::String& name, AccessMode amode, + OpenMode omode = OpenCreate, + ShareMode smode = AllowNone) throw(LogicError, IO::IOError); /** Frees any resources associated with this object, like filehandles. |
From: Christian P. <cp...@us...> - 2004-12-30 17:07:10
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29275/src/System Modified Files: File.posix.cpp Log Message: Reordered ctor/open() args. Removed std::string ctor/open() method. Added default args for ctor and open(). Index: File.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/File.posix.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- File.posix.cpp 24 Dec 2004 17:15:51 -0000 1.6 +++ File.posix.cpp 30 Dec 2004 17:07:00 -0000 1.7 @@ -91,21 +91,12 @@ _handle = (unsigned long)handle; } -File::File(const Unicode::String& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(IO::IOError) -: _handle((unsigned long)-1) -{ - open(name,omode,amode,smode); -} - -#ifdef PCLASSES_WITH_STL -File::File(const std::string& name, OpenMode omode, AccessMode amode, +File::File(const Unicode::String& name, AccessMode amode, OpenMode omode, ShareMode smode) throw(IO::IOError) : _handle((unsigned long)-1) { - open(name,omode,amode,smode); + open(name,amode,omode,smode); } -#endif File::~File() throw() { @@ -115,37 +106,14 @@ } } -void File::open(const Unicode::String& name, OpenMode omode, AccessMode amode, - ShareMode smode) throw(LogicError, IO::IOError) -{ - if(!valid()) - { - /*@fixme - int flags = OpenMode2Flags(omode) | AccessMode2Flags(amode); - int handle = ::open(name.utf8(), flags); - if(handle == -1) - throw IO::IOError(errno, "Could not open file", P_SOURCEINFO); - - _handle = (unsigned long)handle; - IODevice::setAccess(amode); - IODevice::setValid(true); - IODevice::setEof(false);*/ - - return; - } - - throw LogicError("File is already open", P_SOURCEINFO); -} - -#ifdef PCLASSES_WITH_STL -void File::open(const std::string& name, OpenMode omode, AccessMode amode, +void File::open(const Unicode::String& name, AccessMode amode, OpenMode omode, ShareMode smode) throw(LogicError, IO::IOError) { if(!valid()) { int flags = OpenMode2Flags(omode) | AccessMode2Flags(amode); - int handle = ::open(name.c_str(), flags); + int handle = ::open(name.utf8().c_str(), flags, 0644); if(handle == -1) throw IO::IOError(errno, "Could not open file", P_SOURCEINFO); @@ -159,7 +127,6 @@ throw LogicError("File is already open", P_SOURCEINFO); } -#endif void File::close() throw(LogicError, IO::IOError) { |
From: stephan b. <sg...@us...> - 2004-12-30 16:46:40
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24383/include/pclasses/Util Modified Files: Makefile.am Log Message: Added SimpleArgvParser. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 28 Dec 2004 23:25:12 -0000 1.3 +++ Makefile.am 30 Dec 2004 16:46:30 -0000 1.4 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = Any.h LexT.h ManagedThread.h Prefs.h SimplePropertyStore.h StringTool.h ThreadPool.h Variant.h WorkQueue.h +pkginclude_HEADERS = Any.h LexT.h ManagedThread.h Prefs.h SimplePropertyStore.h SimpleArgvParser.h StringTool.h ThreadPool.h Variant.h WorkQueue.h |
From: stephan b. <sg...@us...> - 2004-12-30 16:46:40
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24383/src/Util Modified Files: Makefile.am Log Message: Added SimpleArgvParser. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 28 Dec 2004 23:01:01 -0000 1.3 +++ Makefile.am 30 Dec 2004 16:46:31 -0000 1.4 @@ -1,7 +1,13 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_util.la -libpclasses_util_la_SOURCES = ManagedThread.cpp Prefs.cpp SimplePropertyStore.cpp StringTool.cpp ThreadPool.cpp Variant.cpp WorkQueue.cpp +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? libpclasses_util_la_LIBADD = $(top_builddir)/src/System/libpclasses_system.la \ $(top_builddir)/src/libpclasses.la |
From: stephan b. <sg...@us...> - 2004-12-30 16:40:54
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23149/test Modified Files: Makefile.toc Log Message: Added SimpleArgvParser. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.toc 29 Dec 2004 20:55:37 -0000 1.14 +++ Makefile.toc 30 Dec 2004 16:40:40 -0000 1.15 @@ -1,6 +1,8 @@ #!/usr/bin/make -f include toc.make +# CXXFLAGS := $(shell echo $(CFFLAGS) | sed s/.DNDEBUG=1//) + HEADERS = Test.h \ FactoryTest.h @@ -15,7 +17,12 @@ build_bins = 1 ifeq (1,$(build_bins)) - BIN_PROGRAMS = PtrTest StringToolTest FactoryTest s11nTest SimplePropertyStoreTest + BIN_PROGRAMS = PtrTest \ + StringToolTest \ + FactoryTest \ + s11nTest \ + SimpleArgvParserTest \ + SimplePropertyStoreTest BIN_PROGRAMS_LDADD = $(LIBP_TESTS_LDADD) FactoryTest_bin_OBJECTS = FactoryTest.o registrations.o FactoryTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPSIO_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) @@ -27,6 +34,8 @@ s11nTest_bin_LDADD = $(LIBPSIO_CLIENT_LDADD) $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) SimplePropertyStoreTest_bin_LDADD = $(s11nTest_bin_LDADD) SimplePropertyStoreTest_bin_OBJECTS = SimplePropertyStoreTest.o + SimpleArgvParserTest_bin_LDADD = $(s11nTest_bin_LDADD) + SimpleArgvParserTest_bin_OBJECTS = SimpleArgvParserTest.o include $(TOC_MAKESDIR)/BIN_PROGRAMS.make endif |
From: stephan b. <sg...@us...> - 2004-12-30 16:40:53
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23149/src/Util Modified Files: Makefile.toc Log Message: Added SimpleArgvParser. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.toc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.toc 28 Dec 2004 23:01:02 -0000 1.8 +++ Makefile.toc 30 Dec 2004 16:40:40 -0000 1.9 @@ -3,6 +3,7 @@ SOURCES = \ ManagedThread.cpp \ Prefs.cpp \ + SimpleArgvParser.cpp \ SimplePropertyStore.cpp \ StringTool.cpp \ ThreadPool.cpp \ |