Class: OLEStorageLitePPSFile
- Inherits:
-
OLEStorageLitePPS
- Object
- OLEStorageLite
- OLEStorageLitePPS
- OLEStorageLitePPSFile
- Defined in:
- lib/writeexcel/storage_lite.rb
Overview
:nodoc:
Constant Summary
Constants inherited from OLEStorageLite
OLEStorageLite::DATA_SIZE_SMALL, OLEStorageLite::LONG_INT_SIZE, OLEStorageLite::PPS_SIZE, OLEStorageLite::PPS_TYPE_DIR, OLEStorageLite::PPS_TYPE_FILE, OLEStorageLite::PPS_TYPE_ROOT
Instance Attribute Summary
Attributes inherited from OLEStorageLitePPS
#child, #data, #dir_pps, #name, #next_pps, #no, #pps_file, #prev_pps, #size, #start_block, #time_1st, #time_2nd, #type
Attributes inherited from OLEStorageLite
Instance Method Summary collapse
- #append(data) ⇒ Object
-
#initialize(sNm, data = '') ⇒ OLEStorageLitePPSFile
constructor
A new instance of OLEStorageLitePPSFile.
- #set_file(sFile = '') ⇒ Object
Methods inherited from OLEStorageLite
#asc2ucs, #getNthPps, #getPpsSearch, #getPpsTree, #localDate2OLE, #oleData2Local, #ucs2asc
Constructor Details
#initialize(sNm, data = '') ⇒ OLEStorageLitePPSFile
Returns a new instance of OLEStorageLitePPSFile.
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 |
# File 'lib/writeexcel/storage_lite.rb', line 938 def initialize(sNm, data = '') super( nil, sNm || '', PPS_TYPE_FILE, nil, nil, nil, nil, nil, nil, nil, data || '', nil ) end |
Instance Method Details
#append(data) ⇒ Object
971 972 973 974 975 976 977 978 979 |
# File 'lib/writeexcel/storage_lite.rb', line 971 def append(data) return if data.nil? if @pps_file @pps_file << data @pps_file.flush else @data << data end end |
#set_file(sFile = '') ⇒ Object
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 |
# File 'lib/writeexcel/storage_lite.rb', line 955 def set_file(sFile = '') if sFile.nil? or sFile == '' @pps_file = Tempfile.new('OLEStorageLitePPSFile') elsif sFile.respond_to?(:write) @pps_file = sFile elsif sFile.respond_to?(:to_str) #File Name @pps_file = open(sFile, "r+") return nil unless @pps_file else return nil end @pps_file.seek(0, IO::SEEK_END) @pps_file.binmode end |