Unravel Engine C++ Reference
Loading...
Searching...
No Matches
project_manager.h
Go to the documentation of this file.
1#pragma once
2#include <context/context.hpp>
8#include <filesystem/syncer.h>
9#include <cmd_line/parser.h>
10
11#include <cstdint>
12
13
14namespace unravel
15{
17{
18public:
21
22 auto init(rtti::context& ctx, const cmd_line::parser& parser) -> bool;
23 auto deinit(rtti::context& ctx) -> bool;
24
25
30 enum class project_compat : std::uint8_t
31 {
38 ok,
44 };
45
53
56 auto inspect_project(const fs::path& project_path) const -> project_compat_report;
57
58 auto open_project(rtti::context& ctx, const fs::path& project_path) -> bool;
59
61
62 void create_project(rtti::context& ctx, const fs::path& project_path);
63
67 auto regenerate_agent_files() -> bool;
68
70
72
73 auto get_name() const -> const std::string&;
74
75 void set_name(const std::string& name);
76
77 auto get_settings() -> settings&;
82 auto get_project_info() const -> const project_info&;
83
84
85 auto has_open_project() const -> bool;
86
88 void save_project_settings(rtti::context& ctx);
95 auto load_project_info() -> bool;
96 void save_project_info();
97
98private:
99 void fixup_editor_settings_on_save();
100 void fixup_editor_settings_on_load();
101
102 void setup_directory(rtti::context& ctx, fs::syncer& syncer);
103 void setup_meta_syncer(rtti::context& ctx, fs::syncer& syncer, const fs::path& data_dir, const fs::path& meta_dir);
104 void setup_cache_syncer(rtti::context& ctx,
105 std::vector<uint64_t>& watchers,
106 fs::syncer& syncer,
107 const fs::path& meta_dir,
108 const fs::path& cache_dir);
109 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
110
111
113 std::string project_name_;
114 settings project_settings_;
115 deploy_settings deploy_settings_;
116 editor_settings editor_settings_;
117 project_editor_settings project_editor_settings_;
118 project_info project_info_;
119
120 fs::syncer app_meta_syncer_;
121 fs::syncer app_cache_syncer_;
122 std::vector<std::uint64_t> app_watchers_;
123
124 fs::syncer editor_meta_syncer_;
125 fs::syncer editor_cache_syncer_;
126 std::vector<std::uint64_t> editor_watchers_;
127
128 fs::syncer engine_meta_syncer_;
129 fs::syncer engine_cache_syncer_;
130 std::vector<std::uint64_t> engine_watchers_;
131};
132} // namespace unravel
auto regenerate_agent_files() -> bool
auto inspect_project(const fs::path &project_path) const -> project_compat_report
auto init(rtti::context &ctx, const cmd_line::parser &parser) -> bool
auto get_project_editor_settings() -> project_editor_settings &
auto get_deploy_settings() -> deploy_settings &
auto get_project_info() -> project_info &
project_manager(rtti::context &ctx, cmd_line::parser &parser)
void set_name(const std::string &name)
auto has_open_project() const -> bool
auto get_editor_settings() -> editor_settings &
auto open_project(rtti::context &ctx, const fs::path &project_path) -> bool
auto deinit(rtti::context &ctx) -> bool
void create_project(rtti::context &ctx, const fs::path &project_path)
auto get_settings() -> settings &
void save_project_settings(rtti::context &ctx)
auto get_name() const -> const std::string &
void close_project(rtti::context &ctx)
std::string name
Definition hub.cpp:33
Definition cache.hpp:11
Hash specialization for batch_key to enable use in std::unordered_map.