Boost logo

Boost :

Subject: Re: [boost] boost::filesystem request
From: Jorge Lodos Vigil (lodos_at_[hidden])
Date: 2008-10-30 09:38:16


Hi

Beman Dawes wrote:

> Here is an example; this code does compile and run correctly under V3:
>
> #include <boost/filesystem/path.hpp>
> #include <boost/filesystem/operations.hpp> #include <string>
> #include <cassert> #include <windows.h> #include <winnt.h>
>
> namespace fs = boost::filesystem;
>
> typedef std::basic_string<TCHAR> tstring;
>
> void func( const fs::path & p )
> {
> assert( fs::exists( p ) );
> }
>
> int main()
> {
> // get a path that is known to exist
> fs::path cp = fs::current_path();
>
> // demo: get tstring from the path
> tstring cp_as_tstring = cp.string<tstring>();
>
> // demo: pass tstring to filesystem function taking path
> assert( fs::exists( cp_as_tstring ) );
>
> // demo: pass tstring to user function taking path
> func( cp_as_tstring );
>
> return 0;
> }
>

It is nice to have a single path class, thank you. I'm curious about the internal path representation and the conversion to std::string or std::wstring. If I understood the logic, the string type and path traits are now function template parameters. Is that correct?
Could you please estimate when filesystem v3 will be included in a boost release?
Thanks again.

Best regards
Jorge


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