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 / 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 class CGitByteArray:public std::vector<BYTE>\r
12 {\r
13 public:\r
14         int find(BYTE data,int start=0)\r
15         {\r
16                 for(int i=start;i<size();i++)\r
17                         if( at(i) == data )\r
18                                 return i;\r
19                 return -1;\r
20         }\r
21         int findNextString(int start=0)\r
22         {\r
23                 int pos=start;\r
24                 do\r
25                 {\r
26                         pos=find(0,pos);\r
27                         if(pos >= 0)\r
28                                 pos++;\r
29                         else\r
30                                 break;\r
31 \r
32                         if( pos >= size())\r
33                                 return -1;\r
34 \r
35                 }while(at(pos)==0);\r
36 \r
37                 return pos;\r
38         }\r
39         int append( std::vector<BYTE> &v,int start=0,int end=-1)\r
40         {\r
41                 if(end<0)\r
42                         end=v.size();\r
43                 for(int i=start;i<end;i++)\r
44                         this->push_back(v[i]);\r
45                 return 0;\r
46         }\r
47 };\r
48 typedef std::vector<CString> STRING_VECTOR;\r
49 typedef std::map<CString, STRING_VECTOR> MAP_HASH_NAME;\r
50 typedef CGitByteArray BYTE_VECTOR;