| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <QLoggingCategory> | ||
| 4 | #include <QLocalServer> | ||
| 5 | #include <QLocalSocket> | ||
| 6 | #include <QFile> | ||
| 7 | |||
| 8 | #include "../qi3pc.h" | ||
| 9 | |||
| 10 | Q_DECLARE_LOGGING_CATEGORY(MockI3ServerLogger); | ||
| 11 | |||
| 12 | class MockI3Server : public QLocalServer | ||
| 13 | { | ||
| 14 | Q_OBJECT | ||
| 15 | |||
| 16 | public: | ||
| 17 | MockI3Server(const QString& socketPath, QObject* parent = nullptr); | ||
| 18 | qsizetype clientCount(); | ||
| 19 | |||
| 20 | private slots: | ||
| 21 | void handleNewConnection(); | ||
| 22 | void handleClientMessage(QLocalSocket* socket); | ||
| 23 | void send(QLocalSocket* socket, const QByteArray& payload, qi3pc::IpcType type); | ||
| 24 | void sendBarConfigReply(QLocalSocket* socket, const QByteArray& message); | ||
| 25 | |||
| 26 | private: | ||
| 27 | QLocalServer* m_server; | ||
| 28 | QString m_socketPath; | ||
| 29 | std::vector<QLocalSocket*> m_clients; | ||
| 30 | }; | ||
| 31 |