From 586461676df9abd2e011fbcb1bb7c784cdb2844c Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Wed, 16 Mar 2016 15:14:03 +0100 Subject: Add filtering functionality --- ops/Cargo.toml | 1 + ops/src/lib.rs | 23 ++--------------------- 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'ops') diff --git a/ops/Cargo.toml b/ops/Cargo.toml index 6789aa2..85ca5a7 100644 --- a/ops/Cargo.toml +++ b/ops/Cargo.toml @@ -10,6 +10,7 @@ authors = ["Till Höppner "] [dependencies] log = "0.3.5" chrono = "0.2.19" +regex = "0.1.54" ilc-base = "~0.2" blist = "0.0.4" bit-set = "0.3.0" diff --git a/ops/src/lib.rs b/ops/src/lib.rs index 2ebe51f..6fd4cab 100644 --- a/ops/src/lib.rs +++ b/ops/src/lib.rs @@ -5,9 +5,11 @@ extern crate bit_set; extern crate serde; extern crate chrono; extern crate ilc_base; +extern crate regex; mod ageset; pub mod stats; +pub mod convert; /// No-op log parsing pub mod parse { @@ -27,27 +29,6 @@ pub mod parse { } } -/// Log format conversion -pub mod convert { - use ilc_base::{self, Context, Decode, Encode}; - use std::io::{BufRead, Write}; - - /// Convert from one format to another, not necessarily different, format. In combination with a - /// timezone offset, this can be used to correct the timestamps. - /// Will return `Err` and abort conversion if the decoder yields `Err` or re-encoding fails. - pub fn convert(ctx: &Context, - input: &mut BufRead, - decoder: &mut Decode, - output: &mut Write, - encoder: &Encode) - -> ilc_base::Result<()> { - for e in decoder.decode(&ctx, input) { - try!(encoder.encode(&ctx, output, &try!(e))); - } - Ok(()) - } -} - /// Last-seen of nicks pub mod seen { use ilc_base::{self, Context, Decode, Encode, Event}; -- cgit v1.2.3