Added a new filter which can directly read the output
[gnucomo.git] / src / gcm_input / df_filter.h
1
2 /**************************************************************************
3 **  (c) Copyright 2007, Andromeda Technology & Automation
4 ** This is free software; you can redistribute it and/or modify it under the
5 ** terms of the GNU General Public License, see the file COPYING.
6 ***************************************************************************
7 ** MODULE INFORMATION *
8 ***********************
9 **      FILE NAME      : df_filter.h
10 **      SYSTEM NAME    : 
11 **      VERSION NUMBER : $Revision: 1.1 $
12 **
13 **  DESCRIPTION      :  
14 **
15 **  EXPORTED OBJECTS : 
16 **  LOCAL    OBJECTS : 
17 **  MODULES  USED    :
18 ***************************************************************************
19 **  ADMINISTRATIVE INFORMATION *
20 ********************************
21 **      ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
22 **      CREATION DATE   : Oct 31, 2007
23 **      LAST UPDATE     : Oct 31, 2007
24 **      MODIFICATIONS   : 
25 **************************************************************************/
26
27 /*****************************
28    $Log: df_filter.h,v $
29    Revision 1.1  2007-11-03 10:26:13  arjen
30    Added a new filter which can directly read the output
31    of the UNIX df command. A brief description is added in
32    the user manual.
33
34  *****************************/
35
36 /* static const char *RCSID = "$Id: df_filter.h,v 1.1 2007-11-03 10:26:13 arjen Exp $"; */
37
38 #include "message_filter.h"
39 #include "line_cooker.h"
40
41 /*
42 ///////////////////////////////////////////////////////////////////////////
43 //  NAME           : df_filter
44 //  BASECLASS      : 
45 //  MEMBERS        :
46 //  OPERATORS      :
47 //  METHODS        : 
48 //
49 //  DESCRIPTION    : 
50 //
51 //  RELATIONS      :
52 //  SEE ALSO       :
53 //  LAST MODIFIED  : Oct 31, 2007
54 ///////////////////////////////////////////////////////////////////////////
55 */
56
57 class df_filter : public message_filter
58 {
59
60 protected:
61
62 public:
63
64    df_filter(String host, UTC arriv, String service) : message_filter(host, arriv, service)
65    {
66    }
67
68    virtual void construct_XML(message_buffer &in, std::strstream &xml);
69 };
70
71 /*
72 ///////////////////////////////////////////////////////////////////////////
73 //  NAME           : df_cooker
74 //  BASECLASS      : 
75 //  MEMBERS        :
76 //  OPERATORS      :
77 //  METHODS        : 
78 //
79 //  DESCRIPTION    : 
80 //
81 //  RELATIONS      :
82 //  SEE ALSO       :
83 //  LAST MODIFIED  : Oct 31, 2007
84 ///////////////////////////////////////////////////////////////////////////
85 */
86
87 class df_cooker : public line_cooker
88 {
89
90    bool df_detected;
91
92 protected:
93
94
95 public:
96
97    df_cooker()
98    {
99       df_detected = false;
100    }
101
102    bool check_pattern(String logline);
103    bool cook_this(String logline, UTC arrival);
104
105    String message_type()
106    {
107       return "df report";
108    }
109
110 };