From: Christian P. <cp...@us...> - 2005-05-24 04:19:58
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10841/include/pclasses/System Modified Files: PathFinder.h Log Message: - Modified PathFinder to not search for the resource without any extension Index: PathFinder.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/PathFinder.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- PathFinder.h 7 May 2005 13:23:39 -0000 1.8 +++ PathFinder.h 24 May 2005 04:19:50 -0000 1.9 @@ -5,9 +5,6 @@ // License: Public Domain // Readability cleanup and code P-ificaton by Christian Prochnow <cp...@se...> -// TODO: get rid of string_list and joinList and tokenize_to_list and provide a common -// implementation as it may be useful for other too. -- cproch - #include <pclasses/Export.h> #include <pclasses/StringList.h> #include <pclasses/Unicode/String.h> @@ -25,19 +22,16 @@ <pre> PathFinder p; - p.path( "/lib/lib:/usr/lib/lib" ); + p.path( "/lib:/usr/lib" ); p.extensions( ".a:.so" ); - cout << p.find( "z" ); + cout << p.find( "libz" ); </pre> That would print an empty string if it finds nothing, or a string if it finds any of the following: - - z - - /lib/libz - /lib/libz.a - /lib/libz.so - - /usr/lib/libz - /usr/lib/libz.a - /usr/lib/libz.so |