Class: FFI::Clang::SourceLocation

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ SourceLocation

Returns a new instance of SourceLocation.



34
35
36
# File 'lib/ffi/clang/source_location.rb', line 34

def initialize(location)
	@location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



33
34
35
# File 'lib/ffi/clang/source_location.rb', line 33

def location
  @location
end

Class Method Details

.null_locationObject



29
30
31
# File 'lib/ffi/clang/source_location.rb', line 29

def self.null_location
	ExpansionLocation.new Lib.get_null_location
end

Instance Method Details

#==(other) ⇒ Object



66
67
68
# File 'lib/ffi/clang/source_location.rb', line 66

def ==(other)
	Lib.equal_locations(@location, other.location) != 0
end

#expansion_locationObject



46
47
48
# File 'lib/ffi/clang/source_location.rb', line 46

def expansion_location
	ExpansionLocation.new(@location)
end

#file_locationObject



58
59
60
# File 'lib/ffi/clang/source_location.rb', line 58

def file_location
	FileLocation.new(@location)
end

#from_main_file?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/ffi/clang/source_location.rb', line 42

def from_main_file?
	Lib.location_is_from_main_file(@location) != 0
end

#in_system_header?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/ffi/clang/source_location.rb', line 38

def in_system_header?
	Lib.location_in_system_header(@location) != 0
end

#null?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/ffi/clang/source_location.rb', line 62

def null?
	Lib.equal_locations(@location, Lib.get_null_location) != 0
end

#presumed_locationObject



50
51
52
# File 'lib/ffi/clang/source_location.rb', line 50

def presumed_location
	PresumedLocation.new(@location)
end

#spelling_locationObject



54
55
56
# File 'lib/ffi/clang/source_location.rb', line 54

def spelling_location
	SpellingLocation.new(@location)
end