Advanced search engine supporting multiple search modes.
More...
#include <SearchEngine.hpp>
|
| | SearchEngine () |
| |
| void | SetMode (SearchMode mode) |
| | Set search mode.
|
| |
| SearchMode | GetMode () const |
| |
| void | SetCaseSensitive (bool sensitive) |
| | Set case sensitivity for substring/advanced modes.
|
| |
| bool | IsCaseSensitive () const |
| |
| bool | CompilePattern (const std::string &pattern, std::string &outError) |
| | Compile a search pattern (validates regex, parses advanced syntax)
|
| |
| bool | Matches (const std::string &text) const |
| | Check if a string matches the current search pattern.
|
| |
| std::vector< SearchMatch > | FindMatches (const std::string &text) const |
| | Find all matches in a string (for highlighting)
|
| |
| const std::string & | GetPattern () const |
| | Get compiled pattern (for display/logging)
|
| |
| void | Clear () |
| | Clear current pattern.
|
| |
| void | AddToHistory (const std::string &term) |
| | Add to search history.
|
| |
| const std::vector< std::string > & | GetHistory () const |
| | Get search history (most recent first)
|
| |
| void | ClearHistory () |
| | Clear history.
|
| |
| std::vector< std::string > | GetSuggestions (const std::string &prefix) const |
| | Get suggestions based on current input (for autocomplete)
|
| |
Advanced search engine supporting multiple search modes.
Supports:
- Simple substring search
- Case-sensitive search
- Regex patterns
- Advanced syntax: "term1 AND term2", "term1 OR term2", "NOT term1"
◆ SearchEngine()
| ui::qt::utils::SearchEngine::SearchEngine |
( |
| ) |
|
|
default |
◆ AddToHistory()
| void ui::qt::utils::SearchEngine::AddToHistory |
( |
const std::string & |
term | ) |
|
◆ Clear()
| void ui::qt::utils::SearchEngine::Clear |
( |
| ) |
|
◆ ClearHistory()
| void ui::qt::utils::SearchEngine::ClearHistory |
( |
| ) |
|
|
inline |
◆ compileAdvanced()
| bool ui::qt::utils::SearchEngine::compileAdvanced |
( |
const std::string & |
pattern, |
|
|
std::string & |
outError |
|
) |
| |
|
private |
◆ CompilePattern()
| bool ui::qt::utils::SearchEngine::CompilePattern |
( |
const std::string & |
pattern, |
|
|
std::string & |
outError |
|
) |
| |
Compile a search pattern (validates regex, parses advanced syntax)
◆ compileRegex()
| bool ui::qt::utils::SearchEngine::compileRegex |
( |
const std::string & |
pattern, |
|
|
std::string & |
outError |
|
) |
| |
|
private |
◆ compileSimple()
| bool ui::qt::utils::SearchEngine::compileSimple |
( |
const std::string & |
pattern | ) |
|
|
private |
◆ FindMatches()
| std::vector< SearchMatch > ui::qt::utils::SearchEngine::FindMatches |
( |
const std::string & |
text | ) |
const |
Find all matches in a string (for highlighting)
◆ findRegexMatches()
| std::vector< SearchMatch > ui::qt::utils::SearchEngine::findRegexMatches |
( |
const std::string & |
text | ) |
const |
|
private |
◆ findSimpleMatches()
| std::vector< SearchMatch > ui::qt::utils::SearchEngine::findSimpleMatches |
( |
const std::string & |
text | ) |
const |
|
private |
◆ GetHistory()
| const std::vector< std::string > & ui::qt::utils::SearchEngine::GetHistory |
( |
| ) |
const |
|
inline |
Get search history (most recent first)
◆ GetMode()
| SearchMode ui::qt::utils::SearchEngine::GetMode |
( |
| ) |
const |
|
inline |
◆ GetPattern()
| const std::string & ui::qt::utils::SearchEngine::GetPattern |
( |
| ) |
const |
|
inline |
Get compiled pattern (for display/logging)
◆ GetSuggestions()
| std::vector< std::string > ui::qt::utils::SearchEngine::GetSuggestions |
( |
const std::string & |
prefix | ) |
const |
Get suggestions based on current input (for autocomplete)
◆ IsCaseSensitive()
| bool ui::qt::utils::SearchEngine::IsCaseSensitive |
( |
| ) |
const |
|
inline |
◆ Matches()
| bool ui::qt::utils::SearchEngine::Matches |
( |
const std::string & |
text | ) |
const |
Check if a string matches the current search pattern.
◆ matchesAdvanced()
| bool ui::qt::utils::SearchEngine::matchesAdvanced |
( |
const std::string & |
text | ) |
const |
|
private |
◆ matchesRegex()
| bool ui::qt::utils::SearchEngine::matchesRegex |
( |
const std::string & |
text | ) |
const |
|
private |
◆ matchesSimple()
| bool ui::qt::utils::SearchEngine::matchesSimple |
( |
const std::string & |
text | ) |
const |
|
private |
◆ SetCaseSensitive()
| void ui::qt::utils::SearchEngine::SetCaseSensitive |
( |
bool |
sensitive | ) |
|
|
inline |
Set case sensitivity for substring/advanced modes.
◆ SetMode()
| void ui::qt::utils::SearchEngine::SetMode |
( |
SearchMode |
mode | ) |
|
◆ kMaxHistorySize
| constexpr size_t ui::qt::utils::SearchEngine::kMaxHistorySize = 50 |
|
staticconstexprprivate |
◆ m_advancedQuery
| std::optional<AdvancedQuery> ui::qt::utils::SearchEngine::m_advancedQuery {std::nullopt} |
|
private |
◆ m_caseSensitive
| bool ui::qt::utils::SearchEngine::m_caseSensitive {false} |
|
private |
◆ m_compiledRegex
| std::optional<std::regex> ui::qt::utils::SearchEngine::m_compiledRegex {std::nullopt} |
|
private |
◆ m_history
| std::vector<std::string> ui::qt::utils::SearchEngine::m_history |
|
private |
◆ m_mode
◆ m_normalizedPattern
| std::string ui::qt::utils::SearchEngine::m_normalizedPattern |
|
mutableprivate |
◆ m_normalizedPatternValid
| bool ui::qt::utils::SearchEngine::m_normalizedPatternValid {false} |
|
mutableprivate |
◆ m_pattern
| std::string ui::qt::utils::SearchEngine::m_pattern |
|
private |
The documentation for this class was generated from the following files: