diff options
| author | Per Larsson <[email protected]> | 2021-09-23 13:56:56 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-09-23 13:56:56 +0200 |
| commit | 0bbb51bc88d4a1b0fa7762d133037a728af24767 (patch) | |
| tree | 8c8a43350d103031bb9af1806b79cf70dac2faf8 /zencore | |
| parent | Respect Jupiter auth token expiration time. (diff) | |
| parent | cidstore: added some implementation notes (diff) | |
| download | zen-0bbb51bc88d4a1b0fa7762d133037a728af24767.tar.xz zen-0bbb51bc88d4a1b0fa7762d133037a728af24767.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore')
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 3 | ||||
| -rw-r--r-- | zencore/iobuffer.cpp | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index 517cc7b69..6ee40e468 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -9,6 +9,7 @@ namespace zen { +struct IoHash; struct IoBufferExtendedCore; enum class ZenContentType : uint8_t @@ -348,6 +349,8 @@ public: inline static IoBuffer MakeCloneFromMemory(const void* Ptr, size_t Sz) { return IoBuffer(IoBuffer::Clone, Ptr, Sz); } }; +IoHash HashBuffer(IoBuffer& Buffer); + void iobuffer_forcelink(); } // namespace zen diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index bcecc768f..dc998d5ea 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -4,6 +4,7 @@ #include <zencore/filesystem.h> #include <zencore/fmtutils.h> +#include <zencore/iohash.h> #include <zencore/logging.h> #include <zencore/memory.h> #include <zencore/testing.h> @@ -381,6 +382,13 @@ IoBufferBuilder::MakeFromTemporaryFile(const wchar_t* FileName) return {}; } +IoHash +HashBuffer(IoBuffer& Buffer) +{ + // TODO: handle disk buffers with special path + return IoHash::HashBuffer(Buffer.Data(), Buffer.Size()); +} + ////////////////////////////////////////////////////////////////////////// #if ZEN_WITH_TESTS |