Class Ole::Storage::DirClass::Dir
In: lib/ole/storage/file_system.rb
Parent: Object
String Data Lpstr Clsid Lpwstr Section Enumerable DateTime FileTime Constants Variant::Constants Storage\n[lib/ole/storage/base.rb\nlib/ole/storage/file_system.rb\nlib/ole/storage/meta_data.rb] PropertySet lib/ole/storage/file_system.rb lib/ole/types/property_set.rb lib/ole/types/base.rb Constants Constants Variant Types Ole dot/m_9_0.png

note that there is nothing remotely ole specific about this class. it simply provides the dir like sequential access methods on top of an array. hmm, doesn‘t throw the IOError‘s on use of a closed directory…

Methods

close   each   new   pos   pos=   read   rewind   seek   tell  

Included Modules

Enumerable

Attributes

path  [R] 

Public Class methods

[Source]

     # File lib/ole/storage/file_system.rb, line 381
381:                                 def initialize path, entries
382:                                         @path, @entries, @pos = path, entries, 0
383:                                         @closed = false
384:                                 end

Public Instance methods

[Source]

     # File lib/ole/storage/file_system.rb, line 396
396:                                 def close
397:                                         @closed = true
398:                                 end

[Source]

     # File lib/ole/storage/file_system.rb, line 391
391:                                 def each(&block)
392:                                         raise IOError if @closed
393:                                         @entries.each(&block)
394:                                 end

[Source]

     # File lib/ole/storage/file_system.rb, line 386
386:                                 def pos
387:                                         raise IOError if @closed
388:                                         @pos
389:                                 end

[Source]

     # File lib/ole/storage/file_system.rb, line 407
407:                                 def pos= pos
408:                                         raise IOError if @closed
409:                                         @pos = [[0, pos].max, @entries.length].min
410:                                 end

[Source]

     # File lib/ole/storage/file_system.rb, line 400
400:                                 def read
401:                                         raise IOError if @closed
402:                                         @entries[pos]
403:                                 ensure
404:                                         @pos += 1 if pos < @entries.length
405:                                 end

[Source]

     # File lib/ole/storage/file_system.rb, line 412
412:                                 def rewind
413:                                         raise IOError if @closed
414:                                         @pos = 0
415:                                 end
seek(pos)

Alias for pos=

tell()

Alias for pos

[Validate]