updated: to the new ezc api
added: following ezc functions: ezc_and_not, ezc_any_not, ezc_or_not, ezc_one_not, is, is_not, is_empty, is_not_empty git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1005 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014, Tomasz Sowa
|
||||
* Copyright (c) 2014-2015, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -102,6 +102,53 @@ void ezc_one(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void ezc_and_not(Info & i)
|
||||
{
|
||||
if( !i.params.empty() )
|
||||
{
|
||||
i.res = true;
|
||||
|
||||
for(size_t a=0 ; a < i.params.size() ; ++a)
|
||||
{
|
||||
if( i.params[a].res )
|
||||
{
|
||||
i.res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ezc_any_not(Info & i)
|
||||
{
|
||||
ezc_and_not(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ezc_or_not(Info & i)
|
||||
{
|
||||
i.res = false;
|
||||
|
||||
for(size_t a=0 ; a < i.params.size() ; ++a)
|
||||
{
|
||||
if( !i.params[a].res )
|
||||
{
|
||||
i.res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ezc_one_not(Info & i)
|
||||
{
|
||||
ezc_or_not(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ezc_not(Info & i)
|
||||
{
|
||||
if( !i.params.empty() )
|
||||
@@ -110,6 +157,7 @@ void ezc_not(Info & i)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* compare strings
|
||||
*/
|
||||
@@ -132,6 +180,44 @@ void cmp(Info & i)
|
||||
|
||||
|
||||
|
||||
void is(Info & i)
|
||||
{
|
||||
cmp(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void is_not(Info & i)
|
||||
{
|
||||
cmp(i);
|
||||
i.res = !i.res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void is_empty(Info & i)
|
||||
{
|
||||
i.res = true;
|
||||
|
||||
for(size_t a=0 ; a < i.params.size() ; ++a)
|
||||
{
|
||||
if( !i.params[a].str.empty() )
|
||||
{
|
||||
i.res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void is_not_empty(Info & i)
|
||||
{
|
||||
is_empty(i);
|
||||
i.res = !i.res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// IMPROVE ME !! may we need such a filter too?
|
||||
|
Reference in New Issue
Block a user