Class: Zip64::LocalFileHeader
- Inherits:
-
Block
- Object
- Block
- Zip64::LocalFileHeader
show all
- Defined in:
- lib/zip64/structures.rb
Constant Summary
collapse
- SIG =
0x04034b50
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Block
base_size, #describe, #fields, fields, #initialize, #pack_field, #read_field_from, read_from, #size, size_of, #size_of
Constructor Details
This class inherits a constructor from Block
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
191
192
193
|
# File 'lib/zip64/structures.rb', line 191
def filename
@filename
end
|
Instance Method Details
213
214
215
|
# File 'lib/zip64/structures.rb', line 213
def
(@extra_field ||= [])
end
|
205
206
207
208
209
210
211
212
|
# File 'lib/zip64/structures.rb', line 205
def (str)
case str
when Array
@extra_field = str
else
@extra_field = [str]
end
end
|
216
217
218
219
220
221
222
223
224
225
226
|
# File 'lib/zip64/structures.rb', line 216
def
buf = ''.force_encoding('ASCII-8BIT')
.each do |field|
if field.respond_to?(:to_string)
buf << field.to_string.force_encoding('ASCII-8BIT')
else
buf << field.to_s.force_encoding('ASCII-8BIT')
end
end
buf
end
|
#to_s ⇒ Object
197
198
199
|
# File 'lib/zip64/structures.rb', line 197
def to_s
to_string
end
|
#to_string ⇒ Object
192
193
194
195
196
|
# File 'lib/zip64/structures.rb', line 192
def to_string
=
self. = .size
super + "#{@filename}#{}"
end
|
#version ⇒ Object
187
188
189
|
# File 'lib/zip64/structures.rb', line 187
def version
zip64? ? 45 : 10
end
|
#zip64? ⇒ Boolean
183
184
185
|
# File 'lib/zip64/structures.rb', line 183
def zip64?
data_len == LEN64 && raw_data_len == LEN64
end
|