aboutsummaryrefslogtreecommitdiff
path: root/src/zenremotestore/partialblockrequestmode.cpp
blob: b3edf515b070cf7e64d1c33037bc9fd92d14985a (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.

#include <zenremotestore/partialblockrequestmode.h>

#include <zencore/string.h>

namespace zen {

EPartialBlockRequestMode
PartialBlockRequestModeFromString(const std::string_view ModeString)
{
	switch (HashStringAsLowerDjb2(ModeString))
	{
		case HashStringDjb2("false"):
			return EPartialBlockRequestMode::Off;
		case HashStringDjb2("zencacheonly"):
			return EPartialBlockRequestMode::ZenCacheOnly;
		case HashStringDjb2("mixed"):
			return EPartialBlockRequestMode::Mixed;
		case HashStringDjb2("true"):
			return EPartialBlockRequestMode::All;
		default:
			return EPartialBlockRequestMode::Invalid;
	}
}

}  // namespace zen