diff options
| author | Stefan Boberg <[email protected]> | 2021-10-01 18:50:32 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-01 18:50:32 +0200 |
| commit | 4e5fe27def24e21d7e105f59ab98e0c4c80c87dc (patch) | |
| tree | ba476a3955550ea0362e5fdff2ebeb8f06a07a38 /zencore/filesystem.cpp | |
| parent | structured cache: Fixed package payload endpoint handling of HEAD (diff) | |
| download | zen-4e5fe27def24e21d7e105f59ab98e0c4c80c87dc.tar.xz zen-4e5fe27def24e21d7e105f59ab98e0c4c80c87dc.zip | |
filesystem: Added FileContents::Flatten() and ensured it's possible to #include filesystem.h standalone
Diffstat (limited to 'zencore/filesystem.cpp')
| -rw-r--r-- | zencore/filesystem.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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) { |