forked from len0rd/rockbox
FS#5805 NOT operator for tagnavi.config by Jochen Kemnade.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10558 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0a7ded3e29
commit
33d9104078
4 changed files with 21 additions and 4 deletions
|
@ -588,6 +588,11 @@ static bool check_against_clause(long numeric, const char *str,
|
|||
return numeric == clause->numeric_data;
|
||||
else
|
||||
return !strcasecmp(clause->str, str);
|
||||
case clause_is_not:
|
||||
if (clause->numeric)
|
||||
return numeric != clause->numeric_data;
|
||||
else
|
||||
return strcasecmp(clause->str, str);
|
||||
|
||||
case clause_gt:
|
||||
return numeric > clause->numeric_data;
|
||||
|
@ -600,10 +605,16 @@ static bool check_against_clause(long numeric, const char *str,
|
|||
|
||||
case clause_contains:
|
||||
return (strcasestr(str, clause->str) != NULL);
|
||||
case clause_not_contains:
|
||||
return (strcasestr(str, clause->str) == NULL);
|
||||
case clause_begins_with:
|
||||
return (strcasestr(str, clause->str) == str);
|
||||
case clause_not_begins_with:
|
||||
return (strcasestr(str, clause->str) != str);
|
||||
case clause_ends_with: /* Not supported yet */
|
||||
return false;
|
||||
case clause_not_ends_with: /* Not supported yet */
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -71,9 +71,10 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
|
|||
#define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */
|
||||
#define FLAG_DIRTYNUM 0x0004 /* Numeric data has been modified */
|
||||
|
||||
enum clause { clause_none, clause_is, clause_gt, clause_gteq, clause_lt,
|
||||
clause_lteq, clause_contains, clause_begins_with, clause_ends_with };
|
||||
enum modifiers { clause_mod_none, clause_mod_not };
|
||||
enum clause { clause_none, clause_is, clause_is_not, clause_gt, clause_gteq,
|
||||
clause_lt, clause_lteq, clause_contains, clause_not_contains,
|
||||
clause_begins_with, clause_not_begins_with, clause_ends_with,
|
||||
clause_not_ends_with };
|
||||
|
||||
struct tagcache_stat {
|
||||
bool initialized; /* Is tagcache currently busy? */
|
||||
|
|
|
@ -176,13 +176,17 @@ static int get_clause(int *condition)
|
|||
|
||||
MATCH(condition, buf, "=", clause_is);
|
||||
MATCH(condition, buf, "==", clause_is);
|
||||
MATCH(condition, buf, "!=", clause_is_not);
|
||||
MATCH(condition, buf, ">", clause_gt);
|
||||
MATCH(condition, buf, ">=", clause_gteq);
|
||||
MATCH(condition, buf, "<", clause_lt);
|
||||
MATCH(condition, buf, "<=", clause_lteq);
|
||||
MATCH(condition, buf, "~", clause_contains);
|
||||
MATCH(condition, buf, "!~", clause_not_contains);
|
||||
MATCH(condition, buf, "^", clause_begins_with);
|
||||
MATCH(condition, buf, "!^", clause_not_begins_with);
|
||||
MATCH(condition, buf, "$", clause_ends_with);
|
||||
MATCH(condition, buf, "!$", clause_not_ends_with);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -223,3 +223,4 @@ Alexander Levin
|
|||
Barry Wardell
|
||||
Lars van de Klomp
|
||||
Philippe Miossec
|
||||
Jochen Kemnade
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue