Class: FFI::Clang::PresumedLocation

Inherits:
SourceLocation show all
Defined in:
lib/ffi/clang/source_location.rb

Instance Attribute Summary collapse

Attributes inherited from SourceLocation

#location

Instance Method Summary collapse

Methods inherited from SourceLocation

#==, #expansion_location, #file_location, #from_main_file?, #in_system_header?, #null?, null_location, #presumed_location, #spelling_location

Constructor Details

#initialize(location) ⇒ PresumedLocation

Returns a new instance of PresumedLocation.



94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/ffi/clang/source_location.rb', line 94

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

#columnObject (readonly)

Returns the value of attribute column.



92
93
94
# File 'lib/ffi/clang/source_location.rb', line 92

def column
  @column
end

#filenameObject (readonly)

Returns the value of attribute filename.



92
93
94
# File 'lib/ffi/clang/source_location.rb', line 92

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



92
93
94
# File 'lib/ffi/clang/source_location.rb', line 92

def line
  @line
end

#offsetObject (readonly)

Returns the value of attribute offset.



92
93
94
# File 'lib/ffi/clang/source_location.rb', line 92

def offset
  @offset
end