rename 'files' to 'io'

This commit is contained in:
MihailRis
2025-01-30 16:53:52 +03:00
parent e5d558d357
commit 1e22882284
45 changed files with 157 additions and 160 deletions
@@ -1,7 +1,7 @@
#include "api_lua.hpp"
#include "files/files.hpp"
#include "files/util.hpp"
#include "io/io.hpp"
#include "io/util.hpp"
#include "coders/binary_json.hpp"
#include "world/Level.hpp"
#include "world/generator/VoxelFragment.hpp"
@@ -17,7 +17,7 @@ static int l_save_fragment(lua::State* L) {
auto file = paths.resolve(lua::require_string(L, 2), true);
auto map = fragment->getFragment()->serialize();
auto bytes = json::to_binary(map, true);
files::write_bytes(file, bytes.data(), bytes.size());
io::write_bytes(file, bytes.data(), bytes.size());
return 0;
}
@@ -41,7 +41,7 @@ static int l_load_fragment(lua::State* L) {
if (!std::filesystem::exists(path)) {
throw std::runtime_error("file "+path.u8string()+" does not exist");
}
auto map = files::read_binary_json(path);
auto map = io::read_binary_json(path);
auto fragment = std::make_shared<VoxelFragment>();
fragment->deserialize(map);