Class: FFI::Clang::ExpansionLocation

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) ⇒ ExpansionLocation

Returns a new instance of ExpansionLocation.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ffi/clang/source_location.rb', line 74

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

#columnObject (readonly)

Returns the value of attribute column.



72
73
74
# File 'lib/ffi/clang/source_location.rb', line 72

def column
  @column
end

#fileObject (readonly)

Returns the value of attribute file.



72
73
74
# File 'lib/ffi/clang/source_location.rb', line 72

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



72
73
74
# File 'lib/ffi/clang/source_location.rb', line 72

def line
  @line
end

#offsetObject (readonly)

Returns the value of attribute offset.



72
73
74
# File 'lib/ffi/clang/source_location.rb', line 72

def offset
  @offset
end