LogSystem beta 1.4
This is a logging system project
 
载入中...
搜索中...
未找到
Xulog::Util::File类 参考

文件操作相关的实用工具类 更多...

#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)
 创建新文件
 

详细描述

文件操作相关的实用工具类

提供判断文件是否存在、获取文件路径和创建目录的功能。

成员函数说明

◆ createDirectory()

static void Xulog::Util::File::createDirectory ( const std::string &  pathname)
inlinestatic

创建目录及其父级目录

参数
pathname要创建的目录的路径

逐层创建目录,直到完整路径创建完成。

函数调用图:
这是这个函数的调用关系图:

◆ createFile()

static bool Xulog::Util::File::createFile ( const std::string  filename)
inlinestatic

创建新文件

参数
filename新文件名
返回
true 创建成功,false 创建失败

在指定路径下创建一个新文件。

这是这个函数的调用关系图:

◆ exists()

static bool Xulog::Util::File::exists ( const std::string &  pathname)
inlinestatic

判断文件是否存在

参数
pathname文件的路径
返回
true 如果文件存在
false 如果文件不存在
这是这个函数的调用关系图:

◆ path()

static std::string Xulog::Util::File::path ( const std::string &  pathname)
inlinestatic

获取文件路径

参数
pathname文件的路径
返回
std::string 文件所在的目录路径

如果没有找到路径分隔符,返回当前目录。

这是这个函数的调用关系图: