File indexing completed on 2024-04-21 03:52:04

0001 /*
0002  * BluezQt - Asynchronous BlueZ wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #include "Parameter.h"
0010 #include <QStringList>
0011 
0012 Parameter Parameter::fromString(const QString &string)
0013 {
0014     Parameter param;
0015     QStringList arg = string.split(QLatin1Char(' '));
0016     if (arg.size() != 2) {
0017         return param;
0018     }
0019 
0020     param.m_type = arg.first();
0021     param.m_name = arg.last();
0022 
0023     return param;
0024 }
0025 
0026 QString Parameter::type() const
0027 {
0028     return m_type;
0029 }
0030 
0031 QString Parameter::name() const
0032 {
0033     return m_name;
0034 }