-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathTencentApi.h
70 lines (56 loc) · 1.58 KB
/
TencentApi.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _TENCENT_API_H
#define _TENCENT_API_H
#include <memory>
#include <string>
#include <vector>
#include "curl.h"
namespace tencent_api {
using namespace std;
struct MarketQuote {
char code[32];
int32_t date;
int32_t time;
double open;
double high;
double low;
double close;
double last;
double high_limit;
double low_limit;
double pre_close;
int64_t volume;
double turnover;
double ask1;
double ask2;
double ask3;
double ask4;
double ask5;
double bid1;
double bid2;
double bid3;
double bid4;
double bid5;
int64_t ask_vol1;
int64_t ask_vol2;
int64_t ask_vol3;
int64_t ask_vol4;
int64_t ask_vol5;
int64_t bid_vol1;
int64_t bid_vol2;
int64_t bid_vol3;
int64_t bid_vol4;
int64_t bid_vol5;
};
class TencentApi {
public:
TencentApi();
~TencentApi();
void set_url(string url) { m_url = url; }
bool get_quotes(const vector<string>& codes, vector<shared_ptr<MarketQuote>>* quotes);
private:
string download(const vector<string>& codes);
CURL * m_curl;
string m_url;
};
}
#endif