CSqlite3.h 398 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <sqlite3/sqlite3.h>
  3. #include "CSetting.h"
  4. class CSqlite3
  5. {
  6. public:
  7. CSqlite3();
  8. ~CSqlite3();
  9. public:
  10. bool InitConfig();
  11. bool SaveParams(std::map<std::string, std::string>& params);
  12. bool SaveChufangPrinter(std::vector<ChufangPrinter>& printers);
  13. void Close()
  14. {
  15. if (m_db != NULL)
  16. {
  17. sqlite3_close(m_db);
  18. }
  19. }
  20. private:
  21. int m_rc;
  22. sqlite3* m_db = NULL;
  23. };