/// <summary> /// Initializes a new instance of the <see cref="FileExFatDirectoryEntry"/> class. /// </summary> /// <param name="buffer">The buffer.</param> public FileExFatDirectoryEntry(Buffer buffer) : base(buffer) { // the raw SecondaryCount = new BufferUInt8(buffer, 1); SetChecksum = new BufferUInt16(buffer, 2); FileAttributes = new EnumValueProvider <ExFatFileAttributes, UInt16>(new BufferUInt16(buffer, 4)); CreationTimeStamp = new BufferUInt32(buffer, 8); LastWriteTimeStamp = new BufferUInt32(buffer, 12); LastAccessTimeStamp = new BufferUInt32(buffer, 16); Creation10msIncrement = new BufferUInt8(buffer, 20); LastWrite10msIncrement = new BufferUInt8(buffer, 21); CreationTimeZoneOffset = new BufferUInt8(buffer, 22); LastWriteTimeZoneOffset = new BufferUInt8(buffer, 23); LastAccessTimeZoneOffset = new BufferUInt8(buffer, 24); // the cooked CreationTime = new EntryDateTime(CreationTimeStamp, Creation10msIncrement); LastWriteTime = new EntryDateTime(LastWriteTimeStamp, LastWrite10msIncrement); LastAccessTime = new EntryDateTime(LastAccessTimeStamp); CreationTimeOffset = new EntryTimeZone(CreationTimeZoneOffset); LastWriteTimeOffset = new EntryTimeZone(LastWriteTimeZoneOffset); LastAccessTimeOffset = new EntryTimeZone(LastAccessTimeZoneOffset); CreationDateTimeOffset = new EntryDateTimeOffset(CreationTime, CreationTimeOffset); LastWriteDateTimeOffset = new EntryDateTimeOffset(LastWriteTime, LastWriteTimeOffset); LastAccessDateTimeOffset = new EntryDateTimeOffset(LastAccessTime, LastAccessTimeOffset); }
/// <summary> /// Initializes a new instance of the <see cref="StreamExtensionExFatDirectoryEntry"/> class. /// </summary> /// <param name="buffer">The buffer.</param> public StreamExtensionExFatDirectoryEntry(Buffer buffer) : base(buffer) { GeneralSecondaryFlags = new EnumValueProvider <ExFatGeneralSecondaryFlags, Byte>(new BufferUInt8(buffer, 1)); NameLength = new BufferUInt8(buffer, 3); NameHash = new BufferUInt16(buffer, 4); ValidDataLength = new BufferUInt64(buffer, 8); FirstCluster = new BufferUInt32(buffer, 20); DataLength = new BufferUInt64(buffer, 24); }
public FatDirectoryEntry(Buffer buffer) { DirName = new BufferByteString(buffer, 0, 11, Encoding.Default); DirAttr = new BufferUInt8(buffer, 11); DirNtRes = new BufferUInt8(buffer, 12); DirCrtTimeTenth = new BufferUInt8(buffer, 13); DirCrtTime = new BufferUInt16(buffer, 14); DirCrtDate = new BufferUInt16(buffer, 16); DirLastAccDate = new BufferUInt16(buffer, 18); DirFstClusHI = new BufferUInt16(buffer, 20); DirWrtTime = new BufferUInt16(buffer, 22); DirWrtDate = new BufferUInt16(buffer, 24); DirFstClusLO = new BufferUInt16(buffer, 26); DirFileSize = new BufferUInt32(buffer, 28); }
/// <summary> /// Initializes a new instance of the <see cref="ExFatBootSector"/> class. /// </summary> internal ExFatBootSector(byte[] bytes) { _bytes = bytes; var buffer = new Buffer(_bytes); JmpBoot = new BufferBytes(buffer, 0, 3); OemName = new BufferByteString(buffer, 3, 8); VolumeLengthSectors = new BufferUInt64(buffer, 72); FatOffsetSector = new BufferUInt32(buffer, 80); FatLengthSectors = new BufferUInt32(buffer, 84); ClusterOffsetSector = new BufferUInt32(buffer, 88); ClusterCount = new BufferUInt32(buffer, 92); RootDirectoryCluster = new BufferUInt32(buffer, 96); VolumeSerialNumber = new BufferUInt32(buffer, 100); FileSystemRevision = new BufferUInt16(buffer, 104); VolumeFlags = new BufferUInt16(buffer, 106); BytesPerSector = new CacheValueProvider <uint>(new ShiftValueProvider(new BufferUInt8(buffer, 108))); SectorsPerCluster = new ShiftValueProvider(new BufferUInt8(buffer, 109)); NumberOfFats = new BufferUInt8(buffer, 110); DriveSelect = new BufferUInt8(buffer, 111); PercentInUse = new BufferUInt8(buffer, 112); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:ExFat.Partition.Entries.AllocationBitmapExFatDirectoryEntry" /> class. /// </summary> /// <param name="buffer">The buffer.</param> public AllocationBitmapExFatDirectoryEntry(Buffer buffer) : base(buffer) { BitmapFlags = new EnumValueProvider <AllocationBitmapFlags, Byte>(new BufferUInt8(buffer, 1)); FirstCluster = new BufferUInt32(buffer, 20); DataLength = new BufferUInt64(buffer, 24); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:ExFat.Partition.Entries.UpCaseTableExFatDirectoryEntry" /> class. /// </summary> /// <param name="buffer">The buffer.</param> public UpCaseTableExFatDirectoryEntry(Buffer buffer) : base(buffer) { TableChecksum = new BufferUInt32(buffer, 4); FirstCluster = new BufferUInt32(buffer, 20); DataLength = new BufferUInt64(buffer, 24); }