Namespace insert_bytes

This commit is contained in:
Marc Gilleron 2022-01-03 01:58:35 +00:00
parent 0773f9f107
commit e2d3cb2c57
3 changed files with 7 additions and 6 deletions

View File

@ -67,7 +67,7 @@ Error check_directory_created(const String &directory_path) {
return OK;
}
namespace VoxelFileUtils {
namespace zylann {
// TODO Write tests
@ -110,4 +110,4 @@ void insert_bytes(FileAccess *f, size_t count, size_t temp_chunk_size) {
}
}
} // namespace VoxelFileUtils
} // namespace zylann

View File

@ -44,14 +44,15 @@ enum VoxelFileResult {
};
const char *to_string(VoxelFileResult res);
VoxelFileResult check_magic_and_version(FileAccess *f, uint8_t expected_version, const char *expected_magic, uint8_t &out_version);
VoxelFileResult check_magic_and_version(
FileAccess *f, uint8_t expected_version, const char *expected_magic, uint8_t &out_version);
Error check_directory_created(const String &directory_path);
// TODO Wrap other stuff in that
namespace VoxelFileUtils {
namespace zylann {
void insert_bytes(FileAccess *f, size_t count, size_t temp_chunk_size = 512);
} // namespace VoxelFileUtils
} // namespace zylann
#endif // FILE_UTILS_H

View File

@ -561,7 +561,7 @@ bool VoxelRegionFile::migrate_from_v2_to_v3(FileAccess *f, VoxelRegionFormat &fo
const unsigned int extra_bytes_needed = new_header_size - old_header_size;
f->seek(MAGIC_AND_VERSION_SIZE);
VoxelFileUtils::insert_bytes(f, extra_bytes_needed);
zylann::insert_bytes(f, extra_bytes_needed);
f->seek(0);