Boost logo

Boost :

From: Mark Bartosik (mbartosik_at_[hidden])
Date: 2006-02-26 00:11:37


Here is my first comment on usage for wide character support.

I see that we have boost::filesystem::basic_ifstream that can take wpath
arguments.
However, there are parts of boost (not just standard lib) that also take
file names as arguments.
Not only do those parts of boost not accept boost::filesystem::path
(preferring std::string) they don't accept wide characters either :-(

For example:
boost\iostreams\device\mapped_file.hpp mapped_file
boost\iostreams\device\file_descriptor.hpp file_descriptor

It would be great to perform an audit of the boost libraries for where
filenames are passed and add support for path and wpath.
The problem that I keep hitting when attempting to write code for wide
characters is that it only takes one function or class to not support wide
characters to spoil my day. Then I am faced with rewriting library code, or
dropping wide character support, or requesting library support (as in this
case).

Similarly other boost libraries should use boost::filesystem::basic_fstream
internally, and thus enabling path and wpath as arguments to functions.

A quick scan of CVS source for CreateFile(A or W) and fstream shows that:
boost::iostreams could use boost::filesystem, for example the mapped_file
class
boost::regex could also use boost::filesystem, and actually it could use
boost::iostream, since it reimplements a memory mapped file (narrow char
path only). See boost\libs\regex\src\fileiter.cpp, again it only allows a
narrow character filepath.

boost::date_time could use boost::filesystem (only in tz_db_base.hpp
tz_db_base::load_from_file that I spotted)
boost::graph uses std::ofstream, but only is what appears to be undocumented
(in html) constructors, other constructors use std::ostream yes narrow only,
not wide char support.
boost::wave, but probably not an issue here

So there's some of my needs.

"Beman Dawes" <bdawes_at_[hidden]> wrote in message
news:dtl9pn$4vo$1_at_sea.gmane.org...
>
> "Mark Bartosik" <mbartosik_at_[hidden]> wrote in message
> news:dtjclm$7dr$1_at_sea.gmane.org...
>> bug in filesystem::wpath.
>> In mirgrating to support wchar_t, a couple of lines were missed.
>> m_path which has type of std::wstring is assigned a narrow character
>> string resulting in a compilation error.
>
> Fixed in CVS. Test cases were also added to wide_test.cpp.
>
> Thanks,
>
> --Beman
>
> PS: I'd like to hear from programmers using wide character file names. Are
> they working OK? Are they meeting your needs?
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk