
16 Jun
2012
16 Jun
'12
7:44 a.m.
On 2012-06-15 22:41, Nathan Ridge wrote:
Isn't it what you want? http://www.boost.org/libs/filesystem/v3/doc/reference.html#equivalent
Not quite. Suppose I want to test whether a file has a "jpg" extension (case insensitive on Windows). I would like to be able to do:
path file = ...; path jpeg_ext = ".jpg"; .... if (file.extension() == jpeg_ext)
and have the comparison return true for "something.JPG" on Windows.
In this particular case, you should really use case-insensitive comparison on /all/ platforms (and check for ".jpeg" in addition to ".jpeg"). It's not unusual to find files with an uppercase ".JPG" extension on case-sensitive file systems. -- Rainer Deyke (rainerd@eldwood.com)