| 105 | |
| 106 | |
| 107 | void SpectrumLookup::addReferenceFormat(const String& regexp) |
| 108 | { |
| 109 | // does the reg. exp. contain any of the recognized group names? |
| 110 | bool found = false; |
| 111 | for (vector<String>::iterator it = regexp_name_list_.begin(); |
| 112 | it != regexp_name_list_.end(); ++it) |
| 113 | { |
| 114 | if (regexp.hasSubstring("?<" + (*it) + ">")) |
| 115 | { |
| 116 | found = true; |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | if (!found) |
| 121 | { |
| 122 | String msg = "The regular expression describing the reference format must contain at least one of the following named groups (in the format '?<GROUP>'): " + regexp_names_; |
| 123 | throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, |
| 124 | msg); |
| 125 | } |
| 126 | |
| 127 | boost::regex re(regexp); |
| 128 | reference_formats.push_back(re); |
| 129 | } |
| 130 | |
| 131 | |
| 132 | Size SpectrumLookup::findByRegExpMatch_(const String& spectrum_ref, |
no test coverage detected