void CommandData::ReadConfig() { StringList List; if (ReadTextFile(DefConfigName,&List,true)) { wchar *Str; while ((Str=List.GetString())!=NULL) { while (IsSpace(*Str)) Str++; if (wcsnicomp(Str,L"switches=",9)==0) ProcessSwitchesString(Str+9); if (*Command!=0) { wchar Cmd[16]; wcsncpyz(Cmd,Command,ASIZE(Cmd)); wchar C0=toupperw(Cmd[0]); wchar C1=toupperw(Cmd[1]); if (C0=='I' || C0=='L' || C0=='M' || C0=='S' || C0=='V') Cmd[1]=0; if (C0=='R' && (C1=='R' || C1=='V')) Cmd[2]=0; wchar SwName[16+ASIZE(Cmd)]; swprintf(SwName,ASIZE(SwName),L"switches_%ls=",Cmd); size_t Length=wcslen(SwName); if (wcsnicomp(Str,SwName,Length)==0) ProcessSwitchesString(Str+Length); } } } }
void CommandData::ParseEnvVar() { char *EnvStr=getenv("RAR"); if (EnvStr!=NULL) { ProcessSwitchesString(EnvStr); } }
void CommandData::ParseEnvVar() { char *EnvStr=getenv("RAR"); if (EnvStr!=NULL) { Array<wchar> EnvStrW(strlen(EnvStr)+1); CharToWide(EnvStr,&EnvStrW[0],EnvStrW.Size()); ProcessSwitchesString(&EnvStrW[0]); } }
void CommandData::ReadConfig(int argc,char *argv[]) { StringList List; if (ReadTextFile((char *) DefConfigName,&List,true)) { char *Str; while ((Str=List.GetString())!=NULL) if (strnicomp(Str,"switches=",9)==0) ProcessSwitchesString(Str+9); } }
void CommandData::ReadConfig() { StringList List; if (ReadTextFile(DefConfigName,NULL,&List,true)) { char *Str; while ((Str=List.GetString())!=NULL) { while (IsSpace(*Str)) Str++; if (strnicomp(Str,"switches=",9)==0) ProcessSwitchesString(Str+9); } } }