xtmlfile/header: Encapsulate in XtmFile module.
This commit is contained in:
parent
60b2e6d9ff
commit
53bb3fe39a
1 changed files with 74 additions and 71 deletions
|
@ -3,22 +3,24 @@ require 'rubygems'
|
|||
gem 'bindata', '~> 1.2.1'
|
||||
require 'bindata'
|
||||
|
||||
#
|
||||
# Offset | Information | Size (bytes)
|
||||
# --------------------------------------------
|
||||
# 0 | Software name length | 1
|
||||
# 1 | Software name | 20
|
||||
# 21 | Version length | 1
|
||||
# 22 | Version | 4
|
||||
# 26 | Not used | 10
|
||||
# 36 | Date | 4
|
||||
# 40 | Filename length | 1
|
||||
# 41 | Filename | 50
|
||||
# 91 | MD5 Enable | 1
|
||||
# 92 | File parts count | 4
|
||||
# 96 | Original file size | 8
|
||||
#
|
||||
class Header < BinData::Record
|
||||
module XtmFile
|
||||
|
||||
#
|
||||
# Offset | Information | Size (bytes)
|
||||
# --------------------------------------------
|
||||
# 0 | Software name length | 1
|
||||
# 1 | Software name | 20
|
||||
# 21 | Version length | 1
|
||||
# 22 | Version | 4
|
||||
# 26 | Not used | 10
|
||||
# 36 | Date | 4
|
||||
# 40 | Filename length | 1
|
||||
# 41 | Filename | 50
|
||||
# 91 | MD5 Enable | 1
|
||||
# 92 | File parts count | 4
|
||||
# 96 | Original file size | 8
|
||||
#
|
||||
class Header < BinData::Record
|
||||
endian :little
|
||||
|
||||
uint8 :progname_len, :value => lambda { progname_str.length }
|
||||
|
@ -85,4 +87,5 @@ class Header < BinData::Record
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue