mirror of
https://github.com/JS8Call-improved/JS8Call-improved
synced 2026-08-13 17:47:36 -04:00
31 lines
670 B
C
31 lines
670 B
C
|
|
#ifndef DIRECTEDMESSAGEPARSER_H
|
||
|
|
#define DIRECTEDMESSAGEPARSER_H
|
||
|
|
|
||
|
|
#include <QList>
|
||
|
|
#include <QPair>
|
||
|
|
#include <QString>
|
||
|
|
|
||
|
|
class DirectedMessageParser {
|
||
|
|
public:
|
||
|
|
struct Token {
|
||
|
|
int start = 0;
|
||
|
|
int length = 0;
|
||
|
|
enum Type {
|
||
|
|
Sender,
|
||
|
|
Recipient,
|
||
|
|
RelayChain,
|
||
|
|
Command,
|
||
|
|
Group
|
||
|
|
} type = Recipient;
|
||
|
|
QString tooltip;
|
||
|
|
QList<QPair<int, int>> hops;
|
||
|
|
int recipientHopIndex = -1;
|
||
|
|
bool partial = false;
|
||
|
|
};
|
||
|
|
|
||
|
|
static QList<Token> parseTokensForLine(
|
||
|
|
const QString &text, const QString &implicitTarget = QString());
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // DIRECTEDMESSAGEPARSER_H
|