From 32e6bb262beacd2d00b60c39692a0ebb4720c756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Thu, 30 Apr 2026 11:38:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(test):=20=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=E6=A1=86=E6=9E=B6=E5=B9=B6=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=9B=BD=E9=99=85=E5=8C=96=E6=94=AF=E6=8C=81=20-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20CMake=20=E6=B5=8B=E8=AF=95=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81=20safe?= =?UTF-8?q?=5Fstring=E3=80=81string=5Fext=20=E5=92=8C=20path=5Fmanager=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=20-=20=E5=AE=9E=E7=8E=B0=20Windows=20API=20Mock=20=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=BE=BF=E4=BA=8E=E6=B5=8B=E8=AF=95=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E8=BD=AC=E6=8D=A2=E5=87=BD=E6=95=B0=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20error=5Fcode=20=E6=A8=A1=E5=9D=97=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=A1=A8=E7=A4=BA=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8B=B1=E6=96=87=E9=94=99=E8=AF=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=20-=20=E5=9C=A8=20UI=20=E5=9B=9E=E8=B0=83=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=AD=E9=9B=86=E6=88=90=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=8C=E8=A6=86=E7=9B=96=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E3=80=81=E7=BC=96=E8=BE=91=E3=80=81=E5=AF=BC=E5=85=A5=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=AD=89=E6=93=8D=E4=BD=9C=E6=8F=90=E7=A4=BA=20-=20?= =?UTF-8?q?=E6=89=A9=E5=B1=95=20string=5Flist=20=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=87=8D=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=87=BD=E6=95=B0=20-=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E6=96=87=E4=BB=B6=EF=BC=8C=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7=E7=95=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/core/import_export.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/core/import_export.h b/include/core/import_export.h index 98fb95e..f0599bc 100644 --- a/include/core/import_export.h +++ b/include/core/import_export.h @@ -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 \ No newline at end of file