|
dl
|
文件系统 更多...
#include <string>#include <vector>#include <fstream>#include "base/dl_tree.h"#include "memory/dl_buffer.h"命名空间 | |
| namespace | dl |
| namespace | dl::File |
| 文件系统 | |
| namespace | dl::File::Lua |
| 文件系统lua接口 | |
枚举 | |
| enum class | dl::File::CopyMode { dl::File::NONE , dl::File::OVERRIDE , dl::File::SKIP } |
函数 | |
| void | dl::File::GetPathFileAll (std::string_view path, std::vector< std::string > &ret, std::string_view regex="", bool recursion=true) |
| 获取文件夹所有文件 | |
| void | dl::File::GetPathContent (std::string_view path, std::vector< std::string > &ret, std::string_view regex="", bool folder=true, bool file=true) |
| 获取文件夹当前内容 | |
| void | dl::File::GetPathContentAll (std::string_view path, NTree< std::string > &ret) |
| 获取文件夹所有内容 | |
| FILE * | dl::File::GetFile (std::string_view path_name, bool is_binary=true) |
| 打开一个文件(只读),可能从压缩包内读取 | |
| std::ifstream | dl::File::Get (std::string_view path_name, bool is_binary=true) |
| std::ofstream | dl::File::Set (std::string_view path_name, bool is_binary=true, bool is_app=false) |
| 打开一个文件(只写) | |
| bool | dl::File::ConvertMb2U8 (std::string_view path_name, std::string_view out) |
| 将文本文件从mb转到utf-8 | |
| std::string | dl::File::GetString (std::string_view path_name) |
| 按文本读文件 | |
| Buffer | dl::File::GetBuffer (std::string_view path_name) |
| 返回文件内存 | |
| Buffer | dl::File::GetBuffer (std::ifstream &ifs) |
| 返回文件内存 | |
| bool | dl::File::SaveBuffer (BufferView buf, std::string_view path_name) |
| 将内存保存为文件 | |
| bool | dl::File::SaveString (BufferView buf, std::string_view path_name) |
| 将字符串保存为文件 | |
| bool | dl::File::SaveString (std::string_view str, std::string_view path_name) |
| 将字符串保存为文件 | |
| uint32_t | dl::File::GetCrc32 (std::string_view path_name) |
| 返回文件Blake2b值 | |
| bool | dl::File::IsExist (std::string_view path_name) |
| 返回文件是否存在 | |
| bool | dl::File::Delete (std::string_view path_name, bool all=false) |
| 删除文件或路径 | |
| void | dl::File::DeleteContent (std::string_view path_name) |
| 删除文件夹内容,但不删除文件夹 | |
| bool | dl::File::Rename (std::string_view src, std::string_view tar) |
| 重命名文件 | |
| std::string | dl::File::Search (std::string_view path, std::string_view file_name) |
| 从路径搜索文件 | |
| bool | dl::File::Copy (std::string_view source, std::string_view target, CopyMode mode=CopyMode::NONE, bool recursion=false) |
| 复制文件或文件夹 | |
| std::string | dl::File::GetExtension (std::string_view path_name, bool has_dot=false) |
| 返回文件后缀 | |
| std::string | dl::File::GetFileName (std::string_view path_name) |
| 返回文件名 | |
| std::string | dl::File::GetStem (std::string_view path_name) |
| 返回文件名不含后缀 | |
| std::string | dl::File::GetFolderName (std::string_view path_name) |
| 返回路径所在文件夹名 | |
| std::string | dl::File::GetFilePath (std::string_view path_name) |
| 返回文件所在路径 | |
| std::string | dl::File::GetAbsolute (std::string_view path_name) |
| 返回绝对路径 | |
| std::string | dl::File::GetRelative (std::string_view path_name, std::string_view path_base) |
| 返回相对路径 | |
| bool | dl::File::CreateFolder (std::string_view path) |
| 创建目录 | |
| time_t | dl::File::GetLastWriteTime (std::string_view path_name) |
| 返回文件最后修改时间 | |
| bool | dl::File::CheckPathFileModified (std::string_view path_name, std::string_view regex, std::string_view cache, bool update) |
| 判断路径内的文件是否有修改(包括增加、删除文件) | |
| std::string | dl::File::PathCurrent () |
| 返回资源路径 | |
| std::string | dl::File::PathTemp () |
| 返回临时路径 rw | |
| std::string | dl::File::PathStorage () |
| 返回存储路径 rw(安卓只读) | |
| std::string | dl::File::PathStorageRoot () |
| std::string | dl::File::PathPrivate () |
| 返回私有路径 rw | |
| std::string | dl::File::PathPublic () |
| 返回公共路径 rw | |
| void | dl::File::InitFileSystem () |
| std::vector< std::string > | dl::File::Lua::lua_GetPathFileAll_3 (std::string_view path, std::string_view regex, bool recursion) |
| std::vector< std::string > | dl::File::Lua::lua_GetPathFileAll_2 (std::string_view path, std::string_view regex) |
| std::vector< std::string > | dl::File::Lua::lua_GetPathFileAll_1 (std::string_view path) |
文件系统
在文件 dl_file.h 中定义.