Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::filesystem::native
From: Christopher J. Pisz (cpisz_at_[hidden])
Date: 2016-11-10 17:50:15


On 11/10/2016 4:25 PM, Fernando Gomes da Silva wrote:
SNIP
> That's especially weird considering that "\P" should be an invalid
> escape sequence, which should give you a compiler warning/error
> and/or should make "\PATH" give identical results to "\\PATH".
>
> Unless you further escaped these before compiling it?

That is wierd. It seems to be an error on rebuild. Disregard those
results I guess. I don't know how I got it to run.

Here is another test I just tried, making this set of boost functions
and thier documentation appear even more confusing to me.

#include <iostream>
#include <sstream>

#include <boost/filesystem.hpp>

// Just a garbage console application to do some manual testing.
int main()
{
     std::cout << boost::filesystem::native("C://PATH") << std::endl;
     std::cout << boost::filesystem::native("C:/PATH") << std::endl;
     std::cout << boost::filesystem::native("C:\\PATH") << std::endl;
     std::cout << boost::filesystem::native("\\PATH") << std::endl;
     std::cout << boost::filesystem::native("/PATH") << std::endl;
     std::cout << boost::filesystem::native("//PATH") << std::endl <<
std::endl;

     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"C://PATH")) << std::endl;
     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"C:/PATH")) << std::endl;
     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"C:\\PATH")) << std::endl;
     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"\\PATH")) << std::endl;
     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"/PATH")) << std::endl;
     std::cout << boost::filesystem::native(reinterpret_cast<char
*>(L"//PATH")) << std::endl;

     return 0;
}

0
0
0
0
0
0

1
1
1
0
0
0


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net