I am working on a Windows C++ App, where I get a URI similar to file:///C:/test 1/file.foo. Now I want to e.g. open that URI with ifstream.
Is there any C/C++ API available on Windows to convert such a path?
My Google Foo seems to be weak today.
I am working on a Windows C++ App, where I get a URI similar to file:///C:/test 1/file.foo. Now I want to e.g. open that URI with ifstream.
Is there any C/C++ API available on Windows to convert such a path?
My Google Foo seems to be weak today.
There is PathCreateFromUrl() :
https://msdn.microsoft.com/en-us/library/bb773581(v=vs.85).aspx
There are multiple file URI "versions" so you should not parse it yourself, some of the APIs are broken as well.
If you just want a Windows style path, call PathCreateFromUrl.
If you don't want to convert the path then you must use CreateURLMonikerEx or SHParseDisplayName (with a bind context) but then you end up with a Windows IStream instead.