Class: FFI::Clang::ExpansionLocation
- Inherits:
-
SourceLocation
- Object
- SourceLocation
- FFI::Clang::ExpansionLocation
- 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) ⇒ ExpansionLocation
constructor
A new instance of ExpansionLocation.
- #to_s ⇒ Object
Methods inherited from SourceLocation
#==, #from_main_file?, #in_system_header?, #null?, null_location
Constructor Details
#initialize(location) ⇒ ExpansionLocation
Returns a new instance of ExpansionLocation.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ffi/clang/source_location.rb', line 46 def initialize(location) super(location) cxfile = MemoryPointer.new :pointer line = MemoryPointer.new :uint column = MemoryPointer.new :uint offset = MemoryPointer.new :uint Lib::get_expansion_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.
44 45 46 |
# File 'lib/ffi/clang/source_location.rb', line 44 def column @column end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
44 45 46 |
# File 'lib/ffi/clang/source_location.rb', line 44 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
44 45 46 |
# File 'lib/ffi/clang/source_location.rb', line 44 def line @line end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
44 45 46 |
# File 'lib/ffi/clang/source_location.rb', line 44 def offset @offset end |
Instance Method Details
#as_string ⇒ Object
62 63 64 |
# File 'lib/ffi/clang/source_location.rb', line 62 def as_string "#{@file}:#{@line}:#{@column}:#{@offset}" end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/ffi/clang/source_location.rb', line 66 def to_s "ExpansionLocation <#{self.as_string}>" end |