我不知道如何使用 std::filesystem::path 来识别绝对路径是否包含一些相对目录,但仍然没有运气。我有以下代码和平:
const std::filesystem::path absolutePath = "/Users/user/Library/Preferences";
const std::filesystem::path relativePath = "Library/Preferences";
bool isSubDir = isSubDirectory(absolutePath, relativePath);
在这种情况下,isSubDirectory 应该返回 true。感谢任何帮助。