Baloo
8#ifndef BALOO_ENGINEQUERY_H
9#define BALOO_ENGINEQUERY_H
11#include "engine_export.h"
19class BALOO_ENGINE_EXPORT EngineQuery
29 EngineQuery(
const QByteArray& term, Operation op = Equal);
30 EngineQuery(
const QVector<EngineQuery> &subQueries);
32 QByteArray term()
const {
36 Operation op()
const {
40 void setOp(
const Operation& op) {
45 return !m_term.isEmpty();
49 return m_subQueries.isEmpty() && m_term.isEmpty();
52 QVector<EngineQuery> subQueries()
const {
56 bool operator ==(
const EngineQuery& q)
const {
57 return m_term == q.m_term && m_op == q.m_op && m_subQueries == q.m_subQueries;
63 QVector<EngineQuery> m_subQueries;
66inline QDebug operator<<(QDebug d,
const Baloo::EngineQuery& q)
68 QDebugStateSaver state(d);
71 using Operation = Baloo::EngineQuery::Operation;
72 if ((q.op() == Operation::Equal) || q.op() == Operation::StartsWith) {
73 Q_ASSERT(q.subQueries().isEmpty());
74 return d << q.term() << (q.op() == Operation::StartsWith ?
".." :
"");
77 Q_ASSERT(q.op() == Operation::Phrase);
79 for (
auto &sq : q.subQueries()) {
Implements storage for docIds without any associated data Instantiated for:
char * toString(const EngineQuery &query)
Helper for QTest.
const char * constData() const const
void setAutoInsertSpaces(bool b)
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:50:57 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.