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.
189
190
191
|
# File 'lib/zip64/structures.rb', line 189
def filename
@filename
end
|
Instance Method Details
211
212
213
|
# File 'lib/zip64/structures.rb', line 211
def
(@extra_field ||= [])
end
|
203
204
205
206
207
208
209
210
|
# File 'lib/zip64/structures.rb', line 203
def (str)
case str
when Array
@extra_field = str
else
@extra_field = [str]
end
end
|
214
215
216
217
218
219
220
221
222
223
224
|
# File 'lib/zip64/structures.rb', line 214
def
buf = ''.zip64_force_encoding('ASCII-8BIT')
.each do |field|
if field.respond_to?(:to_string)
buf << field.to_string.zip64_force_encoding('ASCII-8BIT')
else
buf << field.to_s.zip64_force_encoding('ASCII-8BIT')
end
end
buf
end
|
#to_s ⇒ Object
195
196
197
|
# File 'lib/zip64/structures.rb', line 195
def to_s
to_string
end
|
#to_string ⇒ Object
190
191
192
193
194
|
# File 'lib/zip64/structures.rb', line 190
def to_string
=
self. = .size
super + "#{@filename}#{}"
end
|
#version ⇒ Object
185
186
187
|
# File 'lib/zip64/structures.rb', line 185
def version
zip64? ? 45 : 10
end
|
#zip64? ⇒ Boolean
181
182
183
|
# File 'lib/zip64/structures.rb', line 181
def zip64?
data_len == LEN64 && raw_data_len == LEN64
end
|