协能can协议
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * @content:Sqlite3I接口定义文件
  3. * @time:2016-8-25
  4. * @author:Mr_zhu
  5. * @version: V1.0
  6. * @describe:
  7. * 1#2016-8-23#V1.0#首次生成
  8. */
  9. #ifndef INCLUDE_SQLITE3I_H_
  10. #define INCLUDE_SQLITE3I_H_
  11. #include <string>
  12. #include "../common/IUnknown.h"
  13. #include "../common/Type.h"
  14. interface Sqlite3I:IUnknown{
  15. /**
  16. * 打开Sqlite3数据库文件
  17. */
  18. virtual bool Open(std::string const& db_file) = 0;
  19. /**
  20. * 直接执行SQL语句
  21. */
  22. virtual bool DirectStatement(std::string const& stmt) = 0;
  23. /**
  24. * 执行SQL语句
  25. */
  26. virtual bool Statement(std::string const& stmt) = 0;
  27. /**
  28. * SQL事务处理接口
  29. */
  30. virtual bool Begin() = 0;
  31. virtual bool Commit() = 0;
  32. virtual bool Rollback() = 0;
  33. /**
  34. * 获取上次Sqlite3操作错误代码
  35. */
  36. virtual std::string LastError() = 0;
  37. /**
  38. * 参数绑定
  39. */
  40. virtual bool Bind(int pos_zero_indexed, std::string const& value) = 0;
  41. virtual bool Bind(int pos_zero_indexed, double value) = 0;
  42. virtual bool Bind(int pos_zero_indexed, int value) = 0;
  43. virtual bool BindNull(int pos_zero_indexed) = 0;
  44. /**
  45. * 执行SQL
  46. */
  47. virtual bool Execute() = 0;
  48. /**
  49. * 获取查询结果的下一行
  50. */
  51. virtual bool NextRow() = 0;
  52. virtual bool Reset() = 0;
  53. virtual bool RestartSelect() = 0;
  54. /**
  55. * 获取String结果值
  56. */
  57. virtual std::string ValueString(int pos_zero_indexed) = 0;
  58. /**
  59. * 获取Int结果值
  60. */
  61. virtual int ValueInt(int pos_zero_indexed) = 0;
  62. virtual double ValueFloat(int pos_zero_indexed) = 0;
  63. virtual ~Sqlite3I(){}
  64. };
  65. #endif /* INCLUDE_SQLITE3I_H_ */