libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
List of all members | Public Member Functions
t3_widget::finder_t Class Reference

Class holding the context of a find operation. More...

Public Member Functions

 finder_t (void)
 Create a new empty finder_t.
 finder_t (const std::string *needle, int flags, const std::string *replacement=NULL)
 Create a new finder_t for a specific search.
int get_flags (void)
 Retrieve the flags set when setting the search context.
std::string * get_replacement (const std::string *haystack)
 Retrieve the replacement string.
bool match (const std::string *haystack, find_result_t *result, bool reverse)
 Try to find the previously set needle in a string.
finder_toperator= (finder_t &other)
 Assign the value of another finder_t to this finder_t.
void set_context (const std::string *needle, int flags, const std::string *replacement=NULL)
 Set the search parameters.
virtual ~finder_t (void)
 Destroy a finder_t instance.

Detailed Description

Class holding the context of a find operation.

Constructor & Destructor Documentation

t3_widget::finder_t::finder_t ( void  )

Create a new empty finder_t.

t3_widget::finder_t::finder_t ( const std::string *  needle,
int  flags,
const std::string *  replacement = NULL 
)

Create a new finder_t for a specific search.

May throw a const char pointer holding an error message. Caller of this constructor remains owner of passed objects.

t3_widget::finder_t::~finder_t ( void  )
virtual

Destroy a finder_t instance.

Member Function Documentation

int t3_widget::finder_t::get_flags ( void  )

Retrieve the flags set when setting the search context.

string * t3_widget::finder_t::get_replacement ( const std::string *  haystack)

Retrieve the replacement string.

Returns a newly allocated string, for which the caller will have ownership.

bool t3_widget::finder_t::match ( const std::string *  haystack,
find_result_t result,
bool  reverse 
)

Try to find the previously set needle in a string.

finder_t & t3_widget::finder_t::operator= ( finder_t other)

Assign the value of another finder_t to this finder_t.

Assignment using this operator is destructive to other. I.e. this finder_t instance will take ownership of all objects allocated by other, and set other's object pointers to NULL.

void t3_widget::finder_t::set_context ( const std::string *  needle,
int  flags,
const std::string *  replacement = NULL 
)

Set the search parameters.

May throw a const char pointer holding an error message. Caller of this function remains owner of passed objects.