2015-01-07 01:26:14 +08:00
|
|
|
/*
|
|
|
|
* SQLiteBaseInfoDriver.h
|
|
|
|
*
|
|
|
|
* Created on: 2012-8-14
|
|
|
|
* Author: fasiondog
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SQLITEBASEINFODRIVER_H_
|
|
|
|
#define SQLITEBASEINFODRIVER_H_
|
|
|
|
|
|
|
|
#include <sqlite3.h>
|
2016-04-03 00:08:31 +08:00
|
|
|
#include "../../../Log.h"
|
|
|
|
#include "../../BaseInfoDriver.h"
|
2015-01-07 01:26:14 +08:00
|
|
|
|
|
|
|
namespace hku {
|
|
|
|
|
|
|
|
class SQLiteBaseInfoDriver: public BaseInfoDriver {
|
|
|
|
public:
|
|
|
|
SQLiteBaseInfoDriver(const shared_ptr<IniParser>& config);
|
|
|
|
virtual ~SQLiteBaseInfoDriver() { }
|
|
|
|
|
2016-04-03 00:08:31 +08:00
|
|
|
virtual bool loadMarketInfo(MarketInfoMap& out);
|
|
|
|
virtual bool loadStockTypeInfo(StockTypeInfoMap& out);
|
2015-01-07 01:26:14 +08:00
|
|
|
virtual bool loadStock();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool _getStockWeightList(hku_uint32, StockWeightList&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _getMarketTableCallBack(void *out, int nCol,
|
|
|
|
char **azVals, char **azCols);
|
|
|
|
|
|
|
|
static int _getStockTypeInfoTableCallBack(void *out, int nCol,
|
|
|
|
char **azVals, char **azCols);
|
|
|
|
|
|
|
|
static int _getStockWeightCallBack(void *out, int nCol,
|
|
|
|
char **azVals, char **azCols);
|
|
|
|
|
|
|
|
static int _getStockTableCallBack(void *out, int nCol,
|
|
|
|
char **azVals, char **azCols);
|
|
|
|
|
|
|
|
private:
|
|
|
|
//股票基本信息数据库实例
|
|
|
|
shared_ptr<sqlite3> m_db;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace hku */
|
|
|
|
#endif /* SQLITEBASEINFODRIVER_H_ */
|