| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /**
- * @content:Sqlite3I接口定义文件
- * @time:2016-8-25
- * @author:Mr_zhu
- * @version: V1.0
- * @describe:
- * 1#2016-8-23#V1.0#首次生成
- */
-
- #ifndef INCLUDE_SQLITE3I_H_
- #define INCLUDE_SQLITE3I_H_
-
- #include <string>
-
- #include "../common/IUnknown.h"
- #include "../common/Type.h"
-
- interface Sqlite3I:IUnknown{
- /**
- * 打开Sqlite3数据库文件
- */
- virtual bool Open(std::string const& db_file) = 0;
-
- /**
- * 直接执行SQL语句
- */
- virtual bool DirectStatement(std::string const& stmt) = 0;
-
- /**
- * 执行SQL语句
- */
- virtual bool Statement(std::string const& stmt) = 0;
-
- /**
- * SQL事务处理接口
- */
- virtual bool Begin() = 0;
- virtual bool Commit() = 0;
- virtual bool Rollback() = 0;
-
- /**
- * 获取上次Sqlite3操作错误代码
- */
- virtual std::string LastError() = 0;
-
- /**
- * 参数绑定
- */
- virtual bool Bind(int pos_zero_indexed, std::string const& value) = 0;
- virtual bool Bind(int pos_zero_indexed, double value) = 0;
- virtual bool Bind(int pos_zero_indexed, int value) = 0;
- virtual bool BindNull(int pos_zero_indexed) = 0;
-
- /**
- * 执行SQL
- */
- virtual bool Execute() = 0;
-
- /**
- * 获取查询结果的下一行
- */
- virtual bool NextRow() = 0;
-
- virtual bool Reset() = 0;
- virtual bool RestartSelect() = 0;
-
- /**
- * 获取String结果值
- */
- virtual std::string ValueString(int pos_zero_indexed) = 0;
-
- /**
- * 获取Int结果值
- */
- virtual int ValueInt(int pos_zero_indexed) = 0;
-
- virtual double ValueFloat(int pos_zero_indexed) = 0;
-
- virtual ~Sqlite3I(){}
- };
-
- #endif /* INCLUDE_SQLITE3I_H_ */
|