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

Inherits:
Object
  • Object
show all
Includes:
Entry
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



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 23

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.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def atime
  @atime
end

#attributesObject

Returns the value of attribute attributes.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def attributes
  @attributes
end

#compressed_sizeObject

Returns the value of attribute compressed_size.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def compressed_size
  @compressed_size
end

#compression_optionsObject

Returns the value of attribute compression_options.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def compression_options
  @compression_options
end

#crcObject

Returns the value of attribute crc.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def crc
  @crc
end

#ctimeObject

Returns the value of attribute ctime.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def ctime
  @ctime
end

#file_indexObject

Returns the value of attribute file_index.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def file_index
  @file_index
end

#folder_indexObject

Returns the value of attribute folder_index.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def folder_index
  @folder_index
end

#has_streamObject

Returns the value of attribute has_stream.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def has_stream
  @has_stream
end

#inline_dataObject

Returns the value of attribute inline_data.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def inline_data
  @inline_data
end

#is_antiObject

Returns the value of attribute is_anti.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def is_anti
  @is_anti
end

#is_dirObject

Returns the value of attribute is_dir.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def is_dir
  @is_dir
end

#is_emptyObject

Returns the value of attribute is_empty.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def is_empty
  @is_empty
end

#mtimeObject

Returns the value of attribute mtime.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def mtime
  @mtime
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def name
  @name
end

#sizeObject

Returns the value of attribute size.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def size
  @size
end

#source_pathObject

Returns the value of attribute source_path.



12
13
14
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 12

def source_path
  @source_path
end

Instance Method Details

#directory?Boolean

Check if entry is a directory

Returns:

  • (Boolean)

    true if directory



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

def directory?
  @is_dir
end

#entry_directory?Boolean

Returns:

  • (Boolean)


18
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 18

def entry_directory? = is_dir

#entry_mtimeObject



20
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 20

def entry_mtime = mtime

#entry_nameObject



17
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 17

def entry_name = name

#entry_sizeObject



19
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 19

def entry_size = size

#file?Boolean

Check if entry is a file

Returns:

  • (Boolean)

    true if regular file



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

def file?
  !@is_dir
end

#has_stream?Boolean

Check if entry has data stream

Returns:

  • (Boolean)

    true if has stream



58
59
60
# File 'lib/omnizip/formats/seven_zip/models/file_entry.rb', line 58

def has_stream?
  @has_stream && !@is_empty
end