Class: FFI::Clang::SourceLocation
- Inherits:
-
Object
- Object
- FFI::Clang::SourceLocation
- Defined in:
- lib/ffi/clang/source_location.rb
Overview
Represents a location in source code. This base class provides common functionality for source locations, with specific subclasses for different types of location information.
Direct Known Subclasses
ExpansionLocation, FileLocation, PresumedLocation, SpellingLocation
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Class Method Summary collapse
-
.null_location ⇒ Object
Get a null source location.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Compare this location with another for equality.
-
#from_main_file? ⇒ Boolean
Check if this location is from the main file.
-
#in_system_header? ⇒ Boolean
Check if this location is in a system header.
-
#initialize(location) ⇒ SourceLocation
constructor
Create a new source location.
-
#null? ⇒ Boolean
Check if this location is null.
Constructor Details
#initialize(location) ⇒ SourceLocation
Create a new source location.
32 33 34 |
# File 'lib/ffi/clang/source_location.rb', line 32 def initialize(location) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
28 29 30 |
# File 'lib/ffi/clang/source_location.rb', line 28 def location @location end |
Class Method Details
.null_location ⇒ Object
Get a null source location.
22 23 24 |
# File 'lib/ffi/clang/source_location.rb', line 22 def self.null_location ExpansionLocation.new Lib.get_null_location end |
Instance Method Details
#==(other) ⇒ Object
Compare this location with another for equality.
57 58 59 |
# File 'lib/ffi/clang/source_location.rb', line 57 def ==(other) Lib.equal_locations(@location, other.location) != 0 end |
#from_main_file? ⇒ Boolean
Check if this location is from the main file.
44 45 46 |
# File 'lib/ffi/clang/source_location.rb', line 44 def from_main_file? Lib.location_is_from_main_file(@location) != 0 end |
#in_system_header? ⇒ Boolean
Check if this location is in a system header.
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
Check if this location is null.
50 51 52 |
# File 'lib/ffi/clang/source_location.rb', line 50 def null? Lib.equal_locations(@location, Lib.get_null_location) != 0 end |