12 return Error::Invalid(std::format(
"'{}' must name the layout's source .xml, not the compiled resource",
layout));
19 return std::unexpected(
Error::Invalid(
"a layout name is required"));
38 "'{}' is outside {}, the only directory the addon whitelist allows layouts in",
layout,
Directory)));
51 std::string_view name = _resource;
52 name.remove_prefix(name.rfind(
'/') + 1);
A layout resource the client will accept, checked before anything is spawned.
static Result< LayoutPath > Parse(std::string_view layout)
static constexpr std::string_view Directory
std::string_view Name() const noexcept
static constexpr std::string_view SourceExtension
static std::string ReadFile(const std::filesystem::path &path)
static Error NotSourceXml(std::string_view layout)
std::expected< T, Error > Result
One failure: a code to branch on, text for the log, and an optional translation key.
static Error Invalid(std::string detail)