-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathParser.h
More file actions
47 lines (39 loc) · 927 Bytes
/
Parser.h
File metadata and controls
47 lines (39 loc) · 927 Bytes
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
#ifndef __PARSER__
#define __PARSER__
//base class for parser
#include <QRegExp>
#include <QWebPage>
#include <QWebFrame>
#include <QUrl>
#include <QDate>
#include <QTextStream>
#include <QNetworkAccessManager>
class Parser
{
public:
Parser():
_cleanup("<.*>"),
_stdout(stdout),
_net_manager_done(false)
{
_cleanup.setMinimal(true);
}
~Parser();
//need to implement these in the base class
virtual QString getTitle()=0;
virtual QString getAuthors()=0;
virtual QString getAbstract()=0;
virtual QString getPaperName()=0;
virtual QUrl getDownloadLocation()=0;
virtual QDate getDate()=0;
virtual QString getNumber()=0;
void setData(const QString & data){_data = data;}
QString requestPageData(const QUrl & url);
protected:
QString _data;
QRegExp _cleanup;
QTextStream _stdout;
QNetworkAccessManager * _net_manager;
bool _net_manager_done;
};
#endif //__PARSER__