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.
28 29 30 31 32 33 34 35 |
# File 'lib/ffi/clang/file.rb', line 28 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.
26 27 28 |
# File 'lib/ffi/clang/file.rb', line 26 def translation_unit @translation_unit end |
Instance Method Details
#device ⇒ Object
53 54 55 |
# File 'lib/ffi/clang/file.rb', line 53 def device @unique_id[:device] end |
#include_guarded? ⇒ Boolean
49 50 51 |
# File 'lib/ffi/clang/file.rb', line 49 def include_guarded? Lib.is_file_multiple_include_guarded(@translation_unit, self) != 0 end |
#inode ⇒ Object
57 58 59 |
# File 'lib/ffi/clang/file.rb', line 57 def inode @unique_id[:inode] end |
#modification ⇒ Object
61 62 63 |
# File 'lib/ffi/clang/file.rb', line 61 def modification Time.at(@unique_id[:modification]) end |
#name ⇒ Object
41 42 43 |
# File 'lib/ffi/clang/file.rb', line 41 def name Lib.extract_string Lib.get_file_name(self) end |
#time ⇒ Object
45 46 47 |
# File 'lib/ffi/clang/file.rb', line 45 def time Time.at(Lib.get_file_time(self)) end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/ffi/clang/file.rb', line 37 def to_s name end |