splitter: implemented filecount .

This commit is contained in:
user 2010-11-16 13:42:58 +01:00
parent a429b71282
commit 56969ca5b3

View file

@ -1,16 +1,26 @@
require 'xtmfile/header'
module XtmFile module XtmFile
class Splitter class Splitter
attr_reader :parts, :parts_size attr_reader :parts, :parts_size
def initialize input_filename def initialize input_filename
@input_filename = input_filename @input_filename = input_filename
@parts = 0
@parts_size = 0 # create and initialize header
@header = Header.new
@header.filename_str = @input_filename
end end
def parts= count def parts= count
@header.filecount = count
end end
def parts_size= size def parts_size= size
count = @header.filesize / size
remain = @header.filesize % size
count += 1 if remain > 0
@header.filecount = count
end end
def start def start