#pragma once //#include "SQLiteDB.h" #include "DBConst.h" #include "DBStoreBase.h" #include "DBBase.h" namespace OTSSQLITE { class __declspec(dllexport) CInformationDB { public: CInformationDB(CDBStoreBasePtr a_datastore); virtual ~CInformationDB(void); BOOL InsertRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr); BOOL InsertStringRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr); BOOL InsertIntegerRow(LPCTSTR a_sItemName, int a_nItemContent, LPCTSTR a_sItemComment = nullptr); BOOL InsertDoubleRow(LPCTSTR a_sItemName, double a_dItemContent, LPCTSTR a_sItemComment = nullptr); BOOL InsertTimeStampRow(LPCTSTR a_sItemName, LPCTSTR a_sItemComment = nullptr); BOOL UpdateRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr); BOOL UpdateStringRow(LPCTSTR a_sItemName, LPCTSTR a_sItemContent, LPCTSTR a_sItemComment = nullptr); BOOL UpdateIntegerRow(LPCTSTR a_sItemName, int a_nItemContent, LPCTSTR a_sItemComment = nullptr); BOOL UpdateDoubleRow(LPCTSTR a_sItemName, double a_dItemContent, LPCTSTR a_sItemComment = nullptr); BOOL UpdateTimeStampRow(LPCTSTR a_sItemName, LPCTSTR a_sItemComment = nullptr); BOOL DeleteRow(LPCTSTR a_sItemName); BOOL GetStringValue(LPCTSTR a_sItemName, CString& a_sString); BOOL GetIntValue(LPCTSTR a_sItemName, int& a_nValue); virtual CDBTableBasePtr GetTableInfo() ; virtual BOOL Init(const BOOL a_bClean = FALSE) ; virtual BOOL CreateTable(const BOOL a_bForce = FALSE) ; virtual BOOL DeleteTable() ; virtual BOOL RemoveAllRows() ; virtual BOOL IsDBExist() ; virtual CDBStoreBasePtr GetDatastore() ; virtual CDBQueryBasePtr GetTableQuery(LPCTSTR a_sOrderColumnName = nullptr) ; protected: CDBTableBasePtr m_tableInfo; private: CDBBasePtr myDB; }; typedef std::shared_ptr CInformationDBPtr; }