231: orderMatching(
false)
294 const auto key =
qMakePair(rec.typeNameFormat, rec.type);
296 joinedFilterRecords[
key].minimum += rec.minimum;
297 joinedFilterRecords[
key].maximum += rec.maximum;
311 else if (joinedFilterRecords.
contains(emptyTypeKey))
312 counts[emptyTypeKey] += 1;
315 for (
auto it = joinedFilterRecords.
cbegin();
it != joinedFilterRecords.
cend(); ++
it) {
333 && rec.type == currentRecord.
type) {
334 currentRecord.
minimum += rec.minimum;
335 currentRecord.
maximum += rec.maximum;
348 for (
qsizetype messageIndex = 0; matched && messageIndex <
message.size(); ++messageIndex) {
349 const auto &messageRec =
message.at(messageIndex);
354 for (; idx < mergedRecords.
size(); ++idx) {
355 const auto &filterRec = mergedRecords.
at(idx);
356 if (filterRec.typeNameFormat == messageRec.typeNameFormat()
357 && (filterRec.type == messageRec.type() || filterRec.type.isEmpty())) {
360 }
else if (counts[idx] < filterRec.minimum || counts[idx] > filterRec.maximum) {
374 const auto &rec = mergedRecords.
at(
i);
375 totalCount += counts[
i];
376 if (counts[
i] < rec.minimum || counts[
i] > rec.maximum) {
388 if (matched && (totalCount !=
message.size())) {
435 unsigned int min,
unsigned int max)
439 record.typeNameFormat = typeNameFormat;
qsizetype size() const noexcept
bool isEmpty() const noexcept
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
bool contains(const Key &key) const
const_iterator cend() const
const_iterator cbegin() const
QList< QNdefFilter::Record > filterRecords
The QNdefFilter class provides a filter for matching NDEF messages.
QNdefFilter & operator=(const QNdefFilter &other)
Assigns other to this filter and returns a reference to this filter.
bool orderMatch() const
Returns true if the filter takes NDEF record order into account when matching.
bool match(const QNdefMessage &message) const
void setOrderMatch(bool on)
Sets the ordering requirements of the filter.
QNdefFilter()
Constructs a new NDEF filter.
Record recordAt(qsizetype i) const
Returns the NDEF record at index i.
qsizetype recordCount() const
Returns the number of NDEF records in the filter.
bool appendRecord(unsigned int min=1, unsigned int max=1)
Appends a record matching the template parameter to the NDEF filter.
void clear()
Clears the filter.
~QNdefFilter()
Destroys the NDEF filter.
The QNdefMessage class provides an NFC NDEF message.
TypeNameFormat
This enum describes the type name format of an NDEF record.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
static bool verifyRecord(const QNdefFilter::Record &record)
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * message
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
The QNdefFilter::Record struct contains the information about a filter record.
QNdefRecord::TypeNameFormat typeNameFormat