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

Method toChar

src/openms/source/DATASTRUCTURES/DataValue.cpp:674–688  ·  view source on GitHub ↗

Convert DataValues to char

Source from the content-addressed store, hash-verified

672
673 // Convert DataValues to char*
674 const char* DataValue::toChar() const
675 {
676 switch (value_type_)
677 {
678 case DataValue::STRING_VALUE:
679 return const_cast<const char*>(data_.str_->c_str());
680
681 case DataValue::EMPTY_VALUE:
682 return nullptr;
683
684 default:
685 throw Exception::ConversionError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
686 "Could not convert DataValue of type '" + NamesOfDataType[value_type_] + "' and value '" + this->toString(true) + "' to char*");
687 }
688 }
689
690 StringList DataValue::toStringList() const
691 {

Callers 5

main_Method · 0.45
DataValueMethod · 0.45
DataValue_test.cppFile · 0.45

Calls 1

toStringMethod · 0.95

Tested by

no test coverage detected