Leaked source code of windows server 2003
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.

33 lines
947 B

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