简体   繁体   English

Borland C++ Builder 5 的 dir.h header 是否有对应的 C++?

[英]Is there any C++ counterpart for Borland C++ Builder 5's dir.h header?

I need to adapt a file written in Borland C++ Builder 5 to be usable in MS Visual Studio 2022. One of the files heavily utilizes the dir.h library, which, as far as I can tell, is a C library exclusive to Builder.我需要修改一个用 Borland C++ Builder 5 编写的文件,以便在 MS Visual Studio 2022 中使用。其中一个文件大量使用了dir.h库,据我所知,它是 Builder 独有的 C 库。 The source files are available, however they have a lot of dependencies and, as I've mentioned, are written in C.源文件是可用的,但是它们有很多依赖关系,正如我所提到的,它们是用 C 编写的。 I have searched the Internet for a substitute, unfortunately to no avail.我已经在互联网上搜索了替代品,不幸的是无济于事。 Does a similar library exist for C++? C++ 是否存在类似的库? Or do I have to re-write the file (which is pretty big) using eg std::filesystem ?或者我是否必须使用例如std::filesystem重写文件(相当大)?

The functions in dir.h are mapping quite direct to Win32 API calls of fileapi.h . dir.h中的函数直接映射到对 fileapi.h 的 Win32 API调用。 You could use this header for a quick port.您可以使用此 header 进行快速端口。

For a modernization it might be the best idea to re-write the code using std::filesystem.对于现代化,使用 std::filesystem 重写代码可能是最好的主意。 There is hardly any sensible C++ library with such a C-like API.几乎没有任何明智的 C++ 库具有类似 C 的 API。

Well there are the modernized Embarcadero API-calls in System.SysUtils.hpp .那么System.SysUtils.hpp中有现代化的 Embarcadero API 调用。 But they are still no modern C++ and they are only available their ecosystem.但它们仍然不是现代的 C++,它们只能在其生态系统中使用。

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

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