diff --git a/include/zenkit-capi/Vfs.h b/include/zenkit-capi/Vfs.h index cd50b72..8486e68 100644 --- a/include/zenkit-capi/Vfs.h +++ b/include/zenkit-capi/Vfs.h @@ -26,6 +26,7 @@ typedef ZkBool (*ZkVfsNodeEnumerator)(void* ctx, ZkVfsNode const* node); ZKC_API ZkVfs* ZkVfs_new(void); ZKC_API void ZkVfs_del(ZkVfs* slf); +ZKC_API void ZkVfs_save(ZkVfs const* slf, ZkString path, ZkGameVersion version); ZKC_API ZkVfsNode const* ZkVfs_getRoot(ZkVfs const* slf); diff --git a/src/Vfs.cc b/src/Vfs.cc index f03d704..c56fd5e 100644 --- a/src/Vfs.cc +++ b/src/Vfs.cc @@ -14,6 +14,14 @@ void ZkVfs_del(ZkVfs* slf) { delete slf; } +void ZkVfs_save(ZkVfs const* slf, ZkString path, ZkGameVersion version) { + ZKC_TRACE_FN(); + ZKC_CHECK_NULLV(slf, path); + + auto wr = zenkit::Write::to(path); + slf->save(wr.get(), static_cast(version)); +} + ZkVfsNode const* ZkVfs_getRoot(ZkVfs const* slf) { ZKC_TRACE_FN(); ZKC_CHECK_NULL(slf);