Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qevdevutil.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qevdevutil_p.h"
5
7
8using namespace Qt::StringLiterals;
9
10namespace QEvdevUtil {
11
13{
15
16 result.args = QStringView{specification}.split(u':');
17
18 for (const auto &arg : std::as_const(result.args)) {
19 if (arg.startsWith("/dev/"_L1)) {
20 // if device is specified try to use it
21 result.devices.append(arg.toString());
22 } else {
23 // build new specification without /dev/ elements
24 result.spec += arg + u':';
25 }
26 }
27
28 if (!result.spec.isEmpty())
29 result.spec.chop(1); // remove trailing ':'
30
31 return result;
32}
33
34} // namespace QEvdevUtil
35
\inmodule QtCore
Definition qstringview.h:78
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
Definition qstring.cpp:8249
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
ParsedSpecification parseSpecification(const QString &specification)
Combined button and popup list for selecting options.
GLuint64EXT * result
[6]
SSL_CTX int void * arg