Class: ZXing::FFI::Result

Inherits:
Object
  • Object
show all
Includes:
Result
Defined in:
lib/zxing/ffi/result.rb

Instance Attribute Summary

Attributes included from Result

#native

Instance Method Summary collapse

Methods included from Result

#initialize, new

Instance Method Details

#formatObject



7
8
9
10
# File 'lib/zxing/ffi/result.rb', line 7

def format
  enum = ZXing::FFI::Library.Result_getBarcodeFormat @native
  ZXing::FFI::Library.BarcodeFormat_enum_to_string enum
end

#metadataObject



20
21
# File 'lib/zxing/ffi/result.rb', line 20

def 
end

#textObject



12
13
14
15
16
17
18
# File 'lib/zxing/ffi/result.rb', line 12

def text
  s = ZXing::FFI::Library.String_string ZXing::FFI::Library::StringPointer.new(ZXing::FFI::Library.Result_getText(@native))
  if RUBY_VERSION =~ /^1.9/
    s.force_encoding("UTF-8")
  end
  s
end