OSDN Git Service

Fix Crash Problem When TortoiseGit Install before Msysgit.
[tortoisegit/TortoiseGitJp.git] / src / Git / gittype.h
1 #pragma once\r
2 \r
3 enum\r
4 {\r
5         GIT_SUCCESS=0,\r
6         GIT_ERROR_OPEN_PIP,\r
7         GIT_ERROR_CREATE_PROCESS,\r
8         GIT_ERROR_GET_EXIT_CODE\r
9 };\r
10 \r
11 extern BOOL g_IsWingitDllload;\r
12 \r
13 class CGitByteArray:public std::vector<BYTE>\r
14 {\r
15 public:\r
16         int find(BYTE data,int start=0)\r
17         {\r
18                 for(int i=start;i<size();i++)\r
19                         if( at(i) == data )\r
20                                 return i;\r
21                 return -1;\r
22         }\r
23         int findNextString(int start=0)\r
24         {\r
25                 int pos=start;\r
26                 do\r
27                 {\r
28                         pos=find(0,pos);\r
29                         if(pos >= 0)\r
30                                 pos++;\r
31                         else\r
32                                 break;\r
33 \r
34                         if( pos >= size())\r
35                                 return -1;\r
36 \r
37                 }while(at(pos)==0);\r
38 \r
39                 return pos;\r
40         }\r
41         int append( std::vector<BYTE> &v,int start=0,int end=-1)\r
42         {\r
43                 if(end<0)\r
44                         end=v.size();\r
45                 for(int i=start;i<end;i++)\r
46                         this->push_back(v[i]);\r
47                 return 0;\r
48         }\r
49 };\r
50 typedef std::vector<CString> STRING_VECTOR;\r
51 typedef std::map<CString, STRING_VECTOR> MAP_HASH_NAME;\r
52 typedef CGitByteArray BYTE_VECTOR;