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.
246 247 248 |
# File 'lib/libmspack/mscab.rb', line 246 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.
239 240 241 |
# File 'lib/libmspack/mscab.rb', line 239 def filename self[:filename] end |
#files ⇒ MsCabdFile?
A list of all files in the cabinet or cabinet set.
304 305 306 307 |
# File 'lib/libmspack/mscab.rb', line 304 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.
357 358 359 |
# File 'lib/libmspack/mscab.rb', line 357 def flags self[:flags] end |
#folders ⇒ MsCabdFolder?
A list of all folders in the cabinet or cabinet set.
312 313 314 315 |
# File 'lib/libmspack/mscab.rb', line 312 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.
341 342 343 |
# File 'lib/libmspack/mscab.rb', line 341 def header_resv self[:header_resv] end |
#length ⇒ Fixnum
The length of the cabinet file in bytes.
253 254 255 |
# File 'lib/libmspack/mscab.rb', line 253 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.
229 230 231 232 |
# File 'lib/libmspack/mscab.rb', line 229 def next return nil if self[:next].pointer.address.zero? self[:next] end |
#nextcab ⇒ MsCabdCabinet?
The next cabinet in a cabinet set, or nil.
268 269 270 271 |
# File 'lib/libmspack/mscab.rb', line 268 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.
297 298 299 |
# File 'lib/libmspack/mscab.rb', line 297 def nextinfo self[:nextinfo] end |
#nextname ⇒ String
The filename of the next cabinet in a cabinet set, or nil.
283 284 285 |
# File 'lib/libmspack/mscab.rb', line 283 def nextname self[:nextname] end |
#prevcab ⇒ MsCabdCabinet?
The previous cabinet in a cabinet set, or nil.
260 261 262 263 |
# File 'lib/libmspack/mscab.rb', line 260 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.
290 291 292 |
# File 'lib/libmspack/mscab.rb', line 290 def previnfo self[:previnfo] end |
#prevname ⇒ String
The filename of the previous cabinet in a cabinet set, or nil.
276 277 278 |
# File 'lib/libmspack/mscab.rb', line 276 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.
322 323 324 |
# File 'lib/libmspack/mscab.rb', line 322 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.
331 332 333 |
# File 'lib/libmspack/mscab.rb', line 331 def set_index self[:set_index] end |