1
0

cmddata.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _RAR_CMDDATA_
  2. #define _RAR_CMDDATA_
  3. #define DefaultStoreList L"7z;ace;arj;bz2;cab;gz;jpeg;jpg;lha;lz;lzh;mp3;rar;taz;tgz;xz;z;zip;zipx"
  4. enum RAR_CMD_LIST_MODE {RCLM_AUTO,RCLM_REJECT_LISTS,RCLM_ACCEPT_LISTS};
  5. enum IS_PROCESS_FILE_FLAGS {IPFF_EXCLUDE_PARENT=1};
  6. class CommandData:public RAROptions
  7. {
  8. private:
  9. void ProcessSwitch(const wchar *Switch);
  10. void BadSwitch(const wchar *Switch);
  11. uint GetExclAttr(const wchar *Str,bool &Dir);
  12. #if !defined(SFX_MODULE)
  13. void SetTimeFilters(const wchar *Mod,bool Before,bool Age);
  14. void SetStoreTimeMode(const wchar *S);
  15. #endif
  16. bool FileLists;
  17. bool NoMoreSwitches;
  18. RAR_CMD_LIST_MODE ListMode;
  19. bool BareOutput;
  20. public:
  21. CommandData();
  22. void Init();
  23. void ParseCommandLine(bool Preprocess,int argc, char *argv[]);
  24. void ParseArg(wchar *ArgW);
  25. void ParseDone();
  26. void ParseEnvVar();
  27. void ReadConfig();
  28. void PreprocessArg(const wchar *Arg);
  29. void ProcessSwitchesString(const wchar *Str);
  30. void OutTitle();
  31. void OutHelp(RAR_EXIT ExitCode);
  32. bool IsSwitch(int Ch);
  33. bool ExclCheck(const wchar *CheckName,bool Dir,bool CheckFullPath,bool CheckInclList);
  34. static bool CheckArgs(StringList *Args,bool Dir,const wchar *CheckName,bool CheckFullPath,int MatchMode);
  35. bool ExclDirByAttr(uint FileAttr);
  36. bool TimeCheck(RarTime &ftm,RarTime &ftc,RarTime &fta);
  37. bool SizeCheck(int64 Size);
  38. bool AnyFiltersActive();
  39. int IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType,
  40. bool Flags,wchar *MatchedArg,uint MatchedArgSize);
  41. void ProcessCommand();
  42. void AddArcName(const wchar *Name);
  43. bool GetArcName(wchar *Name,int MaxSize);
  44. bool CheckWinSize();
  45. int GetRecoverySize(const wchar *CmdStr,const wchar *Value,int DefSize);
  46. #ifndef SFX_MODULE
  47. void ReportWrongSwitches(RARFORMAT Format);
  48. #endif
  49. wchar Command[NM+16];
  50. wchar ArcName[NM];
  51. StringList FileArgs;
  52. StringList ExclArgs;
  53. StringList InclArgs;
  54. StringList ArcNames;
  55. StringList StoreArgs;
  56. };
  57. #endif