options.hpp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #ifndef _RAR_OPTIONS_
  2. #define _RAR_OPTIONS_
  3. #define DEFAULT_RECOVERY -1
  4. #define DEFAULT_RECVOLUMES -10
  5. enum PATH_EXCL_MODE {
  6. EXCL_UNCHANGED=0, // Process paths as is (default).
  7. EXCL_SKIPWHOLEPATH, // -ep (exclude the path completely)
  8. EXCL_BASEPATH, // -ep1 (exclude the base part of path)
  9. EXCL_SAVEFULLPATH, // -ep2 (the full path without the disk letter)
  10. EXCL_ABSPATH, // -ep3 (the full path with the disk letter)
  11. EXCL_SKIPABSPATH // Works as EXCL_BASEPATH for fully qualified paths
  12. // and as EXCL_UNCHANGED for relative paths.
  13. // Used by WinRAR GUI only.
  14. };
  15. enum {SOLID_NONE=0,SOLID_NORMAL=1,SOLID_COUNT=2,SOLID_FILEEXT=4,
  16. SOLID_VOLUME_DEPENDENT=8,SOLID_VOLUME_INDEPENDENT=16};
  17. enum {ARCTIME_NONE=0,ARCTIME_KEEP,ARCTIME_LATEST};
  18. enum EXTTIME_MODE {
  19. EXTTIME_NONE=0,EXTTIME_1S,EXTTIME_HIGH1,EXTTIME_HIGH2,EXTTIME_HIGH3
  20. };
  21. enum {NAMES_ORIGINALCASE=0,NAMES_UPPERCASE,NAMES_LOWERCASE};
  22. enum MESSAGE_TYPE {MSG_STDOUT=0,MSG_STDERR,MSG_ERRONLY,MSG_NULL};
  23. enum RECURSE_MODE
  24. {
  25. RECURSE_NONE=0, // no recurse switches
  26. RECURSE_DISABLE, // switch -r-
  27. RECURSE_ALWAYS, // switch -r
  28. RECURSE_WILDCARDS, // switch -r0
  29. };
  30. enum OVERWRITE_MODE
  31. {
  32. OVERWRITE_DEFAULT=0, // ask for extraction, silently overwrite for archiving
  33. OVERWRITE_ALL,
  34. OVERWRITE_NONE,
  35. OVERWRITE_AUTORENAME,
  36. OVERWRITE_FORCE_ASK
  37. };
  38. enum RAR_CHARSET { RCH_DEFAULT=0,RCH_ANSI,RCH_OEM,RCH_UNICODE };
  39. #define MAX_FILTERS 16
  40. enum FilterState {FILTER_DEFAULT=0,FILTER_AUTO,FILTER_FORCE,FILTER_DISABLE};
  41. struct FilterMode
  42. {
  43. FilterState State;
  44. int Param1;
  45. int Param2;
  46. };
  47. #define MAX_GENERATE_MASK 128
  48. class RAROptions
  49. {
  50. public:
  51. RAROptions();
  52. ~RAROptions();
  53. void Init();
  54. uint ExclFileAttr;
  55. uint InclFileAttr;
  56. bool InclAttrSet;
  57. uint WinSize;
  58. char TempPath[NM];
  59. bool ConfigDisabled; // Switch -cfg-.
  60. char ExtrPath[NM];
  61. wchar ExtrPathW[NM];
  62. char CommentFile[NM];
  63. wchar CommentFileW[NM];
  64. RAR_CHARSET CommentCharset;
  65. RAR_CHARSET FilelistCharset;
  66. char ArcPath[NM];
  67. wchar ArcPathW[NM];
  68. wchar Password[MAXPASSWORD];
  69. bool EncryptHeaders;
  70. char LogName[NM];
  71. MESSAGE_TYPE MsgStream;
  72. bool Sound;
  73. OVERWRITE_MODE Overwrite;
  74. int Method;
  75. int Recovery;
  76. int RecVolNumber;
  77. bool DisablePercentage;
  78. bool DisableCopyright;
  79. bool DisableDone;
  80. int Solid;
  81. int SolidCount;
  82. bool ClearArc;
  83. bool AddArcOnly;
  84. bool AV;
  85. bool DisableComment;
  86. bool FreshFiles;
  87. bool UpdateFiles;
  88. PATH_EXCL_MODE ExclPath;
  89. RECURSE_MODE Recurse;
  90. int64 VolSize;
  91. Array<int64> NextVolSizes;
  92. uint CurVolNum;
  93. bool AllYes;
  94. bool DisableViewAV;
  95. bool DisableSortSolid;
  96. int ArcTime;
  97. int ConvertNames;
  98. bool ProcessOwners;
  99. bool SaveLinks;
  100. int Priority;
  101. int SleepTime;
  102. bool KeepBroken;
  103. bool OpenShared;
  104. bool DeleteFiles;
  105. #ifndef SFX_MODULE
  106. bool GenerateArcName;
  107. char GenerateMask[MAX_GENERATE_MASK];
  108. #endif
  109. bool SyncFiles;
  110. bool ProcessEA;
  111. bool SaveStreams;
  112. bool SetCompressedAttr;
  113. bool IgnoreGeneralAttr;
  114. RarTime FileTimeBefore;
  115. RarTime FileTimeAfter;
  116. int64 FileSizeLess;
  117. int64 FileSizeMore;
  118. bool OldNumbering;
  119. bool Lock;
  120. bool Test;
  121. bool VolumePause;
  122. FilterMode FilterModes[MAX_FILTERS];
  123. char EmailTo[NM];
  124. uint VersionControl;
  125. bool NoEndBlock;
  126. bool AppendArcNameToPath;
  127. bool Shutdown;
  128. EXTTIME_MODE xmtime;
  129. EXTTIME_MODE xctime;
  130. EXTTIME_MODE xatime;
  131. EXTTIME_MODE xarctime;
  132. char CompressStdin[NM];
  133. #ifdef PACK_SMP
  134. uint Threads;
  135. #endif
  136. #ifdef RARDLL
  137. char DllDestName[NM];
  138. wchar DllDestNameW[NM];
  139. int DllOpMode;
  140. int DllError;
  141. LPARAM UserData;
  142. UNRARCALLBACK Callback;
  143. CHANGEVOLPROC ChangeVolProc;
  144. PROCESSDATAPROC ProcessDataProc;
  145. #endif
  146. };
  147. #endif