From 9fc0d2d328c71f6e485fc1a054e2ac89bf654f62 Mon Sep 17 00:00:00 2001 From: Per Larsson Date: Fri, 1 Oct 2021 11:02:19 +0200 Subject: Clang format fix. --- zencore/filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zencore/filesystem.cpp') diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index a06c00e41..1d6b2f61c 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -815,7 +815,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)); -- cgit v1.2.3 From 4e5fe27def24e21d7e105f59ab98e0c4c80c87dc Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 1 Oct 2021 18:50:32 +0200 Subject: filesystem: Added FileContents::Flatten() and ensured it's possible to #include filesystem.h standalone --- zencore/filesystem.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'zencore/filesystem.cpp') diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index 1d6b2f61c..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) { -- cgit v1.2.3