blob: 19f96567c0e9fb07653fb7ff7487228fd33828e3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include <zencore/iobuffer.h>
#include <zencore/thread.h>
#include <unordered_map>
namespace zen {
//////////////////////////////////////////////////////////////////////////
class ZipFs
{
public:
ZipFs() = default;
ZipFs(IoBuffer&& Buffer);
IoBuffer GetFile(const std::string_view& FileName) const;
inline operator bool() const { return !m_Files.empty(); }
private:
using FileItem = MemoryView;
using FileMap = std::unordered_map<std::string_view, FileItem>;
mutable RwLock m_FilesLock;
FileMap mutable m_Files;
IoBuffer m_Buffer;
};
} // namespace zen
|