result.h
来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 63 行
H
63 行
//////////////////////////////////////////////////////////////////////////////// File Name : Result.h// Written By : Gday29@ewestsoft.com// Description : Definition of Result Class//////////////////////////////////////////////////////////////////////////////#ifndef __RESULT_H__#define __RESULT_H__#include "Types.h"#include "Exception.h"#include <sys/time.h>#include <mysql/mysql.h>//////////////////////////////////////////////////////////////////////////////// forward declaration//////////////////////////////////////////////////////////////////////////////class Connection;class Statement;#define T_RESULT MYSQL_RES//////////////////////////////////////////////////////////////////////////////// class Result;// Result 绰 昏力且 鞘夸啊 绝促. 荤侩磊绰 Statement 父 昏力窍搁 等促.//////////////////////////////////////////////////////////////////////////////class Result {public: Result(T_RESULT *, const string& statement) throw(Error); ~Result() throw();public: // 促澜 row肺 逞绢埃促. bool next() throw(Error); // 漂沥 鞘靛(拿烦) 蔼阑 啊瘤绊 柯促. char * getField(uint index) throw(OutOfBoundException, Error); char getChar(uint index) throw(OutOfBoundException, Error) { return(getField(index))[0]; } int getInt(uint index) throw(OutOfBoundException, Error) { return atoi(getField(index)); } uint getUInt(uint index) throw(OutOfBoundException, Error) { return(uint)atoi(getField(index)); } BYTE getBYTE(uint index) throw(OutOfBoundException, Error) { return(BYTE)atoi(getField(index)); } WORD getWORD(uint index) throw(OutOfBoundException, Error) { return(WORD)atoi(getField(index)); } DWORD getDWORD(uint index) throw(OutOfBoundException, Error) { return strtoul(getField(index), (char**)NULL, 10); } const char* getString(uint index) throw(OutOfBoundException, Error); // 孽府 搬苞蔼捞 器窃窍绰 row/column狼 箭磊甫 府畔茄促. uint getRowCount() const throw() { return m_RowCount; } uint getFieldCount() const throw() { return m_FieldCount; } string getStatement(void) const { return m_Statement; }private: T_RESULT* m_pResult; // 搬苞蔼阑 唱鸥郴绰 MYSQL structure MYSQL_ROW m_pRow; // 泅犁 贸府窍绊 乐绰 row uint m_RowCount; // 孽府 搬苞肺 掘绢辰 row狼 箭磊 uint m_FieldCount; string m_Statement; // 绢恫 query巩俊 狼茄 搬苞牢啊...?};#endif // __RESULT_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?