This commit is contained in:
parent
5fe7c14ccb
commit
e1282b6bae
@ -37,10 +37,28 @@ class Module {
|
||||
|
||||
template<typename Editor>
|
||||
[[nodiscard]]
|
||||
studio::EditorMaker editorMaker(studio::StudioContext &ctx, ox::StringParam ext) noexcept {
|
||||
EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept {
|
||||
return {
|
||||
{std::move(ext)},
|
||||
[&ctx](ox::StringViewCR path) -> ox::Result<studio::BaseEditor*> {
|
||||
[&ctx](ox::StringViewCR path) -> ox::Result<BaseEditor*> {
|
||||
return ox::makeCatch<Editor>(ctx, path);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template<typename Editor>
|
||||
[[nodiscard]]
|
||||
EditorMaker editorMaker(StudioContext &ctx, std::initializer_list<ox::StringView> exts) noexcept {
|
||||
return {
|
||||
[&exts] {
|
||||
ox::Vector<ox::String> fileTypes;
|
||||
fileTypes.reserve(exts.size());
|
||||
for (auto &s : exts) {
|
||||
fileTypes.emplace_back(s);
|
||||
}
|
||||
return fileTypes;
|
||||
}(),
|
||||
[&ctx](ox::StringViewCR path) -> ox::Result<BaseEditor*> {
|
||||
return ox::makeCatch<Editor>(ctx, path);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user