using System; namespace SabreTools.Library.Data { #region Archival /// /// Determines the level to scan archives at /// [Flags] public enum ArchiveScanLevel { // 7zip SevenZipExternal = 1 << 0, SevenZipInternal = 1 << 1, SevenZipBoth = SevenZipExternal | SevenZipInternal, // GZip GZipExternal = 1 << 2, GZipInternal = 1 << 3, GZipBoth = GZipExternal | GZipInternal, // RAR RarExternal = 1 << 4, RarInternal = 1 << 5, RarBoth = RarExternal | RarInternal, // Zip ZipExternal = 1 << 6, ZipInternal = 1 << 7, ZipBoth = ZipExternal | ZipInternal, // Tar TarExternal = 1 << 8, TarInternal = 1 << 9, TarBoth = TarExternal | TarInternal, } /// /// Determines the archive general bit flags /// [Flags] public enum GeneralPurposeBitFlag : ushort { Encrypted = 1 << 0, ZeroedCRCAndSize = 1 << 3, CompressedPatchedData = 1 << 5, StrongEncryption = 1 << 6, LanguageEncodingFlag = 1 << 11, EncryptedCentralDirectory = 1 << 13, // For Method 6 - Imploding Imploding8KSlidingDictionary = 1 << 1, Imploding3ShannonFanoTrees = 1 << 2, // For Methods 8 and 9 - Deflating DeflatingMaximumCompression = 1 << 1, DeflatingFastCompression = 1 << 2, DeflatingSuperFastCompression = 1 << 1 | 1 << 2, EnhancedDeflating = 1 << 4, // For Method 14 - LZMA LZMAEOSMarkerUsed = 1 << 1, // Reserved and unused (SHOULD NOT BE USED) Bit7 = 1 << 7, Bit8 = 1 << 8, Bit9 = 1 << 9, Bit10 = 1 << 10, Bit12 = 1 << 12, // Reserved by PKWARE for enhanced compression Bit14 = 1 << 14, // Reserved by PKWARE Bit15 = 1 << 15, // Reserved by PKWARE } /// /// Internal file attributes used by archives /// [Flags] public enum InternalFileAttributes : ushort { ASCIIOrTextFile = 1 << 0, RecordLengthControl = 1 << 1, // Reserved and unused (SHOULD NOT BE USED) Bit1 = 1 << 1, Bit2 = 1 << 2, } /// /// RAR archive flags /// [Flags] public enum RarArchiveFlags : uint { /// /// Volume. Archive is a part of multivolume set. /// Volume = 1 << 0, /// /// Volume number field is present. This flag is present in all volumes except first. /// VolumeNumberField = 1 << 1, /// /// Solid archive. /// Solid = 1 << 2, /// /// Recovery record is present. /// RecoveryRecordPresent = 1 << 3, /// /// Locked archive. /// Locked = 1 << 4, } /// /// RAR entry encryption flags /// [Flags] public enum RarEncryptionFlags : uint { PasswordCheckDataPresent = 1 << 0, UseTweakedChecksums = 1 << 1, /* If flag 0x0002 is present, RAR transforms the checksum preserving file or service data integrity, so it becomes dependent on encryption key. It makes guessing file contents based on checksum impossible. It affects both data CRC32 in file header and checksums in file hash record in extra area. */ } /// /// RAR file flags /// [Flags] public enum RarFileFlags : uint { /// /// Directory file system object (file header only) /// Directory = 1 << 0, /// /// Time field in Unix format is present /// TimeInUnix = 1 << 1, /// /// CRC32 field is present /// CRCPresent = 1 << 2, /// /// Unpacked size is unknown /// UnpackedSizeUnknown = 1 << 3, /* If flag 0x0008 is set, unpacked size field is still present, but must be ignored and extraction must be performed until reaching the end of compression stream. This flag can be set if actual file size is larger than reported by OS or if file size is unknown such as for all volumes except last when archiving from stdin to multivolume archive */ } /// /// RAR header flags /// [Flags] public enum RarHeaderFlags : uint { /// /// Extra area is present in the end of header /// ExtraAreaPresent = 1 << 0, /// /// Data area is present in the end of header /// DataAreaPresent = 1 << 1, /// /// Blocks with unknown type and this flag must be skipped when updating an archive /// BlocksWithUnknownType = 1 << 2, /// /// Data area is continuing from previous volume /// DataAreaContinuingFromPrevious = 1 << 3, /// /// Data area is continuing in next volume /// DataAreaContinuingToNext = 1 << 4, /// /// Block depends on preceding file block /// BlockDependsOnPreceding = 1 << 5, /// /// Preserve a child block if host block is modified /// PreserveChildBlock = 1 << 6, } [Flags] public enum RarUnixOwnerRecordFlags : uint { UserNameStringIsPresent = 1 << 0, GroupNameStringIsPresent = 1 << 1, NumericUserIdIsPresent = 1 << 2, NumericGroupIdIsPresent = 1 << 3, } /// /// RAR entry time flags /// [Flags] public enum RarTimeFlags : uint { TimeInUnixFormat = 1 << 0, ModificationTimePresent = 1 << 1, CreationTimePresent = 1 << 2, LastAccessTimePresent = 1 << 3, } #endregion #region DatFile related /// /// DAT output formats /// [Flags] public enum DatFormat { #region XML Formats /// /// Logiqx XML (using machine) /// Logiqx = 1 << 0, /// /// Logiqx XML (using game) /// LogiqxDeprecated = 1 << 1, /// /// MAME Softare List XML /// SoftwareList = 1 << 2, /// /// MAME Listxml output /// Listxml = 1 << 3, /// /// OfflineList XML /// OfflineList = 1 << 4, /// /// SabreDat XML /// SabreDat = 1 << 5, /// /// openMSX Software List XML /// OpenMSX = 1 << 6, #endregion #region Propietary Formats /// /// ClrMamePro custom /// ClrMamePro = 1 << 7, /// /// RomCetner INI-based /// RomCenter = 1 << 8, /// /// DOSCenter custom /// DOSCenter = 1 << 9, /// /// AttractMode custom /// AttractMode = 1 << 10, #endregion #region Standardized Text Formats /// /// ClrMamePro missfile /// MissFile = 1 << 11, /// /// Comma-Separated Values (standardized) /// CSV = 1 << 12, /// /// Semicolon-Separated Values (standardized) /// SSV = 1 << 13, /// /// Tab-Separated Values (standardized) /// TSV = 1 << 14, /// /// MAME Listrom output /// Listrom = 1 << 15, /// /// Everdrive Packs SMDB /// EverdriveSMDB = 1 << 16, /// /// JSON /// Json = 1 << 17, #endregion #region SFV-similar Formats /// /// CRC32 hash list /// RedumpSFV = 1 << 18, /// /// MD5 hash list /// RedumpMD5 = 1 << 19, #if NET_FRAMEWORK /// /// RIPEMD160 hash list /// RedumpRIPEMD160 = 1 << 20, #endif /// /// SHA-1 hash list /// RedumpSHA1 = 1 << 21, /// /// SHA-256 hash list /// RedumpSHA256 = 1 << 22, /// /// SHA-384 hash list /// RedumpSHA384 = 1 << 23, /// /// SHA-512 hash list /// RedumpSHA512 = 1 << 24, #endregion // Specialty combinations ALL = Int32.MaxValue, } /// /// Available hashing types /// [Flags] public enum Hash { CRC = 1 << 0, MD5 = 1 << 1, #if NET_FRAMEWORK RIPEMD160 = 1 << 2, #endif SHA1 = 1 << 3, SHA256 = 1 << 4, SHA384 = 1 << 5, SHA512 = 1 << 6, // Special combinations Standard = CRC | MD5 | SHA1, #if NET_FRAMEWORK DeepHashes = SHA256 | SHA384 | SHA512, SecureHashes = MD5 | RIPEMD160 | SHA1 | SHA256 | SHA384 | SHA512, #else DeepHashes = SHA256 | SHA384 | SHA512, SecureHashes = MD5 | SHA1 | SHA256 | SHA384 | SHA512, #endif } /// /// Determine which format to output Stats to /// [Flags] public enum StatReportFormat { /// /// Only output to the console /// None = 0x00, /// /// Console-formatted /// Textfile = 1 << 0, /// /// ClrMamePro HTML /// HTML = 1 << 1, /// /// Comma-Separated Values (Standardized) /// CSV = 1 << 2, /// /// Semicolon-Separated Values (Standardized) /// SSV = 1 << 3, /// /// Tab-Separated Values (Standardized) /// TSV = 1 << 4, All = Int32.MaxValue, } /// /// Determines how the DAT will be split on output /// [Flags] public enum SplittingMode { None = 0x00, Extension = 1 << 0, Hash = 1 << 2, Level = 1 << 3, Type = 1 << 4, Size = 1 << 5, } /// /// Determines special update modes /// [Flags] public enum UpdateMode { None = 0x00, // Standard diffs DiffDupesOnly = 1 << 0, DiffNoDupesOnly = 1 << 1, DiffIndividualsOnly = 1 << 2, // Cascaded diffs DiffCascade = 1 << 3, DiffReverseCascade = 1 << 4, // Base diffs DiffAgainst = 1 << 5, // Special update modes Merge = 1 << 6, BaseReplace = 1 << 7, ReverseBaseReplace = 1 << 8, // Combinations AllDiffs = DiffDupesOnly | DiffNoDupesOnly | DiffIndividualsOnly, } #endregion #region DatItem related /// /// Determines which type of duplicate a file is /// [Flags] public enum DupeType { // Type of match Hash = 1 << 0, All = 1 << 1, // Location of match Internal = 1 << 2, External = 1 << 3, } /// /// Determine the status of the item /// [Flags] public enum ItemStatus { /// /// This is a fake flag that is used for filter only /// NULL = 0x00, None = 1 << 0, Good = 1 << 1, BadDump = 1 << 2, Nodump = 1 << 3, Verified = 1 << 4, } /// /// Determine what type of machine it is /// [Flags] public enum MachineType { /// /// This is a fake flag that is used for filter only /// NULL = 0x00, None = 1 << 0, Bios = 1 << 1, Device = 1 << 2, Mechanical = 1 << 3, } #endregion }