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

Method ReadConfig

Libraries/unrar/cmddata.cpp:223–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222#if !defined(SFX_MODULE)
223void CommandData::ReadConfig()
224{
225 StringList List;
226 if (ReadTextFile(DefConfigName,&List,true))
227 {
228 wchar *Str;
229 while ((Str=List.GetString())!=NULL)
230 {
231 while (IsSpace(*Str))
232 Str++;
233 if (wcsnicomp(Str,L"switches=",9)==0)
234 ProcessSwitchesString(Str+9);
235 if (*Command!=0)
236 {
237 wchar Cmd[16];
238 wcsncpyz(Cmd,Command,ASIZE(Cmd));
239 wchar C0=toupperw(Cmd[0]);
240 wchar C1=toupperw(Cmd[1]);
241 if (C0=='I' || C0=='L' || C0=='M' || C0=='S' || C0=='V')
242 Cmd[1]=0;
243 if (C0=='R' && (C1=='R' || C1=='V'))
244 Cmd[2]=0;
245 wchar SwName[16+ASIZE(Cmd)];
246 swprintf(SwName,ASIZE(SwName),L"switches_%ls=",Cmd);
247 size_t Length=wcslen(SwName);
248 if (wcsnicomp(Str,SwName,Length)==0)
249 ProcessSwitchesString(Str+Length);
250 }
251 }
252 }
253}
254#endif
255
256

Callers 1

mainFunction · 0.80

Calls 6

ReadTextFileFunction · 0.85
IsSpaceFunction · 0.85
wcsnicompFunction · 0.85
wcsncpyzFunction · 0.85
toupperwFunction · 0.85
GetStringMethod · 0.80

Tested by

no test coverage detected