| 62 | } |
| 63 | |
| 64 | template <class Container> bool |
| 65 | SequenceLineParser<Container>::parse_sequence(Container &q, const std::string &seq, const char sep_char) |
| 66 | { |
| 67 | size_t pos = 0; |
| 68 | size_t start_pos = 0; |
| 69 | |
| 70 | //while (pos < static_cast<int>(seq.size())) { |
| 71 | while(true) { |
| 72 | while (seq[pos] == ' ') |
| 73 | pos++; |
| 74 | |
| 75 | start_pos = pos; |
| 76 | pos = seq.find_first_of(sep_char, pos); |
| 77 | std::string s = seq.substr(start_pos, (pos - start_pos)); |
| 78 | int i = SequenceLineParser::str2int(s); |
| 79 | if (i < 0) |
| 80 | return false; |
| 81 | q.push_back(i); |
| 82 | if (pos == string::npos) |
| 83 | break; |
| 84 | pos++; |
| 85 | } |
| 86 | return true; |
| 87 | } |
| 88 | |
| 89 | template <class Container> int |
| 90 | SequenceLineParser<Container>::str2int(const std::string &s) |
nothing calls this directly
no outgoing calls
no test coverage detected