Source code of Windows XP (NT5)
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.

37 lines
1.1 KiB

  1. // Persistor.h: interface for the CPersistor class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. //***************************************************************************
  5. //
  6. // judyp May 1999
  7. //
  8. //***************************************************************************
  9. #if !defined(AFX_PERSISTOR_H__74C9CD33_EC48_11D2_826A_0008C75BFC19__INCLUDED_)
  10. #define AFX_PERSISTOR_H__74C9CD33_EC48_11D2_826A_0008C75BFC19__INCLUDED_
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif // _MSC_VER > 1000
  14. class CPersistor
  15. {
  16. public:
  17. virtual ~CPersistor();
  18. CPersistor(const char *pszFilename, int nMode, bool bLoading = true );
  19. HRESULT Close();
  20. HRESULT Open();
  21. // For logging support. We only log out.
  22. HRESULT OpenLog(bool bAppend = true);
  23. t_fstream &Stream() {return *m_pfsFile;}
  24. bool IsLoading() {return m_bLoading;}
  25. const char* GetFilename() {return m_sFilename.c_str();}
  26. protected:
  27. t_fstream *m_pfsFile;
  28. bool m_bLoading;
  29. string m_sFilename;
  30. int m_nMode;
  31. bool m_bFirst;
  32. };
  33. #endif // !defined(AFX_PERSISTOR_H__74C9CD33_EC48_11D2_826A_0008C75BFC19__INCLUDED_)