wex v24.10.0
|
Offers a class to hold data for find replace functionality. More...
#include <wex/factory/frd.h>
Public Member Functions | |
find_replace_data () | |
Default constructor. | |
~find_replace_data () | |
Destructor, writes data to config. | |
virtual void | set_find_string (const std::string &value) |
Sets the find string. | |
virtual void | set_replace_string (const std::string &value) |
Sets the replace string. | |
wxFindReplaceData * | data () |
Access to data. | |
const std::string | get_find_string () const |
Returns the find string. | |
const std::string | get_replace_string () const |
Returns the replace string. | |
bool | is_regex () const |
Returns true if find text is used as a regular expression. | |
bool | match_case () const |
Returns true if the flags have match case set. | |
bool | match_word () const |
Returns true if the flags have whole word set. | |
int | regex_replace (std::string &text) const |
Replaces all occurrences of the find string as regular expression in text by the replace string. | |
int | regex_search (const std::string &text) const |
Finds the find string in text. | |
bool | search_down () const |
Returns true if the flags have search down set. | |
void | set_match_case (bool value) |
Sets flags for match case. | |
void | set_match_word (bool value) |
Sets flags for match word. | |
void | set_regex (bool value) |
Sets using regular expression for find text. | |
void | set_search_down (bool value) |
Sets flags for search down. | |
auto * | wx () const |
Returns wx frd. | |
Offers a class to hold data for find replace functionality.
int wex::factory::find_replace_data::regex_replace | ( | std::string & | text | ) | const |
Replaces all occurrences of the find string as regular expression in text by the replace string.
Returns number of replacements done in text.
int wex::factory::find_replace_data::regex_search | ( | const std::string & | text | ) | const |
Finds the find string in text.
Returns -1 if find string as regular expression does not match text, otherwise the start pos of the match.
|
virtual |
Sets the find string.
If use_regex also sets the regular expression. This string is used for tool find in files and replace in files. Also moves the find string to the beginning of the find strings list.
Reimplemented in wex::find_replace_data.
void wex::factory::find_replace_data::set_regex | ( | bool | value | ) |
Sets using regular expression for find text.
If get_find_string does not contain a valid regular expression the use member is not set.
|
virtual |
Sets the replace string.
Also moves the replace string to the beginning of the replace strings list.
Reimplemented in wex::find_replace_data.