Working with Poco::Path
I've found a very curious error. See following code:
#include <iostream>
#include <string>
#include <Poco/Path.h>
int main()
{
std::wstring a_path = L"c:\\temp";
//Poco::Path from_wstring(a_path); // ERROR: fails to compile, expected
Poco::Path from_wchar_t(a_path.c_str()); // compiles... unexpected
std::cout << from_wchar_t.toString() << std::endl;
return 0;
}
But the output of the above program is (in Windows):
\
instead of the expected:
c:\temp
Reviewing the Poco::Path
documentation I see no constructor expecting std::wstring
(that's why the first path fails) nor const wchar_t*
, only from std::string
and const char*
(both UTF-8).
How is it compiling with const wchar_t*
and why the unexpected output (wrong path)?