OSDN Git Service

made wingit.dll delay load so that PATH can be inited with git/bin dir before dll...
[tortoisegit/TortoiseGitJp.git] / src / Git / Git.h
1 #pragma once\r
2 #include "GitType.h"\r
3 #include "GitRev.h"\r
4 #include "GitStatus.h"\r
5 #include "GitAdminDir.h"\r
6 \r
7 \r
8 class CGit\r
9 {\r
10 private:\r
11         GitAdminDir m_GitDir;\r
12 public:\r
13         static BOOL CheckMsysGitDir();\r
14         static CString ms_LastMsysGitDir;       // the last msysgitdir added to the path, blank if none\r
15 \r
16 //      static CString m_MsysGitPath;\r
17         CGit(void);\r
18         ~CGit(void);\r
19         \r
20         int Run(CString cmd, CString* output,int code);\r
21         int Run(CString cmd, BYTE_VECTOR *byte_array);\r
22 \r
23         int RunAsync(CString cmd,PROCESS_INFORMATION *pi, HANDLE* hRead, CString *StdioFile=NULL);\r
24         int RunLogFile(CString cmd, CString &filename);\r
25         CString GetUserName(void);\r
26         CString GetUserEmail(void);\r
27         CString GetCurrentBranch(void);\r
28 \r
29         bool SetCurrentDir(CString path)\r
30         {\r
31                 return m_GitDir.HasAdminDir(path,&m_CurrentDir);\r
32         }\r
33         CString m_CurrentDir;\r
34 \r
35         typedef enum\r
36         {\r
37                 BRANCH_LOCAL=0x1,\r
38                 BRANCH_REMOTE=0x2,\r
39                 BRANCH_ALL=BRANCH_LOCAL|BRANCH_REMOTE,\r
40         }BRANCH_TYPE;\r
41 \r
42         typedef enum\r
43         {\r
44                 LOG_INFO_STAT=0x1,\r
45                 LOG_INFO_FILESTATE=0x2,\r
46                 LOG_INFO_PATCH=0x4,\r
47                 LOG_INFO_FULLHISTORY=0x8,\r
48                 LOG_INFO_BOUNDARY=0x10,\r
49         LOG_INFO_ALL_BRANCH=0x20,\r
50                 LOG_INFO_ONLY_HASH=0x40,\r
51                 LOG_INFO_DETECT_RENAME=0x80,\r
52                 LOG_INFO_DETECT_COPYRENAME=0x100\r
53         }LOG_INFO_MASK;\r
54 \r
55         int GetRemoteList(STRING_VECTOR &list);\r
56         int GetBranchList(STRING_VECTOR &list, int *Current,BRANCH_TYPE type=BRANCH_LOCAL);\r
57         int GetTagList(STRING_VECTOR &list);\r
58         int GetMapHashToFriendName(MAP_HASH_NAME &map);\r
59         \r
60         //hash is empty means all. -1 means all\r
61         int GetLog(BYTE_VECTOR& logOut,CString &hash, CTGitPath *path = NULL,int count=-1,int InfoMask=LOG_INFO_STAT|LOG_INFO_FILESTATE|LOG_INFO_BOUNDARY|LOG_INFO_DETECT_COPYRENAME);\r
62 \r
63         git_revnum_t GetHash(CString &friendname);\r
64 \r
65         int BuildOutputFormat(CString &format,bool IsFull=TRUE);\r
66         //int GetShortLog(CString &log,CTGitPath * path=NULL, int count =-1);\r
67         static void StringAppend(CString *str,BYTE *p,int code=CP_UTF8,int length=-1);\r
68 \r
69         BOOL IsInitRepos();\r
70         \r
71 };\r
72 extern void GetTempPath(CString &path);\r
73 extern CString GetTempFile();\r
74 \r
75 \r
76 extern CGit g_Git;