|
a/src/internfile/mh_html.h |
|
b/src/internfile/mh_html.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _HTML_H_INCLUDED_
|
17 |
#ifndef _HTML_H_INCLUDED_
|
18 |
#define _HTML_H_INCLUDED_
|
18 |
#define _HTML_H_INCLUDED_
|
19 |
/* @(#$Id: mh_html.h,v 1.7 2006-01-30 11:15:27 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: mh_html.h,v 1.8 2006-12-15 12:40:02 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
|
22 |
|
23 |
#include "mimehandler.h"
|
23 |
#include "mimehandler.h"
|
24 |
|
24 |
|
25 |
/**
|
25 |
/**
|
26 |
Translate html document to internal one.
|
26 |
Translate html document to internal one.
|
27 |
|
|
|
28 |
There are 2 interfaces, depending if we're working on a file, or
|
|
|
29 |
on a string. The string form is applied to the output of external
|
|
|
30 |
handlers for foreign formats: they return a result in html, which
|
|
|
31 |
has the advantage to be text (easy to use in shell-scripts), and
|
|
|
32 |
semi-structured (can carry titles, abstracts, whatever)
|
|
|
33 |
*/
|
27 |
*/
|
34 |
class MimeHandlerHtml : public MimeHandler {
|
28 |
class MimeHandlerHtml : public RecollFilter {
|
35 |
public:
|
29 |
public:
|
36 |
std::string charsethint;
|
30 |
MimeHandlerHtml(const string& mt) : RecollFilter(mt) {}
|
37 |
|
31 |
virtual ~MimeHandlerHtml() {}
|
38 |
/** Create internal document from html file (standard interface) */
|
32 |
virtual bool set_document_file(const string &file_path);
|
39 |
virtual MimeHandler::Status
|
33 |
virtual bool set_document_string(const string &data);
|
40 |
mkDoc(RclConfig *conf, const std::string &fn,
|
34 |
virtual bool next_document();
|
41 |
const std::string &mtype, Rcl::Doc &docout, std::string&);
|
35 |
private:
|
42 |
|
36 |
string m_html;
|
43 |
/** Create internal doc from html string (postfilter for external ones) */
|
|
|
44 |
virtual MimeHandler::Status
|
|
|
45 |
mkDoc(RclConfig *conf, const std::string &fn, const std::string& htext,
|
|
|
46 |
const std::string &mtype, Rcl::Doc &docout);
|
|
|
47 |
};
|
37 |
};
|
48 |
|
38 |
|
49 |
#endif /* _HTML_H_INCLUDED_ */
|
39 |
#endif /* _HTML_H_INCLUDED_ */
|