Return 0 if file must not be processed or a number of matched parameter otherwise.
| 275 | |
| 276 | // Return 0 if file must not be processed or a number of matched parameter otherwise. |
| 277 | int 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) |