Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
packagefilter.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "logging.h"
6#include <iostream>
7
8PackageFilter::PackageFilter(const QString &expression)
9 : type(InvalidFilter)
10{
11 const QLatin1String filter("QDocModule=");
12 if (expression.startsWith(filter)) {
13 type = QDocModuleFilter;
14 this->expression = expression.mid(filter.size());
15 } else {
16 std::cerr << qPrintable(tr("Invalid filter expression \"%1\"").arg(expression)) << std::endl;
17 std::cerr << qPrintable(tr("Currently only \"QDocModule=*\" is supported.")) << std::endl;
18 }
19}
20
22{
23 switch (type) {
24 case InvalidFilter:
25 return true;
26 case QDocModuleFilter:
27 return p.qdocModule == expression;
28 }
29 return false;
30}
PackageFilter(const QString &expression)
bool operator()(const Package &p)