2024-11-14 16:04:54 +08:00
|
|
|
#ifndef OFEN_PATH_HEADER
|
|
|
|
#define OFEN_PATH_HEADER
|
|
|
|
|
2024-11-15 13:16:04 +08:00
|
|
|
#include "of_def.hpp"
|
2024-11-14 16:04:54 +08:00
|
|
|
|
|
|
|
namespace ofen {
|
|
|
|
class COfPath
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
COfPath();
|
|
|
|
~COfPath();
|
|
|
|
|
|
|
|
public:
|
2024-12-12 22:42:44 +08:00
|
|
|
static bool is_same_path(const ofString& pa, const ofString& pb);
|
|
|
|
static ofString normalize(const ofString& path);
|
|
|
|
static ofString get_full_path();
|
|
|
|
static ofString get_home();
|
|
|
|
static ofString get_config_dir(const ofString& sub_dir, bool create = false);
|
|
|
|
static ofString get_full(const ofString& path, const ofString& sub_file_path);
|
|
|
|
static bool exist(const ofString& path);
|
|
|
|
static bool write(const ofString& path, const char* data, int len);
|
2024-12-13 23:02:30 +08:00
|
|
|
static ofString to_full(const ofString& path);
|
2025-04-07 11:03:34 +08:00
|
|
|
static ofString standardize(const ofString& path);
|
|
|
|
static bool is_same_dir(const ofString& pa, const ofString& pb);
|
2025-02-13 16:28:55 +08:00
|
|
|
|
|
|
|
/// @brief 根据通配符获取内容,仅支持通配文件,仅支持 *? 两种通配符。
|
2025-04-07 11:03:34 +08:00
|
|
|
/// @param path
|
|
|
|
/// @return
|
2025-02-13 16:28:55 +08:00
|
|
|
static ofStrVec match_files(const ofString& path);
|
2024-11-14 16:04:54 +08:00
|
|
|
};
|
|
|
|
}; // namespace ofen
|
|
|
|
#endif
|