* @brief Runs the source's engine over a text frame, falling back to source 0. */
| 464 | * @brief Runs the source's engine over a text frame, falling back to source 0. |
| 465 | */ |
| 466 | QList<QStringList> DataModel::FrameParser::parseMultiFrame(const QString& frame, int sourceId) |
| 467 | { |
| 468 | Q_ASSERT(sourceId >= 0); |
| 469 | Q_ASSERT(!frame.isEmpty()); |
| 470 | |
| 471 | if (sourceId < 0 || frame.isEmpty()) [[unlikely]] |
| 472 | return {}; |
| 473 | |
| 474 | auto it = m_engines.find(sourceId); |
| 475 | if (it == m_engines.end() || !it->second->isLoaded()) { |
| 476 | if (sourceId == 0 || languageForSource(sourceId) != languageForSource(0)) |
| 477 | return {}; |
| 478 | |
| 479 | return parseMultiFrame(frame, 0); |
| 480 | } |
| 481 | |
| 482 | return it->second->parseString(frame); |
| 483 | } |
| 484 | |
| 485 | /** |
| 486 | * @brief Runs the source's engine over a binary frame, falling back to source 0. |
no test coverage detected