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.

64 lines
2.0 KiB

  1. // VerEngine.h: interface for the CVerEngine class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_VERENGINE_H__EC78FB59_EF1C_11D0_A42F_00C04FB99B01__INCLUDED_)
  5. #define AFX_VERENGINE_H__EC78FB59_EF1C_11D0_A42F_00C04FB99B01__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #include "ssauto.h"
  10. #include <list>
  11. using namespace std;
  12. class CVerEngine
  13. {
  14. public:
  15. // thee methods
  16. HRESULT SyncPrj(LPCTSTR szBasePrj,LPCTSTR szDir);
  17. // dir versioning methods
  18. HRESULT AddPrj(LPCTSTR szBasePrj,LPCTSTR szRelSpec);
  19. HRESULT RenamePrj(LPCTSTR szBasePrj,LPCTSTR szRelSpec,LPCTSTR szRelSpecOld);
  20. // file versioning methods
  21. HRESULT Rename(LPCTSTR szBasePrj,LPCTSTR szDir,LPCTSTR szRelSpec,LPCTSTR szRelSpecOld);
  22. HRESULT CheckOut(LPCTSTR szFileSpec,LPCTSTR szBasePrj,LPCTSTR szRelSpec);
  23. HRESULT Delete(LPCTSTR szBasePrj,LPCTSTR szRelSpec);
  24. HRESULT Sync(LPCTSTR szBasePrj,LPCTSTR szDir,LPCTSTR szRelSpec,LPCTSTR szFileSpec = NULL);
  25. HRESULT Sync2(LPCTSTR szPrj,LPCTSTR szFileName,LPCTSTR szFileSpec);
  26. HRESULT GetLocalWritable(LPCTSTR szFileSpec,LPCTSTR szBasePrj,LPCTSTR szRelSpec);
  27. // init/shutdown
  28. HRESULT NewInit(LPCTSTR szVSSRootPrj);
  29. HRESULT ShutDown();
  30. // ctor/dtor
  31. CVerEngine();
  32. virtual ~CVerEngine();
  33. private:
  34. // private methods
  35. HRESULT GetPrjEx(LPCTSTR szPrj,IVSSItem **hIPrj,bool bCreate);
  36. HRESULT GetItemEx(LPCTSTR szItem,IVSSItem **hIItem,bool bCreate);
  37. HRESULT Add(LPCTSTR szItem,LPCTSTR szFileSpec);
  38. HRESULT CheckIn(IVSSItem *pIItem,LPCTSTR szFileSpec);
  39. HRESULT CheckOutNoGet(IVSSItem *pIItem);
  40. HRESULT CheckOutGet(IVSSItem *pIItem);
  41. HRESULT CheckOutLocal(IVSSItem *pIItem,LPCTSTR szFileSpec);
  42. // helper
  43. void MakePrjSpec(wstring &szDest,LPCTSTR szSource);
  44. void EliminateCommon(list<wstring> &ListOne, list<wstring> &ListTwo);
  45. CComPtr<IVSSDatabase> m_pIDB;
  46. CComBSTR m_bstrSrcSafeIni;
  47. CComBSTR m_bstrUsername;
  48. CComBSTR m_bstrPassword;
  49. wstring m_szVSSRootPrj;
  50. };
  51. #endif // !defined(AFX_VERENGINE_H__EC78FB59_EF1C_11D0_A42F_00C04FB99B01__INCLUDED_)