libimagentryfilter: Delete old filter lib

Signed-off-by: Gavin Thomas Claugus <gclaugus@gmail.com>
This commit is contained in:
Gavin Thomas Claugus 2016-08-14 14:29:02 -04:00
parent 0b94490e81
commit bc4cb6cdc8
6 changed files with 0 additions and 129 deletions

View file

@ -1,54 +0,0 @@
use libimagstore::store::Entry;
pub use ops::and::And;
pub use ops::not::Not;
pub use ops::or::Or;
pub trait Filter {
fn filter(&self, &Entry) -> bool;
fn not(self) -> Not
where Self: Sized + 'static
{
Not::new(Box::new(self))
}
fn or(self, other: Box<Filter>) -> Or
where Self: Sized + 'static
{
Or::new(Box::new(self), other)
}
fn or_not(self, other: Box<Filter>) -> Or
where Self: Sized + 'static
{
self.or(Box::new(Not::new(other)))
}
fn or3(self, other: Box<Filter>, other2: Box<Filter>) -> Or
where Self: Sized + 'static
{
Or::new(Box::new(self), Box::new(Or::new(other, other2)))
}
fn and(self, other: Box<Filter>) -> And
where Self: Sized + 'static
{
And::new(Box::new(self), other)
}
fn and3(self, other: Box<Filter>, other2: Box<Filter>) -> And
where Self: Sized + 'static
{
And::new(Box::new(self), Box::new(And::new(other, other2)))
}
fn and_not(self, other: Box<Filter>) -> And
where Self: Sized + 'static
{
self.and(Box::new(Not::new(other)))
}
}

View file

@ -29,7 +29,6 @@ extern crate libimagentrytag;
pub mod cli; pub mod cli;
pub mod builtin; pub mod builtin;
pub mod ops;
// extended functionality of the crate // extended functionality of the crate
// these depend on other internal libraries than libimagstore and use the upper core modules for // these depend on other internal libraries than libimagstore and use the upper core modules for

View file

@ -1,24 +0,0 @@
use libimagstore::store::Entry;
use filters::filter::Filter;
pub struct And {
a: Box<Filter<Entry>>,
b: Box<Filter<Entry>>
}
impl And {
pub fn new(a: Box<Filter<Entry>>, b: Box<Filter<Entry>>) -> And {
And { a: a, b: b }
}
}
impl Filter<Entry> for And {
fn filter(&self, e: &Entry) -> bool {
self.a.filter(e) && self.b.filter(e)
}
}

View file

@ -1,3 +0,0 @@
pub mod and;
pub mod not;
pub mod or;

View file

@ -1,23 +0,0 @@
use libimagstore::store::Entry;
use filters::filter::Filter;
pub struct Not {
a: Box<Filter<Entry>>
}
impl Not {
pub fn new(a: Box<Filter<Entry>>) -> Not {
Not { a: a }
}
}
impl Filter<Entry> for Not {
fn filter(&self, e: &Entry) -> bool {
!self.a.filter(e)
}
}

View file

@ -1,24 +0,0 @@
use libimagstore::store::Entry;
use filters::filter::Filter;
pub struct Or {
a: Box<Filter<Entry>>,
b: Box<Filter<Entry>>
}
impl Or {
pub fn new(a: Box<Filter<Entry>>, b: Box<Filter<Entry>>) -> Or {
Or { a: a, b: b }
}
}
impl Filter<Entry> for Or {
fn filter(&self, e: &Entry) -> bool {
self.a.filter(e) || self.b.filter(e)
}
}