Class: Clang::TranslationUnitImpl
- Inherits:
-
Object
- Object
- Clang::TranslationUnitImpl
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/rbind/clang/clang_types.rb
Instance Attribute Summary collapse
-
#__obj_ptr__ ⇒ Object
readonly
Returns the value of attribute obj_ptr.
Class Method Summary collapse
Instance Method Summary collapse
- #cursor ⇒ Object
-
#initialize(ptr) ⇒ TranslationUnitImpl
constructor
A new instance of TranslationUnitImpl.
- #spelling ⇒ Object
Constructor Details
#initialize(ptr) ⇒ TranslationUnitImpl
66 67 68 69 70 71 72 |
# File 'lib/rbind/clang/clang_types.rb', line 66 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? TranslationUnitImplStruct ptr else TranslationUnitImplStruct.new(ptr) end end |
Instance Attribute Details
#__obj_ptr__ ⇒ Object (readonly)
Returns the value of attribute obj_ptr.
65 66 67 |
# File 'lib/rbind/clang/clang_types.rb', line 65 def __obj_ptr__ @__obj_ptr__ end |
Class Method Details
.from_native(ptr, context) ⇒ Object
61 62 63 |
# File 'lib/rbind/clang/clang_types.rb', line 61 def self.from_native(ptr,context) TranslationUnitImpl.new(ptr) end |
.to_native(obj, context) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/rbind/clang/clang_types.rb', line 53 def self.to_native(obj,context) if obj.is_a? TranslationUnitImpl obj.__obj_ptr__ else raise TypeError, "expected kind of #{name}, was #{obj.class}" end end |
Instance Method Details
#cursor ⇒ Object
74 75 76 77 78 |
# File 'lib/rbind/clang/clang_types.rb', line 74 def cursor cu = Rbind::get_translation_unit_cursor(self) cu.instance_variable_set(:@__translation_unit__,self) cu end |
#spelling ⇒ Object
80 81 82 |
# File 'lib/rbind/clang/clang_types.rb', line 80 def spelling Rbind::get_translation_unit_spelling(self).to_s end |