第三方框架改为仓内子集并完善构建忽略规则

完整 NIM_Duilib_Framework 仓库移至父目录,third_party 仅保留实际使用的 base、duilib、bin/resources 与许可证;.gitignore 覆盖 MSBuild 与打包产物。
This commit is contained in:
tongtong committed 2026-11-15 08:54:17 +08:00
1 parent 249e8548de
commit e1e26acc49
391 files changed
+342850

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
struct sqlite3;
enum class TaskState : int
{
kQueued = 0,
kDownloading = 1,
kCompleted = 2,
kFailed = 3,
kPaused = 4,
};
struct TaskInfo
{
int64_t id = 0;
std::wstring url;
std::wstring save_path;
std::wstring file_name;
TaskState state = TaskState::kQueued;
int64_t total_bytes = 0;
int64_t downloaded_bytes = 0;
std::wstring error;
};
class TaskStore
{
public:
~TaskStore();
bool Open(const std::wstring& db_path);
void Close();
std::vector<TaskInfo> LoadTasks();
bool Insert(TaskInfo& task);
bool DeleteTask(int64_t id);
bool UpdateProgress(int64_t id, int64_t downloaded_bytes, int64_t total_bytes);
bool UpdateState(int64_t id, TaskState state, int64_t downloaded_bytes,
int64_t total_bytes, const std::wstring& error);
bool UpdateTarget(int64_t id, const std::wstring& save_path, const std::wstring& file_name);
private:
sqlite3* db_ = nullptr;
};