/[debian]/mimetic/branches/upstream/current/examples/engine.h
ViewVC logotype

Contents of /mimetic/branches/upstream/current/examples/engine.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 128 - (show annotations)
Sat Feb 25 16:49:20 2006 UTC (15 years, 5 months ago) by gregoa
File MIME type: text/plain
File size: 1823 byte(s)
[svn-inject] Installing original source of mimetic
1 #ifndef _MM_ENGINE_H_
2 #define _MM_ENGINE_H_
3 #include <mimetic/mimetic.h>
4 #include <stack>
5 #include "mm.h"
6 #include "cmdline.h"
7
8 struct engine
9 {
10 typedef mimetic::MimeEntity MimeEntity;
11 typedef std::string string;
12 typedef std::list<MimeEntity*> parts_hierarchy;
13 engine(const command_line&);
14 MimeEntity* match(MimeEntity&, int level = 0, parts_hierarchy* ph = 0);
15 private:
16 enum {
17 match_type_none,
18 match_type_exact,
19 match_type_regex,
20 match_type_shell,
21 // flags
22 match_flag_case_insensitive = 1 << 4,
23 match_flag_perl_mode = 1 << 5,
24 // masks
25 match_type_mask = 0x0F,
26 match_flag_mask = 0xF0
27 };
28 void action_attach(MimeEntity&, parts_hierarchy*, const string& fqn);
29
30 void action(MimeEntity&, parts_hierarchy*);
31 int perl_regex_match(const string&, const string&, int);
32 int match_filename(const string&, const string&);
33 int posix_regex_match(const string&, const string&, int);
34
35 int regex_match(const string&, const string&, int);
36 int exact_match(const string&, const string&, int);
37 int shell_match(const string&, const string&, int);
38 int pattern_match(const string&, const string&, int);
39
40 int pattern_field_match(const MimeEntity& me, const string&, int);
41 int fixed_field_match(const MimeEntity&, const string&, const string&, int);
42
43 int has_binary_attach(const MimeEntity&, const command_line_switch&);
44 int has_field(const MimeEntity&, const command_line_switch&);
45 int attach_filename(const MimeEntity&, const command_line_switch&);
46 int field_match(const MimeEntity&, const command_line_switch&);
47
48 string remove_external_blanks(const string&) const;
49 private:
50 command_line m_cl;
51 bool m_ignore_childs, m_pcre;
52 int m_match_mode;
53 };
54
55 #endif

  ViewVC Help
Powered by ViewVC 1.1.26