Class: MiniSOReader

Inherits:
Object
  • Object
show all
Defined in:
ext/oci8/oraconf.rb

Overview

minimal implementation to read information of a shared object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ MiniSOReader

Returns a new instance of MiniSOReader.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'ext/oci8/oraconf.rb', line 103

def initialize(filename)
  f = open(filename, 'rb')
  begin
    case file_header = f.read(2)
    when "\177E"
      # Linux, Solaris and HP-UX(64-bit)
      read_elf(f) if f.read(2) == 'LF'
    when "MZ"
      # Windows
      read_pe(f)
    else
      # HP-UX(32-bit), AIX, Mac OS X and Tru64
      raise format("unknown file header: %02x %02x", file_header[0], file_header[1])
    end
  ensure
    f.close
  end
end

Instance Attribute Details

#bitsObject (readonly)

Returns the value of attribute bits.



101
102
103
# File 'ext/oci8/oraconf.rb', line 101

def bits
  @bits
end

#cpuObject (readonly)

Returns the value of attribute cpu.



99
100
101
# File 'ext/oci8/oraconf.rb', line 99

def cpu
  @cpu
end

#endianObject (readonly)

Returns the value of attribute endian.



100
101
102
# File 'ext/oci8/oraconf.rb', line 100

def endian
  @endian
end

#file_formatObject (readonly)

Returns the value of attribute file_format.



98
99
100
# File 'ext/oci8/oraconf.rb', line 98

def file_format
  @file_format
end