简体   繁体   English

boost :: filesystem v3 - 正确的路径大小写

[英]boost::filesystem v3 - correct case of path

Hi Is there an efficient way of correct the case of an given windows path? 嗨有没有一种有效的方法来纠正给定的Windows路径的情况?

fs::path dir("c:/winDOWS"); --> C:/Windows?

(without Windows-API!) (没有Windows-API!)

Without the windows api it's impossible to know that the correct case is. 没有Windows API,就不可能知道正确的情况。 The common windows filesystems are case-insensitive and case preserving. 常见的Windows文件系统不区分大小写并保留大小写。

The windows api way to do this is GetFullPathName windows api的方法是GetFullPathName

Since I came here looking for the same thing I figured I would spare others a google. 自从我来到这里寻找同样的事情,我想我会让其他人一个谷歌。

An answer can be found in this stackoverflow thread . 可以在此stackoverflow线程中找到答案。

It is sadly not how to do it with boost instead using the Windows API. 遗憾的是,使用Windows API而不是如何使用boost来实现它。 But at least it works which the API mentioned above does not. 但至少它的工作原理上面提到的API没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM