![]() |
Kiwano Engine v1.3.x
|
文件系统,为其他模块提供文件搜索规则等 更多...
#include <FileSystem.h>
Public 成员函数 | |
| void | AddSearchPath (StringView path) |
| 添加文件搜索路径 更多... | |
| void | SetSearchPaths (const Vector< String > &paths) |
| 设置文件搜索路径 更多... | |
| String | GetFullPathForFile (StringView file) const |
| 在搜索列表中查找文件并获取完整路径 更多... | |
| String | GetFileExt (StringView file) const |
| 获取文件拓展名 更多... | |
| void | AddFileLookupRule (StringView key, StringView file_path) |
| 添加文件路径查找字典规则 更多... | |
| void | SetFileLookupDictionary (const UnorderedMap< String, String > &dict) |
| 设置文件路径查找字典 更多... | |
| void | ReadFile (StringView file_path, std::vector< uint8_t > &output) |
| 读取文件内容 | |
| bool | IsFileExists (StringView file_path) const |
| 文件是否存在 更多... | |
| bool | IsAbsolutePath (StringView path) const |
| 判断路径是否是绝对路径 更多... | |
| bool | RemoveFile (StringView file_path) const |
| 删除文件 更多... | |
| bool | ExtractResourceToFile (const Resource &res, StringView dest_file_name) const |
| 释放二进制资源到临时文件目录 更多... | |
额外继承的成员函数 | |
Public 类型 继承自 kiwano::Singleton< FileSystem > | |
| using | object_type = FileSystem |
静态 Public 成员函数 继承自 kiwano::Singleton< FileSystem > | |
| static object_type & | GetInstance () |
| static object_type * | GetInstancePtr () |
Protected 成员函数 继承自 kiwano::Singleton< FileSystem > | |
| Singleton (const Singleton &)=delete | |
| Singleton & | operator= (const Singleton &)=delete |
静态 Protected 属性 继承自 kiwano::Singleton< FileSystem > | |
| static FileSystem | instance_ |
文件系统,为其他模块提供文件搜索规则等
| void kiwano::FileSystem::AddFileLookupRule | ( | StringView | key, |
| StringView | file_path | ||
| ) |
添加文件路径查找字典规则
| key | 文件关键词 |
| file_path | 文件路径 |
| void kiwano::FileSystem::AddSearchPath | ( | StringView | path | ) |
添加文件搜索路径
| path | 文件搜索路径 |
| bool kiwano::FileSystem::ExtractResourceToFile | ( | const Resource & | res, |
| StringView | dest_file_name | ||
| ) | const |
释放二进制资源到临时文件目录
| res | 资源 |
| dest_file_name | 目标文件名 |
| String kiwano::FileSystem::GetFileExt | ( | StringView | file | ) | const |
获取文件拓展名
| file | 文件路径 |
| String kiwano::FileSystem::GetFullPathForFile | ( | StringView | file | ) | const |
在搜索列表中查找文件并获取完整路径
| file | 文件路径 |
| bool kiwano::FileSystem::IsAbsolutePath | ( | StringView | path | ) | const |
判断路径是否是绝对路径
| path | 文件路径 |
| bool kiwano::FileSystem::IsFileExists | ( | StringView | file_path | ) | const |
文件是否存在
| file_path | 文件路径 |
| bool kiwano::FileSystem::RemoveFile | ( | StringView | file_path | ) | const |
删除文件
| file_path | 文件路径 |
| void kiwano::FileSystem::SetFileLookupDictionary | ( | const UnorderedMap< String, String > & | dict | ) |
设置文件路径查找字典
| dict | 文件路径查找字典 |
| void kiwano::FileSystem::SetSearchPaths | ( | const Vector< String > & | paths | ) |
设置文件搜索路径
| paths | 搜索路径数组 |