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-24 11:41:19
|
Update of /cvsroot/pclasses/pclasses2/toc/sbin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9742 Modified Files: toc_core.sh Log Message: Was a bit too quick there - fixed an extra }. Index: toc_core.sh =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/sbin/toc_core.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- toc_core.sh 24 Dec 2004 11:39:44 -0000 1.2 +++ toc_core.sh 24 Dec 2004 11:41:08 -0000 1.3 @@ -163,7 +163,7 @@ ######################################################################## # _TOC_ATEXIT holds the path to this app's "atexit" code, which is # executed at app exit. -_TOC_ATEXIT=$TOP_SRCDIR}/.toc.atexit.sh +_TOC_ATEXIT=$TOP_SRCDIR/.toc.atexit.sh trap 'echo "rm $_TOC_ATEXIT" >> $_TOC_ATEXIT; $SHELL $_TOC_ATEXIT; exit;' 0 1 2 3 # ^^^^^ the 'exit' in the trap is to force a SIGINT/SIGHUP to cause an exit. # On a trap 0 the exit is redundant yet harmless. |
From: stephan b. <sg...@us...> - 2004-12-24 11:40:00
|
Update of /cvsroot/pclasses/pclasses2/toc/sbin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9471 Modified Files: toc_core.sh Log Message: Added toc_atexit() Index: toc_core.sh =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/sbin/toc_core.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc_core.sh 22 Dec 2004 19:04:25 -0000 1.1 +++ toc_core.sh 24 Dec 2004 11:39:44 -0000 1.2 @@ -160,6 +160,40 @@ return 0 } +######################################################################## +# _TOC_ATEXIT holds the path to this app's "atexit" code, which is +# executed at app exit. +_TOC_ATEXIT=$TOP_SRCDIR}/.toc.atexit.sh +trap 'echo "rm $_TOC_ATEXIT" >> $_TOC_ATEXIT; $SHELL $_TOC_ATEXIT; exit;' 0 1 2 3 +# ^^^^^ the 'exit' in the trap is to force a SIGINT/SIGHUP to cause an exit. +# On a trap 0 the exit is redundant yet harmless. +######################################################################## +# toc_atexit() is used to provide 'trap' functionality within the TOC framework. +# Client code should NEVER use trap directly, because trap does not offer +# a way to append trap commands. i.e., if clients add a trap they will override +# the framework's trap, which won't be nice. +# $@ must be a list of commands to run at app shutdown. +# Returns 0 unless there is a usage error, in which case it returns non-zero. +# Note that complex string quoting will probably not survive the quote-conversion +# process involved in function calls and parameter passing, so if you need to +# run complex commands at exit, send them to a script and then register that +# script to be run via toc_atexit(). +# +# Commands are run in the order they are registered, NOT in reverse order +# (as in C's atexit()). +# +# NEVER call exit from within atexit code! +toc_atexit() +{ + toc_debug toc_atexit "$@" + test "x" = "x$1" && { + echo "toc_atexit() usage error: \$@ must contain commands to run at app shutdown." + return 1 + } + echo "$@" >> $_TOC_ATEXIT + return 0 +} + toc_dump_make_properties () { # Dumps the current properties from the makefile array to stdout |
From: stephan b. <sg...@us...> - 2004-12-24 10:58:56
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2074 Modified Files: Makefile.toc toc.pclasses2.make.at Log Message: added some missing DIST_FILES Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc.pclasses2.make.at 22 Dec 2004 22:11:13 -0000 1.1 +++ toc.pclasses2.make.at 24 Dec 2004 10:58:46 -0000 1.2 @@ -3,9 +3,11 @@ CLEAN_FILES += $(wildcard *.o *~) -CXXFLAGS += -fPIC +# CXXFLAGS += -fPIC -INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses2 +DIST_FILES += Makefile.am -INCLUDES += $(PACKAGE_INCLUDES) +INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses + +INCLUDES += -I$(top_srcdir)/include -I$(top_srcdir)/include/pclasses $(PACKAGE_INCLUDES) Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 24 Dec 2004 01:14:17 -0000 1.2 +++ Makefile.toc 24 Dec 2004 10:58:46 -0000 1.3 @@ -1,12 +1,15 @@ #!/usr/bin/make -f include toc.make SUBDIRS = AT include m4 src templates test doc toc + DIST_FILES += README \ NEWS \ ChangeLog \ - toc.pclasses2.make.at \ autogen.sh \ find_toc.sh \ - notes.txt + notes.txt \ + toc.$(PACKAGE_NAME).make.at \ + toc.$(PACKAGE_NAME).help \ + configure configure.in configure.toc configure.$(PACKAGE_NAME) all: subdirs |
From: stephan b. <sg...@us...> - 2004-12-24 10:57:22
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1844 Added Files: toc.pclasses2.help Log Message: egg --- NEW FILE: toc.pclasses2.help --- (Reminder: not all of the following options actually work yet!) --without-stl : disable STL support. Might or might not result in a buildable tree. --with-atalk : enable AppleTalk protocol support. --with-ipx : enable IPX protocol. --with-ipv6 : enable IPV6. |
From: stephan b. <sg...@us...> - 2004-12-24 04:52:20
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5735 Modified Files: Makefile.toc Log Message: mass commit: build tweaks/fixes Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 23 Dec 2004 04:59:26 -0000 1.2 +++ Makefile.toc 24 Dec 2004 04:52:03 -0000 1.3 @@ -2,7 +2,7 @@ include toc.make -SUBDIRS = Net System Util +SUBDIRS = Unicode IO Net System Util HEADERS = Algorithm.h \ @@ -11,7 +11,6 @@ AtomicTraits.h \ BasicTypes.h \ ByteOrderTraits.h \ - Char.h \ CircularQueue.h \ Exception.h \ Factory.h \ @@ -24,7 +23,6 @@ LockTraits.h \ NonCopyable.h \ Pair.h \ - pclasses_config.h \ Phoenix.h \ Queue.h \ ScopedArrayPtr.h \ @@ -32,8 +30,6 @@ SharedPtr.h \ SourceInfo.h \ Stack.h \ - String.h \ - TextStream.h \ TypeTraits.h \ ValueType.h \ Vector.h @@ -45,4 +41,4 @@ DIST_FILES += $(HEADERS) $(CONF_H_IN) DISTCLEAN_FILES += $(CONF_H) -all: +all: subdirs |
From: stephan b. <sg...@us...> - 2004-12-24 04:52:20
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5735/Net Modified Files: Makefile.toc Log Message: mass commit: build tweaks/fixes Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 23 Dec 2004 00:18:58 -0000 1.1 +++ Makefile.toc 24 Dec 2004 04:52:04 -0000 1.2 @@ -1,26 +1,20 @@ +#!/usr/bin/make -f ################################################### # AUTO-GENERATED guess at a toc-aware Makefile, # based off of the contents of directory: # ./include/pclasses/Net # Created by ./toc/bin/create_makefile_stubs.sh -# Wed Dec 22 23:10:45 CET 2004 +# Thu Dec 23 01:31:56 CET 2004 # It must be tweaked to suit your needs. ################################################### include toc.make ############## FLEXES: -# WARNING: FLEXES stuff only works for C++-based flexers -FLEXES = -FLEXES_ARGS = -+ -p -OBJECTS += -include $(TOC_MAKESDIR)/flex.make -# Run target FLEXES to process these. -# REMINDER: add the generated C++ files to your SOURCES, if needed. -############## /FLEXES HEADERS = InetAddress.h \ InetSocket.h \ NetworkAddress.h \ Socket.h DIST_FILES += $(HEADERS) +INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses/Net INSTALL_PACKAGE_HEADERS += $(HEADERS) all: |
From: stephan b. <sg...@us...> - 2004-12-24 04:52:20
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5735/Util Modified Files: Makefile.toc Log Message: mass commit: build tweaks/fixes Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 23 Dec 2004 00:18:58 -0000 1.1 +++ Makefile.toc 24 Dec 2004 04:52:04 -0000 1.2 @@ -1,21 +1,14 @@ +#!/usr/bin/make -f ################################################### # AUTO-GENERATED guess at a toc-aware Makefile, # based off of the contents of directory: # ./include/pclasses/Util # Created by ./toc/bin/create_makefile_stubs.sh -# Wed Dec 22 23:10:45 CET 2004 +# Thu Dec 23 01:31:56 CET 2004 # It must be tweaked to suit your needs. ################################################### include toc.make ############## FLEXES: -# WARNING: FLEXES stuff only works for C++-based flexers -FLEXES = -FLEXES_ARGS = -+ -p -OBJECTS += -include $(TOC_MAKESDIR)/flex.make -# Run target FLEXES to process these. -# REMINDER: add the generated C++ files to your SOURCES, if needed. -############## /FLEXES HEADERS = ManagedThread.h \ ThreadPool.h \ WorkQueue.h |
From: stephan b. <sg...@us...> - 2004-12-24 04:52:18
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5735/System Modified Files: Makefile.toc Log Message: mass commit: build tweaks/fixes Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 23 Dec 2004 00:18:59 -0000 1.1 +++ Makefile.toc 24 Dec 2004 04:52:04 -0000 1.2 @@ -1,25 +1,19 @@ +#!/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 -# Wed Dec 22 23:10:45 CET 2004 +# Thu Dec 23 01:31:56 CET 2004 # It must be tweaked to suit your needs. ################################################### include toc.make ############## FLEXES: -# WARNING: FLEXES stuff only works for C++-based flexers -FLEXES = -FLEXES_ARGS = -+ -p -OBJECTS += -include $(TOC_MAKESDIR)/flex.make -# Run target FLEXES to process these. -# REMINDER: add the generated C++ files to your SOURCES, if needed. -############## /FLEXES HEADERS = Condition.h \ CriticalSection.h \ File.h \ Mutex.h \ + PathFinder.h \ Pipe.h \ Semaphore.h \ SharedLib.h \ @@ -27,6 +21,7 @@ SystemError.h \ Thread.h DIST_FILES += $(HEADERS) +INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses/System INSTALL_PACKAGE_HEADERS += $(HEADERS) all: |
From: stephan b. <sg...@us...> - 2004-12-24 04:49:35
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5295/Unicode Added Files: Makefile.toc Log Message: egg --- NEW FILE: Makefile.toc --- #!/usr/bin/make -f ################################################### # AUTO-GENERATED guess at a toc-aware Makefile, # based off of the contents of directory: # ./include/pclasses/Unicode # Created by ./toc/bin/create_makefile_stubs.sh # Fri Dec 24 02:04:52 CET 2004 # It must be tweaked to suit your needs. ################################################### include toc.make HEADERS = Char.h \ String.h \ TextStream.h DIST_FILES += $(HEADERS) INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses/Util INSTALL_PACKAGE_HEADERS += $(HEADERS) all: ################################################### # end auto-generated rules ################################################### |
From: stephan b. <sg...@us...> - 2004-12-24 04:49:34
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5295/IO Added Files: Makefile.toc Log Message: egg --- NEW FILE: Makefile.toc --- #!/usr/bin/make -f include toc.make HEADERS = IODevice.h \ IOError.h DIST_FILES += $(HEADERS) INSTALL_PACKAGE_HEADERS += $(HEADERS) INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses/IO all: |
From: stephan b. <sg...@us...> - 2004-12-24 04:30:22
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1241/include/pclasses/System Modified Files: PathFinder.h Log Message: Moved joinList() from public to private. Index: PathFinder.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/PathFinder.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PathFinder.h 24 Dec 2004 01:43:15 -0000 1.3 +++ PathFinder.h 24 Dec 2004 04:30:12 -0000 1.4 @@ -121,11 +121,6 @@ const string_list & extensions() const; /** - Helper function to collapse a list into a string. - */ - std::string joinList( const string_list & list, const std::string & separator ) const; - - /** Returns true if path is readable. */ static bool isAccessible( const std::string & path ); @@ -169,6 +164,10 @@ private: + /** + Helper function to collapse a list into a string. + */ + std::string joinList( const string_list & list, const std::string & separator ) const; string_list paths; string_list exts; std::string pathseparator; |
From: stephan b. <sg...@us...> - 2004-12-24 04:28:59
|
Update of /cvsroot/pclasses/pclasses2/doc/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv881/doc/manual Modified Files: Makefile.toc Log Message: Now only does lyx exports when explicitely told to. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/doc/manual/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 24 Dec 2004 01:11:38 -0000 1.1 +++ Makefile.toc 24 Dec 2004 04:28:50 -0000 1.2 @@ -19,7 +19,8 @@ done include $(TOC_MAKESDIR)/LYX_EXPORT.make CLEAN_FILES += $(wildcard *.html *.pdf *.ps) -docs: LYX_EXPORT +docs: + @echo "Run the LYX_EXPORT target to export the lyx files." else docs: @echo "If you will install lyx and reconfigure you can build the documentation." |
From: stephan b. <sg...@us...> - 2004-12-24 04:06:45
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29164/src/System Modified Files: Mime.cpp Log Message: corrected fileext prob: was a broken op< in MimeType. Index: Mime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mime.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Mime.cpp 24 Dec 2004 03:24:55 -0000 1.3 +++ Mime.cpp 24 Dec 2004 04:06:35 -0000 1.4 @@ -51,15 +51,20 @@ bool MimeType::operator<( const MimeType & rhs ) const { if( &rhs == this ) return false; - return (m_mediaType < rhs.m_mediaType) - && - (m_subType < rhs.m_subType) - ; + return this->mimeType() < rhs.mimeType(); + if( m_mediaType < rhs.m_mediaType) + { + return true; + } + else if( m_mediaType == rhs.m_mediaType) + { + return (m_subType < rhs.m_subType); + } + return false; } bool MimeType::operator==( const MimeType & rhs ) const { - if( &rhs == this ) return true; return (m_mediaType == rhs.m_mediaType) && (m_subType == rhs.m_subType) @@ -115,7 +120,7 @@ MimeType* MimeTypeDb::findByFileExt(const string& fileExt) const { - CERR << "findByFileExt() not yet implemented.\n"; + CERR << "findByFileExt() not yet implemented.\n"; return 0; // const MimeType* type = 0; // MimeTypeMap::const_iterator i = m_types.begin(); @@ -208,22 +213,26 @@ strMediaType = line.substr(0,p1); strSubType = line.substr(p1+1,p2-(p1+1)); rest = line.substr(p2+1,(line.size()-p2)); -// CERR << "media=["<<strMediaType<<"]\t p1="<<p1<<", p2="<<p2<<", subtype=["<<strSubType<<"]\t" -// << "rest=["<<rest<<"]\n"; +// CERR << "media=["<<strMediaType<<"]\t subtype=["<<strSubType<<"]\t" +// << "rest=["<<rest<<"]\n"; mimet = MimeType(strMediaType, strSubType); db.typeMap().insert(make_pair(strMediaType, mimet ) ); std::istringstream istr(rest.c_str()); + p1 = 0; while( ! istr.eof() ) { istr >> ext; if( ! ext.empty() && ext[0] != '#' ) { + ++p1; db.extensionsMap().insert(make_pair(mimet, ext ) ); } ext = ""; } + // CERR << "Mapped "<<p1<<" file extensions for "<<strMediaType<<" / " << strSubType<<"\n"; } + } void |
From: stephan b. <sg...@us...> - 2004-12-24 04:06:44
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29164/include/pclasses/System Modified Files: Mime.h Log Message: corrected fileext prob: was a broken op< in MimeType. Index: Mime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Mime.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Mime.h 24 Dec 2004 03:24:54 -0000 1.3 +++ Mime.h 24 Dec 2004 04:06:27 -0000 1.4 @@ -54,11 +54,10 @@ /** For compatibility with containers. - Returns false if rhs is this object - or if this object's media- and sub-types - both compare less than those of rhs. + Returns the equivalent of mimeType()<rhs.mimeType(). */ bool operator<( const MimeType & rhs ) const; + /** For compatibility with containers. Returns true if this object's media- and sub-types are the @@ -97,7 +96,7 @@ typedef std::multimap< std::string, MimeType > MimeTypeMap; typedef MimeTypeMap::const_iterator const_iterator; - typedef std::multimap<MimeType,std::string> FileExtensionsMap; + typedef std::multimap< MimeType, std::string > FileExtensionsMap; /** Add MIME type to database. Does not re-insert if type is |
From: stephan b. <sg...@us...> - 2004-12-24 03:25:29
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22145 Modified Files: Makefile.toc Log Message: added testMime.cpp Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.toc 24 Dec 2004 02:53:35 -0000 1.6 +++ Makefile.toc 24 Dec 2004 03:25:07 -0000 1.7 @@ -93,8 +93,9 @@ # Run targets STATIC_LIBS and SHARED_LIBS build these. endif -BIN_PROGRAMS = testPathFinder +BIN_PROGRAMS = testPathFinder testMime testPathFinder_bin_OBJECTS = testPathFinder.o PathFinder.o +testMime_bin_OBJECTS = testMime.o Mime.o PathFinder.o include $(TOC_MAKESDIR)/BIN_PROGRAMS.make all: STATIC_LIBS SHARED_LIBS |
From: stephan b. <sg...@us...> - 2004-12-24 03:25:06
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22067/include/pclasses/System Modified Files: Mime.h Log Message: appears to work except for file ext map, maybe due to operator prob in MimeType. Too tired... Index: Mime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Mime.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Mime.h 24 Dec 2004 03:01:08 -0000 1.2 +++ Mime.h 24 Dec 2004 03:24:54 -0000 1.3 @@ -36,6 +36,12 @@ class /* PIO_EXPORT */ MimeType { public: //! Constructor + /** + Creates an empty, useless MimeType. Required + for classloading and deserialization. + */ + MimeType(); + //! Constructor /*! \param mediaType MIME media type \param subType MIME sub type @@ -88,9 +94,7 @@ class /* PIO_EXPORT */ MimeTypeDb { public: - typedef std::multimap< - std::string,MimeType - > MimeTypeMap; + typedef std::multimap< std::string, MimeType > MimeTypeMap; typedef MimeTypeMap::const_iterator const_iterator; typedef std::multimap<MimeType,std::string> FileExtensionsMap; |
From: stephan b. <sg...@us...> - 2004-12-24 03:25:04
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22073 Added Files: testMime.cpp Log Message: egg --- NEW FILE: testMime.cpp --- #include "pclasses/System/Mime.h" #include "pclasses/pclasses-config.h" #include <stdlib.h> // getenv() #include <iostream> #include <algorithm> #ifndef CERR #define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif int main( int argc, char ** argv ) { CERR << "Mime tests...\n"; using P::System::MimeType; using P::System::MimeTypeDb; MimeTypeDb & db = MimeTypeDb::instance(); MimeTypeDb::const_iterator it = db.begin(), et = db.end(); typedef MimeTypeDb::FileExtensionsMap FMap; FMap::const_iterator fit, fet; for( ; et != it; ++it ) { CERR << "Mime type: " << (*it).second.mimeType() << "\n"; fit = db.extensionsMap().lower_bound( (*it).second ); fet = db.extensionsMap().upper_bound( (*it).second ); CERR << "\tNumber of extensions: " << std::distance(fit, fet )<<"\n"; // for( ; fet != fit; ++fit ) // { // CERR << "\t extension: " << (*fit).second << "\n"; // } } return 0; } |
From: stephan b. <sg...@us...> - 2004-12-24 03:25:04
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22067/src/System Modified Files: Mime.cpp Log Message: appears to work except for file ext map, maybe due to operator prob in MimeType. Too tired... Index: Mime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mime.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Mime.cpp 24 Dec 2004 03:01:09 -0000 1.2 +++ Mime.cpp 24 Dec 2004 03:24:55 -0000 1.3 @@ -40,6 +40,10 @@ { } +MimeType::MimeType() +{ +} + MimeType::~MimeType() { } @@ -183,15 +187,18 @@ std::string rest; std::string strMediaType; std::string strSubType; + MimeType mimet; while(!strm.eof()) { getline(strm, line); - if(line.empty() || line[0] != '#') + if(line.empty() || line[0] == '#') { continue; } p1 = line.find("/"); p2 = line.find_first_of( " \t", p1+1 ); + // line.find_first_not_of( "abcdefghijklmnopqrstuvqxyz-ABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789", p1+1 ); + // ^^^ find_first_of( " \t", p1+1 ) is giving me until line.end()! if( std::string::npos == p1 || std::string::npos == p2 ) { @@ -199,19 +206,22 @@ } strMediaType = line.substr(0,p1); - strSubType = line.substr(p1+1,p2); - - db.typeMap().insert(make_pair(strMediaType, MimeType(strMediaType, strSubType) ) ); + strSubType = line.substr(p1+1,p2-(p1+1)); + rest = line.substr(p2+1,(line.size()-p2)); +// CERR << "media=["<<strMediaType<<"]\t p1="<<p1<<", p2="<<p2<<", subtype=["<<strSubType<<"]\t" +// << "rest=["<<rest<<"]\n"; + mimet = MimeType(strMediaType, strSubType); + db.typeMap().insert(make_pair(strMediaType, mimet ) ); - rest = line.substr(p2+1,line.size()-1); std::istringstream istr(rest.c_str()); - while( istr.good() ) + while( ! istr.eof() ) { istr >> ext; if( ! ext.empty() && ext[0] != '#' ) { - db.extensionsMap().insert(make_pair(MimeType(strMediaType, strSubType), ext ) ); + db.extensionsMap().insert(make_pair(mimet, ext ) ); } + ext = ""; } } } |
From: stephan b. <sg...@us...> - 2004-12-24 03:01:47
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17410/include/pclasses/System Modified Files: Mime.h Log Message: corrected staticness of MimeTypeDb::instance() Index: Mime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Mime.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Mime.h 24 Dec 2004 02:51:50 -0000 1.1 +++ Mime.h 24 Dec 2004 03:01:08 -0000 1.2 @@ -21,7 +21,6 @@ #ifndef _pmime_h_ #define _pmime_h_ -#include <pclasses/Phoenix.h> #include <list> #include <string> #include <map> @@ -129,11 +128,7 @@ const MimeTypeMap & typeMap() const { return this->m_types; } - MimeTypeDb & instance() - { - typedef ::P::Phoenix< MimeTypeDb, MimeTypeDb, MimeTypeDb::init_functor > PHX; - return PHX::instance(); - } + static MimeTypeDb & instance(); private: /** For use with P::Phoenix. */ @@ -141,8 +136,8 @@ { /** Gets called when instance() creates a new instance. - If db is empty thent this function tries to populate - it using the system-wise mime db. + If db is empty then this function tries to populate + it using the system-wide mime db. */ void operator()( MimeTypeDb & db ) const; }; |
From: stephan b. <sg...@us...> - 2004-12-24 03:01:24
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17410/src/System Modified Files: Mime.cpp Log Message: corrected staticness of MimeTypeDb::instance() Index: Mime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mime.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Mime.cpp 24 Dec 2004 02:51:50 -0000 1.1 +++ Mime.cpp 24 Dec 2004 03:01:09 -0000 1.2 @@ -19,6 +19,7 @@ #include "pclasses/System/Mime.h" #include "pclasses/System/PathFinder.h" +#include "pclasses/Phoenix.h" #include <algorithm> #include <iostream> @@ -73,6 +74,13 @@ } +MimeTypeDb & MimeTypeDb::instance() +{ + typedef ::P::Phoenix< MimeTypeDb, MimeTypeDb, MimeTypeDb::init_functor > PHX; + return PHX::instance(); +} + + MimeType* MimeTypeDb::findByMimeType(const string& mimeTypeName) const { typedef MimeTypeMap::const_iterator MI; |
From: stephan b. <sg...@us...> - 2004-12-24 02:53:45
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15686 Modified Files: Makefile.toc Log Message: added Mime.cpp Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.toc 24 Dec 2004 01:40:27 -0000 1.5 +++ Makefile.toc 24 Dec 2004 02:53:35 -0000 1.6 @@ -13,6 +13,7 @@ SOURCES_COMMON = \ CriticalSection.cpp \ CriticalSection.generic.cpp \ + Mime.cpp \ Mutex.cpp \ PathFinder.cpp \ SystemError.cpp \ |
From: stephan b. <sg...@us...> - 2004-12-24 02:52:00
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15318/src/System Added Files: Mime.cpp Log Message: initial go at a mime rewrite --- NEW FILE: Mime.cpp --- /* * P::Classes - Portable C++ Application Framework * Copyright (C) 2000-2004 Christian Prochnow <cp...@se...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "pclasses/System/Mime.h" #include "pclasses/System/PathFinder.h" #include <algorithm> #include <iostream> #include <fstream> #include <sstream> #ifndef CERR #define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif namespace P { namespace System { using namespace std; MimeType::MimeType(const string& mediaType, const string& subType) : m_mediaType(mediaType), m_subType(subType) { } MimeType::~MimeType() { } bool MimeType::operator<( const MimeType & rhs ) const { if( &rhs == this ) return false; return (m_mediaType < rhs.m_mediaType) && (m_subType < rhs.m_subType) ; } bool MimeType::operator==( const MimeType & rhs ) const { if( &rhs == this ) return true; return (m_mediaType == rhs.m_mediaType) && (m_subType == rhs.m_subType) ; } MimeTypeDb::MimeTypeDb() { } MimeTypeDb::~MimeTypeDb() { m_types.clear(); m_exts.clear(); } MimeType* MimeTypeDb::findByMimeType(const string& mimeTypeName) const { typedef MimeTypeMap::const_iterator MI; std::string::size_type slashat = mimeTypeName.find("/"); if( std::string::npos == slashat || (mimeTypeName.size()-1) == slashat) // trailing slash { return 0; } string strMediaType = mimeTypeName.substr(0,slashat); string strSubType = mimeTypeName.substr(slashat+1); const MimeType* type = 0; pair<MI,MI> i = m_types.equal_range(strMediaType); while(1) { type = &(*i.first).second; if(type->subType() == strSubType) return const_cast<MimeType*>(type); if(i.first == i.second) break; ++i.first; } return 0; } MimeType* MimeTypeDb::findByFileExt(const string& fileExt) const { CERR << "findByFileExt() not yet implemented.\n"; return 0; // const MimeType* type = 0; // MimeTypeMap::const_iterator i = m_types.begin(); // while(i != m_types.end()) // { // type = &i->second; // const MimeType::FileExtVector& fileExts = type->fileExts(); // if(find(fileExts.begin(), fileExts.end(), fileExt) != fileExts.end()) // return const_cast<MimeType*>(type); // ++i; // } // return 0; } bool MimeTypeDb::add(const MimeType& type) { if(findByMimeType(type.mimeType())) return false; insert(type); return true; } void MimeTypeDb::insert(const MimeType& type) { m_types.insert(make_pair(type.mediaType(), type)); } #ifndef CERR #define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif std::string findSystemMimeTypeFile() { ::P::System::PathFinder pf; #ifndef WIN32 pf.addPath( "/etc/" ); pf.addPath( "/usr/share/pclasses/" ); pf.addPath( "/usr/local/share/pclasses/" ); pf.addPath( "/etc/apache2/conf/" ); #else // @fixme: add win32 paths #endif pf.addExtension( ".types" ); return pf.find( "mime" ); } void readSystemMimeTypes( MimeTypeDb & db ) { std::string mf = findSystemMimeTypeFile(); if( mf.empty() ) { CERR << "WARNING: Could not find mime.types database!\n"; return; } std::ifstream strm(mf.c_str()); std::string line; std::string::size_type p1, p2; std::string ext; std::string rest; std::string strMediaType; std::string strSubType; while(!strm.eof()) { getline(strm, line); if(line.empty() || line[0] != '#') { continue; } p1 = line.find("/"); p2 = line.find_first_of( " \t", p1+1 ); if( std::string::npos == p1 || std::string::npos == p2 ) { continue; } strMediaType = line.substr(0,p1); strSubType = line.substr(p1+1,p2); db.typeMap().insert(make_pair(strMediaType, MimeType(strMediaType, strSubType) ) ); rest = line.substr(p2+1,line.size()-1); std::istringstream istr(rest.c_str()); while( istr.good() ) { istr >> ext; if( ! ext.empty() && ext[0] != '#' ) { db.extensionsMap().insert(make_pair(MimeType(strMediaType, strSubType), ext ) ); } } } } void MimeTypeDb::init_functor::operator()( MimeTypeDb & db ) const { if( db.end() == db.begin() ) { readSystemMimeTypes(db); } } } } // P::System |
From: stephan b. <sg...@us...> - 2004-12-24 02:52:00
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15318/include/pclasses/System Added Files: Mime.h Log Message: initial go at a mime rewrite --- NEW FILE: Mime.h --- /* * P::Classes - Portable C++ Application Framework * Copyright (C) 2000-2004 Christian Prochnow <cp...@se...> * Copyright (C) 2004-2005 stephan beal <st...@s1...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _pmime_h_ #define _pmime_h_ #include <pclasses/Phoenix.h> #include <list> #include <string> #include <map> namespace P { namespace System { //! MIME type /*! \author Christian Prochnow <cp...@se...> \author stephan beal <st...@s1...> \ingroup System */ class /* PIO_EXPORT */ MimeType { public: //! Constructor /*! \param mediaType MIME media type \param subType MIME sub type \param fileExts vector of associated file extensions */ MimeType(const std::string& mediaType, const std::string& subType ); ~MimeType(); /** For compatibility with containers. Returns false if rhs is this object or if this object's media- and sub-types both compare less than those of rhs. */ bool operator<( const MimeType & rhs ) const; /** For compatibility with containers. Returns true if this object's media- and sub-types are the same as rhs'. */ bool operator==( const MimeType & rhs ) const; //! Return the full MIME type inline const std::string mimeType() const { return m_mediaType + "/" + m_subType; } //! Returns the MIME media type inline const std::string& mediaType() const { return m_mediaType; } //! Returns the MIME sub type inline const std::string& subType() const { return m_subType; } private: std::string m_mediaType; std::string m_subType; }; //! MIME type database /*! The class is used as an application wide MIME type registry. \author Christian Prochnow <cp...@se...> \author stephan beal <st...@s1...> \ingroup System */ class /* PIO_EXPORT */ MimeTypeDb { public: typedef std::multimap< std::string,MimeType > MimeTypeMap; typedef MimeTypeMap::const_iterator const_iterator; typedef std::multimap<MimeType,std::string> FileExtensionsMap; /** Add MIME type to database. Does not re-insert if type is already in the db. */ bool add(const MimeType& type); //! Find MIME type by full name MimeType* findByMimeType(const std::string& mimeType) const; //! Find MIME type by file extension MimeType* findByFileExt(const std::string& fileExt) const; inline const_iterator begin() const { return m_types.begin(); } inline const_iterator end() const { return m_types.end(); } FileExtensionsMap & extensionsMap() { return this->m_exts; } const FileExtensionsMap & extensionsMap() const { return this->m_exts; } MimeTypeDb(); ~MimeTypeDb(); MimeTypeMap & typeMap() { return this->m_types; } const MimeTypeMap & typeMap() const { return this->m_types; } MimeTypeDb & instance() { typedef ::P::Phoenix< MimeTypeDb, MimeTypeDb, MimeTypeDb::init_functor > PHX; return PHX::instance(); } private: /** For use with P::Phoenix. */ struct init_functor { /** Gets called when instance() creates a new instance. If db is empty thent this function tries to populate it using the system-wise mime db. */ void operator()( MimeTypeDb & db ) const; }; /** Like add(), but this inserts regardless of duplication. */ void insert(const MimeType& type); MimeTypeMap m_types; FileExtensionsMap m_exts; }; } } // P::System #endif |
From: stephan b. <sg...@us...> - 2004-12-24 01:45:14
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1628 Modified Files: pclasses-config.h.at Log Message: added the lib dirs Index: pclasses-config.h.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/pclasses-config.h.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pclasses-config.h.at 23 Dec 2004 05:25:56 -0000 1.1 +++ pclasses-config.h.at 24 Dec 2004 01:45:02 -0000 1.2 @@ -9,6 +9,9 @@ # undef _ALL_SOURCE #endif +#define PCLASSES_INSTALL_PREFIX "@prefix@" +#define PCLASSES_LIB_DIR "@prefix@/lib" +#define PCLASSES_PLUGINS_DIR "@prefix@/lib/pclasses" #if @PCLASSES_HAVE_LARGEFILE@ == 0 # undef PCLASSES_HAVE_LARGEFILE |
From: stephan b. <sg...@us...> - 2004-12-24 01:44:40
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1452 Modified Files: testPathFinder.cpp Log Message: added fileExtensions() tests Index: testPathFinder.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/testPathFinder.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- testPathFinder.cpp 24 Dec 2004 01:40:16 -0000 1.1 +++ testPathFinder.cpp 24 Dec 2004 01:44:21 -0000 1.2 @@ -12,15 +12,27 @@ using P::System::PathFinder; - const char * ldp = getenv( "LD_LIBRARY_PATH" ); PathFinder f; f.addPath( "." ); + const char * ldp = getenv( "LD_LIBRARY_PATH" ); if( ldp ) f.addPath( ldp ); f.addPath( PCLASSES_LIB_DIR ); f.addPath( PCLASSES_PLUGINS_DIR ); + ldp = getenv( "HOME" ); + if( ldp ) f.addPath( ldp ); + + f.addExtension( ".a" ); + f.addExtension( ".so" ); + CERR << "path="<<f.pathString() << "\n"; + +#define FIND(A) CERR << "find("<<A<<") = " << f.find(A)<<"\n"; + FIND("libs11n"); + FIND("libpcore"); + FIND("libeshell"); +#undef FIND return 0; } |