It seems crediting other people for my work is becoming a new trend around here. And foo_search_ex is not the only case:tboehrer (playlist gen syntax)
Well I must apologize again but i borrowed the extended syntax from foo_playlistgen_ex
And foo_playlistgen_ex/common.cpp contains only the following :
DECLARE_COMPONENT_VERSION("Playlist generator - Extended","1.3.2","Extended version of Foobar's Playlist generator\n\ntboehrer");
... while playlist_gen itself does not contain any author information so I did not know you invented the syntax yourself. I will correct asap.
Edit : Now who should I credit for playlist_search_ex? You (Peter), Foosion? MusicMusic? As i am a little confused, please have a look at this code :
unsigned pattern_type = cfg_search_pattern_type;
ptr_list_t<char> substrings;
if (pattern_type == PATTERN_ONE || pattern_type == PATTERN_ALL)
{
const char *ptr = pattern;
while(*ptr)
{
while(*ptr==' ') ptr++;
const char * start = ptr;
while(*ptr && *ptr!=' ') ptr++;
if (ptr>start)
{
substrings.add_item(strdup_n(start,ptr-start));
}
}
}
unsigned n, found = 0;
for(n=0;n<count;n++)
{
g_results[n]->handle_format_title(temp,cfg_search_format,0);
bool val = false;
switch(pattern_type)
{
case PATTERN_ONE:
{
uStringLower(temp_lower,temp);
unsigned sub;
val = false;
for(sub=0;sub<substrings.get_count();sub++)
{
if (strstr(temp_lower,substrings[sub])) {val = true; break; }
}
}
break;
case PATTERN_ALL:
{
uStringLower(temp_lower,temp);
unsigned sub;
val = true;
for(sub=0;sub<substrings.get_count();sub++)
{
if (!strstr(temp_lower,substrings[sub])) {val = false; break; }
}
}
break;
case PATTERN_EXACT:
val = !stricmp_utf8(pattern,temp);
break;
case PATTERN_BOOL:
val = !temp.is_empty() && strcmp(temp,"?");
break;
}
if (val)
{
found++;
if (IsUnicode() || found < 0x8000)
{
g_results[n]->handle_format_title(temp,cfg_search_display_format,0);
uSendMessageText(list,LB_ADDSTRING,0,temp);
}
}
mask.set(n,val);
}
g_results.filter_mask_del(mask);
substrings.free_all();
and let me know so that I can fix this embarassing situation.
Edit(2) : Please also note that ntboehrer is not mentionned in my versions for 0.9 as I use the SDK helpers for extended search syntax.