MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / toBool

Method toBool

src/openms/source/DATASTRUCTURES/DataValue.cpp:762–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760 }
761
762 bool DataValue::toBool() const
763 {
764 if (value_type_ != STRING_VALUE)
765 {
766 throw Exception::ConversionError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
767 "Could not convert non-string DataValue of type '" + NamesOfDataType[value_type_] + "' and value '" + this->toString(true) + "' to bool");
768 }
769 else if (*(data_.str_) != "true" && *(data_.str_) != "false")
770 {
771 throw Exception::ConversionError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
772 String("Could not convert non-string DataValue of type '") + NamesOfDataType[value_type_] +
773 "' and value '" + *(data_.str_) + "' to bool. Valid stings are 'true' and 'false'.");
774 }
775
776 return *(data_.str_) == "true";
777 }
778
779 // ----------------- Comparator ----------------------
780

Callers 15

updateEntriesMethod · 0.45
showTOPPDialogMethod · 0.45
setParamMethod · 0.45
isIonMobilityDataFunction · 0.45
isDIADataFunction · 0.45
chromatogram_flag_setFunction · 0.45
main_Method · 0.45
main_Method · 0.45
main_Method · 0.45
main_Method · 0.45
main_Method · 0.45

Calls 2

toStringMethod · 0.95
StringClass · 0.50

Tested by 10

updateEntriesMethod · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
operator()Method · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
getSpectrumAlignmentFunction · 0.36