wex v24.04.0
Public Member Functions | Static Public Member Functions | List of all members
wex::find_replace_data Class Reference

Offers a class to hold data for find replace functionality. More...

#include <wex/ui/frd.h>

Inheritance diagram for wex::find_replace_data:
Inheritance graph
[legend]

Public Member Functions

const auto & get_find_strings () const
 Returns the find strings.
 
const auto & get_replace_strings () const
 Returns the replace strings.
 
bool match (const std::string &text, const data::find &f) const
 Returns true if specified find text (input) matches with the text, using the find replace data flags.
 
void set_find_strings (const ex_commandline_input::values_t &v)
 Sets the find strings.
 
void set_replace_strings (const ex_commandline_input::values_t &v)
 Sets the replace strings.
 
void set_find_string (const std::string &value) override
 Sets the find string.
 
void set_replace_string (const std::string &value) override
 Sets the replace string.
 
- Public Member Functions inherited from wex::factory::find_replace_data
 find_replace_data ()
 Default constructor.
 
 ~find_replace_data ()
 Destructor, writes data to config.
 
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.
 

Static Public Member Functions

static find_replace_dataget (bool createOnDemand=true)
 Returns the find replace data.
 
static find_replace_dataset (find_replace_data *frd)
 Sets the object as the current one, returns the pointer to the previous current object (both the parameter and returned value may be nullptr).
 
- Static Public Member Functions inherited from wex::factory::find_replace_data
static const auto & text_find ()
 Returns text.
 
static const auto & text_match_case ()
 Returns text.
 
static const auto & text_match_word ()
 Returns text.
 
static const auto & text_regex ()
 Returns text.
 
static const auto & text_replace_with ()
 Returns text.
 
static const auto & text_search_down ()
 Returns text.
 

Detailed Description

Offers a class to hold data for find replace functionality.

Member Function Documentation

◆ set_find_string()

void wex::find_replace_data::set_find_string ( const std::string & value)
overridevirtual

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 from wex::factory::find_replace_data.

◆ set_find_strings()

void wex::find_replace_data::set_find_strings ( const ex_commandline_input::values_t & v)

Sets the find strings.

Also moves the find string to the beginning of the find strings list.

◆ set_replace_string()

void wex::find_replace_data::set_replace_string ( const std::string & value)
overridevirtual

Sets the replace string.

Also moves the replace string to the beginning of the replace strings list.

Reimplemented from wex::factory::find_replace_data.

◆ set_replace_strings()

void wex::find_replace_data::set_replace_strings ( const ex_commandline_input::values_t & v)

Sets the replace strings.

Also moves the replace string to the beginning of the replace strings list.