存储目录位置

Store directory location

本文关键字:位置 存储      更新时间:2023-10-16

我试图在ram中存储目录位置,以便我可以稍后在应用程序中访问它。我的目标是实现这段代码:

ContentManager.GetDir();
ContentManager.SetDir("../Content/");

我现在很困惑,需要一些帮助!

将路径存储在std::字符串中或使用boost::filesystem: http://live.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm

文件系统:

path dirLocation = "c:\mydirectorylocation";
if(exists(dirLocation) && is_directory(dirLocation))
{
    std::string myPath = dirLocation.string();
}