Module: FXlsx::XlsxExt

Defined in:
lib/f_xlsx/xlsx_ext.rb

Class Method Summary collapse

Class Method Details

.load_libObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/f_xlsx/xlsx_ext.rb', line 5

def self.load_lib
  return if @lib_loaded
  @lib_loaded = true
  extend FFI::Library
  ffi_lib LIB_PATH
  attach_function :printStr, [:string], :void
  
  attach_function :newFile, [], :uint32
  attach_function :openFile, [:string], :uint32
  
  attach_function :newSheet, [:uint32, :string], :int
  attach_function :deleteSheet, [:uint32, :string], :void
  attach_function :setSheetName, [:uint32, :string, :string], :void
  attach_function :setSheetVisible, [:uint32, :string, :int], :void
  attach_function :getSheetVisible, [:uint32, :string], :int

  attach_function :getSheetList, [:uint32], CStrArray.ptr
  attach_function :getSheetName, [:uint32, :int], :string

  attach_function :setCellValue, [:uint32, :string, :int, :int, :pointer, :int], :void
  attach_function :getCellValue, [:uint32, :string, :int, :int], :string

  attach_function :getRows, [:uint32, :string], CStrArray2.ptr
  
  attach_function :putRow, [:uint32, :string, :int, CStrArray.ptr], :void
  attach_function :putRows, [:uint32, :string, CStrArray2.ptr], :void


  attach_function :mergeCell, [:uint32, :string, :int, :int, :int, :int], :void
  attach_function :unMergeCell, [:uint32, :string, :int, :int, :int, :int], :void

  attach_function :getMergeCells, [:uint32, :string], CCellArray.ptr

  attach_function :save, [:uint32], :void
  attach_function :saveAs, [:uint32, :string], :void

  attach_function :closeFile, [:uint32], :void
end