}\r
int findData(const BYTE* dataToFind, size_t dataSize, int start=0)\r
{\r
+ //Pre checks\r
+ if(empty())\r
+ return -1;\r
+ if(dataSize==0)\r
+ return 0;\r
+ if(dataSize>size()-start)\r
+ return -1;//Data to find is greater then data to search in. No match\r
+\r
+ //Initialize\r
const BYTE* pos=&*(begin()+start);\r
- const BYTE* dataEnd=&*(begin()+size()-(dataSize-1) );//Set end one step after last place to search\r
+ const BYTE* dataEnd=&*(begin()+(size()-dataSize) );++dataEnd;//Set end one step after last place to search\r
if(pos>=dataEnd)\r
return -1;//Started over end. Return not found\r
if(dataSize==0)\r
};\r
typedef std::vector<CString> STRING_VECTOR;\r
typedef std::map<CString, STRING_VECTOR> MAP_HASH_NAME;\r
-typedef CGitByteArray BYTE_VECTOR;
\ No newline at end of file
+typedef CGitByteArray BYTE_VECTOR;\r
+\r