using System;
namespace SabreTools.Data.Models.ISO9660
{
///
/// Enum for VolumeDescriptor.Type
/// All values 4-254 are reserved
///
///
public enum VolumeDescriptorType : byte
{
///
/// Primary Volume Descriptor
///
BOOT_RECORD_VOLUME_DESCRIPTOR = 0x00,
///
/// Primary Volume Descriptor
///
PRIMARY_VOLUME_DESCRIPTOR = 0x01,
///
/// Supplementary Volume Descriptor
///
SUPPLEMENTARY_VOLUME_DESCRIPTOR = 0x02,
///
/// Enhanced Volume Descriptor (including Joliet extensions)
///
ENHANCED_VOLUME_DESCRIPTOR = SUPPLEMENTARY_VOLUME_DESCRIPTOR,
///
/// Volume Partition Descriptor
///
VOLUME_PARTITION_DESCRIPTOR = 0x03,
///
/// Volume Descriptor Set Terminator
///
VOLUME_DESCRIPTOR_SET_TERMINATOR = 0xFF,
}
///
/// Enum for DirectoryRecord.FileFlags
/// Flag 6 (Bit 5 LSB): Reserved: 0
/// Flag 7 (Bit 5 LSB): Reserved: 0
///
///
[Flags]
public enum FileFlags : byte
{
///
/// Flag 1 (Bit 0 LSB): Existence
/// 1 if file should be hidden from the user upon inquiry
/// 0 otherwise
///
EXISTENCE = 0x01,
///
/// Flag 2 (Bit 1 LSB): Directory
/// 1 if the directory Record identifies a directory
/// 0 otherwise
///
DIRECTORY = 0x02,
///
/// Flag 3 (Bit 2 LSB): Associated File
/// 1 if the file is an associated file
/// 0 otherwise
///
ASSOCIATED_FILE = 0x04,
///
/// Flag 4 (Bit 3 LSB): Record
/// 1 if file has record format specified by non-zero record format of extended attribute record
/// 0 otherwise
///
RECORD = 0x08,
///
/// Flag 5 (Bit 4 LSB): Protection
/// 1 if owner/group ID is set for the file and permissions field is set properly
/// 0 otherwise
///
PROTECTION = 0x10,
///
/// Flag 6 (Bit 5 LSB): Reserved by ISO9660
///
RESERVED_BIT5 = 0x20,
///
/// Flag 7 (Bit 6 LSB): Reserved by ISO9660
///
RESERVED_BIT6 = 0x40,
///
/// Flag 8 (Bit 7 LSB): Multi-extent
/// 1 if Directory Extent is not the final record for the file
/// 0 otherwise
///
MULTI_EXTENT = 0x80,
}
///
/// Enum for SupplementaryVolumeDescriptor.VolumeFlags
/// Flag 1 (Bit 0, LSB) is used
/// All other flags/bits are reserved (0x00)
///
///
[Flags]
public enum VolumeFlags : byte
{
///
/// Flag 1 (Bit 0, LSB):
/// 1 if SupplementaryVolumeDescriptor.EscapeSequences has at least 1 unregistered escape sequence
/// 0 if all escape sequences in SupplementaryVolumeDescriptor.EscapeSequences are registered
///
UNREGISTERED_ESCAPE_SEQUENCES = 0x01,
}
///
/// Enum for ExtendedAttributeRecord.Permissions
/// Every 2nd bit is fixed to 1 (i.e. minimum value of 0xAAAA)
///
///
[Flags]
public enum Permissions : ushort
{
///
/// Flag 1 (Bit 0): 1 if system users may not read, 0 otherwise
///
SYSTEM_USER_CANNOT_READ = 0b0000_0000_0000_0001,
///
/// Flag 2 (Bit 2): 1 if system users may not execute, 0 otherwise
///
SYSTEM_USER_CANNOT_EXECUTE = 0b0000_0000_0000_0100,
///
/// Flag 3 (Bit 4): 1 if owner may not read, 0 otherwise
///
OWNER_CANNOT_READ = 0b0000_0000_0001_0000,
///
/// Flag 4 (Bit 6): 1 if owner may not execute, 0 otherwise
///
OWNER_CANNOT_EXECUTE = 0b0000_0000_0100_0000,
///
/// Flag 5 (Bit 8): 1 if group members may not read, 0 otherwise
///
GROUP_MEMBER_CANNOT_READ = 0b0000_0001_0000_0000,
///
/// Flag 6 (Bit 10): 1 if group members may not execute, 0 otherwise
///
GROUP_MEMBER_CANNOT_EXECUTE = 0b0000_0100_0000_0000,
///
/// Flag 7 (Bit 12): 1 if non-group members may not read, 0 if any user can read
///
NON_GROUP_MEMBER_CANNOT_READ = 0b0001_0000_0000_0000,
///
/// Flag 8 (Bit 14): 1 if non-group members may not execute, 0 if any user can execute
///
NON_GROUP_MEMBER_CANNOT_EXECUTE = 0b0100_0000_0000_0000,
///
/// Fixed values in the enum, every other bit set to 1
///
PERMISSIONS_MASK = 0b1010_1010_1010_1010,
}
///
/// Enum for ExtendedAttributeRecord.RecordFormat
/// 4-127 (0x04-7F): Reserved
/// 128-255 (0x80-FF): System Use
///
///
public enum RecordFormat : byte
{
///
/// Record format unspecified by this type
///
UNSPECIFIED = 0x00,
///
/// Sequence of fixed-length records
///
FIXED_LENGTH_RECORDS = 0x01,
///
/// Sequence of variable-length records, Record Control World is LSB
///
VARIABLE_LENGTH_RECORDS_LSB = 0x02,
///
/// Sequence of variable-length records, Record Control World is MSB
///
VARIABLE_LENGTH_RECORDS_MSG = 0x03,
}
///
/// Enum for ExtendedAttributeRecord.RecordAttributes
/// 3-255 (0x03-FF): Reserved by ISO9660
///
///
public enum RecordAttributes : byte
{
///
/// Records are preceeded by linefeed and followed by carriage return
///
LINEFEED_CARRIAGE_RETURN = 0x00,
///
/// First byte of each record is Fortran-style
///
FORTRAN_STYLE = 0x01,
///
/// Record contains necessary control information within itself
///
SELF_DEFINED = 0x02,
}
}