File: HTMLDriver.h

package info (click to toggle)
html2text 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,144 kB
  • sloc: cpp: 5,891; sh: 5,747; yacc: 891; makefile: 84
file content (54 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Copyright 2020-2023 Fabian Groffen <grobian@gentoo.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License in the file COPYING for more details.
 */

#ifndef HTML_DRIVER_H
#define HTML_DRIVER_H 1

#include "HTMLParser.hh"
#include "HTMLControl.h"
#include "iconvstream.h"

class HTMLDriver {
	public:
		HTMLDriver(HTMLControl &c,
				iconvstream& os_,
				bool& enable_links_,
				int& width_,
				int& mode_,
				bool& debug_parser);
		~HTMLDriver();

		int parse();
		int lex(html2text::HTMLParser::semantic_type * const lval);
		void yyerror(const char *msg);
		void process(const Document&);
		bool read_cdata(const char *terminal, string *);
		int list_nesting = 0;
		bool enable_links;
		OrderedList *links = nullptr;

		enum {
			PRINT_AS_ASCII, SYNTAX_CHECK
		};

	private:
		HTMLControl& control;
		bool trace_parsing;
		int width;
		int mode;
		iconvstream& os;

		html2text::HTMLParser::semantic_type *yylval = nullptr;
};

#endif