| 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 | #include "Parameter.h" |
| 10 | #include <QStringList> |
| 11 | |
| 12 | Parameter Parameter::fromString(const QString &string) |
| 13 | { |
| 14 | Parameter param; |
| 15 | QStringList arg = string.split(sep: QLatin1Char(' ')); |
| 16 | if (arg.size() != 2) { |
| 17 | return param; |
| 18 | } |
| 19 | |
| 20 | param.m_type = arg.first(); |
| 21 | param.m_name = arg.last(); |
| 22 | |
| 23 | return param; |
| 24 | } |
| 25 | |
| 26 | QString Parameter::type() const |
| 27 | { |
| 28 | return m_type; |
| 29 | } |
| 30 | |
| 31 | QString Parameter::name() const |
| 32 | { |
| 33 | return m_name; |
| 34 | } |
| 35 | |