Class: LibMsPack::MsCab::MsCabdCabinet
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LibMsPack::MsCab::MsCabdCabinet
- Defined in:
- lib/libmspack/mscab.rb
Overview
A structure which represents a single cabinet file.
If this cabinet is part of a merged cabinet set, the files and folders fields are common to all cabinets in the set, and will be identical.
Instance Method Summary collapse
-
#base_offset ⇒ Fixnum
The file offset of cabinet within the physical file it resides in.
-
#filename ⇒ String
The filename of the cabinet.
-
#files ⇒ MsCabdFile?
A list of all files in the cabinet or cabinet set.
-
#flags ⇒ Fixnum
Header flags.
-
#folders ⇒ MsCabdFolder?
A list of all folders in the cabinet or cabinet set.
-
#header_resv ⇒ Fixnum
The number of bytes reserved in the header area of the cabinet.
-
#length ⇒ Fixnum
The length of the cabinet file in bytes.
-
#next ⇒ MsCabdCabinet?
The next cabinet in a chained list, if this cabinet was opened with MsCabDecompressor#search.
-
#nextcab ⇒ MsCabdCabinet?
The next cabinet in a cabinet set, or nil.
-
#nextinfo ⇒ String
The name of the disk containing the next cabinet in a cabinet set, or nil.
-
#nextname ⇒ String
The filename of the next cabinet in a cabinet set, or nil.
-
#prevcab ⇒ MsCabdCabinet?
The previous cabinet in a cabinet set, or nil.
-
#previnfo ⇒ String
The name of the disk containing the previous cabinet in a cabinet set, or nil.
-
#prevname ⇒ String
The filename of the previous cabinet in a cabinet set, or nil.
-
#set_id ⇒ Fixnum
The set ID of the cabinet.
-
#set_index ⇒ Fixnum
The index number of the cabinet within the set.
Instance Method Details
#base_offset ⇒ Fixnum
The file offset of cabinet within the physical file it resides in.
233 234 235 |
# File 'lib/libmspack/mscab.rb', line 233 def base_offset self[:base_offset] end |
#filename ⇒ String
The filename of the cabinet.
More correctly, the filename of the physical file that the cabinet resides in. This is given by the library user and may be in any format.
226 227 228 |
# File 'lib/libmspack/mscab.rb', line 226 def filename self[:filename] end |
#files ⇒ MsCabdFile?
A list of all files in the cabinet or cabinet set.
291 292 293 294 |
# File 'lib/libmspack/mscab.rb', line 291 def files return nil if self[:files].pointer.address.zero? self[:files] end |
#flags ⇒ Fixnum
Header flags.
- MSCAB_HDR_PREVCAB indicates the cabinet is part of a cabinet set, and has a predecessor cabinet.
- MSCAB_HDR_NEXTCAB indicates the cabinet is part of a cabinet set, and has a successor cabinet.
- MSCAB_HDR_RESV indicates the cabinet has reserved header space.
344 345 346 |
# File 'lib/libmspack/mscab.rb', line 344 def flags self[:flags] end |
#folders ⇒ MsCabdFolder?
A list of all folders in the cabinet or cabinet set.
299 300 301 302 |
# File 'lib/libmspack/mscab.rb', line 299 def folders return nil if self[:folders].pointer.address.zero? self[:folders] end |
#header_resv ⇒ Fixnum
The number of bytes reserved in the header area of the cabinet.
If this is non-zero and flags has MSCAB_HDR_RESV set, this data can be read by the calling application. It is of the given length, located at offset (base_offset + MSCAB_HDR_RESV_OFFSET) in the cabinet file.
328 329 330 |
# File 'lib/libmspack/mscab.rb', line 328 def header_resv self[:header_resv] end |
#length ⇒ Fixnum
The length of the cabinet file in bytes.
240 241 242 |
# File 'lib/libmspack/mscab.rb', line 240 def length self[:length] end |
#next ⇒ MsCabdCabinet?
The next cabinet in a chained list, if this cabinet was opened with MsCabDecompressor#search
May be nil to mark the end of the list.
216 217 218 219 |
# File 'lib/libmspack/mscab.rb', line 216 def next return nil if self[:next].pointer.address.zero? self[:next] end |
#nextcab ⇒ MsCabdCabinet?
The next cabinet in a cabinet set, or nil.
255 256 257 258 |
# File 'lib/libmspack/mscab.rb', line 255 def nextcab return nil if self[:nextcab].pointer.address.zero? self[:nextcab] end |
#nextinfo ⇒ String
The name of the disk containing the next cabinet in a cabinet set, or nil.
284 285 286 |
# File 'lib/libmspack/mscab.rb', line 284 def nextinfo self[:nextinfo] end |
#nextname ⇒ String
The filename of the next cabinet in a cabinet set, or nil.
270 271 272 |
# File 'lib/libmspack/mscab.rb', line 270 def nextname self[:nextname] end |
#prevcab ⇒ MsCabdCabinet?
The previous cabinet in a cabinet set, or nil.
247 248 249 250 |
# File 'lib/libmspack/mscab.rb', line 247 def prevcab return nil if self[:prevcab].pointer.address.zero? self[:prevcab] end |
#previnfo ⇒ String
The name of the disk containing the previous cabinet in a cabinet set, or nil.
277 278 279 |
# File 'lib/libmspack/mscab.rb', line 277 def previnfo self[:previnfo] end |
#prevname ⇒ String
The filename of the previous cabinet in a cabinet set, or nil.
263 264 265 |
# File 'lib/libmspack/mscab.rb', line 263 def prevname self[:prevname] end |
#set_id ⇒ Fixnum
The set ID of the cabinet.
All cabinets in the same set should have the same set ID.
309 310 311 |
# File 'lib/libmspack/mscab.rb', line 309 def set_id self[:set_id] end |
#set_index ⇒ Fixnum
The index number of the cabinet within the set.
Numbering should start from 0 for the first cabinet in the set, and increment by 1 for each following cabinet.
318 319 320 |
# File 'lib/libmspack/mscab.rb', line 318 def set_index self[:set_index] end |