[ox/preloader] Remove unused files
This commit is contained in:
parent
512522711a
commit
e0381cd98a
2
deps/ox/src/ox/preloader/CMakeLists.txt
vendored
2
deps/ox/src/ox/preloader/CMakeLists.txt
vendored
@ -1,7 +1,6 @@
|
||||
|
||||
add_library(
|
||||
OxPreloader
|
||||
preload.cpp
|
||||
preloader.cpp
|
||||
)
|
||||
|
||||
@ -16,7 +15,6 @@ install(
|
||||
FILES
|
||||
alignmentcatcher.hpp
|
||||
platspecs.hpp
|
||||
preload.hpp
|
||||
preloader.hpp
|
||||
unionsizecatcher.hpp
|
||||
DESTINATION
|
||||
|
33
deps/ox/src/ox/preloader/preload.cpp
vendored
33
deps/ox/src/ox/preloader/preload.cpp
vendored
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ox/claw/claw.hpp>
|
||||
|
||||
#include "preload.hpp"
|
||||
|
||||
namespace ox {
|
||||
|
||||
static ox::Error buildPreloadBuffer(ox::Buffer *buff, std::size_t buffStart, ox::FileSystem *fs,
|
||||
ox::TypeStore *ts, const char *path) noexcept {
|
||||
oxRequire(files, fs->ls(path));
|
||||
for (const auto &f : files) {
|
||||
oxRequire(stat, fs->stat(f));
|
||||
if (stat.fileType == ox::FileType::NormalFile) {
|
||||
oxRequire(fileBuff, fs->read(path));
|
||||
oxRequire(obj, ox::readClaw(ts, fileBuff));
|
||||
} else if (stat.fileType == ox::FileType::Directory) {
|
||||
const auto childPath = ox::sfmt("{}/{}", path, f);
|
||||
oxReturnError(buildPreloadBuffer(buff, buffStart, fs, ts, childPath.c_str()));
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
ox::Result<ox::Buffer> buildPreloadBuffer(std::size_t buffStart, ox::FileSystem *fs, ox::TypeStore *ts) noexcept {
|
||||
ox::Buffer buff;
|
||||
oxReturnError(buildPreloadBuffer(&buff, buffStart, fs, ts, "/"));
|
||||
return buff;
|
||||
}
|
||||
|
||||
}
|
21
deps/ox/src/ox/preloader/preload.hpp
vendored
21
deps/ox/src/ox/preloader/preload.hpp
vendored
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ox/fs/fs.hpp>
|
||||
#include <ox/std/buffer.hpp>
|
||||
|
||||
namespace ox {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param buffStart where the preload buffer will start in ROM
|
||||
* @param fs an ox::FileSystem containing the contents to be preloaded
|
||||
* @return preload buffer or error
|
||||
*/
|
||||
[[maybe_unused]]
|
||||
ox::Result<ox::Buffer> buildPreloadBuffer(std::size_t buffStart, ox::FileSystem *fs) noexcept;
|
||||
|
||||
}
|
24
deps/ox/src/ox/preloader/preloader.cpp
vendored
24
deps/ox/src/ox/preloader/preloader.cpp
vendored
@ -2,32 +2,8 @@
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ox/std/error.hpp>
|
||||
|
||||
#include "platspecs.hpp"
|
||||
#include "preloader.hpp"
|
||||
|
||||
namespace ox {
|
||||
|
||||
struct TestType {
|
||||
static constexpr auto TypeName = "net.drinkingtea.nostalgia.preloader.TestType";
|
||||
static constexpr auto TypeVersion = 1;
|
||||
uint32_t field1 = 0;
|
||||
uint32_t *field2 = nullptr;
|
||||
ox::Vector<uint32_t> field3;
|
||||
};
|
||||
|
||||
oxModelBegin(TestType)
|
||||
oxModelField(field1)
|
||||
oxModelField(field2)
|
||||
oxModelField(field3)
|
||||
oxModelEnd()
|
||||
|
||||
constexpr ox::Error asdf() noexcept {
|
||||
const TestType t;
|
||||
return preload<NativePlatSpec>(&t).error;
|
||||
}
|
||||
|
||||
//static_assert(asdf().errCode == 0);
|
||||
|
||||
}
|
||||
|
1
deps/ox/src/ox/preloader/preloader.hpp
vendored
1
deps/ox/src/ox/preloader/preloader.hpp
vendored
@ -213,6 +213,7 @@ constexpr ox::Error Preloader<PlatSpec>::offsetPtrs(std::size_t offset) noexcept
|
||||
oxReturnError(m_writer.seekp(p.loc));
|
||||
oxReturnError(ox::serialize(&m_writer, PlatSpec::correctEndianness(p.value + offset)));
|
||||
}
|
||||
oxReturnError(m_writer.seekp(0, ox::ios_base::end));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user