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/src/lib.rs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'ops/src') 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