Repository navigation
Expand file tree
/
Copy pathUpdateEngine.h
More file actions
47 lines (40 loc) · 1.8 KB
/
Copy pathUpdateEngine.h
File metadata and controls
47 lines (40 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "CliParser.h"
#include "FileScanner.h"
#include "UpdateState.h"
class ModVersionInfo;
namespace modrinth_cli::engine {
struct UpdateComputation {
state::UpdateState state;
std::unordered_map<std::string, ModVersionInfo> target_versions_by_project;
std::unordered_map<std::string, ModVersionInfo> installed_versions_by_project;
std::unordered_map<std::string, std::string> project_local_filenames;
std::unordered_map<std::string, std::string> installed_source_paths_by_project;
std::unordered_map<std::string, std::string> installed_hashes_by_project;
std::unordered_map<std::string, std::string> project_titles;
std::unordered_set<std::string> installed_project_ids;
std::unordered_map<std::string, std::string> installed_version_ids_by_project;
std::unordered_set<std::string> updatable_project_ids;
std::vector<files::FileHashRecord> scanned_files;
std::unordered_set<std::string> resolved_current_hashes;
std::unordered_set<std::string> resolved_latest_hashes;
size_t scanned_file_count = 0;
size_t current_version_count = 0;
size_t latest_version_count = 0;
size_t current_response_bytes = 0;
size_t latest_response_bytes = 0;
size_t curseforge_response_bytes = 0;
size_t curseforge_unresolved_count = 0;
bool curseforge_attempted = false;
std::vector<std::string> unresolved_mod_filenames;
};
class UpdateEngine {
public:
static UpdateComputation computeUpdateState(const cli::CommandLineOptions& options,
const std::filesystem::path& state_file);
};
} // namespace modrinth_cli::engine