Class: HttpZip::Parser::CentralDirectoryFileHeader
- Inherits:
-
Object
- Object
- HttpZip::Parser::CentralDirectoryFileHeader
- Defined in:
- lib/http_zip/parser/central_directory_file_header.rb
Overview
Parses the Central Directory File Header.
Constant Summary collapse
- ZIP64_EXTRA_FIELD_HEADER_ID =
"\x01\x00"
- CENTRAL_DIRECTORY_FILE_HEADER_IDENTIFIER =
"\x50\x4B\x01\x02"
Instance Attribute Summary collapse
-
#compressed_size ⇒ Object
readonly
Returns the value of attribute compressed_size.
-
#disk_number ⇒ Object
readonly
Returns the value of attribute disk_number.
-
#end_of_entry ⇒ Object
readonly
Returns the value of attribute end_of_entry.
-
#external_file_attributes ⇒ Object
readonly
Returns the value of attribute external_file_attributes.
-
#extra_field_length ⇒ Object
readonly
Returns the value of attribute extra_field_length.
-
#file_comment_length ⇒ Object
readonly
Returns the value of attribute file_comment_length.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#file_name_length ⇒ Object
readonly
Returns the value of attribute file_name_length.
-
#header_offset ⇒ Object
readonly
Returns the value of attribute header_offset.
-
#internal_file_attributes ⇒ Object
readonly
Returns the value of attribute internal_file_attributes.
-
#uncompressed_size ⇒ Object
readonly
Returns the value of attribute uncompressed_size.
Instance Method Summary collapse
-
#initialize(file_header_bytes) ⇒ CentralDirectoryFileHeader
constructor
Create a new instance of CentralDirectoryFileHeader.
Constructor Details
#initialize(file_header_bytes) ⇒ CentralDirectoryFileHeader
Create a new instance of CentralDirectoryFileHeader.
28 29 30 31 32 33 34 35 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 28 def initialize(file_header_bytes) @bytes = file_header_bytes unless @bytes.start_with?(CENTRAL_DIRECTORY_FILE_HEADER_IDENTIFIER) raise ZipError, "Central Directory File Header seems to be corrupt" end parse! end |
Instance Attribute Details
#compressed_size ⇒ Object (readonly)
Returns the value of attribute compressed_size.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def compressed_size @compressed_size end |
#disk_number ⇒ Object (readonly)
Returns the value of attribute disk_number.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def disk_number @disk_number end |
#end_of_entry ⇒ Object (readonly)
Returns the value of attribute end_of_entry.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def end_of_entry @end_of_entry end |
#external_file_attributes ⇒ Object (readonly)
Returns the value of attribute external_file_attributes.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def external_file_attributes @external_file_attributes end |
#extra_field_length ⇒ Object (readonly)
Returns the value of attribute extra_field_length.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def extra_field_length @extra_field_length end |
#file_comment_length ⇒ Object (readonly)
Returns the value of attribute file_comment_length.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def file_comment_length @file_comment_length end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def file_name @file_name end |
#file_name_length ⇒ Object (readonly)
Returns the value of attribute file_name_length.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def file_name_length @file_name_length end |
#header_offset ⇒ Object (readonly)
Returns the value of attribute header_offset.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def header_offset @header_offset end |
#internal_file_attributes ⇒ Object (readonly)
Returns the value of attribute internal_file_attributes.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def internal_file_attributes @internal_file_attributes end |
#uncompressed_size ⇒ Object (readonly)
Returns the value of attribute uncompressed_size.
10 11 12 |
# File 'lib/http_zip/parser/central_directory_file_header.rb', line 10 def uncompressed_size @uncompressed_size end |