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

Method TimeCheck

Libraries/unrar/cmdfilter.cpp:192–257  ·  view source on GitHub ↗

Return 'true' if we need to exclude the file from processing.

Source from the content-addressed store, hash-verified

190#ifndef SFX_MODULE
191// Return 'true' if we need to exclude the file from processing.
192bool CommandData::TimeCheck(RarTime &ftm,RarTime &ftc,RarTime &fta)
193{
194 bool FilterOR=false;
195
196 if (FileMtimeBefore.IsSet()) // Filter present.
197 if (ftm>=FileMtimeBefore) // Condition not matched.
198 if (FileMtimeBeforeOR)
199 FilterOR=true; // Not matched OR filter is present.
200 else
201 return true; // Exclude file in AND mode.
202 else // Condition matched.
203 if (FileMtimeBeforeOR)
204 return false; // Include file in OR mode.
205
206 if (FileMtimeAfter.IsSet()) // Filter present.
207 if (ftm<FileMtimeAfter) // Condition not matched.
208 if (FileMtimeAfterOR)
209 FilterOR=true; // Not matched OR filter is present.
210 else
211 return true; // Exclude file in AND mode.
212 else // Condition matched.
213 if (FileMtimeAfterOR)
214 return false; // Include file in OR mode.
215
216 if (FileCtimeBefore.IsSet()) // Filter present.
217 if (ftc>=FileCtimeBefore) // Condition not matched.
218 if (FileCtimeBeforeOR)
219 FilterOR=true; // Not matched OR filter is present.
220 else
221 return true; // Exclude file in AND mode.
222 else // Condition matched.
223 if (FileCtimeBeforeOR)
224 return false; // Include file in OR mode.
225
226 if (FileCtimeAfter.IsSet()) // Filter present.
227 if (ftc<FileCtimeAfter) // Condition not matched.
228 if (FileCtimeAfterOR)
229 FilterOR=true; // Not matched OR filter is present.
230 else
231 return true; // Exclude file in AND mode.
232 else // Condition matched.
233 if (FileCtimeAfterOR)
234 return false; // Include file in OR mode.
235
236 if (FileAtimeBefore.IsSet()) // Filter present.
237 if (fta>=FileAtimeBefore) // Condition not matched.
238 if (FileAtimeBeforeOR)
239 FilterOR=true; // Not matched OR filter is present.
240 else
241 return true; // Exclude file in AND mode.
242 else // Condition matched.
243 if (FileAtimeBeforeOR)
244 return false; // Include file in OR mode.
245
246 if (FileAtimeAfter.IsSet()) // Filter present.
247 if (fta<FileAtimeAfter) // Condition not matched.
248 if (FileAtimeAfterOR)
249 FilterOR=true; // Not matched OR filter is present.

Callers

nothing calls this directly

Calls 1

IsSetMethod · 0.45

Tested by

no test coverage detected