OTSSpectrumLibFileMgr.h 817 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "afx.h"
  3. #include "DBStoreFile.h"
  4. #include "OTSSTDLibDB.h"
  5. using namespace OTSSQLITE;
  6. namespace OTSClassifyEngine
  7. {
  8. class __declspec(dllexport) CSpectrumLibFileMgr : public CDBStoreFile
  9. {
  10. public:
  11. CSpectrumLibFileMgr(std::string fileName);
  12. virtual ~CSpectrumLibFileMgr();
  13. virtual void Close() override
  14. {
  15. m_datastorePtr.reset();
  16. }
  17. BOOL CreateSTDLibFile();
  18. // Load/Save
  19. BOOL LoadSTDSpectrumItems(CSpectrumSTDItemList& itms, BOOL bClear = TRUE);
  20. BOOL InsertSpectrumSTDItemIntoDB(CSpectrumSTDItemPtr itm);
  21. protected:
  22. void Init();
  23. void Cleanup();
  24. //Get DB
  25. CSTDLibDBPtr GetSTDLibDB();
  26. protected:
  27. // file pathname
  28. CString m_strPathName;
  29. CSTDLibDBPtr m_pSTDLibDB;
  30. };
  31. typedef std::shared_ptr<CSpectrumLibFileMgr> CSpectrumLibFileMgrPtr;
  32. }