Class: LibMsPack::MsCab::MsCabdFolder

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/libmspack/mscab.rb

Overview

A structure which represents a single folder in a cabinet or cabinet set.

A folder is a single compressed stream of data. When uncompressed, it holds the data of one or more files. A folder may be split across more than one cabinet.

Instance Method Summary collapse

Instance Method Details

#comp_typeFixnum

The compression format used by this folder.

#MsCabdCompMethod should be used on this field to get the algorithm used. #MsCabdCompLevel should be used to get the "compression level".

Returns:

  • (Fixnum)


80
81
82
# File 'lib/libmspack/mscab.rb', line 80

def comp_type
    self[:comp_type]
end

#compressionLevelFixnum

Returns the compression level used by a folder.

Returns:

  • (Fixnum)

    the compression level. This is only defined by LZX and Quantum compression



103
104
105
# File 'lib/libmspack/mscab.rb', line 103

def compressionLevel
    MsCab::MsCabdCompLevel(comp_type)
end

#compressionMethodFixnum

Returns the compression method used by a folder.

Returns:

  • (Fixnum)

    one of MSCAB_COMP_NONE, MSCAB_COMP_MSZIP, MSCAB_COMP_QUANTUM or MSCAB_COMP_LZX



96
97
98
# File 'lib/libmspack/mscab.rb', line 96

def compressionMethod
    MsCab::MsCabdCompMethod(comp_type)
end

#nextMsCabdFolder?

A next folder in this cabinet or cabinet set, or nil if this is the final folder.

Returns:



70
71
72
73
# File 'lib/libmspack/mscab.rb', line 70

def next
    return nil if self[:next].pointer.address.zero?
    self[:next]
end

#num_blocksFixnum

The total number of data blocks used by this folder.

This includes data blocks present in other files, if this folder spans more than one cabinet.

Returns:

  • (Fixnum)


89
90
91
# File 'lib/libmspack/mscab.rb', line 89

def num_blocks
    self[:num_blocks]
end