mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-09 18:02:52 +08:00
feat(test): 添加单元测试框架并完善国际化支持
- 新增 CMake 测试框架配置,支持 safe_string、string_ext 和 path_manager 模块的单元测试 - 实现 Windows API Mock 机制,便于测试编码转换函数 - 添加 error_code 模块的字符串表示函数,支持英文错误日志 - 在 UI 回调函数中集成国际化翻译,覆盖新建、编辑、导入导出等操作提示 - 扩展 string_list 功能,新增重复路径检查函数 - 更新翻译文件,同步所有用户界面的中英文文本
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
|
||||
#define EXPORT_VERSION "1.0"
|
||||
|
||||
// 导出数据类型
|
||||
typedef enum {
|
||||
EXPORT_JSON, // JSON 格式
|
||||
EXPORT_CSV // CSV 格式
|
||||
} ExportFormat;
|
||||
|
||||
// 导出数据结构
|
||||
// 注意:此结构体用于导出时是只读的,items 指针指向外部 StringList 的数据
|
||||
// 不要对 ExportData 调用 clear_string_list,会破坏原始数据
|
||||
@@ -14,10 +20,16 @@ typedef struct {
|
||||
StringList user;
|
||||
} ExportData;
|
||||
|
||||
// 导出 PATH 到文件
|
||||
// 导出 PATH 到文件(自动根据扩展名选择格式)
|
||||
ErrorCode export_paths_to_file(const ExportData *data, const char *filepath);
|
||||
|
||||
// 导出 PATH 到指定格式的文件
|
||||
ErrorCode export_paths_to_format(const ExportData *data, const char *filepath, ExportFormat format);
|
||||
|
||||
// 从文件导入 PATH
|
||||
ErrorCode import_paths_from_file(const char *filepath, ExportData *data);
|
||||
|
||||
// 验证路径格式是否有效
|
||||
int is_valid_path_format(const char *path);
|
||||
|
||||
#endif // IMPORT_EXPORT_H
|
||||
Reference in New Issue
Block a user