Class: Fzeet::Windows::ShellItemArray

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/fzeet/windows/shell/Common.rb

Instance Method Summary collapse

Instance Method Details

#countObject Also known as: size, length



106
# File 'lib/fzeet/windows/shell/Common.rb', line 106

def count; FFI::MemoryPointer.new(:ulong) { |pc| next unless GetCount(pc) == S_OK; return pc.get_ulong(0) } end

#each(&block) ⇒ Object



124
# File 'lib/fzeet/windows/shell/Common.rb', line 124

def each(&block) length.times { |i| get(i, &block) }; self end

#get(i) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/fzeet/windows/shell/Common.rb', line 110

def get(i)
	FFI::MemoryPointer.new(:pointer) { |psi|
		next unless GetItemAt(i, psi) == S_OK

		si = ShellItem.new(psi.read_pointer)

		begin
			yield si
		ensure
			si.Release
		end
	}
end