[nostalgia,keel] Move core::TypeStore to Keel

This commit is contained in:
2023-06-01 23:43:19 -05:00
parent 1d35f6ce70
commit 4364911229
8 changed files with 14 additions and 12 deletions
-2
View File
@@ -5,7 +5,6 @@ add_library(
module.cpp
tilesheet.cpp
typeconv.cpp
typestore.cpp
)
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
@@ -40,7 +39,6 @@ install(
ptidxconv.hpp
tilesheet.hpp
typeconv.hpp
typestore.hpp
DESTINATION
include/nostalgia/core
)
-18
View File
@@ -1,18 +0,0 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include "typestore.hpp"
namespace nostalgia::core {
ox::Result<ox::UniquePtr<ox::DescriptorType>> TypeStore::loadDescriptor(ox::CRStringView typeId) noexcept {
constexpr auto descPath = "/.nostalgia/type_descriptors";
auto path = ox::sfmt("{}/{}", descPath, typeId);
oxRequire(buff, m_fs->read(path));
auto dt = ox::make_unique<ox::DescriptorType>();
oxReturnError(ox::readClaw<ox::DescriptorType>(buff, dt.get()));
return dt;
}
}
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <ox/claw/claw.hpp>
#include <ox/fs/fs.hpp>
#include <ox/model/typestore.hpp>
namespace nostalgia::core {
class TypeStore: public ox::TypeStore {
private:
ox::FileSystem *m_fs = nullptr;
public:
constexpr explicit TypeStore(ox::FileSystem *fs) noexcept: m_fs(fs) {
}
protected:
ox::Result<ox::UniquePtr<ox::DescriptorType>> loadDescriptor(ox::CRStringView typeId) noexcept override;
};
}