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
qndeffilter.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QNDEFFILTER_H
5#define QNDEFFILTER_H
6
7#include <QtCore/QSharedDataPointer>
8#include <QtNfc/qtnfcglobal.h>
9#include <QtNfc/QNdefRecord>
10
12
13class QNdefMessage;
14
16class Q_NFC_EXPORT QNdefFilter
17{
18public:
22
23 void clear();
24
25 void setOrderMatch(bool on);
26 bool orderMatch() const;
27
34
35 template<typename T>
36 bool appendRecord(unsigned int min = 1, unsigned int max = 1);
37 bool appendRecord(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type,
38 unsigned int min = 1, unsigned int max = 1);
39 bool appendRecord(const Record &record);
40
41 qsizetype recordCount() const;
42 Record recordAt(qsizetype i) const;
43
44 QNdefFilter &operator=(const QNdefFilter &other);
45
46 bool match(const QNdefMessage &message) const;
47
48private:
49 QSharedDataPointer<QNdefFilterPrivate> d;
50};
51
52template <typename T>
53bool QNdefFilter::appendRecord(unsigned int min, unsigned int max)
54{
55 T record;
56
57 return appendRecord(record.typeNameFormat(), record.type(), min, max);
58}
59
61
62#endif // QNDEFFILTER_H
\inmodule QtCore
Definition qbytearray.h:57
The QNdefFilter class provides a filter for matching NDEF messages.
Definition qndeffilter.h:17
bool appendRecord(unsigned int min=1, unsigned int max=1)
Appends a record matching the template parameter to the NDEF filter.
Definition qndeffilter.h:53
The QNdefMessage class provides an NFC NDEF message.
TypeNameFormat
This enum describes the type name format of an NDEF record.
Definition qndefrecord.h:18
b clear()
Combined button and popup list for selecting options.
GLenum type
GLuint GLsizei const GLchar * message
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
ptrdiff_t qsizetype
Definition qtypes.h:165
MyRecord record(int row) const
[0]
QSharedPointer< T > other(t)
[5]
The QNdefFilter::Record struct contains the information about a filter record.
Definition qndeffilter.h:28
QNdefRecord::TypeNameFormat typeNameFormat
Definition qndeffilter.h:29
unsigned int maximum
Definition qndeffilter.h:32
unsigned int minimum
Definition qndeffilter.h:31