From: stephan b. <sg...@us...> - 2004-12-24 12:44:16
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21438/src/System Modified Files: Makefile.toc Mime.cpp testMime.cpp Log Message: mass commit: toc-related fixes/changes Index: testMime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/testMime.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- testMime.cpp 24 Dec 2004 03:24:56 -0000 1.1 +++ testMime.cpp 24 Dec 2004 12:44:02 -0000 1.2 @@ -15,22 +15,32 @@ using P::System::MimeType; using P::System::MimeTypeDb; + MimeType m1( "text", "plain" ); + MimeType m2( "application", "html" ); +#define MCMP(M1,OP,M2) CERR << M1.mimeType() << " "<<# OP<<" "<< M2.mimeType() << " == " << (M1 OP M2)<<"\n"; +#define MCMP2(M1,M2) MCMP(M1,<,M2); MCMP(M2,<,M1); MCMP(M1,==,M2); + MCMP2(m1,m2); + MCMP2(MimeType( "application", "x" ),MimeType( "application", "x" )); + +// return 0; + 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 ) + MimeType mimet; + 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"; -// } + mimet = (*it).second; + CERR << "Mime type: " << mimet.mimeType() << "\n"; + fit = db.extensionsMap().lower_bound( mimet ); + fet = db.extensionsMap().upper_bound( mimet ); + for( ; fet != fit; fit++ ) + { + CERR << "\t extension: " << (*fit).second << "\n"; + } } return 0; Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.toc 24 Dec 2004 03:25:07 -0000 1.7 +++ Makefile.toc 24 Dec 2004 12:44:02 -0000 1.8 @@ -91,6 +91,7 @@ include $(TOC_MAKESDIR)/SHARED_LIBS.make include $(TOC_MAKESDIR)/STATIC_LIBS.make # Run targets STATIC_LIBS and SHARED_LIBS build these. +SHARED_LIBS: STATIC_LIBS endif BIN_PROGRAMS = testPathFinder testMime @@ -98,7 +99,8 @@ testMime_bin_OBJECTS = testMime.o Mime.o PathFinder.o include $(TOC_MAKESDIR)/BIN_PROGRAMS.make -all: STATIC_LIBS SHARED_LIBS +BIN_PROGRAMS: SHARED_LIBS +all: SHARED_LIBS ################################################### # end auto-generated rules ################################################### Index: Mime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mime.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Mime.cpp 24 Dec 2004 04:06:35 -0000 1.4 +++ Mime.cpp 24 Dec 2004 12:44:02 -0000 1.5 @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "pclasses/pclasses-config.h" #include "pclasses/System/Mime.h" #include "pclasses/System/PathFinder.h" #include "pclasses/Phoenix.h" @@ -162,10 +163,11 @@ { ::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/" ); + pf.addPath( PCLASSES_SHARED_DATA_DIR ); + pf.addPath( "/etc" ); + pf.addPath( "/etc/apache2/conf" ); + pf.addPath( "/usr/share/pclasses" ); + pf.addPath( "/usr/local/share/pclasses" ); #else // @fixme: add win32 paths #endif |