|
| 1 | +namespace ReScene.NET.Models; |
| 2 | + |
| 3 | +/// <summary> |
| 4 | +/// Serializable snapshot of all user-editable fields and options on the RAR Reconstructor tab. |
| 5 | +/// </summary> |
| 6 | +public sealed class ReconstructorConfig |
| 7 | +{ |
| 8 | + public int Version { get; set; } = 1; |
| 9 | + |
| 10 | + // Paths |
| 11 | + public string WinRarPath { get; set; } = string.Empty; |
| 12 | + public string ReleasePath { get; set; } = string.Empty; |
| 13 | + public string VerificationPath { get; set; } = string.Empty; |
| 14 | + public string OutputPath { get; set; } = string.Empty; |
| 15 | + |
| 16 | + // RAR Versions |
| 17 | + public bool Version2 { get; set; } |
| 18 | + public bool Version3 { get; set; } = true; |
| 19 | + public bool Version4 { get; set; } = true; |
| 20 | + public bool Version5 { get; set; } = true; |
| 21 | + public bool Version6 { get; set; } = true; |
| 22 | + public bool Version7 { get; set; } |
| 23 | + |
| 24 | + // Compression Method |
| 25 | + public bool SwitchM0 { get; set; } |
| 26 | + public bool SwitchM1 { get; set; } |
| 27 | + public bool SwitchM2 { get; set; } |
| 28 | + public bool SwitchM3 { get; set; } = true; |
| 29 | + public bool SwitchM4 { get; set; } |
| 30 | + public bool SwitchM5 { get; set; } |
| 31 | + |
| 32 | + // Archive Format |
| 33 | + public bool SwitchMA4 { get; set; } |
| 34 | + public bool SwitchMA5 { get; set; } |
| 35 | + |
| 36 | + // Dictionary Size |
| 37 | + public bool SwitchMD64K { get; set; } |
| 38 | + public bool SwitchMD128K { get; set; } |
| 39 | + public bool SwitchMD256K { get; set; } |
| 40 | + public bool SwitchMD512K { get; set; } |
| 41 | + public bool SwitchMD1024K { get; set; } |
| 42 | + public bool SwitchMD2048K { get; set; } |
| 43 | + public bool SwitchMD4096K { get; set; } = true; |
| 44 | + public bool SwitchMD8M { get; set; } |
| 45 | + public bool SwitchMD16M { get; set; } |
| 46 | + public bool SwitchMD32M { get; set; } |
| 47 | + public bool SwitchMD64M { get; set; } |
| 48 | + public bool SwitchMD128M { get; set; } |
| 49 | + public bool SwitchMD256M { get; set; } |
| 50 | + public bool SwitchMD512M { get; set; } |
| 51 | + public bool SwitchMD1G { get; set; } |
| 52 | + |
| 53 | + // Timestamps — Modification |
| 54 | + public bool SwitchTSM0 { get; set; } |
| 55 | + public bool SwitchTSM1 { get; set; } |
| 56 | + public bool SwitchTSM2 { get; set; } |
| 57 | + public bool SwitchTSM3 { get; set; } |
| 58 | + public bool SwitchTSM4 { get; set; } |
| 59 | + |
| 60 | + // Timestamps — Creation |
| 61 | + public bool SwitchTSC0 { get; set; } |
| 62 | + public bool SwitchTSC1 { get; set; } |
| 63 | + public bool SwitchTSC2 { get; set; } |
| 64 | + public bool SwitchTSC3 { get; set; } |
| 65 | + public bool SwitchTSC4 { get; set; } |
| 66 | + |
| 67 | + // Timestamps — Access |
| 68 | + public bool SwitchTSA0 { get; set; } |
| 69 | + public bool SwitchTSA1 { get; set; } |
| 70 | + public bool SwitchTSA2 { get; set; } |
| 71 | + public bool SwitchTSA3 { get; set; } |
| 72 | + public bool SwitchTSA4 { get; set; } |
| 73 | + |
| 74 | + // Other Options |
| 75 | + public bool SwitchAI { get; set; } |
| 76 | + public bool SwitchR { get; set; } = true; |
| 77 | + public bool SwitchDS { get; set; } |
| 78 | + public bool SwitchSDash { get; set; } |
| 79 | + public bool SwitchMT { get; set; } |
| 80 | + public int SwitchMTStart { get; set; } = 1; |
| 81 | + public int SwitchMTEnd { get; set; } = Environment.ProcessorCount; |
| 82 | + |
| 83 | + // Volume |
| 84 | + public bool SwitchV { get; set; } |
| 85 | + public string VolumeSize { get; set; } = "15000"; |
| 86 | + public int VolumeSizeUnitIndex { get; set; } = 1; |
| 87 | + public bool UseOldVolumeNaming { get; set; } |
| 88 | + |
| 89 | + // File attributes |
| 90 | + public bool? FileA { get; set; } = false; |
| 91 | + public bool? FileI { get; set; } = false; |
| 92 | + |
| 93 | + // Output options |
| 94 | + public bool DeleteRARFiles { get; set; } |
| 95 | + public bool DeleteDuplicateCRCFiles { get; set; } = true; |
| 96 | + public bool StopOnFirstMatch { get; set; } = true; |
| 97 | + public bool CompleteAllVolumes { get; set; } |
| 98 | + public bool RenameToOriginal { get; set; } |
| 99 | + |
| 100 | + // Header patching |
| 101 | + public bool EnableHostOSPatching { get; set; } = true; |
| 102 | + |
| 103 | + /// <summary> |
| 104 | + /// Snapshot of the SRR-imported state (timestamps, CRCs, comment, detected flags, …). |
| 105 | + /// Null when no SRR has been imported yet. |
| 106 | + /// </summary> |
| 107 | + public ImportedSrrState? ImportedSrr { get; set; } |
| 108 | +} |
| 109 | + |
| 110 | +/// <summary> |
| 111 | +/// Persisted snapshot of state captured by Import-from-SRR. |
| 112 | +/// </summary> |
| 113 | +public sealed class ImportedSrrState |
| 114 | +{ |
| 115 | + public string? SRRFilePath { get; set; } |
| 116 | + |
| 117 | + public List<string> ArchiveFiles { get; set; } = []; |
| 118 | + public List<string> ArchiveDirectories { get; set; } = []; |
| 119 | + |
| 120 | + public Dictionary<string, DateTime> DirTimestamps { get; set; } = []; |
| 121 | + public Dictionary<string, DateTime> DirCreationTimes { get; set; } = []; |
| 122 | + public Dictionary<string, DateTime> DirAccessTimes { get; set; } = []; |
| 123 | + public Dictionary<string, DateTime> FileTimestamps { get; set; } = []; |
| 124 | + public Dictionary<string, DateTime> FileCreationTimes { get; set; } = []; |
| 125 | + public Dictionary<string, DateTime> FileAccessTimes { get; set; } = []; |
| 126 | + |
| 127 | + public Dictionary<string, string> ArchiveFileCrcs { get; set; } = []; |
| 128 | + |
| 129 | + public List<string> OriginalRarFileNames { get; set; } = []; |
| 130 | + |
| 131 | + public string? ArchiveComment { get; set; } |
| 132 | + public byte[]? ArchiveCommentBytes { get; set; } |
| 133 | + public byte[]? CmtCompressedData { get; set; } |
| 134 | + public byte? CmtCompressionMethod { get; set; } |
| 135 | + |
| 136 | + public byte? DetectedFileHostOS { get; set; } |
| 137 | + public uint? DetectedFileAttributes { get; set; } |
| 138 | + public byte? DetectedCmtHostOS { get; set; } |
| 139 | + public uint? DetectedCmtFileTime { get; set; } |
| 140 | + public uint? DetectedCmtFileAttributes { get; set; } |
| 141 | + public bool? DetectedLargeFlag { get; set; } |
| 142 | + public uint? DetectedHighPackSize { get; set; } |
| 143 | + public uint? DetectedHighUnpSize { get; set; } |
| 144 | + |
| 145 | + public string CustomPackerType { get; set; } = "None"; |
| 146 | + public string? CustomPackerWarning { get; set; } |
| 147 | +} |
0 commit comments