MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / IsProcessFile

Method IsProcessFile

Libraries/unrar/cmdfilter.cpp:277–308  ·  view source on GitHub ↗

Return 0 if file must not be processed or a number of matched parameter otherwise.

Source from the content-addressed store, hash-verified

275
276// Return 0 if file must not be processed or a number of matched parameter otherwise.
277int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType,
278 bool Flags,wchar *MatchedArg,uint MatchedArgSize)
279{
280 if (MatchedArg!=NULL && MatchedArgSize>0)
281 *MatchedArg=0;
282 bool Dir=FileHead.Dir;
283 if (ExclCheck(FileHead.FileName,Dir,false,true))
284 return 0;
285#ifndef SFX_MODULE
286 if (TimeCheck(FileHead.mtime,FileHead.ctime,FileHead.atime))
287 return 0;
288 if ((FileHead.FileAttr & ExclFileAttr)!=0 || FileHead.Dir && ExclDir)
289 return 0;
290 if (InclAttrSet && (!FileHead.Dir && (FileHead.FileAttr & InclFileAttr)==0 ||
291 FileHead.Dir && !InclDir))
292 return 0;
293 if (!Dir && SizeCheck(FileHead.UnpSize))
294 return 0;
295#endif
296 wchar *ArgName;
297 FileArgs.Rewind();
298 for (int StringCount=1;(ArgName=FileArgs.GetString())!=NULL;StringCount++)
299 if (CmpName(ArgName,FileHead.FileName,MatchType))
300 {
301 if (ExactMatch!=NULL)
302 *ExactMatch=wcsicompc(ArgName,FileHead.FileName)==0;
303 if (MatchedArg!=NULL)
304 wcsncpyz(MatchedArg,ArgName,MatchedArgSize);
305 return StringCount;
306 }
307 return 0;
308}
309
310
311#if !defined(SFX_MODULE)

Callers 2

ListArchiveFunction · 0.80
ExtractCurrentFileMethod · 0.80

Calls 5

CmpNameFunction · 0.85
wcsicompcFunction · 0.85
wcsncpyzFunction · 0.85
GetStringMethod · 0.80
RewindMethod · 0.45

Tested by

no test coverage detected