载入中...
搜索中...
未找到
EditorHostProfile.cpp
浏览该文件的文档.
2
3namespace eve::editor {
4
6 HostProfile profile(HostKind::Developer);
10 profile.allowAllCommands_ = true;
11 profile.maxPayloadBytes_ = 4 * 1024 * 1024;
12 return profile;
13}
14
16 HostProfile profile(HostKind::RuntimeBuilder);
18 return profile;
19}
20
22 HostProfile profile(HostKind::Automation);
24 profile.maxPayloadBytes_ = 1024 * 1024;
25 return profile;
26}
27
28bool HostProfile::hasFeatures(HostFeature required) const { return (features_ & required) == required; }
29
31 if (!id) return;
32 deniedCommands_.erase(id);
33 allowedCommands_.insert(std::move(id));
34}
35
36void HostProfile::allowCommands(std::initializer_list<CommandId> ids) {
37 for (const auto& id : ids) allowCommand(id);
38}
39
41 if (!id) return;
42 allowedCommands_.erase(id);
43 deniedCommands_.insert(id);
44}
45
47 if (!id || deniedCommands_.contains(id)) return false;
48 return allowAllCommands_ || allowedCommands_.contains(id);
49}
50
51} // namespace eve::editor
glm::uvec4 ids
bool required
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Upper capability boundary for one editor host.
static HostProfile runtimeBuilder()
Safe runtime profile that denies commands unless allow-listed.
static HostProfile developer()
Unrestricted developer profile used by legacy sessions.
void allowCommands(std::initializer_list< CommandId > ids)
Allow commands.
void denyCommand(const CommandId &id)
Deny command.
bool hasFeatures(HostFeature required) const
True when features.
bool allowsCommand(const CommandId &id) const
Allows command.
void allowCommand(CommandId id)
Allow command.
static HostProfile automation()
Headless profile that denies commands unless allow-listed.
HostFeature
Coarse host features used to discover and gate editor extensions.