Class: FFI::Clang::PrintingPolicy

Inherits:
AutoPointer
  • Object
show all
Defined in:
lib/ffi/clang/printing_policy.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cursor) ⇒ PrintingPolicy

Returns a new instance of PrintingPolicy.



12
13
14
15
16
# File 'lib/ffi/clang/printing_policy.rb', line 12

def initialize(cursor)
     policy = Lib.get_printing_policy(cursor)
	super(policy)
     @cursor = cursor
end

Class Method Details

.release(pointer) ⇒ Object



18
19
20
# File 'lib/ffi/clang/printing_policy.rb', line 18

def self.release(pointer)
	Lib.dispose_printing_policy(pointer)
end

Instance Method Details

#get_property(property) ⇒ Object



22
23
24
25
# File 'lib/ffi/clang/printing_policy.rb', line 22

def get_property(property)
  result = Lib.printing_policy_get_property(self, property)
  result == 0 ? false : true
end

#pretty_printObject



31
32
33
# File 'lib/ffi/clang/printing_policy.rb', line 31

def pretty_print
  Lib.extract_string Lib.pretty_print(@cursor, self)
end

#set_property(property, value) ⇒ Object



27
28
29
# File 'lib/ffi/clang/printing_policy.rb', line 27

def set_property(property, value)
  Lib.printing_policy_set_property(self, property, value ? 1 : 0)
end