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
qmimemagicrulematcher_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QMIMEMAGICRULEMATCHER_P_H
5#define QMIMEMAGICRULEMATCHER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qmimemagicrule_p.h"
19
21
22#include <QtCore/qbytearray.h>
23#include <QtCore/qlist.h>
24#include <QtCore/qstring.h>
25
27
29{
30public:
31 explicit QMimeMagicRuleMatcher(const QString &mime, unsigned priority = 65535);
32
34 {
35 qSwap(m_list, other.m_list);
36 qSwap(m_priority, other.m_priority);
37 qSwap(m_mimetype, other.m_mimetype);
38 }
39
40 bool operator==(const QMimeMagicRuleMatcher &other) const;
41
42 void addRule(const QMimeMagicRule &rule);
43 void addRules(const QList<QMimeMagicRule> &rules);
44 QList<QMimeMagicRule> magicRules() const;
45
46 bool matches(const QByteArray &data) const;
47
48 unsigned priority() const;
49
50 QString mimetype() const { return m_mimetype; }
51
52private:
53 QList<QMimeMagicRule> m_list;
54 unsigned m_priority;
55 QString m_mimetype;
56};
57Q_DECLARE_SHARED(QMimeMagicRuleMatcher)
58
60
61#endif // QMIMEMAGICRULEMATCHER_P_H
\inmodule QtCore
Definition qbytearray.h:57
The QMimeMagicRuleMatcher class checks a number of rules based on operator "or".
bool matches(const QByteArray &data) const
QList< QMimeMagicRule > magicRules() const
QMimeMagicRuleMatcher(const QString &mime, unsigned priority=65535)
void swap(QMimeMagicRuleMatcher &other) noexcept
void addRules(const QList< QMimeMagicRule > &rules)
bool operator==(const QMimeMagicRuleMatcher &other) const
void addRule(const QMimeMagicRule &rule)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char * rule
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
Definition qswap.h:20
#define QT_REQUIRE_CONFIG(feature)
application x qt windows mime
[2]
QSharedPointer< T > other(t)
[5]