Class: FFI::Clang::SpellingLocation
- Inherits:
-
SourceLocation
- Object
- SourceLocation
- FFI::Clang::SpellingLocation
- Defined in:
- lib/ffi/clang/source_location.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
Attributes inherited from SourceLocation
Instance Method Summary collapse
- #as_string ⇒ Object
-
#initialize(location) ⇒ SpellingLocation
constructor
A new instance of SpellingLocation.
- #to_s ⇒ Object
Methods inherited from SourceLocation
#==, #from_main_file?, #in_system_header?, #null?, null_location
Constructor Details
#initialize(location) ⇒ SpellingLocation
Returns a new instance of SpellingLocation.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/ffi/clang/source_location.rb', line 100 def initialize(location) super(location) cxfile = MemoryPointer.new :pointer line = MemoryPointer.new :uint column = MemoryPointer.new :uint offset = MemoryPointer.new :uint Lib::get_spelling_location(@location, cxfile, line, column, offset) @file = Lib.extract_string Lib.get_file_name(cxfile.read_pointer) @line = line.get_uint(0) @column = column.get_uint(0) @offset = offset.get_uint(0) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
98 99 100 |
# File 'lib/ffi/clang/source_location.rb', line 98 def column @column end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
98 99 100 |
# File 'lib/ffi/clang/source_location.rb', line 98 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
98 99 100 |
# File 'lib/ffi/clang/source_location.rb', line 98 def line @line end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
98 99 100 |
# File 'lib/ffi/clang/source_location.rb', line 98 def offset @offset end |
Instance Method Details
#as_string ⇒ Object
116 117 118 |
# File 'lib/ffi/clang/source_location.rb', line 116 def as_string "#{@file}:#{@line}:#{@column}:#{@offset}" end |
#to_s ⇒ Object
120 121 122 |
# File 'lib/ffi/clang/source_location.rb', line 120 def to_s "SpellingLocation <#{self.as_string}>" end |