mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 02:09:46 +08:00
refactor: 重构项目为 MVC 架构并移除全局变量
- 将原有扁平目录结构重构为 MVC 分层架构: * src/core/: 核心业务逻辑(Model),完全独立于 UI 框架 * src/ui/: 界面组件构建(View),负责纯视觉展示 * src/controller/: 用户交互处理(Controller),连接数据与界面 * src/utils/: 底层工具函数,专注于系统调用和字符串处理 - 引入 AppContext 结构体统一管理应用状态,替代原有的全局变量模式 - 重命名并重新组织头文件,按功能模块划分到对应子目录 - 更新 CMakeLists.txt 以适配新的目录结构 - 同步更新 README.md 文档,说明新的架构设计
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#ifndef STRING_EXT_H
|
||||
#define STRING_EXT_H
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
// 简单字符串列表结构
|
||||
typedef struct
|
||||
{
|
||||
char **items;
|
||||
int count;
|
||||
int capacity;
|
||||
} StringList;
|
||||
|
||||
// 字符串列表
|
||||
void init_string_list(StringList *list);
|
||||
void add_string_list(StringList *list, const char *str);
|
||||
void clear_string_list(StringList *list);
|
||||
|
||||
// 字符串转换函数
|
||||
char *wide_to_utf8(const wchar_t *wstr);
|
||||
wchar_t *utf8_to_wide(const char *str);
|
||||
char *stristr(const char *haystack, const char *needle);
|
||||
|
||||
#endif // STRING_EXT_H
|
||||
Reference in New Issue
Block a user