📄 stocktel.h
字号:
#ifndef STOCKTELH#define STOCKTELH#include <iostream>#include <string>#include <sstream>#include <iomanip>#include <qsocket.h>#include "datastruct.h"using namespace std;class ZTel{protected: char Head[13]; int length; char* body;public: ZTel(ZTel* tel); ZTel(int length,unsigned int command); ZTel(int length); void setLength(int length); ZTel(); ~ZTel(); char* getBody(); int getLength(); char* getHead(); void send(QSocket* socket); bool receive(QSocket* socket); string printTel(); void writeToFile(string FileName); unsigned int getCommand(); void setCommand(unsigned int c); ZCurrentIndexStruct* getCurrentIndex(){return((ZCurrentIndexStruct*)(getBody()+4));} bool isDaysTel(){ return((getCommand()==0x00020920)||(getCommand()==0x00030920));} bool isMinutesTel(){return((getCommand()==0x00010600)||(getCommand()==0x00010401));}//0x00010401);} bool isStockDaysTel(){return((getCommand()==0x00020920));} bool isIndexDaysTel(){return((getCommand()==0x00030920));} bool isIndexMinutesTel(){return((getCommand()==0x00010600));} bool isStockMinutesTel(){return((getCommand()==0x00010401));} bool isOldMinutesTel(){return(getCommand()==0x00030f00);} bool isCodeTel(){return(getCommand()==0x00000102);} bool isUrgentBBTel(){return(getCommand()==0x00010b07);} bool isSHBBTel(){return(getCommand()==0x00010b01);} bool isSZBBTel(){return(getCommand()==0x00010b02);} bool isQC1BBTel(){return(getCommand()==0x00010b04);} bool isQC2BBTel(){return(getCommand()==0x00010b03);} bool isDBBBTel(){return(getCommand()==0x00010b08);} bool isBBTel(){return(isUrgentBBTel()||isSHBBTel()||isSZBBTel()||isQC1BBTel()||isQC2BBTel()||isDBBBTel());}};class ZLoginTel:public ZTel{public: ZLoginTel(string name,string pass);};class ZLoginBackTel:public ZTel{public: string getMessage();};class ZGetCodeTel:public ZTel{public: ZGetCodeTel(); };class ZCodeTel:public ZTel{public: ZCodeTel(ZCodeTel* tel); ZNameCode* getCodeData(); int getRecords(); ZNameCode* getRecord(int index); ZNameCode* findByCode(string code); int getIndex(ZNameCode* nc){return(nc-getCodeData());} ZNameCode* findNearBy(string s);};class ZGetDaysTel:public ZTel{public: ZGetDaysTel(string Code,unsigned char style); };class ZGetMinutesTel:public ZTel{public: ZGetMinutesTel(string code,unsigned char style); ZGetMinutesTel(ZNameCode* currentStock);};class ZGetOldMinutesTel:public ZTel{public: ZGetOldMinutesTel(string code,unsigned char style,unsigned int date);};class ZGetUrgentBBTel:public ZTel // {public: ZGetUrgentBBTel() : ZTel(0x80,0x00010b07) { body[4]=0x05; } };class ZGetSHBBTel:public ZTel // {public: ZGetSHBBTel(): ZTel(0x80,0x00010b01) { body[4]=0x05; } };class ZGetSZBBTel:public ZTel // {public: ZGetSZBBTel(): ZTel(0x80,0x00010b02) { body[4]=0x05; } };class ZGetQC1BBTel:public ZTel // {public: ZGetQC1BBTel(): ZTel(0x80,0x00010b04) { body[4]=0x05; } };class ZGetQC2BBTel:public ZTel // {public: ZGetQC2BBTel(): ZTel(0x80,0x00010b03) { body[4]=0x05; } };class ZGetDBBBTel:public ZTel // {public: ZGetDBBBTel(): ZTel(0x80,0x00010b08) { body[4]=0x05; } };class ZBBTel:public ZTel{public: string getText();};class ZMinutesTel:public ZTel{public: int getMinutes(); ZMinutesStruct* getMinute(int i); ZIndexInfoDays* getIndexInfo(){return((ZIndexInfoDays*)(body+0x1C));}};class ZOldMinutesTel:public ZTel{public: int getMinutes(); ZOldMinutesStruct* getMinute(int i); string getDate() { string s; stringstream ss; ss<<*((unsigned int*)(body+0x1c)); ss>>s; return s; } float fgetLastClose() { return((float)(*((unsigned int*)(body+0x20)))/1000.0); }};class ZDaysTel:public ZTel{public: int getDays(); ZDaysStruct* getDay(int i); ZMinutesStruct* getMinute(int i); int getMinutes(); ZIndexInfoDays *getIndexInfo(){return((ZIndexInfoDays*)(getBody()+0x1C));} };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -