Mantid
Loading...
Searching...
No Matches
PropertyHelper.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
10
11namespace Mantid::Kernel {
12
14template <> void MANTID_KERNEL_DLL toValue(const std::string &strValue, OptionalBool &value) {
15 const auto normalizedStr = Mantid::Kernel::Strings::toLower(strValue);
16 if (normalizedStr == "0" || normalizedStr == "false") {
18 } else if (normalizedStr == "1" || normalizedStr == "true") {
20 } else {
21 value = strValue;
22 }
23}
24
25} // namespace Mantid::Kernel
double value
The value of the point.
Definition FitMW.cpp:51
OptionalBool : Tri-state bool.
MANTID_KERNEL_DLL std::string toLower(const std::string &input)
Converts string to all lowercase.
Definition Strings.cpp:129
void toValue(const std::string &strvalue, T &value)