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

Method SetTimeFilters

Libraries/unrar/cmdfilter.cpp:127–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126#if !defined(SFX_MODULE)
127void CommandData::SetTimeFilters(const wchar *Mod,bool Before,bool Age)
128{
129 bool ModeOR=false,TimeMods=false;
130 const wchar *S=Mod;
131 // Check if any 'mca' modifiers are present, set OR mode if 'o' is present,
132 // skip modifiers and set S to beginning of time string. Be sure to check
133 // *S!=0, because termination 0 is a part of string for wcschr.
134 for (;*S!=0 && wcschr(L"MCAOmcao",*S)!=NULL;S++)
135 if (*S=='o' || *S=='O')
136 ModeOR=true;
137 else
138 TimeMods=true;
139
140 if (!TimeMods) // Assume 'm' if no modifiers are specified.
141 Mod=L"m";
142
143 // Set the specified time for every modifier. Be sure to check *Mod!=0,
144 // because termination 0 is a part of string for wcschr. This check is
145 // important when we set Mod to "m" above.
146 for (;*Mod!=0 && wcschr(L"MCAOmcao",*Mod)!=NULL;Mod++)
147 switch(toupperw(*Mod))
148 {
149 case 'M':
150 if (Before)
151 {
152 Age ? FileMtimeBefore.SetAgeText(S):FileMtimeBefore.SetIsoText(S);
153 FileMtimeBeforeOR=ModeOR;
154 }
155 else
156 {
157 Age ? FileMtimeAfter.SetAgeText(S):FileMtimeAfter.SetIsoText(S);
158 FileMtimeAfterOR=ModeOR;
159 }
160 break;
161 case 'C':
162 if (Before)
163 {
164 Age ? FileCtimeBefore.SetAgeText(S):FileCtimeBefore.SetIsoText(S);
165 FileCtimeBeforeOR=ModeOR;
166 }
167 else
168 {
169 Age ? FileCtimeAfter.SetAgeText(S):FileCtimeAfter.SetIsoText(S);
170 FileCtimeAfterOR=ModeOR;
171 }
172 break;
173 case 'A':
174 if (Before)
175 {
176 Age ? FileAtimeBefore.SetAgeText(S):FileAtimeBefore.SetIsoText(S);
177 FileAtimeBeforeOR=ModeOR;
178 }
179 else
180 {
181 Age ? FileAtimeAfter.SetAgeText(S):FileAtimeAfter.SetIsoText(S);
182 FileAtimeAfterOR=ModeOR;
183 }
184 break;

Callers

nothing calls this directly

Calls 3

toupperwFunction · 0.85
SetAgeTextMethod · 0.80
SetIsoTextMethod · 0.80

Tested by

no test coverage detected