| 1 |
/* |
| 2 |
* BluezQt - Asynchronous BlueZ wrapper library |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <[email protected]> |
| 5 |
* |
| 6 |
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "Property.h" |
| 10 |
|
| 11 |
Property::Property() |
| 12 |
{ |
| 13 |
} |
| 14 |
|
| 15 |
bool Property::finalize() |
| 16 |
{ |
| 17 |
for (auto tag : m_stringTags) { |
| 18 |
m_tags.isOptional |= tag.contains(QLatin1String("optional"), Qt::CaseInsensitive); |
| 19 |
m_tags.isExperimental |= tag.contains(QLatin1String("experimental"), Qt::CaseInsensitive); |
| 20 |
m_tags.isReadOnly |= tag.contains(QLatin1String("read-only"), Qt::CaseInsensitive); |
| 21 |
} |
| 22 |
m_tags.isServerOnly = m_limitation.contains(QLatin1String("server only"), Qt::CaseInsensitive); |
| 23 |
|
| 24 |
bool success = true; |
| 25 |
success &= m_comment.finalize(); |
| 26 |
|
| 27 |
return success; |
| 28 |
} |
| 29 |
|
| 30 |
QString Property::name() const |
| 31 |
{ |
| 32 |
return m_name; |
| 33 |
} |
| 34 |
|
| 35 |
QString Property::type() const |
| 36 |
{ |
| 37 |
return m_type; |
| 38 |
} |
| 39 |
|
| 40 |
Property::Tags Property::tags() const |
| 41 |
{ |
| 42 |
return m_tags; |
| 43 |
} |
| 44 |
|
| 45 |
QStringList Property::comment() const |
| 46 |
{ |
| 47 |
return m_comment; |
| 48 |
} |