Exemplo n.º 1
0
BOOL DcxComboEx::matchItemText( const int nItem, const TString * search, const UINT SearchType ) {

	char itemtext[MIRC_BUFFER_SIZE_CCH];

	COMBOBOXEXITEM cbi;
	ZeroMemory( &cbi, sizeof( COMBOBOXEXITEM ) );

	cbi.mask = CBEIF_TEXT;
	cbi.iItem = nItem;
	cbi.pszText = itemtext;
	cbi.cchTextMax = MIRC_BUFFER_SIZE_CCH;

	this->getItem( &cbi );

	if ( SearchType == CBEXSEARCH_R )
		return isRegexMatch(itemtext, search->to_chr());

	return TString(itemtext).iswm(search->to_chr());
}
bool SearchCommandTokeniser::isSearchTags(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH TAGS( #[^ ]+)+");
}
bool SearchCommandTokeniser::isSearchEndAfter(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH END AFTER .+");
}
bool SearchCommandTokeniser::isSearchEndBefore(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH END BEFORE .+");
}
bool SortCommandTokeniser::isSortStart(std::string userInput) {
	return isRegexMatch(&userInput, "SORT START( DESC)?");
}
bool DisplayCommandTokeniser::isDisplayTodo(std::string userInput) {
	return isRegexMatch(&userInput, "DISPLAY TODO");
}
bool DisplayCommandTokeniser::isDisplayAll(std::string userInput) {
	return isRegexMatch(&userInput, "DISPLAY ALL");
}
bool AddCommandTokeniser::isAddFloating(std::string userInput) {
	return isRegexMatch(&userInput, "ADD .+");
}
bool SearchCommandTokeniser::isSearchFreeSlot(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH FREE");
}
bool ImportCommandTokeniser::isImportLocal(std::string userInput) {
	return isRegexMatch(&userInput, "IMPORT .+");
}
bool CompleteCommandTokeniser::isCompleteIndex(std::string userInput) {
	return isRegexMatch(&userInput, "COMPLETE [0-9]+");
}
bool ConfigureCommandTokeniser::isConfigureSaveLocation(std::string userInput) {
	return isRegexMatch(&userInput, "CONFIGURE SAVE LOCATION .+");
}
bool SortCommandTokeniser::isSortEnd(std::string userInput) {
	return isRegexMatch(&userInput, "SORT END( DESC)?");
}
bool AddCommandTokeniser::isTagged(std::string userInput) {
	return isRegexMatch(&userInput, ".+?( #[^ ]+)+");
}
bool SearchCommandTokeniser::isSearchName(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH NAME .+");
}
bool AddCommandTokeniser::isAddFromTo(std::string userInput) {
	return isRegexMatch(&userInput, "ADD .+ FROM .+ TO .+");
}
bool SearchCommandTokeniser::isSearchFromTo(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH FROM .+ TO .+");
}
bool UndoCommandTokeniser::isUndoOnce(std::string userInput) {
	return isRegexMatch(&userInput, "UNDO");
}
bool SearchCommandTokeniser::isSearchStartBefore(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH START BEFORE .+");
}
bool DisplayCommandTokeniser::isDisplayActivity(std::string userInput) {
	return isRegexMatch(&userInput, "DISPLAY ACTIVITY");
}
bool SearchCommandTokeniser::isSearchStartAfter(std::string userInput) {
    return isRegexMatch(&userInput, "SEARCH START AFTER .+");
}
bool DisplayCommandTokeniser::isDisplayFloating(std::string userInput) {
	return isRegexMatch(&userInput, "DISPLAY FLOATING");
}
bool SortCommandTokeniser::isSortName(std::string userInput) {
	return isRegexMatch(&userInput, "SORT NAME( DESC)?");
}