Documented search functions.
This commit is contained in:
parent
ba78adb399
commit
57e3fc0289
1
Doxyfile
1
Doxyfile
|
@ -24,3 +24,4 @@ BUILTIN_STL_SUPPORT = YES
|
||||||
VERBATIM_HEADERS = YES
|
VERBATIM_HEADERS = YES
|
||||||
INLINE_SOURCES = YES
|
INLINE_SOURCES = YES
|
||||||
SEARCHENGINE = YES
|
SEARCHENGINE = YES
|
||||||
|
SHOW_FILES = YES
|
||||||
|
|
|
@ -21,20 +21,52 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "sqlite.hpp"
|
#include "sqlite.hpp"
|
||||||
|
|
||||||
|
//! @file
|
||||||
|
|
||||||
namespace remwharead
|
namespace remwharead
|
||||||
{
|
{
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Split expression in subexpressions.
|
||||||
|
*
|
||||||
|
* First it splits at `OR` or `||`, then it splits the subexpressions at
|
||||||
|
* `AND` or `&&`. The first vector contains all tags before the first `OR`.
|
||||||
|
*
|
||||||
|
* @return Vector of `OR`-vectors of `AND`-tags.
|
||||||
|
*/
|
||||||
const vector<vector<string>> parse_expression(string expression);
|
const vector<vector<string>> parse_expression(string expression);
|
||||||
|
|
||||||
|
//! Convert str to lowercase. Works with unicode.
|
||||||
const string to_lowercase(const string &str);
|
const string to_lowercase(const string &str);
|
||||||
|
|
||||||
//! Seach database entries for tags.
|
/*!
|
||||||
|
* @brief Search in tags of database entries.
|
||||||
|
*
|
||||||
|
* Only matches whole tags, *Pill* does not match *Pillow*.
|
||||||
|
*
|
||||||
|
* @param entries Vector of Database::entry to search.
|
||||||
|
* @param expression Search expression.
|
||||||
|
* @param is_re Is it a regular expression?
|
||||||
|
*
|
||||||
|
* @return Vector of matching Database::entry.
|
||||||
|
*/
|
||||||
const vector<Database::entry>
|
const vector<Database::entry>
|
||||||
search_tags(const vector<Database::entry> &entries, string expression,
|
search_tags(const vector<Database::entry> &entries, string expression,
|
||||||
const bool is_re);
|
const bool is_re);
|
||||||
|
|
||||||
//! Search tags, title, description and full text.
|
/*!
|
||||||
|
* @brief Search in full text of database entries.
|
||||||
|
*
|
||||||
|
* Searches in tags, title, description and full text.
|
||||||
|
*
|
||||||
|
* @param entries Vector of Database::entry to search.
|
||||||
|
* @param expression Search expression.
|
||||||
|
* @param is_re Is it a regular expression?
|
||||||
|
*
|
||||||
|
* @return Vector of matching Database::entry.
|
||||||
|
*/
|
||||||
const vector<Database::entry>
|
const vector<Database::entry>
|
||||||
search_all(const vector<Database::entry> &entries, string expression,
|
search_all(const vector<Database::entry> &entries, string expression,
|
||||||
const bool is_re);
|
const bool is_re);
|
||||||
|
|
Loading…
Reference in New Issue