$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] Using boost::filesystem with TCHAR
From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-11-25 10:51:07
On Tue, Nov 25, 2008 at 6:48 AM, Rob Caldecott
<robert.caldecott_at_[hidden]> wrote:
> I wish to use the boost::filesystem library with some Windows apps and want to
> define TCHAR-friendly types.  I *think* the following code should do the trick,
> giving me a boost::filesystem::tpath type, but is there anything I've missed?
Off the top of my head, it looks OK.
Have you tried it?
--Beman
>
>
> tpath.hpp
>
> #include <boost/filesystem.hpp>
>
> namespace boost {
> namespace filesystem {
>
> struct tpath_traits;
> typedef basic_path<std::basic_string<TCHAR>, tpath_traits> tpath;
>
> struct tpath_traits
> {
>        typedef std::basic_string<TCHAR> internal_string_type;
>        typedef std::basic_string<TCHAR> external_string_type;
>        static external_string_type to_external( const tpath &,
>                const internal_string_type & src ) { return src; }
>        static internal_string_type to_internal(
>                const external_string_type & src ) { return src; }
> };
>
> } // filesystem
> } // boost
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://listarchives.boost.org/mailman/listinfo.cgi/boost
>