|
11 | 11 |
|
12 | 12 | class QDltMsg; |
13 | 13 |
|
| 14 | +/** |
| 15 | + * A class which can be used to set search parameters for matching on potential DLT messages. |
| 16 | + * |
| 17 | + * Offers functions to search different parts of a DLT message. |
| 18 | + * Offers the option to search either the header, the payload, or both. |
| 19 | + * Searches can be case-sensitive - default is case-insensitive. |
| 20 | + * The pattern to search a payload can be either a regular expression or plain text. |
| 21 | + * |
| 22 | + * Currently used by the UI search dialog. |
| 23 | + * @see SearchDialog |
| 24 | + */ |
14 | 25 | class QDLT_EXPORT DltMessageMatcher |
15 | 26 | { |
16 | 27 | public: |
@@ -46,9 +57,32 @@ class QDLT_EXPORT DltMessageMatcher |
46 | 57 | m_messageIdFormat = msgIdFormat; |
47 | 58 | } |
48 | 59 |
|
| 60 | + /** |
| 61 | + * |
| 62 | + * @return `true` if `msg` matches all of: |
| 63 | + * - application ID set in `this` |
| 64 | + * - context ID set in `this` |
| 65 | + * - timestamp range set in `this` |
| 66 | + * - pattern matches either the `msg` header or payload |
| 67 | + * `false` otherwise. |
| 68 | + * |
| 69 | + * @see SearchDialog::findMessages |
| 70 | + */ |
49 | 71 | bool match(const QDltMsg& message, const Pattern& pattern) const; |
| 72 | + |
50 | 73 | private: |
| 74 | + |
| 75 | + /** |
| 76 | + * Match the application ID in `appId` against `this` |
| 77 | + * |
| 78 | + * @return `true` if `this` has no application ID set or the IDs match exactly, false otherwise |
| 79 | + */ |
51 | 80 | bool matchAppId(const QString& appId) const; |
| 81 | + /** |
| 82 | + * Match the context ID in `ctxId` against `this` |
| 83 | + * |
| 84 | + * @return `true` if `this` has no application ID set or the IDs match exactly, false otherwise |
| 85 | + */ |
52 | 86 | bool matchCtxId(const QString& ctxId) const; |
53 | 87 | bool matchTimestampRange(unsigned int ts) const; |
54 | 88 | private: |
|
0 commit comments