aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/zipfs.h
blob: 645121693ecdd55043f9a6505fc02b40d88c9e70 (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
// 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:
	explicit ZipFs(IoBuffer&& Buffer);

	IoBuffer GetFile(const std::string_view& FileName) const;

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