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-31 17:23:57
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16416/include/pclasses/System Modified Files: Makefile.toc Log Message: Removed a bunch of bogus comment lines. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 29 Dec 2004 20:21:16 -0000 1.4 +++ Makefile.toc 31 Dec 2004 17:23:46 -0000 1.5 @@ -1,20 +1,9 @@ #!/usr/bin/make -f -################################################### -# AUTO-GENERATED guess at a toc-aware Makefile, -# based off of the contents of directory: -# ./include/pclasses/System -# Created by ./toc/bin/create_makefile_stubs.sh -# Thu Dec 23 01:31:56 CET 2004 -# It must be tweaked to suit your needs. -################################################### include toc.make -############## FLEXES: + HEADERS = $(wildcard *.h) DIST_FILES += $(HEADERS) INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/System INSTALL_PACKAGE_HEADERS += $(HEADERS) all: -################################################### -# end auto-generated rules -################################################### |
From: stephan b. <sg...@us...> - 2004-12-31 16:43:29
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9051/src/App Modified Files: Makefile.toc Log Message: Corrected ld flags. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/App/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 30 Dec 2004 20:59:29 -0000 1.1 +++ Makefile.toc 31 Dec 2004 16:43:19 -0000 1.2 @@ -21,7 +21,7 @@ LIBNAME = lib$(LIBPAPP_BASENAME) SHARED_LIBS = $(LIBNAME) SHARED_LIBS_LDADD = $(P_BACKLINK_LDADD) -$(LIBNAME)_so_LDADD = $(LIBPS11N_LDADD) +$(LIBNAME)_so_LDADD = $(LIBPSIO_CLIENT_LDADD) $(LIBNAME)_so_OBJECTS = $(OBJECTS) $(SUBDIR_OBJECTS) $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) include $(TOC_MAKESDIR)/SHARED_LIBS.make |
From: stephan b. <sg...@us...> - 2004-12-31 16:18:45
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4077/src/App Modified Files: AppDetails.cpp Log Message: Changed some (const String &) returns to (String). Index: AppDetails.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/App/AppDetails.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AppDetails.cpp 30 Dec 2004 20:59:29 -0000 1.1 +++ AppDetails.cpp 31 Dec 2004 16:18:31 -0000 1.2 @@ -5,6 +5,9 @@ struct AppDetails::AppDetailsHolder { +// AppDetailsHolder() :name(""),about(""),license(""),authors() +// { +// } ::P::Unicode::String name; ::P::Unicode::String about; ::P::Unicode::String license; @@ -49,21 +52,21 @@ AppDetails::getAuthors() const throw() { return this->details()->authors; } - const String & + String AppDetails::getLicenseText() const throw() { return this->details()->license; } void AppDetails::setLicenseText( const String & l ) throw() { this->details()->license = l; } - const String & + String AppDetails::getName() const throw() { return this->details()->name; } void AppDetails::setName( const String & n ) throw() { this->details()->name = n; } - const String & + String AppDetails::getAboutText() const throw() { return this->details()->about; } |
From: stephan b. <sg...@us...> - 2004-12-31 16:18:40
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4077/include/pclasses/App Modified Files: AppDetails.h Log Message: Changed some (const String &) returns to (String). Index: AppDetails.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/App/AppDetails.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AppDetails.h 30 Dec 2004 20:59:28 -0000 1.1 +++ AppDetails.h 31 Dec 2004 16:18:31 -0000 1.2 @@ -1,5 +1,5 @@ -#ifndef App_APPINFO_HPP_INCLUDED -#define App_APPINFO_HPP_INCLUDED 1 +#ifndef p_App_APPINFO_HPP_INCLUDED +#define p_App_APPINFO_HPP_INCLUDED 1 #include <string> #include <list> @@ -41,15 +41,15 @@ const DetailList & getAuthors() const throw(); - const String & getLicenseText() const throw(); + String getLicenseText() const throw(); void setLicenseText( const String & l ) throw(); - const String & getName() const throw(); + String getName() const throw(); void setName( const String & n ) throw(); - const String & getAboutText() const throw(); + String getAboutText() const throw(); void setAboutText( const String & n ) throw(); @@ -59,38 +59,7 @@ AppDetailsHolder * details() const; // performs lazy instantiation of m_detail }; -#define APPDETAIL_S11N_EXPERIMENTATION 0 -#if 1 == APPDETAIL_S11N_EXPERIMENTATION - struct AppDetails_s11n - { - // serialize - template <typename NodeType> - bool operator()( NodeType & dest, const AppDetails & src ) const - { - typedef ::P::s11n::node_traits<NodeType> TR; - TR::class_name( dest, "P::App::AppDetails" ); - TR::set( dest, "name", src.getName() ); - TR::set( dest, "about", src.getAboutText() ); - TR::set( dest, "license", src.getLicenseText() ); - return ::P::s11n::serialize_subnode<NodeType,AppDetails>( dest, "authors", src.getAuthors() ); - } - - // deserialize - template <typename NodeType> - bool operator()( const NodeType & src, AppDetails & dest ) const - { - typedef ::P::s11n::node_traits<NodeType> TR; - dest.setName( TR::get( src, "name", dest.getName() ) ); - dest.setAboutText( TR::get( src, "about", dest.getAboutText() ) ); - dest.setLicenseText( TR::get( src, "license", dest.getLicenseText() ) ); - return ::P::s11n::deserialize_subnode<NodeType,AppDetails>( src, "authors", src.getAuthors() ); - } - }; // AppDetails_s11n -#endif // APPDETAIL_S11N_EXPERIMENTATION - - }} // namespace P::App - -#endif // App_APPINFO_HPP_INCLUDED +#endif // p_App_APPINFO_HPP_INCLUDED |
From: stephan b. <sg...@us...> - 2004-12-31 16:17:43
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3840/src/s11n/proxy Modified Files: proxyGen Log Message: Corrected closing braces in generated class. Index: proxyGen =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/proxy/proxyGen,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- proxyGen 30 Dec 2004 19:17:35 -0000 1.1 +++ proxyGen 31 Dec 2004 16:17:34 -0000 1.2 @@ -80,9 +80,9 @@ print "\n"; print <<EOF return true; - }; + } -} +}; // $pname EOF ; |
From: stephan b. <sg...@us...> - 2004-12-31 16:16:59
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3551/src/s11n/io Modified Files: data_node_io.h Log Message: Added a try/catch, to help accomodate the massive number of throws from ctors in P. Index: data_node_io.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/data_node_io.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- data_node_io.h 27 Dec 2004 18:06:46 -0000 1.5 +++ data_node_io.h 31 Dec 2004 16:16:45 -0000 1.6 @@ -335,7 +335,15 @@ return NULL; } // CERR << "Dispatching to node loader for cookie ["<<cookie<<"]\n"; - return ser->deserialize( is ); + try + { + return ser->deserialize( is ); + } + catch( ... ) + { + return 0; + } + return 0; } /** |
From: stephan b. <sg...@us...> - 2004-12-31 16:16:06
|
Update of /cvsroot/pclasses/pclasses2/src/SIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3245/src/SIO Modified Files: Makefile.toc registrations.cpp Log Message: Removed parens_serializer until it's input parser is ported. Index: registrations.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/registrations.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- registrations.cpp 29 Dec 2004 19:54:44 -0000 1.1 +++ registrations.cpp 31 Dec 2004 16:15:57 -0000 1.2 @@ -12,7 +12,7 @@ // KLUDGE until i get S11nNode fully integrated... # include "../s11n/io/expat/expat_serializer.h" #endif -# include "../s11n/io/parens/parens_serializer.h" +// # include "../s11n/io/parens/parens_serializer.h" //////////////////////////////////////////////////////////////////////// #define SIO_KEY_DEFAULT_SERIALIZER "/P/SIO/DefaultSerializerClass" @@ -36,8 +36,8 @@ PM.alias( "P::s11n::io::expat_serializer", "s11n::io::expat_serializer" ); PM.alias( SIO_KEY_DEFAULT_SERIALIZER, "expat" ); #endif - SREG(parens, "s11n::io::parens_serializer", "parens" ); - PM.alias( "P::s11n::io::parens_serializer", "s11n::io::parens_serializer" ); +// SREG(parens, "s11n::io::parens_serializer", "parens" ); +// PM.alias( "P::s11n::io::parens_serializer", "s11n::io::parens_serializer" ); #undef SREG #undef PM } Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 30 Dec 2004 22:54:26 -0000 1.2 +++ Makefile.toc 31 Dec 2004 16:15:57 -0000 1.3 @@ -31,7 +31,7 @@ ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) S11NIO_OBJECTS += $(S11NIO_DIR)/expat/expat_serializer.o endif -S11NIO_OBJECTS += $(S11NIO_DIR)/parens/parens_serializer.o +# S11NIO_OBJECTS += $(S11NIO_DIR)/parens/parens_serializer.o LIBNAME = lib$(LIBPSIO_BASENAME) |
From: stephan b. <sg...@us...> - 2004-12-31 15:12:00
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15745/test Modified Files: CType.cpp FactoryTest.cpp FactoryTest.h Log Message: Added some non-default ctors to TheBase, to test out ideas for Factorying with non-default ctors. Index: FactoryTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- FactoryTest.cpp 26 Dec 2004 09:30:37 -0000 1.9 +++ FactoryTest.cpp 31 Dec 2004 15:11:49 -0000 1.10 @@ -12,7 +12,6 @@ #include <pclasses/Plugin/Plugin.h> - int main( int argc, char ** argv ) { CERR << "Factory tests...\n"; @@ -20,6 +19,7 @@ TheBase * a = 0; + typedef P::NamedTypeFactory<TheBase> NTF; typedef P::Plugin::PluginManager<TheBase> PM; Index: FactoryTest.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- FactoryTest.h 30 Dec 2004 23:09:45 -0000 1.7 +++ FactoryTest.h 31 Dec 2004 15:11:49 -0000 1.8 @@ -18,7 +18,11 @@ struct TheBase { - + TheBase() {} + explicit TheBase( int i ) + { + CERR << "TheBase("<<i<<")\n"; + } virtual ~TheBase() {} virtual std::string classname() const = 0; @@ -63,6 +67,10 @@ struct AType : public TheBase { + explicit AType( int i ) : TheBase(i) + { + CERR << "AType("<<i<<")\n"; + } AType() { CERR << "AType()\n"; @@ -79,6 +87,11 @@ struct BType : public AType { + explicit BType( int i ) : AType(i) + { + CERR << "BType("<<i<<")\n"; + } + BType() { CERR << "BType()\n"; Index: CType.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/CType.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CType.cpp 26 Dec 2004 06:00:55 -0000 1.3 +++ CType.cpp 31 Dec 2004 15:11:49 -0000 1.4 @@ -4,6 +4,11 @@ struct CType : public BType { + explicit CType( int i ) : BType(i) + { + CERR << "CType("<<i<<")\n"; + } + CType() { CERR << "CType()\n"; |
From: stephan b. <sg...@us...> - 2004-12-31 15:10:02
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15300/include/pclasses Modified Files: Factory.h Log Message: Minor code touch-ups, pedantic reorgs. One compile fix in uninstantiated template code. Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Factory.h 29 Dec 2004 20:11:11 -0000 1.15 +++ Factory.h 31 Dec 2004 15:09:52 -0000 1.16 @@ -82,7 +82,7 @@ */ ResultType operator()() { - return create(); + return this->create(); } }; @@ -192,27 +192,56 @@ { public: + + /** + A typedef for the KeyType used by this class. + */ + typedef KeyType key_type; + + /** Same as ContextType */ + typedef ContextT ContextType; + /** A typedef for the InterfaceT used by this class. + For conformance with the Adaptable Unary Functor + model */ typedef InterfaceT value_type; /** - Same as (InterfaceT *), for conformance with the - Adaptable Unary Functor model. + Same as (InterfaceT *). */ typedef InterfaceT * ResultType; + /** + Convenience typedef. + */ + typedef Factory< InterfaceT, ContextType, KeyType > ThisType; + + /** + A map type for storing lookup key aliases. + */ + typedef std::map<key_type,key_type> AliasMap; + + Factory() {} + + virtual ~Factory() {} /** - A typedef for the KeyType used by this class. + The type of factories used by this class: a + function taking void and returning (value_type + *). See factoryMap(). + + todo: implement proper functor support. */ - typedef KeyType key_type; + typedef ResultType ( *FactoryFuncType ) (); - /** Same as ContextType */ - typedef ContextT ContextType; + /** + Internal container type used for mapping keys to + factories. + */ + typedef std::map < key_type, FactoryFuncType > FactoryMap; - typedef std::map<key_type,key_type> AliasMap; /** Returns the map of classname aliases. @@ -274,30 +303,6 @@ return exp; } - /** - Convenience typedef. - */ - typedef Factory< InterfaceT, ContextType, KeyType > ThisType; - - Factory() {} - - virtual ~Factory() {} - - /** - The type of factories used by this class: a - function taking void and returning (value_type - *). See factoryMap(). - - todo: implement proper functor support. - */ - typedef ResultType ( *FactoryFuncType ) (); - - /** - Internal container type used for mapping keys to - factories. - */ - typedef std::map < key_type, FactoryFuncType > FactoryMap; - /** Tries to instantiate an instance of value_type @@ -345,7 +350,7 @@ */ ResultType operator()( const key_type & key ) { - return this->internal( key ); + return this->create( key ); } @@ -429,7 +434,7 @@ /** The CL namespace encapsulates P's classloader-related API. - All of the functions in this API use the obbject + All of the functions in this API use the object NamedTypeFactory<InterfaceT>::instance() for factory-related operations. Thus, using the various Hook classes you can force these functions to use your factory. @@ -437,12 +442,10 @@ i don't like this namespace. Maybe move these functions into Factory itself??? They're simply proxying that type, after all. - */ namespace CL { using namespace ::P; - using namespace ::P::Sharing; /** Registers classname with InterfaceT. If factory_function is 0 |
From: Christian P. <cp...@us...> - 2004-12-31 15:02:08
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13840/test Modified Files: IOTest.cpp Log Message: Added ProcessIO test. Index: IOTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/IOTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IOTest.cpp 30 Dec 2004 17:18:26 -0000 1.1 +++ IOTest.cpp 31 Dec 2004 15:01:57 -0000 1.2 @@ -21,25 +21,122 @@ #include "Test.h" #include "pclasses/IO/IOStream.h" #include "pclasses/System/File.h" +#include "pclasses/System/Pipe.h" +#include "pclasses/System/Process.h" +#include "pclasses/System/ProcessIO.h" + +#include <string> namespace P { +using IO::IOStream; using System::File; +using System::Pipe; +using System::Process; +using System::ProcessIO; class FileTest: public UnitTest { public: void run() throw() { - File file("pclasses_file_test.tmp", File::Write); - P_TEST(file.write("test", 4) == 4); + char data[] = "test"; + + File file("pclasses_file_test.tmp", File::ReadWrite); + P_TEST(file.valid()); + + // write data to file + P_TEST(file.write(data, 4) == 4); P_TEST(file.size() == 4); + // seek to beginning of file P_TEST(file.seek(0, File::SeekSet) == 0); - //@fixme .. wtf ? why is errno==EBADF ? + // read data from file char tmp[4]; P_TEST(file.read(tmp, 4) == 4); + + // verify read data + for(int i = 0; i < 4; i++) + P_TEST(tmp[i] == data[i]); + + // read past the end ... + P_TEST(file.read(tmp, 1) == 0); + P_TEST(file.eof()); + + // close file + file.close(); + P_TEST(!file.valid()); + P_TEST_EXCEPTION(file.close(), LogicError); + + // this must fail cause pclasses_file_test.tmp already exists... + P_TEST_EXCEPTION( + file.open("pclasses_file_test.tmp", File::Read, File::CreateFail), + IO::IOError + ); + } +}; + +class PipeTest: public UnitTest { + public: + + void run() throw() + { + char data[] = "test"; + + Pipe::Pair pipes = Pipe::create(); + + Pipe& readPipe = pipes.first; + Pipe& writePipe = pipes.second; + + P_TEST(writePipe.valid()); + P_TEST(writePipe.write(data, 4) == 4); + + char tmp[4]; + P_TEST(readPipe.valid()); + P_TEST(!readPipe.eof()); + P_TEST(readPipe.read(tmp, 4) == 4); + + for(int i = 0; i < 4; i++) + P_TEST(tmp[i] == data[i]); + + writePipe.close(); + P_TEST(!writePipe.valid()); + P_TEST_EXCEPTION(writePipe.close(), LogicError); + + P_TEST(readPipe.read(tmp, 1) == 0); + P_TEST(readPipe.eof()); + + readPipe.close(); + P_TEST(!readPipe.valid()); + P_TEST_EXCEPTION(readPipe.close(), LogicError); + } +}; + +class ProcessIOTest: public UnitTest { + public: + + void run() throw() + { + char data[] = "test"; + + Process proc("./IOTest"); + proc.addArg("arg1"); + + P_TEST(proc.state() == Process::Stopped); + proc.start(Process::RedirectAll); + P_TEST(proc.state() == Process::Running); + + char tmp[4]; + ProcessIO& io = proc.processIO(); + + P_TEST(io.read(tmp, 4) == 4); + P_TEST(io.readErr(tmp, 4) == 4); + P_TEST(io.write(data, 4) == 4); + P_TEST(io.write("\r", 1) == 1); + + P_TEST(proc.wait() == 0); + P_TEST(proc.state() == Process::Stopped); } }; @@ -47,8 +144,26 @@ int main(int argc, char* argv[]) { + if(argc > 1) + { + std::cout << "test"; + std::cerr << "test"; + std::string tmp; + std::cin >> tmp; + if(tmp != "test") + return 1; + + return 0; + } + + P::PipeTest pt; + pt.run(); + P::FileTest ft; ft.run(); - + + P::ProcessIOTest piot; + piot.run(); + return 0; } |
From: stephan b. <sg...@us...> - 2004-12-31 14:38:55
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8539/include/pclasses/IO Modified Files: Makefile.toc Log Message: Added missing headers. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 26 Dec 2004 16:26:28 -0000 1.2 +++ Makefile.toc 31 Dec 2004 14:38:46 -0000 1.3 @@ -1,9 +1,7 @@ #!/usr/bin/make -f include toc.make -HEADERS = IODevice.h \ - IOError.h \ - URL.h +HEADERS = $(wildcard *.h) DIST_FILES += $(HEADERS) INSTALL_PACKAGE_HEADERS += $(HEADERS) |
From: stephan b. <sg...@us...> - 2004-12-31 14:38:34
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8493/include/pclasses/IO Modified Files: IOManager.h Log Message: Accomodated URL's move to IO module. Index: IOManager.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/IOManager.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- IOManager.h 25 Dec 2004 19:56:32 -0000 1.3 +++ IOManager.h 31 Dec 2004 14:38:25 -0000 1.4 @@ -3,7 +3,7 @@ #include "pclasses/Factory.h" #include "pclasses/Plugin/Plugin.h" -#include "pclasses/Net/URL.h" +#include "pclasses/IO/URL.h" namespace P { namespace IO { @@ -19,7 +19,6 @@ typedef ::P::PluginManager<InterfaceT> ParentType; typedef typename ParentType::FactoryFuncType FactoryFuncType; typedef typename ParentType::ResultType ResultType; - using ::P::Net::URL; IOPluginManager(){} virtual ~IOPluginManager(){} |
From: stephan b. <sg...@us...> - 2004-12-31 14:35:37
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7937/include/pclasses/Util Modified Files: SimpleArgvParser.h Log Message: Default CTor is now public. Index: SimpleArgvParser.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/SimpleArgvParser.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SimpleArgvParser.h 30 Dec 2004 16:38:45 -0000 1.1 +++ SimpleArgvParser.h 31 Dec 2004 14:35:27 -0000 1.2 @@ -2,9 +2,16 @@ #define P_Util_SIMPLEARGVPARSER_HPP_INCLUDED 1 #include <pclasses/Util/SimplePropertyStore.h> -#include <pclasses/Phoenix.h> namespace P { namespace Util { + /** + SimpleArgvParser is a helper for applications which need to + process command-line arguments and don't have strict + requirements for doing so. + + See the parse() function for full information about the + supported argument type. + */ class SimpleArgvParser : public SimplePropertyStore { public: @@ -16,21 +23,80 @@ typedef ParentType::iterator iterator; typedef ParentType::const_iterator const_iterator; + /** + Creats a new argv parser and calls parse(argc,argv) + on it. + */ SimpleArgvParser( int argc, char ** argv ); + + /** + Creates an empty parser. It is pretty useless until + parse() is called or items are explicitely set(). + */ + SimpleArgvParser(); + virtual ~SimpleArgvParser(); + /** + Parsed out arguments in the following formats and + adds them as key/value pairs in this object: + + --ARG=VAL + + --ARG VALUE (same --ARG=VALUE, except that you must + use the equals sign if VALUE starts with a '-'.) + + --ARG="use quotes if it has spaces" + + --ARG [--NONVALUE] same as --ARG=1 + + It does not care if you use - or -- as an argument + prefix: any leading number of dashes are accepted. + + Any entries in argv which are not args or values + ar flags are ignored. + + Each flag entry is entered into this object using + set(), such that get("flag") will return the value + of the --flag parameter. + + Returns the number of arguments parsed out of argv. + + When calling this from main, you can have this + function skip the first argc (the app name) by + callin parse(argc-1,argv+1). + + This function does not clear this object before + parsing: new entries are added to the existing map. + + Note that this type's map is not a multimap, thus + arguments added more than once will take the value + of the most recent one processed. That is, the one + which comes latest in argv. + + Also note that the keys are stored in lexically + sorted order in the map, so there is no way to know + their input order via this class. + */ size_t parse( int argc, char ** argv ); + /** + Populates the shared SimpleArgsParser object. + */ static SimpleArgvParser & args( int argc, char ** argv ); + + /** + Returns a shared SimpleArgvParser. Intended to be + populated from main (or similar) by the overloaded + form of this function. + */ static SimpleArgvParser & args(); + /** + Same as size(). This name is more conventional for + this specific type. + */ int argc() const { return this->size(); } - - private: - SimpleArgvParser(); - typedef ::P::Phoenix< SimpleArgvParser > ArgvPhoenix; - friend class ArgvPhoenix; - }; |
From: stephan b. <sg...@us...> - 2004-12-31 14:34:19
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7652/src/System Modified Files: Makefile.toc Log Message: Added ProcessIO.cpp, Process.common.cpp, Process.posix.cpp Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Makefile.toc 28 Dec 2004 20:21:19 -0000 1.17 +++ Makefile.toc 31 Dec 2004 14:34:10 -0000 1.18 @@ -16,11 +16,12 @@ Mime.cpp \ Mutex.cpp \ PathFinder.cpp \ + Process.common.cpp \ + ProcessIO.cpp \ SystemError.cpp \ timeout.cpp \ SharedLib.common.cpp - SOURCES_SO_LIBDL = \ SharedLib.dl.cpp @@ -54,6 +55,7 @@ FileInfo.posix.cpp \ Mutex.posix.cpp \ Pipe.posix.cpp \ + Process.posix.cpp \ Semaphore.posix.cpp \ SharedMemory.posix.cpp \ SystemClock.posix.cpp \ |
From: Christian P. <cp...@us...> - 2004-12-31 03:24:37
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22658/src/System Modified Files: Makefile.am Log Message: Added ProcessIO.cpp, Process.common.cpp, Process.posix.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 28 Dec 2004 20:35:47 -0000 1.5 +++ Makefile.am 31 Dec 2004 03:24:26 -0000 1.6 @@ -58,11 +58,11 @@ endif if WITH_POSIX_IO -IO_Sources = Pipe.posix.cpp File.posix.cpp FileInfo.posix.cpp Directory.posix.cpp +IO_Sources = Pipe.posix.cpp File.posix.cpp FileInfo.posix.cpp Directory.posix.cpp Process.posix.cpp endif if WITH_WIN32_IO -IO_Sources = Pipe.win32.cpp File.win32.cpp FileInfo.win32.cpp Directory.win32.cpp +IO_Sources = Pipe.win32.cpp File.win32.cpp FileInfo.win32.cpp Directory.win32.cpp Process.win32.cpp endif if WITH_POSIX_TIME @@ -81,8 +81,8 @@ libpclasses_system_la_SOURCES = timeout.cpp SystemError.cpp \ CriticalSection.cpp Mutex.cpp $(Thread_Sources) \ $(Semaphore_Sources) $(SharedMem_Sources) $(SharedLib_Sources) \ - SharedLib.common.cpp FileInfo.common.cpp $(IO_Sources) \ - $(Time_Sources) + SharedLib.common.cpp FileInfo.common.cpp ProcessIO.cpp Process.common.cpp \ + $(IO_Sources) $(Time_Sources) libpclasses_system_la_LDFLAGS = -no-undefined libpclasses_system_la_LIBADD = $(top_builddir)/src/libpclasses.la \ |
From: Christian P. <cp...@us...> - 2004-12-31 03:24:03
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22572/include/pclasses/System Modified Files: Makefile.am Log Message: Added ProcessIO.h, Process.h Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 28 Dec 2004 20:28:21 -0000 1.3 +++ Makefile.am 31 Dec 2004 03:23:53 -0000 1.4 @@ -2,4 +2,4 @@ METASOURCES = AUTO pkginclude_HEADERS = SystemError.h SharedMemory.h CriticalSection.h Mutex.h \ Condition.h Semaphore.h Thread.h SharedLib.h File.h FileInfo.h \ - Directory.h SystemClock.h + Directory.h SystemClock.h ProcessIO.h Process.h |
From: Christian P. <cp...@us...> - 2004-12-31 03:23:09
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22434/include/pclasses/System Added Files: Process.h ProcessIO.h Log Message: Added ProcessIO and Process class (compiles but untested). --- NEW FILE: Process.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_System_Process_h #define P_System_Process_h #include <pclasses/Unicode/String.h> #include <pclasses/IO/IOError.h> #include <pclasses/System/SystemError.h> #include <pclasses/System/ProcessIO.h> #include <list> namespace P { namespace System { //! Child process class /*! This class is used to concurrently execute child processes. \author Christian Prochnow <cp...@se...> */ class Process { public: //! Child process state enum State { Stopped, Running, Stopping }; //! Communication mode flags enum CommFlags { NoComm = 0x00, /*!< Close StdIn, StdOut, StdErr */ InheritStdIn = 0x01, /*!< Inherit StdIn from parent */ RedirectStdIn = 0x02, /*!< Redirect StdIn to ProcessIO object */ InheritStdOut = 0x04, /*!< Inherit StdOut from parent */ RedirectStdOut = 0x08, /*!< Redirect StdOut to ProcessIO object */ InheritStdErr = 0x10, /*!< Inherit StdErr from parent */ RedirectStdErr = 0x20, /*!< Redirect StdErr to ProcessIO object */ InheritAll = InheritStdIn|InheritStdOut|InheritStdErr, RedirectAll = RedirectStdIn|RedirectStdOut|RedirectStdErr }; //! Argument list type typedef std::list<Unicode::String> ArgList; //! Process constructor Process(const Unicode::String& program, const ArgList& args = ArgList()); ~Process() throw(); //! Returns the process state State state() const; void setArgs(const ArgList& args); //! Add argument void addArg(const Unicode::String& arg); //! Clear arguments void clearArgs(); //! Set working directory void setWorkDir(const Unicode::String& dir); //! Returns the programs working directory const Unicode::String& workDir() const; //! Run program void start(int mode = NoComm) throw(IO::IOError,SystemError,LogicError); //! Terminate process void stop() throw(SystemError); //! Kill process void kill() throw(SystemError); //! Try wait for program to finish bool tryWait(int& exitCode) throw(SystemError); //! Wait for program to finish int wait() throw(SystemError); //! Return the process i/o object ProcessIO& processIO() const throw(LogicError); private: unsigned long _handle; ProcessIO* _procIO; State _state; Unicode::String _workDir; Unicode::String _program; ArgList _args; }; } // !namespace System } // !namespace P #endif --- NEW FILE: ProcessIO.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_System_ProcessIO_h #define P_System_ProcessIO_h #include <pclasses/IO/IODevice.h> #include <pclasses/System/Pipe.h> namespace P { namespace System { //! Child process I/O device /*! \author Christian Prochnow <cp...@se...> */ class ProcessIO: public IO::IODevice { public: ProcessIO(const Pipe& in, const Pipe& out, const Pipe& err) throw(IO::IOError); ~ProcessIO() throw(); //! Close pipe's to child process void close() throw(IO::IOError); void closeWrite() throw(IO::IOError); void closeRead() throw(IO::IOError); void closeErr() throw(IO::IOError); //! Write to process stdin size_t write(const char* buffer, size_t count) throw(IO::IOError); //! Read from process stdout size_t read(char* buffer, size_t count) throw(IO::IOError); //! Read from process stderr size_t readErr(char* buffer, size_t count) throw(IO::IOError); private: Pipe _in, _out, _err; }; } // !namespace System } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2004-12-31 03:23:08
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22434/src/System Added Files: Process.common.cpp Process.posix.cpp ProcessIO.cpp Log Message: Added ProcessIO and Process class (compiles but untested). --- NEW FILE: ProcessIO.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/ProcessIO.h" namespace P { namespace System { ProcessIO::ProcessIO(const Pipe& in, const Pipe& out, const Pipe& err) throw(IO::IOError) : _in(in), _out(out), _err(err) { } ProcessIO::~ProcessIO() throw() { } void ProcessIO::close() throw(IO::IOError) { _in.close(); _out.close(); _err.close(); } void ProcessIO::closeWrite() throw(IO::IOError) { if(_in.valid()) _in.close(); } void ProcessIO::closeRead() throw(IO::IOError) { if(_out.valid()) _out.close(); } void ProcessIO::closeErr() throw(IO::IOError) { if(_err.valid()) _err.close(); } size_t ProcessIO::write(const char* buffer, size_t count) throw(IO::IOError) { return _in.write(buffer,count); } size_t ProcessIO::read(char* buffer, size_t count) throw(IO::IOError) { return _out.read(buffer,count); } size_t ProcessIO::readErr(char* buffer, size_t count) throw(IO::IOError) { return _err.read(buffer,count); } } // !namespace System } // !namespace P --- NEW FILE: Process.posix.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/Process.h" #include "pclasses/System/Directory.h" #include "pclasses/System/FileInfo.h" #include "pclasses/System/File.h" #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <errno.h> #include <string> namespace P { namespace System { void Process::start(int mode) throw(IO::IOError,SystemError,LogicError) { if(_state != Stopped) throw LogicError("Process is already running", P_SOURCEINFO); // test if file is existent FileInfo info = File::stat(_program); int ret; int infds[2] = { -1, -1 }; int outfds[2] = { -1, -1 }; int errfds[2] = { -1, -1 }; // save program dir, name and args std::string dir = _workDir.utf8(); std::string program = _program.utf8(); ArgList args = _args; // shall we redirect StdIn ? if(mode & RedirectStdIn) { ret = pipe(infds); if(ret == -1) throw IO::IOError(errno, "Could not create pipe", P_SOURCEINFO); } if(mode & RedirectStdOut) { ret = pipe(outfds); if(ret == -1) { close(infds[0]); close(infds[1]); throw IO::IOError(errno, "Could not create pipe", P_SOURCEINFO); } } if(mode & RedirectStdErr) { ret = pipe(errfds); if(ret == -1) { close(infds[0]); close(infds[1]); close(outfds[0]); close(outfds[1]); throw IO::IOError(errno, "Could not create pipe", P_SOURCEINFO); } } pid_t child = fork(); // fork failed if(child == -1) { close(infds[0]); close(infds[1]); close(outfds[0]); close(outfds[1]); close(errfds[0]); close(errfds[1]); throw SystemError(errno, "Could not start process", P_SOURCEINFO); } // child process else if(child == 0) { //close(0); close(1); close(2); if(mode & RedirectStdIn) { close(infds[1]); ret = dup2(infds[0], 0); close(infds[0]); if(ret == -1) _exit(127); } else if(!(mode & InheritStdIn)) close(0); if(mode & RedirectStdOut) { close(outfds[0]); ret = dup2(outfds[1], 1); close(outfds[1]); if(ret == -1) _exit(127); } else if(!(mode & InheritStdOut)) close(1); if(mode & RedirectStdErr) { close(outfds[0]); ret = dup2(errfds[1], 2); close(errfds[1]); if(ret == -1) _exit(127); } else if(!(mode & InheritStdErr)) close(2); if(!dir.empty()) Directory::change(dir); const char* argv[256]; int argc = 0; argv[argc++] = program.c_str(); for(ArgList::const_iterator argi = args.begin(); argi != args.end() && argc < 256; argi++) { argv[argc++] = (*argi).utf8().c_str(); } argv[argc] = 0; // exec binary, does not return except on error execve(_program.utf8().c_str(), (char**)argv, environ); _exit(127); } if(mode & RedirectStdIn) close(infds[0]); if(mode & RedirectStdOut) close(outfds[1]); if(mode & RedirectStdErr) close(errfds[1]); _handle = (unsigned long)child; if(mode) { _procIO = new ProcessIO(Pipe(infds[1],false), Pipe(outfds[0],true), Pipe(errfds[0],true)); } close(infds[1]); close(outfds[0]); close(errfds[0]); _state = Running; } void Process::stop() throw(SystemError) { int ret = ::kill((pid_t)_handle, SIGTERM); if(ret == -1) throw SystemError(errno, "Could not stop process", P_SOURCEINFO); } void Process::kill() throw(SystemError) { int ret = ::kill((pid_t)_handle, SIGKILL); if(ret == -1) throw SystemError(errno, "Could not kill process", P_SOURCEINFO); } bool Process::tryWait(int& exitCode) throw(SystemError) { int status = 0; pid_t pid = waitpid((pid_t)_handle, &status, WNOHANG|WUNTRACED); if(pid == -1) throw SystemError(errno, "Could not wait for process", P_SOURCEINFO); else if(pid == 0) return false; if(WIFEXITED(status) || WIFSIGNALED(status)) { exitCode = WIFEXITED(status) ? WEXITSTATUS(status) : 127; _state = Stopped; _handle = (unsigned long)-1; delete _procIO; _procIO = 0; return true; } return false; } int Process::wait() throw(SystemError) { int status = 0; Process_wait: pid_t pid = waitpid((pid_t)_handle, &status, WUNTRACED); if(pid == -1) { if(errno == EINTR) goto Process_wait; throw SystemError(errno, "Could not wait for process", P_SOURCEINFO); } _state = Stopped; _handle = (unsigned long)-1; delete _procIO; _procIO = 0; return WIFEXITED(status) ? WEXITSTATUS(status) : 127; } } // !namespace System } // !namespace P --- NEW FILE: Process.common.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/Process.h" namespace P { namespace System { Process::Process(const Unicode::String& program, const ArgList& args) : _handle((unsigned long)-1), _procIO(0), _state(Stopped), _program(program), _args(args) { } Process::~Process() throw() { } Process::State Process::state() const { return _state; } void Process::setArgs(const ArgList& args) { _args = args; } void Process::addArg(const Unicode::String& arg) { _args.push_back(arg); } void Process::clearArgs() { _args.clear(); } void Process::setWorkDir(const Unicode::String& dir) { _workDir = dir; } const Unicode::String& Process::workDir() const { return _workDir; } ProcessIO& Process::processIO() const throw(LogicError) { if(_procIO) return *_procIO; throw LogicError("Process does not have I/O channels", P_SOURCEINFO); } } // !namespace System } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-31 03:22:00
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22206/include/pclasses/System Modified Files: File.h Log Message: Added File::stat(). Index: File.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/File.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- File.h 30 Dec 2004 19:36:48 -0000 1.6 +++ File.h 31 Dec 2004 03:21:18 -0000 1.7 @@ -30,6 +30,8 @@ namespace System { +class FileInfo; + /** File is a cross-platform abstraction for filesystem-based files. */ @@ -114,6 +116,8 @@ */ File& operator=(const File& f) throw(IO::IOError); + static FileInfo stat(const Unicode::String& path) throw(IO::IOError); + private: unsigned long _handle; }; |
From: Christian P. <cp...@us...> - 2004-12-31 03:21:32
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22206/src/System Modified Files: File.posix.cpp Log Message: Added File::stat(). Index: File.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/File.posix.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- File.posix.cpp 30 Dec 2004 19:36:48 -0000 1.8 +++ File.posix.cpp 31 Dec 2004 03:21:19 -0000 1.9 @@ -19,6 +19,7 @@ ***************************************************************************/ #include "pclasses/System/File.h" +#include "pclasses/System/FileInfo.h" #include <sys/types.h> #include <sys/stat.h> @@ -288,6 +289,11 @@ return *this; } +FileInfo File::stat(const Unicode::String& path) throw(IO::IOError) +{ + return FileInfo(path); +} + } // !namespace System } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-31 03:20:49
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22099/include/pclasses/System Modified Files: Pipe.h Log Message: Pipe::Pipe(unsigned long, bool) is now public. Index: Pipe.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Pipe.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Pipe.h 30 Dec 2004 19:36:48 -0000 1.5 +++ Pipe.h 31 Dec 2004 03:20:41 -0000 1.6 @@ -35,6 +35,8 @@ Pipe(const Pipe& f) throw(IO::IOError); + Pipe(unsigned long handle, bool readEnd) throw(); + ~Pipe() throw(); static Pair create() throw(IO::IOError); @@ -51,7 +53,6 @@ private: unsigned long _handle; - Pipe(unsigned long h, bool readEnd) throw(); }; } // !namespace System |
From: stephan b. <sg...@us...> - 2004-12-31 02:45:19
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16410/src/Util Modified Files: SimpleArgvParser.cpp Log Message: Added API docs. Fixed (argc,argv) ctor to actually use it's args. Values may now be quoted strings. Index: SimpleArgvParser.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/SimpleArgvParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SimpleArgvParser.cpp 31 Dec 2004 02:19:37 -0000 1.2 +++ SimpleArgvParser.cpp 31 Dec 2004 02:45:09 -0000 1.3 @@ -1,7 +1,9 @@ #include <vector> #include <list> #include <pclasses/Util/SimpleArgvParser.h> +#include <pclasses/Util/StringTool.h> #include <pclasses/Phoenix.h> + namespace P { namespace Util { SimpleArgvParser::SimpleArgvParser() @@ -9,13 +11,17 @@ } SimpleArgvParser::SimpleArgvParser( int argc, char ** argv ) { - + this->parse( argc, argv ); } SimpleArgvParser::~SimpleArgvParser() { } + /** + Internal helper function to change a char** into an STL + container of strings. + */ template <typename ListT> size_t toList( ListT & tgt, int argc, char ** argv ) { @@ -25,7 +31,7 @@ } } - std::string strip_dashes( const std::string & s ) + std::string internal_strip_leading_dashes( const std::string & s ) { if( 0 != s.find( "-" ) ) return s; std::string::size_type first = s.find_first_not_of( "-" ); @@ -52,12 +58,13 @@ k = alist[at]; if( IS_ARG(k) ) { - k = strip_dashes( k ); + k = internal_strip_leading_dashes( k ); if( std::string::npos != (eqat = k.find( '=' )) ) { ++ret; nextarg = k.substr( eqat+1 ); + ::P::StringTool::normalizeString( nextarg ); // remove leading/trailing quotes k = k.substr( 0, eqat ); this->set( k, nextarg ); continue; @@ -78,11 +85,16 @@ else { ++ret; + ::P::StringTool::normalizeString( nextarg ); // remove leading/trailing quotes this->set( k, nextarg ); skipnext = true; continue; } } + else + { + // do nothing - we're not interesting in non-dashed args. + } } return ret; #undef IS_ARG @@ -99,9 +111,15 @@ return s; } + //! Internal marker class + struct SimpleArgvParserSharingContext {}; + SimpleArgvParser & SimpleArgvParser::args() { - return ArgvPhoenix::instance(); + return ::P::Phoenix< + SimpleArgvParser, + SimpleArgvParserSharingContext + >::instance(); } |
From: stephan b. <sg...@us...> - 2004-12-31 02:19:52
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11455/src/Util Modified Files: SimpleArgvParser.cpp Log Message: Now parses -arg=val args. Index: SimpleArgvParser.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/SimpleArgvParser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SimpleArgvParser.cpp 30 Dec 2004 16:38:45 -0000 1.1 +++ SimpleArgvParser.cpp 31 Dec 2004 02:19:37 -0000 1.2 @@ -42,6 +42,7 @@ SVec alist; int count = toList( alist, argc, argv ); size_t ret = 0; + std::string::size_type eqat = 0; std::string k; std::string nextarg; bool skipnext = false; @@ -52,6 +53,15 @@ if( IS_ARG(k) ) { k = strip_dashes( k ); + + if( std::string::npos != (eqat = k.find( '=' )) ) + { + ++ret; + nextarg = k.substr( eqat+1 ); + k = k.substr( 0, eqat ); + this->set( k, nextarg ); + continue; + } if( at == argc-1 ) { // final arg ++ret; |
From: stephan b. <sg...@us...> - 2004-12-30 23:11:34
|
Update of /cvsroot/pclasses/pclasses2/src/SIO/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6602/src/SIO/Proxy Modified Files: AppDetails_s11n.h LexT_s11n.h SimplePropertyStore_s11n.h String_s11n.h Time_s11n.h Log Message: Accommodated SIO changes. Index: String_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Proxy/String_s11n.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- String_s11n.h 30 Dec 2004 22:52:54 -0000 1.1 +++ String_s11n.h 30 Dec 2004 23:11:13 -0000 1.2 @@ -48,7 +48,7 @@ #define PS11N_TYPE ::P::Unicode::String #define PS11N_TYPE_NAME "P::Unicode::String" #define PS11N_SERIALIZE_FUNCTOR ::P::SIO::Proxy::String_s11n -#include <pclasses/s11n/reg_serializable_traits.h> +#include <pclasses/SIO/RegisterSerializable.h> #endif // p_UNICODE_STRING_REGISTERED_WITH_S11N Index: LexT_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Proxy/LexT_s11n.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LexT_s11n.h 30 Dec 2004 22:52:54 -0000 1.1 +++ LexT_s11n.h 30 Dec 2004 23:11:13 -0000 1.2 @@ -17,7 +17,7 @@ # define PS11N_TYPE P::Util::LexT # define PS11N_TYPE_NAME "LexT" # define PS11N_SERIALIZE_FUNCTOR ::P::s11n::streamable_type_serialization_proxy -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_UTIL_LEXT_REGISTERED_WITH_S11N Index: AppDetails_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Proxy/AppDetails_s11n.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AppDetails_s11n.h 30 Dec 2004 22:52:54 -0000 1.1 +++ AppDetails_s11n.h 30 Dec 2004 23:11:13 -0000 1.2 @@ -51,7 +51,7 @@ # define PS11N_TYPE P::App::AppDetails # define PS11N_TYPE_NAME "P::App::AppDetails" # define PS11N_SERIALIZE_FUNCTOR P::SIO::Proxy::AppDetails_s11n -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_APP_APPINFO_REGISTERED_WITH_S11N Index: SimplePropertyStore_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Proxy/SimplePropertyStore_s11n.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SimplePropertyStore_s11n.h 30 Dec 2004 22:52:54 -0000 1.1 +++ SimplePropertyStore_s11n.h 30 Dec 2004 23:11:13 -0000 1.2 @@ -9,7 +9,7 @@ # define PS11N_TYPE ::P::Util::SimplePropertyStore # define PS11N_TYPE_NAME "P::Util::SimplePropertyStore" # define PS11N_SERIALIZE_FUNCTOR ::P::s11n::map::streamable_map_serializable_proxy -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_UTIL_SIMPLEPRPOPERTYSTORE_REGISTERED_WITH_S11N Index: Time_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/SIO/Proxy/Time_s11n.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Time_s11n.h 30 Dec 2004 22:52:54 -0000 1.1 +++ Time_s11n.h 30 Dec 2004 23:11:13 -0000 1.2 @@ -61,7 +61,7 @@ # define PS11N_TYPE ::P::Time # define PS11N_TYPE_NAME "P::Time" # define PS11N_SERIALIZE_FUNCTOR P::Time_s11n -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_TIME_REGISTERED_WITH_S11N @@ -110,7 +110,7 @@ # define PS11N_TYPE ::P::Date # define PS11N_TYPE_NAME "P::Date" # define PS11N_SERIALIZE_FUNCTOR P::Date_s11n -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_DATE_REGISTERED_WITH_S11N @@ -157,7 +157,7 @@ # define PS11N_TYPE ::P::DateTime # define PS11N_TYPE_NAME "P::DateTime" # define PS11N_SERIALIZE_FUNCTOR P::DateTime_s11n -# include <pclasses/s11n/reg_serializable_traits.h> +# include <pclasses/SIO/RegisterSerializable.h> #endif // p_DATETIME_REGISTERED_WITH_S11N |
From: stephan b. <sg...@us...> - 2004-12-30 23:11:08
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6415/src Modified Files: Makefile.toc Log Message: Added App subdir. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.toc 30 Dec 2004 15:40:13 -0000 1.14 +++ Makefile.toc 30 Dec 2004 23:10:53 -0000 1.15 @@ -2,7 +2,7 @@ include toc.make -SUBDIRS = Unicode IO System Util s11n Net SIO +SUBDIRS = Unicode IO System Util s11n Net SIO App SOURCES = Alloc.cpp \ AtomicInt.gcc-x86.cpp \ |