Class: FFI::Clang::File
- Inherits:
-
Pointer
- Object
- Pointer
- FFI::Clang::File
- Defined in:
- lib/ffi/clang/file.rb
Instance Attribute Summary collapse
-
#translation_unit ⇒ Object
readonly
Returns the value of attribute translation_unit.
Instance Method Summary collapse
- #device ⇒ Object
- #include_guarded? ⇒ Boolean
-
#initialize(pointer, translation_unit) ⇒ File
constructor
A new instance of File.
- #inode ⇒ Object
- #modification ⇒ Object
- #name ⇒ Object
- #time ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(pointer, translation_unit) ⇒ File
Returns a new instance of File.
14 15 16 17 18 19 20 21 |
# File 'lib/ffi/clang/file.rb', line 14 def initialize(pointer, translation_unit) super pointer @translation_unit = translation_unit pointer = MemoryPointer.new(Lib::CXFileUniqueID) Lib.get_file_unique_id(self, pointer) @unique_id = Lib::CXFileUniqueID.new(pointer) end |
Instance Attribute Details
#translation_unit ⇒ Object (readonly)
Returns the value of attribute translation_unit.
12 13 14 |
# File 'lib/ffi/clang/file.rb', line 12 def translation_unit @translation_unit end |
Instance Method Details
#device ⇒ Object
39 40 41 |
# File 'lib/ffi/clang/file.rb', line 39 def device @unique_id[:device] end |
#include_guarded? ⇒ Boolean
35 36 37 |
# File 'lib/ffi/clang/file.rb', line 35 def include_guarded? Lib.is_file_multiple_include_guarded(@translation_unit, self) != 0 end |
#inode ⇒ Object
43 44 45 |
# File 'lib/ffi/clang/file.rb', line 43 def inode @unique_id[:inode] end |
#modification ⇒ Object
47 48 49 |
# File 'lib/ffi/clang/file.rb', line 47 def modification Time.at(@unique_id[:modification]) end |
#name ⇒ Object
27 28 29 |
# File 'lib/ffi/clang/file.rb', line 27 def name Lib.extract_string Lib.get_file_name(self) end |
#time ⇒ Object
31 32 33 |
# File 'lib/ffi/clang/file.rb', line 31 def time Time.at(Lib.get_file_time(self)) end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/ffi/clang/file.rb', line 23 def to_s name end |