gpt4 book ai didi

c++ - 将 URI 转换为路径

转载 作者:行者123 更新时间:2023-11-27 22:46:01 28 4
gpt4 key购买 nike

我正在开发 Windows C++ 应用程序,我在其中获得类似于 file:///C:/test 1/file.foo 的 URI。现在我想例如使用 ifstream 打开该 URI。

Windows 上是否有可用的 C/C++ API 来转换这样的路径?

我的 Google Foo 今天似乎很虚弱。

最佳答案

multiple文件 URI“版本”所以你不应该 parse它自己,一些the APIs are broken

如果您只想要 Windows 样式路径,请调用 PathCreateFromUrl .

如果您不想转换路径,那么您必须使用 CreateURLMonikerExSHParseDisplayName(带有绑定(bind)上下文),但您最终会得到一个 Windows IStream 代替。

关于c++ - 将 URI 转换为路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42858097/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com