OmniStacksStaticModules 2.0.0
Loading...
Searching...
No Matches
ProjectSync Module Reference

Stacks 2 项目/看板索引模块。 More...

Classes

struct  ProjectSync::DbPaths
 项目索引数据库路径。 More...
struct  ProjectSync::SyncSummary
 同步结果摘要;用于 CLI、Alfred 反馈和接口日志。 More...

Enumerations

enum class  ProjectSync::SyncError {
  ProjectSync::search_path_missing , ProjectSync::search_path_not_directory , ProjectSync::project_db_unreadable , ProjectSync::project_file_unreadable ,
  ProjectSync::io_failure
}
 工作区同步的可恢复错误分类。 More...

Functions

std::expected< SyncSummary, SyncError > ProjectSync::sync_all (const std::filesystem::path &search_path, const DbPaths &paths={})
 同步新增路径与全部已记忆路径,并原子重建两个索引。
template<std::invocable< const std::filesystem::directory_entry & > Visitor>
void ProjectSync::for_each_project_file (const std::filesystem::path &directory, Visitor &&visitor)
 递归遍历工作区中的 .project 文件。
std::string_view ProjectSync::sync_error_message (SyncError error) noexcept
 SyncError 到稳定、可读的 CLI/Alfred 错误文本。
std::string ProjectSync::format_file_time (std::filesystem::file_time_type file_time)
 把 filesystem 写入时间转换为本地 YYYY-MM-DD HH:MM:SS。

Detailed Description

Stacks 2 项目/看板索引模块。

本模块只负责读取已保存的工作区路径、扫描 .project 文件并原子重建 data/Project.json 与 data/Stack.json。业务任务的增删改查在 TaskManager 中完成。

设计约束:

  • 路径先规范化去重,避免同一工作区以不同相对路径重复扫描;
  • .project 按绝对路径排序,保证索引顺序与文件系统枚举顺序无关;
  • 单个坏项目只记录到 failed_projects,不阻断其他项目的同步;
  • 两个索引文件都通过同目录临时文件 + rename 原子替换;
  • 模块只依赖 std 与 InterfaceLog,不反向 import TaskManager。

Files

file  /Users/runner/work/CXX-CMake-template/CXX-CMake-template/single-exe-static-modules/modules/project_sync/include/ProjectSync.cppm