Class: Ole::Storage::DirClass::Dir

### Home Classes Methods

### In Files

- lib/ole/storage/file_system.rb

### Parent

Object

### Methods

- ::new
- #close
- #each
- #pos
- #pos=
- #read
- #rewind
- #seek
- #tell

### Files

- ChangeLog
- README

### Class/Module Index

Quicksearch

- Ole
- Ole::IOMode
- Ole::IOMode::Constants
- Ole::Storage
- Ole::Storage::AllocationTable
- Ole::Storage::AllocationTable::Big
- Ole::Storage::AllocationTable::Small
- Ole::Storage::DirClass
- Ole::Storage::DirClass::Dir
- Ole::Storage::Dirent
- Ole::Storage::FileClass
- Ole::Storage::FileClass::Stat
- Ole::Storage::Header
- Ole::Storage::MetaData
- Ole::Storage::RangesIOMigrateable
- Ole::Storage::RangesIOResizeable
- Ole::Types
- Ole::Types::Clsid
- Ole::Types::Data
- Ole::Types::FileTime
- Ole::Types::Lpstr
- Ole::Types::Lpwstr
- Ole::Types::PropertySet
- Ole::Types::PropertySet::Constants
- Ole::Types::PropertySet::Section
- Ole::Types::Variant
- Ole::Types::Variant::Constants
- RangesIO

No matching classes.

# Ole::Storage::DirClass::Dir

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.

### Attributes

path[R]

### Public Class Methods

new(path, entries) click to toggle source

    # File lib/ole/storage/file_system.rb, line 353
    def initialize path, entries
      @path, @entries, @pos = path, entries, 0
      @closed = false
    end

### Public Instance Methods

close() click to toggle source

    # File lib/ole/storage/file_system.rb, line 368
    def close
      @closed = true
    end

each(&block) click to toggle source

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

pos() click to toggle source

    # File lib/ole/storage/file_system.rb, line 358
    def pos
      raise IOError if @closed
      @pos
    end

Also aliased as: tell
pos=(pos) click to toggle source

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

Also aliased as: seek
read() click to toggle source

    # File lib/ole/storage/file_system.rb, line 372
    def read
      raise IOError if @closed
      @entries[pos]
    ensure
      @pos += 1 if pos < @entries.length
    end

rewind() click to toggle source

    # File lib/ole/storage/file_system.rb, line 386
    def rewind
      seek 0
    end

seek(pos) click to toggle source
Alias for: pos=
tell() click to toggle source
Alias for: pos

[Validate]

Generated with the Darkfish Rdoc Generator 2.