aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/storage/vfs/vfsservice.h
blob: 4e06da878af54d3747c077b006aa33e083f02f1d (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zenbase/refcount.h>
#include <zenhttp/httpserver.h>
#include <zenhttp/httpstatus.h>

#include <memory>

namespace zen {

class ProjectStore;
class ZenCacheStore;
struct VfsServiceImpl;

/** Virtual File System service

	Implements support for exposing data via a virtual file system interface. Currently
	this is primarily used to surface various data stored in the local storage service
	to users for debugging and exploration purposes.

	Currently, it surfaces information from the structured cache service and from the
	project store.

 */

class VfsService : public HttpService, public IHttpStatusProvider
{
public:
	explicit VfsService(HttpStatusService& StatusService, VfsServiceImpl* ServiceImpl);
	~VfsService();

protected:
	virtual const char* BaseUri() const override;
	virtual void		HandleRequest(HttpServerRequest& HttpServiceRequest) override;
	virtual void		HandleStatusRequest(HttpServerRequest& Request) override;

private:
	VfsServiceImpl* m_Impl = nullptr;

	HttpStatusService& m_StatusService;
	HttpRequestRouter  m_Router;

	friend struct VfsServiceDataSource;
};

}  // namespace zen