1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/parser.h Sat Dec 10 19:11:12 2005 +0000
1.3 @@ -0,0 +1,46 @@
1.4 +#ifndef _INCLUDE_STRIP_PARSER_H
1.5 +#define _INCLUDE_STRIP_PARSER_H
1.6 +
1.7 +#include <sh_string.h>
1.8 +#include <sh_list.h>
1.9 +#include <pcre.h>
1.10 +
1.11 +struct parse_pair
1.12 +{
1.13 + SourceHook::String key;
1.14 + SourceHook::String val;
1.15 + pcre *re;
1.16 +};
1.17 +
1.18 +struct ent_prop
1.19 +{
1.20 + SourceHook::String key;
1.21 + SourceHook::String val;
1.22 +};
1.23 +
1.24 +class Stripper
1.25 +{
1.26 +public:
1.27 + Stripper();
1.28 + ~Stripper();
1.29 +public:
1.30 + void SetEntityList(const char *ents);
1.31 + void ApplyFileFilter(const char *file);
1.32 + const char *ToString();
1.33 +private:
1.34 + void RunRemoveFilter(SourceHook::List<parse_pair *> &filters);
1.35 + void RunAddFilter(SourceHook::List<parse_pair *> &list);
1.36 + void Clear();
1.37 + void _BuildPropList();
1.38 +private:
1.39 + SourceHook::String m_tostring;
1.40 + SourceHook::List<SourceHook::List<ent_prop *> *> m_props;
1.41 + SourceHook::List<SourceHook::String *> m_lines;
1.42 + bool m_resync;
1.43 + pcre *brk_re;
1.44 + pcre_extra *brk_re_extra;
1.45 +};
1.46 +
1.47 +extern Stripper g_Stripper;
1.48 +
1.49 +#endif //_INCLUDE_STRIP_PARSER_H