aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-01 22:15:42 +0200
committerStefan Boberg <[email protected]>2021-10-01 22:15:42 +0200
commit2a6157b15508541cfd082e8544c78c8f94b18005 (patch)
tree7f70bd046afe918c5433e753a68de72ed602532a /zencore/filesystem.cpp
parentAdded explicit mimalloc IoBuffer allocation path (diff)
parentzen: added print/printpackage subcommands to help in debugging or inspecting ... (diff)
downloadzen-2a6157b15508541cfd082e8544c78c8f94b18005.tar.xz
zen-2a6157b15508541cfd082e8544c78c8f94b18005.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index a06c00e41..f6ba92f98 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -522,6 +522,23 @@ WriteFile(std::filesystem::path Path, IoBuffer Data)
WriteFile(Path, &DataPtr, 1);
}
+IoBuffer
+FileContents::Flatten()
+{
+ if (Data.size() == 1)
+ {
+ return Data[0];
+ }
+ else if (Data.empty())
+ {
+ return {};
+ }
+ else
+ {
+ ZEN_NOT_IMPLEMENTED();
+ }
+}
+
FileContents
ReadFile(std::filesystem::path Path)
{
@@ -815,7 +832,7 @@ TEST_CASE("filesystem")
using namespace std::filesystem;
// GetExePath
- path BinPath = GetRunningExecutablePath();
+ path BinPath = GetRunningExecutablePath();
const bool ExpectedExe = BinPath.stem() == "zencore-test" || BinPath.stem() == "zenserver-test";
CHECK(ExpectedExe);
CHECK(is_regular_file(BinPath));