aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/zipfs.h
blob: 1fa7da451bb3761faa7b10376fd2a6ab59f1d529 (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 <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>;
	FileMap mutable m_Files;
	IoBuffer m_Buffer;
};

}  // namespace zen