| 1 | /* |
| 2 | * BluezQt - Asynchronous BlueZ wrapper library |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef INTERFACE_H |
| 10 | #define INTERFACE_H |
| 11 | |
| 12 | #include "Methods.h" |
| 13 | #include "Properties.h" |
| 14 | |
| 15 | class Interface |
| 16 | { |
| 17 | public: |
| 18 | Interface(); |
| 19 | |
| 20 | bool parse(const QString &line); |
| 21 | bool finalize(); |
| 22 | |
| 23 | QStringList () const; |
| 24 | QString service() const; |
| 25 | QString name() const; |
| 26 | QString objectPath() const; |
| 27 | Methods methods() const; |
| 28 | Properties properties() const; |
| 29 | |
| 30 | private: |
| 31 | enum class State { |
| 32 | , |
| 33 | Service, |
| 34 | Interface, |
| 35 | ObjectPath, |
| 36 | Methods, |
| 37 | Properties, |
| 38 | }; |
| 39 | |
| 40 | void (const QString &line); |
| 41 | void parseService(const QString &line); |
| 42 | void parseInterface(const QString &line); |
| 43 | void parseObjectPath(const QString &line); |
| 44 | |
| 45 | State m_state = State::Comment; |
| 46 | |
| 47 | QStringList ; |
| 48 | QString m_service; |
| 49 | QString m_name; |
| 50 | QString m_objectPath; |
| 51 | Methods m_methods; |
| 52 | Properties m_properties; |
| 53 | }; |
| 54 | |
| 55 | #endif // INTERFACE_H |
| 56 | |