7 GIT_ERROR_CREATE_PROCESS
,
8 GIT_ERROR_GET_EXIT_CODE
11 extern BOOL g_IsWingitDllload
;
13 class CGitByteArray
:public std::vector
<BYTE
>
16 int find(BYTE data
,int start
=0)
18 for(int i
=start
;i
<size();i
++)
23 int findNextString(int start
=0)
41 int findData(const BYTE
* dataToFind
, size_t dataSize
, int start
=0)
48 if(dataSize
>size()-start
)
49 return -1;//Data to find is greater then data to search in. No match
52 const BYTE
* pos
=&*(begin()+start
);
53 const BYTE
* dataEnd
=&*(begin()+(size()-dataSize
) );++dataEnd
;//Set end one step after last place to search
55 return -1;//Started over end. Return not found
57 return start
;//No search data. Return current position
58 BYTE firstByte
=dataToFind
[0];
61 //memchr for first character
62 const BYTE
* found
=(const BYTE
*)memchr(pos
,firstByte
,dataEnd
-pos
);
65 //check rest of characters
66 if(memcmp(found
,dataToFind
,dataSize
)==0)
67 return found
-&*begin();//Match. Return position.
68 //No match. Set position on next byte and continue search
73 int append( std::vector
<BYTE
> &v
,int start
=0,int end
=-1)
77 for(int i
=start
;i
<end
;i
++)
78 this->push_back(v
[i
]);
81 int append(const BYTE
* data
, size_t dataSize
)
83 size_t oldsize
=size();
84 resize(oldsize
+dataSize
);
85 memcpy(&*(begin()+oldsize
),data
,dataSize
);
89 typedef std::vector
<CString
> STRING_VECTOR
;
90 typedef std::map
<CString
, STRING_VECTOR
> MAP_HASH_NAME
;
91 typedef CGitByteArray BYTE_VECTOR
;