class Ole::Header

Defined in:

header.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(data : Bytes) #

[View source]

Instance Method Detail

def byte_order : Ole::ByteOrder #

[View source]
def byte_order=(byte_order : Ole::ByteOrder) #

[View source]
def clsid : String #

[View source]
def clsid=(clsid : String) #

[View source]
def data : Bytes #

[View source]
def data=(data : Bytes) #

[View source]
def determine_byteorder : Ole::ByteOrder #

[View source]
def difat : Array(UInt32) #

[View source]
def difat=(difat : Array(UInt32)) #

[View source]
def dump #

[View source]
def error : String #

[View source]
def error=(error : String) #

[View source]
def errors : Array(String) #

size # start offset (decimal) property magic : Bytes = Bytes.new(8) # 8 bytes 0 property clsid : Bytes = Bytes.new(16) # 16 bytes 8 property minor_version : Bytes = Bytes.new(2) # 2 bytes 24 property major_version : Bytes = Bytes.new(2) # 2 bytes 26 property byte_order : Bytes = Bytes.new(2) # 2 bytes 28 property sector_shift : Bytes = Bytes.new(2) # 2 bytes 30 property mini_sector_shift : Bytes = Bytes.new(2) # 2 bytes 32 property reserved : Bytes = Bytes.new(6) # 6 bytes 34 property nr_dir_sectors : Bytes = Bytes.new(4) # 4 bytes 40 property nr_fat_sectors : Bytes = Bytes.new(4) # 4 bytes 44 property first_dir_sector : Bytes = Bytes.new(4) # 4 bytes 48 property trans_sig_number : Bytes = Bytes.new(4) # 4 bytes 52 property mini_stream_cutoff : Bytes = Bytes.new(4) # 4 bytes 56 property first_minifat_sector : Bytes = Bytes.new(4) # 4 bytes 60 property nr_mini_fat_sectors : Bytes = Bytes.new(4) # 4 bytes 64 property first_difat_loc : Bytes = Bytes.new(4) # 4 bytes 68 property nr_dfat_sectors : Bytes = Bytes.new(4) # 4 bytes 72 property difat : Bytes = Bytes.new(436) # 436 bytes from 76, first 109 = (436/4) FAT sector locations


[View source]
def errors=(errors : Array(String)) #

size # start offset (decimal) property magic : Bytes = Bytes.new(8) # 8 bytes 0 property clsid : Bytes = Bytes.new(16) # 16 bytes 8 property minor_version : Bytes = Bytes.new(2) # 2 bytes 24 property major_version : Bytes = Bytes.new(2) # 2 bytes 26 property byte_order : Bytes = Bytes.new(2) # 2 bytes 28 property sector_shift : Bytes = Bytes.new(2) # 2 bytes 30 property mini_sector_shift : Bytes = Bytes.new(2) # 2 bytes 32 property reserved : Bytes = Bytes.new(6) # 6 bytes 34 property nr_dir_sectors : Bytes = Bytes.new(4) # 4 bytes 40 property nr_fat_sectors : Bytes = Bytes.new(4) # 4 bytes 44 property first_dir_sector : Bytes = Bytes.new(4) # 4 bytes 48 property trans_sig_number : Bytes = Bytes.new(4) # 4 bytes 52 property mini_stream_cutoff : Bytes = Bytes.new(4) # 4 bytes 56 property first_minifat_sector : Bytes = Bytes.new(4) # 4 bytes 60 property nr_mini_fat_sectors : Bytes = Bytes.new(4) # 4 bytes 64 property first_difat_loc : Bytes = Bytes.new(4) # 4 bytes 68 property nr_dfat_sectors : Bytes = Bytes.new(4) # 4 bytes 72 property difat : Bytes = Bytes.new(436) # 436 bytes from 76, first 109 = (436/4) FAT sector locations


[View source]
def first_difat_pos : UInt32 #

[View source]
def first_difat_pos=(first_difat_pos : UInt32) #

[View source]
def first_dir_sector : UInt32 #

[View source]
def first_dir_sector=(first_dir_sector : UInt32) #

[View source]
def first_minifat_sector : UInt32 #

[View source]
def first_minifat_sector=(first_minifat_sector : UInt32) #

[View source]
def magic : String #

[View source]
def magic=(magic : String) #

[View source]
def major_version : UInt16 #

[View source]
def major_version=(major_version : UInt16) #

[View source]
def mini_sector_shift : UInt16 #

[View source]
def mini_sector_shift=(mini_sector_shift : UInt16) #

[View source]
def mini_stream_cutoff : UInt32 #

[View source]
def mini_stream_cutoff=(mini_stream_cutoff : UInt32) #

[View source]
def minifat_sector_size : Int32 #

[View source]
def minor_version : UInt16 #

[View source]
def minor_version=(minor_version : UInt16) #

[View source]
def nr_dfat_sectors : UInt32 #

[View source]
def nr_dfat_sectors=(nr_dfat_sectors : UInt32) #

[View source]
def nr_dir_sectors : UInt32 #

[View source]
def nr_dir_sectors=(nr_dir_sectors : UInt32) #

[View source]
def nr_fat_fields : Int32 #

Page 20

Next Sector in Chain (variable): This field specifies the next sector number in a chain of sectors. If Header Major Version is 3, there MUST be 128 fields specified to fill a 512-byte sector. If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector.


[View source]
def nr_fat_sectors : UInt32 #

[View source]
def nr_fat_sectors=(nr_fat_sectors : UInt32) #

[View source]
def nr_mini_fat_sectors : UInt32 #

[View source]
def nr_mini_fat_sectors=(nr_mini_fat_sectors : UInt32) #

[View source]
def reserved : String #

[View source]
def reserved=(reserved : String) #

[View source]
def sector_shift : UInt16 #

[View source]
def sector_shift=(sector_shift : UInt16) #

[View source]
def sector_size : Int32 #

returns the sector size version 3 : 512 version 4 : 4096


[View source]
def set_error(s : String) #

[View source]
def size : Int32 #

[View source]
def status : Int32 #

[View source]
def status=(status : Int32) #

[View source]
def trans_sig_number : UInt32 #

[View source]
def trans_sig_number=(trans_sig_number : UInt32) #

[View source]
def validate : Bool #

[View source]
def validate_byteorder #

[View source]
def validate_clsid #

[View source]
def validate_magic #

[View source]
def validate_minor_sector_shift #

[View source]
def validate_nr_dir_sectors #

[View source]
def validate_reserved #

[View source]
def validate_sectorshift #

Sector Shift (2 bytes): This field MUST be set to 0x0009, or 0x000c, depending on the Major Version field. This field specifies the sector size of the compound file as a power of 2.

If Major Version is 3, the Sector Shift MUST be 0x0009, specifying a sector size of 512 bytes. If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a sector size of 4096 bytes.


[View source]
def version : Int32 #

[View source]