The Sword Project: sword::SWSearchable Class Reference |
#include <swsearchable.h>
Inheritance diagram for sword::SWSearchable:
Public Member Functions | |
virtual ListKey & | search (const char *istr, int searchType=0, int flags=0, SWKey *scope=0, bool *justCheckIfSupported=0, void(*percent)(char, void *)=&nullPercent, void *percentUserData=0)=0 |
Searches a module for a string. | |
virtual signed char | createSearchFramework (void(*percent)(char, void *)=&nullPercent, void *percentUserData=0) |
ask the object to build any indecies it wants for optimal searching | |
virtual void | deleteSearchFramework () |
virtual bool | hasSearchFramework () |
was SWORD compiled with code to optimize searching for this driver? | |
virtual bool | isSearchOptimallySupported (const char *istr, int searchType, int flags, SWKey *scope) |
Check if the search is optimally supported (e.g. | |
Static Public Member Functions | |
static void | nullPercent (char percent, void *userData) |
This is the default callback function for searching. |
Definition at line 35 of file swsearchable.h.
static void sword::SWSearchable::nullPercent | ( | char | percent, | |
void * | userData | |||
) | [static] |
This is the default callback function for searching.
This function is a placeholder and does nothing. You can define your own function for search progress evaluation, and pass it over to Search().
virtual ListKey& sword::SWSearchable::search | ( | const char * | istr, | |
int | searchType = 0 , |
|||
int | flags = 0 , |
|||
SWKey * | scope = 0 , |
|||
bool * | justCheckIfSupported = 0 , |
|||
void(*)(char, void *) | percent = &nullPercent , |
|||
void * | percentUserData = 0 | |||
) | [pure virtual] |
Searches a module for a string.
istr | string for which to search | |
searchType | type of search to perform >=0 - regex -1 - phrase -2 - multiword -3 - entryAttrib (eg. Word//Strongs/G1234/) -4 - Lucene | |
flags | options flags for search | |
scope | Key containing the scope. VerseKey or ListKey are useful here. | |
justCheckIfSupported | if set, don't search, only tell if this function supports requested search. | |
percent | Callback function to get the current search status in %. | |
percentUserData | User data that is given to the callback function as parameter. |
Implemented in sword::RawText, and sword::SWModule.
Referenced by sword::SWModule::Search().
virtual bool sword::SWSearchable::isSearchOptimallySupported | ( | const char * | istr, | |
int | searchType, | |||
int | flags, | |||
SWKey * | scope | |||
) | [virtual] |
Check if the search is optimally supported (e.g.
if index files are presnt and working) This function checks whether the search framework may work in the best way.
The SWORD Project; P. O. Box 2528; Tempe, AZ 85280-2528 USA |