Class: Omnizip::Formats::SevenZip::Models::FileEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/formats/seven_zip/models/file_entry.rb

Overview

Represents a file entry in .7z archive Contains file metadata, attributes, and extraction information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFileEntry

Initialize file entry



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 16

def initialize
  @name = nil
  @size = 0
  @compressed_size = 0
  @crc = nil
  @is_dir = false
  @is_empty = false
  @is_anti = false
  @has_stream = true
  @mtime = nil
  @atime = nil
  @ctime = nil
  @attributes = nil
  @folder_index = nil
  @file_index = nil
  @source_path = nil
end

Instance Attribute Details

#atimeObject

Returns the value of attribute atime.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def atime
  @atime
end

#attributesObject

Returns the value of attribute attributes.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def attributes
  @attributes
end

#compressed_sizeObject

Returns the value of attribute compressed_size.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def compressed_size
  @compressed_size
end

#compression_optionsObject

Returns the value of attribute compression_options.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def compression_options
  @compression_options
end

#crcObject

Returns the value of attribute crc.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def crc
  @crc
end

#ctimeObject

Returns the value of attribute ctime.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def ctime
  @ctime
end

#file_indexObject

Returns the value of attribute file_index.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def file_index
  @file_index
end

#folder_indexObject

Returns the value of attribute folder_index.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def folder_index
  @folder_index
end

#has_streamObject

Returns the value of attribute has_stream.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def has_stream
  @has_stream
end

#inline_dataObject

Returns the value of attribute inline_data.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def inline_data
  @inline_data
end

#is_antiObject

Returns the value of attribute is_anti.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def is_anti
  @is_anti
end

#is_dirObject

Returns the value of attribute is_dir.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def is_dir
  @is_dir
end

#is_emptyObject

Returns the value of attribute is_empty.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def is_empty
  @is_empty
end

#mtimeObject

Returns the value of attribute mtime.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def mtime
  @mtime
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def name
  @name
end

#sizeObject

Returns the value of attribute size.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def size
  @size
end

#source_pathObject

Returns the value of attribute source_path.



10
11
12
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 10

def source_path
  @source_path
end

Instance Method Details

#directory?Boolean

Check if entry is a directory

Returns:

  • (Boolean)

    true if directory



37
38
39
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 37

def directory?
  @is_dir
end

#file?Boolean

Check if entry is a file

Returns:

  • (Boolean)

    true if regular file



44
45
46
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 44

def file?
  !@is_dir
end

#has_stream?Boolean

Check if entry has data stream

Returns:

  • (Boolean)

    true if has stream



51
52
53
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 51

def has_stream?
  @has_stream && !@is_empty
end