Merge commit '47eee1d56d591e3631d16e95a78ea3629ee312ee'
All checks were successful
Build / build (push) Successful in 1m28s
All checks were successful
Build / build (push) Successful in 1m28s
This commit is contained in:
@ -60,6 +60,11 @@ ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::StringViewCR uuid) noex
|
||||
|
||||
ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::UUID const&uuid) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool isUuidUrl(ox::StringViewCR path) noexcept {
|
||||
return ox::beginsWith(path, "uuid://");
|
||||
}
|
||||
|
||||
#ifndef OX_BARE_METAL
|
||||
|
||||
namespace detail {
|
||||
|
@ -10,6 +10,6 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
void registerModule(studio::Module const*) noexcept;
|
||||
void registerModule(Module const*) noexcept;
|
||||
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
add_library(
|
||||
StudioAppLib
|
||||
aboutpopup.cpp
|
||||
app.cpp
|
||||
clawviewer.cpp
|
||||
deleteconfirmation.cpp
|
||||
filedialogmanager.cpp
|
||||
font.cpp
|
||||
makecopypopup.cpp
|
||||
newdir.cpp
|
||||
newmenu.cpp
|
||||
newproject.cpp
|
||||
popups/about.cpp
|
||||
popups/deleteconfirmation.cpp
|
||||
popups/makecopy.cpp
|
||||
popups/newdir.cpp
|
||||
popups/newmenu.cpp
|
||||
popups/newproject.cpp
|
||||
popups/renamefile.cpp
|
||||
projectexplorer.cpp
|
||||
renamefile.cpp
|
||||
studioui.cpp
|
||||
)
|
||||
target_compile_definitions(
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <studio/imguiutil.hpp>
|
||||
#include "aboutpopup.hpp"
|
||||
#include "about.hpp"
|
||||
|
||||
namespace olympic {
|
||||
extern ox::String appVersion;
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include <studio/imguiutil.hpp>
|
||||
|
||||
#include "makecopypopup.hpp"
|
||||
#include "makecopy.hpp"
|
||||
|
||||
namespace studio {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <studio/imguiutil.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "filedialogmanager.hpp"
|
||||
#include "../filedialogmanager.hpp"
|
||||
#include "newproject.hpp"
|
||||
|
||||
namespace studio {
|
@ -14,14 +14,14 @@
|
||||
#include <studio/project.hpp>
|
||||
#include <studio/task.hpp>
|
||||
|
||||
#include "aboutpopup.hpp"
|
||||
#include "deleteconfirmation.hpp"
|
||||
#include "makecopypopup.hpp"
|
||||
#include "newdir.hpp"
|
||||
#include "newmenu.hpp"
|
||||
#include "newproject.hpp"
|
||||
#include "popups/about.hpp"
|
||||
#include "popups/deleteconfirmation.hpp"
|
||||
#include "popups/makecopy.hpp"
|
||||
#include "popups/newdir.hpp"
|
||||
#include "popups/newmenu.hpp"
|
||||
#include "popups/newproject.hpp"
|
||||
#include "projectexplorer.hpp"
|
||||
#include "renamefile.hpp"
|
||||
#include "popups/renamefile.hpp"
|
||||
|
||||
namespace studio {
|
||||
|
||||
|
@ -30,7 +30,7 @@ inline ox::String slashesToPct(ox::StringViewCR str) noexcept {
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
ox::String configPath(keel::Context const&kctx) noexcept;
|
||||
ox::String configPath(keel::Context const &kctx) noexcept;
|
||||
|
||||
template<typename T>
|
||||
ox::Result<T> readConfig(keel::Context &kctx, ox::StringViewCR name) noexcept {
|
||||
@ -61,7 +61,7 @@ ox::Result<T> readConfig(keel::Context &kctx) noexcept {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const&data) noexcept {
|
||||
ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const &data) noexcept {
|
||||
oxAssert(name != "", "Config type has no TypeName");
|
||||
auto const path = ox::sfmt("/{}.json", detail::slashesToPct(name));
|
||||
ox::PassThroughFS fs(configPath(kctx));
|
||||
@ -79,7 +79,7 @@ ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const&data)
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ox::Error writeConfig(keel::Context &kctx, T const&data) noexcept {
|
||||
ox::Error writeConfig(keel::Context &kctx, T const &data) noexcept {
|
||||
constexpr auto TypeName = ox::requireModelTypeName<T>();
|
||||
return writeConfig(kctx, TypeName, data);
|
||||
}
|
||||
@ -120,7 +120,7 @@ void editConfig(keel::Context &kctx, Func f) noexcept {
|
||||
*/
|
||||
template<typename T>
|
||||
ox::Error headerizeConfigFile(keel::Context &kctx, ox::StringViewCR name = ox::ModelTypeName_v<T>) noexcept {
|
||||
auto const path = ox::sfmt("/{}.json", name);
|
||||
auto const path = ox::sfmt("/{}.json", detail::slashesToPct(name));
|
||||
ox::PassThroughFS fs(configPath(kctx));
|
||||
OX_REQUIRE_M(buff, fs.read(path));
|
||||
OX_REQUIRE_M(cv1, ox::readOC<T>(buff));
|
||||
|
@ -23,7 +23,7 @@ constexpr auto ConfigDir = [] {
|
||||
}
|
||||
}();
|
||||
|
||||
ox::String configPath(keel::Context const&ctx) noexcept {
|
||||
ox::String configPath(keel::Context const &ctx) noexcept {
|
||||
auto const homeDir = std::getenv(ox::defines::OS == ox::OS::Windows ? "USERPROFILE" : "HOME");
|
||||
return ox::sfmt(ConfigDir, homeDir, ctx.appName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user