lib/mapi/msg.rb
def parse_substg key, encoding, offset, obj
				if (encoding & 0x1000) != 0
					if !offset
						# there is typically one with no offset first, whose data is a series of numbers
						# equal to the lengths of all the sub parts. gives an implied array size i suppose.
						# maybe you can initialize the array at this time. the sizes are the same as all the
						# ole object sizes anyway, its to pre-allocate i suppose.
						#p obj.data.unpack('V*')
						# ignore this one
						return
					else
						# remove multivalue flag for individual pieces
						encoding &= ~0x1000
					end
				else
					Log.warn "offset specified for non-multivalue encoding #{obj.name}" if offset
					offset = nil
				end
				# offset is for multivalue encodings.
				unless encoder = ENCODINGS[encoding]
					Log.warn "unknown encoding #{encoding}"
					#encoder = proc { |obj| obj.io } #.read }. maybe not a good idea
					encoder = ENCODINGS[:default]
				end
				add_property key, encoder[obj], offset
			end
# Parse an +Dirent+, as per <tt>msgconvert.pl</tt>. This is how larger properties, such
# as strings, binary blobs, and other ole sub-directories (eg nested Msg) are stored.
Parse an +Dirent+, as per msgconvert.pl. This is how larger properties, such
as strings, binary blobs, and other ole sub-directories  are stored.
Parse an + Dirent + as per msgconvert . pl . This is how larger properties such as strings binary blobs and other ole sub - directories are stored .
def parse_substg key, encoding, offset, obj
				if (encoding & 0x1000) != 0
					if !offset
						return
					else
						encoding &= ~0x1000
					end
				else
					Log.warn "offset specified for non-multivalue encoding #{obj.name}" if offset
					offset = nil
				end
				unless encoder = ENCODINGS[encoding]
					Log.warn "unknown encoding #{encoding}"
					encoder = ENCODINGS[:default]
				end
				add_property key, encoder[obj], offset
			end
def parse_substg key , encoding , offset , obj if ( encoding & 0x1000 ) != 0 if ! offset return else encoding &= ~ 0x1000 end else Log . warn "offset specified for non-multivalue encoding #{obj.name}" if offset offset = nil end unless encoder = ENCODINGS [ encoding ] Log . warn "unknown encoding #{encoding}" encoder = ENCODINGS [ :default ] end add_property key , encoder [ obj ] , offset end
Parse an +Dirent+, as per <tt>msgconvert.pl</tt>.
Parse an + Dirent + as per <tt > msgconvert . pl< / tt > .
# there is typically one with no offset first, whose data is a series of numbers # equal to the lengths of all the sub parts. gives an implied array size i suppose. # maybe you can initialize the array at this time. the sizes are the same as all the # ole object sizes anyway, its to pre-allocate i suppose. #p obj.data.unpack('V*') # ignore this one # remove multivalue flag for individual pieces # offset is for multivalue encodings. #encoder = proc { |obj| obj.io } #.read }. maybe not a good idea
key
encoding
offset
obj