|
a/src/internfile/myhtmlparse.h |
|
b/src/internfile/myhtmlparse.h |
|
|
1 |
=======
|
|
|
2 |
/* myhtmlparse.h: subclass of HtmlParser for extracting text
|
|
|
3 |
*
|
|
|
4 |
* ----START-LICENCE----
|
|
|
5 |
* Copyright 1999,2000,2001 BrightStation PLC
|
|
|
6 |
* Copyright 2002,2003,2004 Olly Betts
|
|
|
7 |
*
|
|
|
8 |
* This program is free software; you can redistribute it and/or
|
|
|
9 |
* modify it under the terms of the GNU General Public License as
|
|
|
10 |
* published by the Free Software Foundation; either version 2 of the
|
|
|
11 |
* License, or (at your option) any later version.
|
|
|
12 |
*
|
|
|
13 |
* This program is distributed in the hope that it will be useful,
|
|
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
16 |
* GNU General Public License for more details.
|
|
|
17 |
*
|
|
|
18 |
* You should have received a copy of the GNU General Public License
|
|
|
19 |
* along with this program; if not, write to the Free Software
|
|
|
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
21 |
* USA
|
|
|
22 |
* -----END-LICENCE-----
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
#include "htmlparse.h"
|
|
|
26 |
|
|
|
27 |
// FIXME: Should we include \xa0 which is non-breaking space in iso-8859-1, but
|
|
|
28 |
// not in all charsets and perhaps spans of all \xa0 should become a single
|
|
|
29 |
// \xa0?
|
|
|
30 |
#define WHITESPACE " \t\n\r"
|
|
|
31 |
|
|
|
32 |
class MyHtmlParser : public HtmlParser {
|
|
|
33 |
public:
|
|
|
34 |
bool in_script_tag;
|
|
|
35 |
bool in_style_tag;
|
|
|
36 |
bool pending_space;
|
|
|
37 |
string title, sample, keywords, dump;
|
|
|
38 |
bool indexing_allowed;
|
|
|
39 |
void process_text(const string &text);
|
|
|
40 |
void opening_tag(const string &tag, const map<string,string> &p);
|
|
|
41 |
void closing_tag(const string &tag);
|
|
|
42 |
MyHtmlParser() :
|
|
|
43 |
in_script_tag(false),
|
|
|
44 |
in_style_tag(false),
|
|
|
45 |
pending_space(false),
|
|
|
46 |
indexing_allowed(true) { }
|
|
|
47 |
};
|