Andrew
2010-12-07 12:41:00 UTC
I am writing some code that traverses a directory, looking for
matching filenames. At the moment the match is done using regular
expressions, using boost::regex. But I am not completely happy with
this. I reckon most people will expect pattern matching to work with
wildcarding as supported by the operating system. But I do not know of
a library that does that.
Of course on Unix it is very rare that one has to worry about such
things because wildcards on the command line are expanded by the
shell. I know that DOS/Windoze doesn't do this. Sigh. But every now
and then an app needs to be able to do the matching itself internally
so one cannot use the faciities provided by the shell. It has to be
done by the code.
Does anyone know of a cross-platform library for doing this please?
BTW, I do not want to use the facilities in boost::filesystem. I have
been burnt by it before with insufficient support for WIN32. I have my
own directory iterator that uses the WIN32 API on Windoze and opendir
on POSIX. It's just the wildcard filename matching I need.
Regards,
Andrew Marlow
matching filenames. At the moment the match is done using regular
expressions, using boost::regex. But I am not completely happy with
this. I reckon most people will expect pattern matching to work with
wildcarding as supported by the operating system. But I do not know of
a library that does that.
Of course on Unix it is very rare that one has to worry about such
things because wildcards on the command line are expanded by the
shell. I know that DOS/Windoze doesn't do this. Sigh. But every now
and then an app needs to be able to do the matching itself internally
so one cannot use the faciities provided by the shell. It has to be
done by the code.
Does anyone know of a cross-platform library for doing this please?
BTW, I do not want to use the facilities in boost::filesystem. I have
been burnt by it before with insufficient support for WIN32. I have my
own directory iterator that uses the WIN32 API on Windoze and opendir
on POSIX. It's just the wildcard filename matching I need.
Regards,
Andrew Marlow
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]