| 60 | } |
| 61 | |
| 62 | bool CsvFile::getRow(Size row, StringList& list) |
| 63 | { |
| 64 | // it is assumed that the value to be cast won't be so large to overflow an ulong int |
| 65 | if (static_cast<int>(row) > static_cast<int>(TextFile::buffer_.size()) - 1) |
| 66 | { |
| 67 | throw Exception::InvalidIterator(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); |
| 68 | } |
| 69 | bool splitted = buffer_[row].split(itemseperator_, list); |
| 70 | if (!splitted) |
| 71 | { |
| 72 | return splitted; |
| 73 | } |
| 74 | for (Size i = 0; i < list.size(); i++) |
| 75 | { |
| 76 | if (itemenclosed_) |
| 77 | { |
| 78 | list[i] = list[i].substr(1, list[i].size() - 2); |
| 79 | } |
| 80 | } |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | std::vector<String>::size_type CsvFile::rowCount() const |
| 85 | { |