forked from Dr15Jones/root_serialization
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathConfigurationParameters.cc
More file actions
35 lines (29 loc) · 1008 Bytes
/
ConfigurationParameters.cc
File metadata and controls
35 lines (29 loc) · 1008 Bytes
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
#include "ConfigurationParameters.h"
namespace cce::tf {
template<>
std::string ConfigurationParameters::convert<std::string>(std::string const& iValue) {
return iValue;
}
template<>
int ConfigurationParameters::convert<int>(std::string const& iValue) {
return std::stoi(iValue);
}
template<>
unsigned int ConfigurationParameters::convert<unsigned int>(std::string const& iValue) {
return std::stoul(iValue);
}
template<>
float ConfigurationParameters::convert<float>(std::string const& iValue) {
return std::stof(iValue);
}
template<>
std::size_t ConfigurationParameters::convert<std::size_t>(std::string const& iValue) {
return std::stoull(iValue);
}
template<>
bool ConfigurationParameters::convert<bool>(std::string const& iValue) {
return (iValue.empty()) or (
(iValue[0] == 't') or (iValue[0] == 'T') or (iValue[0] == 'y') or (iValue[0] == 'Y')
);
}
}