[nostalgia,olympic] Cleanup

This commit is contained in:
2024-12-13 22:00:03 -06:00
parent fcac134af0
commit a5271f6cf6
27 changed files with 64 additions and 64 deletions

View File

@@ -64,7 +64,7 @@ ox::Error writeConfig(keel::Context &ctx, ox::StringViewCR name, T const&data) n
*buff.back().value = '\n';
if (auto const err = fs.write(path, buff.data(), buff.size())) {
//oxErrf("Could not read config file: {} - {}\n", path, toStr(err));
return OxError(2, "Could not read config file");
return ox::Error(2, "Could not read config file");
}
return {};
}

View File

@@ -27,7 +27,7 @@ template<typename T>
ox::Result<T> getDragDropPayload(ox::CStringView name) noexcept {
auto const payload = ImGui::AcceptDragDropPayload(name.c_str());
if (!payload) {
return OxError(1, "No drag/drop payload");
return ox::Error(1, "No drag/drop payload");
}
return ox::readClaw<T>({
reinterpret_cast<char const*>(payload->Data),

View File

@@ -31,7 +31,7 @@ enum class ProjectEvent {
constexpr ox::Result<ox::StringView> fileExt(ox::StringViewCR path) noexcept {
auto const extStart = ox::find(path.crbegin(), path.crend(), '.').offset();
if (!extStart) {
return OxError(1, "file path does not have valid extension");
return ox::Error(1, "file path does not have valid extension");
}
return substr(path, extStart + 1);
}

View File

@@ -31,9 +31,9 @@ OX_ALLOW_UNSAFE_BUFFERS_END
return out;
}
case NFD_CANCEL:
return OxError(1, "Operation cancelled");
return ox::Error(1, "Operation cancelled");
default:
return OxError(2, NFD::GetError());
return ox::Error(2, NFD::GetError());
}
}

View File

@@ -44,7 +44,7 @@ Project::Project(keel::Context &ctx, ox::String path, ox::StringViewCR projectDa
ox::Error Project::create() noexcept {
std::error_code ec;
std::filesystem::create_directory(m_path.toStdString(), ec);
return OxError(static_cast<ox::ErrorCode>(ec.value()), "PassThroughFS: mkdir failed");
return ox::Error(static_cast<ox::ErrorCode>(ec.value()), "PassThroughFS: mkdir failed");
}
ox::String const&Project::projectPath() const noexcept {
@@ -62,7 +62,7 @@ ox::Error Project::mkdir(ox::StringViewCR path) const noexcept {
fileUpdated.emit(path, {});
}
return stat.fileType == ox::FileType::Directory ?
ox::Error{} : OxError(1, "path exists as normal file");
ox::Error{} : ox::Error(1, "path exists as normal file");
}
ox::Result<ox::FileStat> Project::stat(ox::StringViewCR path) const noexcept {