Hello,

On Fri, Jun 15, 2012 at 3:41 PM, Nathan Ridge <zeratul976@hotmail.com> wrote:
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:

That would be case insensitive on NTFS, not on all Windows file systems.
 

path file = ...;
path jpeg_ext = ".jpg";
...
if (file.extension() == jpeg_ext)

and have the comparison return true for "something.JPG" on Windows.


I can't do

if (file.extension().equivalent(jpeg_ext))

because equivalent() requires that one of the paths exists().


So what should I do instead?

#if __WIN32__
   if (iequals(file.extension().string(), jpeg_ext.string())

You can't check whether a file system is case sensitive at compile time.

Cheers,
Will

 
#else
   if (file.extension() == jpeg_ext)
#endif

seems like I'm doing the library's job here...


Regards,
Nate

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users