-
Notifications
You must be signed in to change notification settings - Fork 9
/
yahoo_loader.h
52 lines (42 loc) · 1.12 KB
/
yahoo_loader.h
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
#ifndef YAHOO_LOADER_H_INCLUDED
#define YAHOO_LOADER_H_INCLUDED
#include <QFile>
#include <QString>
#include <QDateTime>
#include <QNetworkAccessManager>
#include <QUrl>
#include <QNetworkReply>
#include "data_loader.h"
#include "ohlc_memory_provider.h"
#include "yahoo_csv_loader.h"
class YahooLoader: public DataLoader {
Q_OBJECT
public:
enum Period { DAY = 'd', WEEK = 'w', MONTH = 'm' };
private:
QUrl buildUrl(QString symbol, QDateTime start, QDateTime end, Period period);
QString symbol;
Period period;
OHLCMemoryProvider* storage;
QNetworkAccessManager* manager;
YahooCSVLoader* csvLoader;
public:
YahooLoader(QString symbol, Period period, OHLCMemoryProvider* storage);
virtual void load();
private:
QNetworkReply* reply;
// QFile* file;
public slots:
void requestFinished(QNetworkReply* reply);
void slotReadyRead();
void slotError(QNetworkReply::NetworkError error);
void slotSslErrors(QList<QSslError> errors);
// void readData(const QHttpResponseHeader&);
// void requestFinished(int id, bool error);
//
private slots:
void csvLoaded();
signals:
void dataLoaded();
};
#endif