1
#ifndef ZEALSEARCHQUERY_H
2
#define ZEALSEARCHQUERY_H
9
* @short The search query model.
14
/// Creates a search query from a string. Single separator will be
15
/// used to contstruct docset filter, but separator repeated twice
16
/// will be left inside coreQuery part since double semicolon is
17
/// used inside qualified symbol names in popular programming
18
/// languages (c++, ruby, perl, etc.).
21
/// "android:setTypeFa" #=> docsetFilters = ["android"], coreQuery = "setTypeFa"
22
/// "noprefix" #=> docsetFilters = [], coreQuery = "noprefix"
23
/// ":find" #=> docsetFilters = [], coreQuery = ":find"
24
/// "std::string" #=> docsetFilters = [], coreQuery = "std::string"
25
/// "c++:std::string" #=> docsetFilters = ["c++"], coreQuery = "std::string"
27
/// Multiple docsets are supported using the ',' character:
28
/// "java,android:setTypeFa #=> docsetFilters = ["java", "android"], coreQuery = "setTypeFa"
29
explicit SearchQuery(const QString &coreQuery);
31
/// Returns true if there's a docset filter for the given query
32
bool hasDocsetFilter() const;
34
/// Returns true if the docset prefix match the ones given on query
35
bool docsetPrefixMatch(const QString &docsetPrefix) const;
37
/// Returns the docset filter raw size for the given query
38
int docsetFilterSize() const;
40
/// Returns the core query, sanitized for use in SQL queries
41
QString sanitizedQuery() const;
43
/// Returns the query with any docset prefixes removed.
44
QString coreQuery() const;
47
QString m_rawDocsetFilter;
48
QStringList m_docsetFilters;
54
#endif // ZEALSEARCHQUERY_H