InformationDB.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. //#include "SQLiteDB.h"
  3. #include "DBConst.h"
  4. #include "DBStoreBase.h"
  5. #include "DBBase.h"
  6. namespace OTSSQLITE
  7. {
  8. class __declspec(dllexport) CInformationDB
  9. {
  10. public:
  11. CInformationDB(CDBStoreBasePtr a_datastore);
  12. virtual ~CInformationDB(void);
  13. BOOL InsertRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr);
  14. BOOL InsertStringRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr);
  15. BOOL InsertIntegerRow(LPCTSTR a_sItemName, int a_nItemContent, LPCTSTR a_sItemComment = nullptr);
  16. BOOL InsertDoubleRow(LPCTSTR a_sItemName, double a_dItemContent, LPCTSTR a_sItemComment = nullptr);
  17. BOOL InsertTimeStampRow(LPCTSTR a_sItemName, LPCTSTR a_sItemComment = nullptr);
  18. BOOL UpdateRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr);
  19. BOOL UpdateStringRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr);
  20. BOOL UpdateIntegerRow(LPCTSTR a_sItemName, int a_nItemContent, LPCTSTR a_sItemComment = nullptr);
  21. BOOL UpdateDoubleRow(LPCTSTR a_sItemName, double a_dItemContent, LPCTSTR a_sItemComment = nullptr);
  22. BOOL UpdateTimeStampRow(LPCTSTR a_sItemName, LPCTSTR a_sItemComment = nullptr);
  23. BOOL DeleteRow(LPCTSTR a_sItemName);
  24. BOOL GetStringValue(LPCTSTR a_sItemName, CString& a_sString);
  25. BOOL GetIntValue(LPCTSTR a_sItemName, int& a_nValue);
  26. virtual CDBTableBasePtr GetTableInfo() ;
  27. virtual BOOL Init(const BOOL a_bClean = FALSE) ;
  28. virtual BOOL CreateTable(const BOOL a_bForce = FALSE) ;
  29. virtual BOOL DeleteTable() ;
  30. virtual BOOL RemoveAllRows() ;
  31. virtual BOOL IsDBExist() ;
  32. virtual CDBStoreBasePtr GetDatastore() ;
  33. virtual CDBQueryBasePtr GetTableQuery(LPCTSTR a_sOrderColumnName = nullptr) ;
  34. protected:
  35. CDBTableBasePtr m_tableInfo;
  36. private:
  37. CDBBasePtr myDB;
  38. };
  39. typedef std::shared_ptr<CInformationDB> CInformationDBPtr;
  40. }