wxMaxima
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
WorksheetSearch.h File Reference

The worksheet's search engine. More...

#include <wx/regex.h>
#include <wx/string.h>
Include dependency graph for WorksheetSearch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  WorksheetSearch::Matcher
 Matches a search expression against worksheet text. More...
 
class  WorksheetSearch::StringMatcher
 Substring search, optionally case-insensitive. More...
 
class  WorksheetSearch::RegexMatcher
 Regular-expression search. More...
 
struct  WorksheetSearch::SearchTarget
 A search match: the group it is in and the matching part. More...
 
struct  WorksheetSearch::SearchStart
 Where a search starts: a group plus what the cursor is doing there. More...
 

Enumerations

enum class  WorksheetSearch::MatchPart { Prompt , Editor , Output }
 Which part of a group cell a search match was found in.
 

Functions

SearchTarget WorksheetSearch::FindNextTarget (GroupCell *tree, GroupCell *last, const SearchStart &start, bool down, const Matcher &matcher, bool searchInInput, bool searchInOutput)
 Find the next match, walking the group cells with wrap-around.
 

Detailed Description

The worksheet's search engine.

Finds the next match of a search expression in the tree of group cells, walking the groups in a wrap-around loop and checking each group's parts in document order: prompt, editor, output when searching down; output, editor, prompt when searching up. In the group the search starts in, skip rules make the search continue behind the cursor or the previous match instead of re-finding it.

This module only decides WHERE the next match is; it knows nothing about the view. Applying the match (activating the editor or selecting the matched cell, scrolling to it) stays in Worksheet.

Function Documentation

◆ FindNextTarget()

SearchTarget WorksheetSearch::FindNextTarget ( GroupCell tree,
GroupCell last,
const SearchStart start,
bool  down,
const Matcher matcher,
bool  searchInInput,
bool  searchInOutput 
)

Find the next match, walking the group cells with wrap-around.

Parameters
treethe first group cell of the worksheet
lastthe last group cell of the worksheet (wrap target going up)
startwhere to start and what the cursor is doing there
downsearch direction
matcherthe search expression
searchInInputwhether prompts and editors are searched
searchInOutputwhether output cells are searched

The start group is searched only once, from the cursor onwards: after a full wrap-around the loop stops when it reaches the start group again.