| 587 | } |
| 588 | |
| 589 | UInt64 OSWFile::getRunID() const |
| 590 | { |
| 591 | SqliteConnector conn(filename_); |
| 592 | Size nr_results = 0; |
| 593 | |
| 594 | std::string select_sql = "SELECT RUN.ID FROM RUN;"; |
| 595 | |
| 596 | sqlite3_stmt* stmt; |
| 597 | conn.prepareStatement(&stmt, select_sql); |
| 598 | Sql::SqlState state = Sql::SqlState::SQL_ROW; |
| 599 | UInt64 id; |
| 600 | while ((state = Sql::nextRow(stmt, state)) == Sql::SqlState::SQL_ROW) |
| 601 | { |
| 602 | ++nr_results; |
| 603 | id = Sql::extractInt64(stmt, 0); |
| 604 | } |
| 605 | // free memory |
| 606 | sqlite3_finalize(stmt); |
| 607 | |
| 608 | if (nr_results != 1) |
| 609 | { |
| 610 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "File '" + filename_ + "' contains more than one run. This is currently not supported!"); |
| 611 | } |
| 612 | return id; |
| 613 | } |
| 614 | |
| 615 | void OSWFile::readTransitions_(OSWData& swath_result) |
| 616 | { |
no test coverage detected