| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef SERVERCMDPARSE_H |
| 6 | #define SERVERCMDPARSE_H |
| 7 | |
| 8 | #include <QCoreApplication> |
| 9 | #include <QCommandLineParser> |
| 10 | #include <optional> |
| 11 | |
| 12 | namespace newlsp { |
| 13 | extern const QString port; |
| 14 | extern const QString mode; |
| 15 | extern const QString parentPid; |
| 16 | extern const QString stdio; |
| 17 | extern const QString tcp; |
| 18 | extern const QString portDefault; |
| 19 | extern const QString parentPidDefault; |
| 20 | class ServerCmdParsePrivate; |
| 21 | class ServerCmdParse : QCommandLineParser |
| 22 | { |
| 23 | ServerCmdParsePrivate *const d; |
| 24 | public: |
| 25 | ServerCmdParse(const QCoreApplication &app); |
| 26 | virtual ~ServerCmdParse(); |
| 27 | std::optional<uint> parentPid() const; |
| 28 | std::optional<std::string> mode() const; |
| 29 | std::optional<uint> port() const; |
| 30 | virtual void bindOptions(); |
| 31 | }; |
| 32 | |
| 33 | } |
| 34 | #endif // SERVERCMDPARSE_H |
| 35 |