[olympic,nostalgia] Cleanup style
All checks were successful
Build / build (push) Successful in 1m18s
All checks were successful
Build / build (push) Successful in 1m18s
This commit is contained in:
@@ -140,7 +140,7 @@ class Editor: public studio::BaseEditor {
|
||||
ox::Error pushCommand(Args&&... args) noexcept {
|
||||
try {
|
||||
return m_undoStack.push(ox::make_unique<UC>(ox::forward<Args>(args)...));
|
||||
} catch (ox::Exception const&ex) {
|
||||
} catch (ox::Exception const &ex) {
|
||||
return ex.toError();
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ class Editor: public studio::BaseEditor {
|
||||
private:
|
||||
ox::Error markUnsavedChanges(UndoCommand const*) noexcept;
|
||||
|
||||
ox::Error handleRename(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
||||
ox::Error handleRename(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const &id) noexcept;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -21,7 +21,7 @@ struct FDFilterItem {
|
||||
FDFilterItem(ox::StringViewCR pName, ox::StringViewCR pSpec) noexcept;
|
||||
};
|
||||
|
||||
ox::Result<ox::String> saveFile(ox::Vector<FDFilterItem> const&exts) noexcept;
|
||||
ox::Result<ox::String> saveFile(ox::Vector<FDFilterItem> const &exts) noexcept;
|
||||
|
||||
ox::Result<ox::String> chooseDirectory() noexcept;
|
||||
|
||||
|
@@ -78,7 +78,7 @@ class FileExplorer: public ox::SignalHandler {
|
||||
}
|
||||
|
||||
private:
|
||||
ox::Result<bool> setSelectedPath(ox::StringViewCR path, FileTreeModel const&node) noexcept;
|
||||
ox::Result<bool> setSelectedPath(ox::StringViewCR path, FileTreeModel const &node) noexcept;
|
||||
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ class FileTreeModel {
|
||||
void setChildren(ox::Vector<ox::UPtr<FileTreeModel>> children) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::Vector<ox::UPtr<FileTreeModel>> const&children() const noexcept {
|
||||
ox::Vector<ox::UPtr<FileTreeModel>> const &children() const noexcept {
|
||||
return m_children;
|
||||
}
|
||||
|
||||
@@ -129,13 +129,13 @@ ox::Result<ox::UPtr<FileTreeModel>> buildFileTreeModel(
|
||||
ox::StringParam name,
|
||||
ox::StringViewCR path,
|
||||
FileTreeModel *parent = nullptr,
|
||||
std::function<bool(ox::StringViewCR, ox::FileStat const&)> const&filter =
|
||||
std::function<bool(ox::StringViewCR, ox::FileStat const&)> const &filter =
|
||||
[](ox::StringViewCR, ox::FileStat const&) {return true;},
|
||||
bool showEmptyDirs = true) noexcept;
|
||||
|
||||
ox::Result<ox::UPtr<FileTreeModel>> buildFileTreeModel(
|
||||
FileExplorer &explorer,
|
||||
std::function<bool(ox::StringViewCR, ox::FileStat const&)> const&filter =
|
||||
std::function<bool(ox::StringViewCR, ox::FileStat const&)> const &filter =
|
||||
[](ox::StringViewCR, ox::FileStat const&) {return true;},
|
||||
bool showEmptyDirs = true) noexcept;
|
||||
|
||||
|
@@ -27,11 +27,11 @@ class ItemTemplate {
|
||||
virtual ~ItemTemplate() = default;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr ox::String const&name() const noexcept {
|
||||
constexpr ox::String const &name() const noexcept {
|
||||
return m_name;
|
||||
}
|
||||
|
||||
constexpr bool operator<=>(ItemTemplate const&other) const noexcept {
|
||||
constexpr bool operator<=>(ItemTemplate const &other) const noexcept {
|
||||
return m_name != other.name() ? (m_name < other.name() ? -1 : 1) : 0;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ class ItemMaker {
|
||||
virtual ~ItemMaker() noexcept = default;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::String const&typeDisplayName() const noexcept {
|
||||
ox::String const &typeDisplayName() const noexcept {
|
||||
return m_typeDisplayName;
|
||||
}
|
||||
|
||||
@@ -120,17 +120,17 @@ class ItemMaker {
|
||||
return false;
|
||||
}
|
||||
|
||||
constexpr ox::Vector<ox::UPtr<ItemTemplate>> const&itemTemplates() const noexcept {
|
||||
constexpr ox::Vector<ox::UPtr<ItemTemplate>> const &itemTemplates() const noexcept {
|
||||
return m_templates;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
ox::String const&fileExt() const noexcept {
|
||||
ox::String const &fileExt() const noexcept {
|
||||
return m_fileExt;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
ox::String const&defaultPath() const noexcept {
|
||||
ox::String const &defaultPath() const noexcept {
|
||||
return m_parentDir;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ class ItemMakerT final: public ItemMaker {
|
||||
ox::StringParam pDisplayName,
|
||||
ox::StringViewCR pParentDir,
|
||||
ox::StringParam fileExt,
|
||||
T const&pItem,
|
||||
T const &pItem,
|
||||
ox::ClawFormat const pFmt) noexcept:
|
||||
ItemMaker(
|
||||
std::move(pDisplayName),
|
||||
@@ -249,7 +249,7 @@ class ItemMakerT final: public ItemMaker {
|
||||
ox::StringViewCR pPath,
|
||||
size_t const pTemplateIdx) const noexcept override {
|
||||
createUuidMapping(keelCtx(ctx.tctx), pPath, ox::UUID::generate().unwrap());
|
||||
auto const&templates = itemTemplates();
|
||||
auto const &templates = itemTemplates();
|
||||
auto const tmplIdx = pTemplateIdx < templates.size() ? pTemplateIdx : 0;
|
||||
OX_REQUIRE_M(tmpl, templates[tmplIdx]->getItem(
|
||||
keelCtx(ctx), typeName(), typeVersion()));
|
||||
|
@@ -43,11 +43,11 @@ class Popup: public Widget {
|
||||
m_title = std::move(title);
|
||||
}
|
||||
|
||||
constexpr ox::String const&title() const noexcept {
|
||||
constexpr ox::String const &title() const noexcept {
|
||||
return m_title;
|
||||
}
|
||||
|
||||
void drawWindow(turbine::Context &ctx, bool &open, std::function<void()> const&drawContents);
|
||||
void drawWindow(turbine::Context &ctx, bool &open, std::function<void()> const &drawContents);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -64,7 +64,7 @@ class Project: public ox::SignalHandler {
|
||||
ox::Error create() noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::String const&projectPath() const noexcept;
|
||||
ox::String const &projectPath() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::FileSystem &romFs() noexcept;
|
||||
@@ -77,7 +77,7 @@ class Project: public ox::SignalHandler {
|
||||
template<typename T>
|
||||
ox::Error writeObj(
|
||||
ox::StringViewCR path,
|
||||
T const&obj,
|
||||
T const &obj,
|
||||
ox::ClawFormat fmt) noexcept;
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ class Project: public ox::SignalHandler {
|
||||
template<typename T>
|
||||
ox::Error writeObj(
|
||||
ox::StringViewCR path,
|
||||
T const&obj) noexcept;
|
||||
T const &obj) noexcept;
|
||||
|
||||
template<typename T>
|
||||
ox::Result<T> loadObj(ox::StringViewCR path) const noexcept;
|
||||
@@ -108,7 +108,7 @@ class Project: public ox::SignalHandler {
|
||||
ox::Error subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&slot) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::Vector<ox::String> const&fileList(ox::StringViewCR ext) noexcept;
|
||||
ox::Vector<ox::String> const &fileList(ox::StringViewCR ext) noexcept;
|
||||
|
||||
ox::Error writeTypeStore() noexcept;
|
||||
|
||||
@@ -117,7 +117,7 @@ class Project: public ox::SignalHandler {
|
||||
|
||||
void indexFile(ox::StringViewCR path) noexcept;
|
||||
|
||||
ox::Error writeBuff(ox::StringViewCR path, ox::BufferView const&buff) noexcept;
|
||||
ox::Error writeBuff(ox::StringViewCR path, ox::BufferView const &buff) noexcept;
|
||||
|
||||
ox::Result<ox::Buffer> loadBuff(ox::StringViewCR path) const noexcept;
|
||||
|
||||
@@ -136,13 +136,13 @@ class Project: public ox::SignalHandler {
|
||||
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
||||
ox::Signal<ox::Error(ox::StringViewCR)> fileDeleted;
|
||||
ox::Signal<ox::Error(ox::StringViewCR)> dirDeleted;
|
||||
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const&id)> fileUpdated;
|
||||
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id)> fileMoved;
|
||||
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const &id)> fileUpdated;
|
||||
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const &id)> fileMoved;
|
||||
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat fmt) noexcept {
|
||||
ox::Error Project::writeObj(ox::StringViewCR path, T const &obj, ox::ClawFormat fmt) noexcept {
|
||||
OX_REQUIRE_M(buff, ox::writeClaw(obj, fmt));
|
||||
if (fmt == ox::ClawFormat::Organic) {
|
||||
buff.pop_back();
|
||||
@@ -167,7 +167,7 @@ ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat f
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ox::Error Project::writeObj(ox::StringViewCR path, T const&obj) noexcept {
|
||||
ox::Error Project::writeObj(ox::StringViewCR path, T const &obj) noexcept {
|
||||
OX_REQUIRE(ext, fileExt(path));
|
||||
auto const fmt = m_typeFmt[ext].or_value(ox::ClawFormat::Metal);
|
||||
return writeObj(path, obj, fmt);
|
||||
@@ -197,7 +197,7 @@ ox::Error Project::subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&s
|
||||
case ProjectEvent::FileRecognized:
|
||||
{
|
||||
OX_REQUIRE(files, listFiles());
|
||||
for (auto const&f : files) {
|
||||
for (auto const &f : files) {
|
||||
slot(f);
|
||||
}
|
||||
connect(this, &Project::fileRecognized, tgt, slot);
|
||||
|
@@ -16,19 +16,19 @@ namespace studio {
|
||||
struct Selection {
|
||||
ox::Point a, b;
|
||||
constexpr Selection() noexcept = default;
|
||||
constexpr Selection(ox::Point const&pA, ox::Point const&pB) noexcept: a(pA), b(pB) {}
|
||||
constexpr Selection(ox::Point const &pA, ox::Point const &pB) noexcept: a(pA), b(pB) {}
|
||||
[[nodiscard]]
|
||||
constexpr ox::Size size() const noexcept {
|
||||
return {b.x - a.x, b.y - a.y};
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr bool contains(ox::Point const&pt) const noexcept {
|
||||
constexpr bool contains(ox::Point const &pt) const noexcept {
|
||||
return a.x <= pt.x && a.y <= pt.y
|
||||
&& b.x >= pt.x && b.y >= pt.y;
|
||||
}
|
||||
};
|
||||
|
||||
constexpr auto iterateSelection(studio::Selection const&sel, auto const&cb) {
|
||||
constexpr auto iterateSelection(Selection const &sel, auto const &cb) {
|
||||
constexpr auto retErr = ox::is_same_v<decltype(cb(0, 0)), ox::Error>;
|
||||
for (auto x = sel.a.x; x <= sel.b.x; ++x) {
|
||||
for (auto y = sel.a.y; y <= sel.b.y; ++y) {
|
||||
@@ -44,7 +44,7 @@ constexpr auto iterateSelection(studio::Selection const&sel, auto const&cb) {
|
||||
}
|
||||
};
|
||||
|
||||
constexpr auto iterateSelectionRows(studio::Selection const&sel, auto const&cb) {
|
||||
constexpr auto iterateSelectionRows(Selection const &sel, auto const &cb) {
|
||||
constexpr auto retErr = ox::is_same_v<decltype(cb(0, 0)), ox::Error>;
|
||||
for (auto y = sel.a.y; y <= sel.b.y; ++y) {
|
||||
for (auto x = sel.a.x; x <= sel.b.x; ++x) {
|
||||
|
@@ -12,7 +12,7 @@ namespace studio {
|
||||
|
||||
class NoChangesException: public ox::Exception {
|
||||
public:
|
||||
inline NoChangesException(std::source_location sloc = std::source_location::current()):
|
||||
explicit NoChangesException(std::source_location sloc = std::source_location::current()):
|
||||
ox::Exception(1, "Command makes no changes.", sloc) {}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user