-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubmoduleInitType.hpp
More file actions
57 lines (45 loc) · 1.54 KB
/
Copy pathSubmoduleInitType.hpp
File metadata and controls
57 lines (45 loc) · 1.54 KB
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
49
50
51
52
53
54
55
56
57
#ifndef RUNCPP2_DATA_SUBMODULE_INIT_TYPE_HPP
#define RUNCPP2_DATA_SUBMODULE_INIT_TYPE_HPP
#include <string>
namespace runcpp2
{
namespace Data
{
enum class SubmoduleInitType
{
NONE,
SHALLOW,
FULL,
COUNT
};
inline std::string SubmoduleInitTypeToString(SubmoduleInitType submoduleInitType)
{
static_assert( static_cast<int>(SubmoduleInitType::COUNT) == 3,
"Add new type to be processed");
switch(submoduleInitType)
{
case SubmoduleInitType::NONE:
return "None";
case SubmoduleInitType::SHALLOW:
return "Shallow";
case SubmoduleInitType::FULL:
return "Full";
case SubmoduleInitType::COUNT:
return "Count";
default:
return "";
}
}
inline SubmoduleInitType StringToSubmoduleInitType(const std::string& submoduleInitTypeStr)
{
if(submoduleInitTypeStr == "None")
return SubmoduleInitType::NONE;
else if(submoduleInitTypeStr == "Shallow")
return SubmoduleInitType::SHALLOW;
else if(submoduleInitTypeStr == "Full")
return SubmoduleInitType::FULL;
return SubmoduleInitType::COUNT;
}
}
}
#endif