Mantid
Loading...
Searching...
No Matches
Framework
Kernel
src
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
8
#include "
MantidKernel/PropertyHelper.h
"
9
#include "
MantidKernel/Strings.h
"
10
11
namespace
Mantid::Kernel
{
12
14
template
<>
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"
) {
17
value
=
OptionalBool::False
;
18
}
else
if
(normalizedStr ==
"1"
|| normalizedStr ==
"true"
) {
19
value
=
OptionalBool::True
;
20
}
else
{
21
value
= strValue;
22
}
23
}
24
25
}
// namespace Mantid::Kernel
value
double value
The value of the point.
Definition
FitMW.cpp:51
PropertyHelper.h
Strings.h
Mantid::Kernel::OptionalBool
OptionalBool : Tri-state bool.
Definition
OptionalBool.h:25
Mantid::Kernel::OptionalBool::True
@ True
Definition
OptionalBool.h:27
Mantid::Kernel::OptionalBool::False
@ False
Definition
OptionalBool.h:27
Mantid::Kernel::Strings::toLower
MANTID_KERNEL_DLL std::string toLower(const std::string &input)
Converts string to all lowercase.
Definition
Strings.cpp:129
Mantid::Kernel
Definition
AnnularRingAbsorption.h:15
Mantid::Kernel::toValue
void toValue(const std::string &strvalue, T &value)
Definition
PropertyHelper.h:201
Generated by
1.9.8