| 197 | } |
| 198 | |
| 199 | inline bool isApiMessage(const QByteArray& data) |
| 200 | { |
| 201 | if (data.isEmpty()) |
| 202 | return false; |
| 203 | |
| 204 | const auto trimmed = data.trimmed(); |
| 205 | if (trimmed.isEmpty() || trimmed.at(0) != '{') |
| 206 | return false; |
| 207 | |
| 208 | QString type; |
| 209 | QJsonObject json; |
| 210 | if (!parseMessage(data, type, json)) |
| 211 | return false; |
| 212 | |
| 213 | return type == MessageType::Command || type == MessageType::Batch || type == MessageType::Raw; |
| 214 | } |
| 215 | |
| 216 | } // namespace API |
no test coverage detected