Class: FFI::Clang::PresumedLocation
- Inherits:
-
SourceLocation
- Object
- SourceLocation
- FFI::Clang::PresumedLocation
- Defined in:
- lib/ffi/clang/source_location.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#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) ⇒ PresumedLocation
constructor
A new instance of PresumedLocation.
- #to_s ⇒ Object
Methods inherited from SourceLocation
#==, #from_main_file?, #in_system_header?, #null?, null_location
Constructor Details
#initialize(location) ⇒ PresumedLocation
Returns a new instance of PresumedLocation.
74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/ffi/clang/source_location.rb', line 74 def initialize(location) super(location) cxstring = MemoryPointer.new Lib::CXString line = MemoryPointer.new :uint column = MemoryPointer.new :uint Lib::get_presumed_location(@location, cxstring, line, column) @filename = Lib.extract_string cxstring @line = line.get_uint(0) @column = column.get_uint(0) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
72 73 74 |
# File 'lib/ffi/clang/source_location.rb', line 72 def column @column end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
72 73 74 |
# File 'lib/ffi/clang/source_location.rb', line 72 def filename @filename end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
72 73 74 |
# File 'lib/ffi/clang/source_location.rb', line 72 def line @line end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
72 73 74 |
# File 'lib/ffi/clang/source_location.rb', line 72 def offset @offset end |
Instance Method Details
#as_string ⇒ Object
88 89 90 |
# File 'lib/ffi/clang/source_location.rb', line 88 def as_string "#{@filename}:#{@line}:#{@column}" end |
#to_s ⇒ Object
92 93 94 |
# File 'lib/ffi/clang/source_location.rb', line 92 def to_s "PresumedLocation <#{self.as_string}>" end |