aboutsummaryrefslogtreecommitdiff
path: root/src/zenvfs/vfs.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-09-20 15:22:03 +0200
committerGitHub <[email protected]>2023-09-20 15:22:03 +0200
commit14d7568f9c7d970b7bbf7b6463a0a8530f98bb6f (patch)
treebf24ac15759385cea339f7e1cf5380f984f5699a /src/zenvfs/vfs.cpp
parentchangelog version bump (diff)
downloadzen-14d7568f9c7d970b7bbf7b6463a0a8530f98bb6f.tar.xz
zen-14d7568f9c7d970b7bbf7b6463a0a8530f98bb6f.zip
VFS implementation for local storage service (#396)
currently, only Windows (using Projected File System) is supported
Diffstat (limited to 'src/zenvfs/vfs.cpp')
-rw-r--r--src/zenvfs/vfs.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/zenvfs/vfs.cpp b/src/zenvfs/vfs.cpp
new file mode 100644
index 000000000..02dbc904c
--- /dev/null
+++ b/src/zenvfs/vfs.cpp
@@ -0,0 +1,56 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#include "zenvfs/vfs.h"
+#include "vfsprovider.h"
+
+#include <zencore/iohash.h>
+#include <zencore/scopeguard.h>
+#include <zencore/string.h>
+#include <zencore/thread.h>
+
+#if ZEN_WITH_VFS
+
+namespace zen {
+
+VfsHost::VfsHost(std::string_view VfsRootPath) : m_Provider(new VfsProvider(VfsRootPath))
+{
+}
+
+VfsHost::~VfsHost()
+{
+ delete m_Provider;
+}
+
+void
+VfsHost::Initialize()
+{
+ m_Provider->Initialize();
+}
+
+void
+VfsHost::Run()
+{
+ m_Provider->Run();
+}
+
+void
+VfsHost::RequestStop()
+{
+ m_Provider->RequestStop();
+}
+
+void
+VfsHost::Cleanup()
+{
+ m_Provider->Cleanup();
+}
+
+void
+VfsHost::AddMount(std::string_view Mountpoint, Ref<VfsTreeDataSource>&& DataSource)
+{
+ m_Provider->AddMount(Mountpoint, std::move(DataSource));
+}
+
+} // namespace zen
+
+#endif