Convert DataValues to char
| 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 | { |
no test coverage detected