文件操作相关的实用工具类 更多...
#include <util.hpp>
静态 Public 成员函数 | |
static bool | exists (const std::string &pathname) |
判断文件是否存在 | |
static std::string | path (const std::string &pathname) |
获取文件路径 | |
static void | createDirectory (const std::string &pathname) |
创建目录及其父级目录 | |
static bool | createFile (const std::string filename) |
创建新文件 | |
文件操作相关的实用工具类
提供判断文件是否存在、获取文件路径和创建目录的功能。
|
inlinestatic |
创建目录及其父级目录
pathname | 要创建的目录的路径 |
逐层创建目录,直到完整路径创建完成。
|
inlinestatic |
创建新文件
filename | 新文件名 |
在指定路径下创建一个新文件。
|
inlinestatic |
判断文件是否存在
pathname | 文件的路径 |
|
inlinestatic |
获取文件路径
pathname | 文件的路径 |
如果没有找到路径分隔符,返回当前目录。