|
Clingo
|
Class representing a range in a file. More...
#include <core.hh>
Public Member Functions | |
| Location (clingo_location_t const *loc) | |
| Constructs a location from an existing C representation. | |
| Location (Position const &begin, Position const &end) | |
| Constructs a location from a begin and end position. | |
| auto | begin () const -> Position |
| Get the position marking the beginning of the location. | |
| auto | end () const -> Position |
| Get the position marking the end of the location. | |
| auto | to_string () const -> std::string |
| Convert the location to a string representation. | |
| auto | hash () const noexcept -> size_t |
| Get a hash value for the location. | |
Friends | |
| auto | c_cast (Location const &x) -> clingo_location_t const * |
| Cast the location to its C representation. | |
| auto | operator== (Location const &a, Location const &b) noexcept -> bool |
| Compare two locations for equality. | |
| auto | operator<=> (Location const &a, Location const &b) noexcept -> std::strong_ordering |
| Compare two locations. | |
Class representing a range in a file.
Locations implement value semantics supporting ordering and hashing.
Constructs a location from a begin and end position.
| begin | the position marking the beginning of the location |
| end | the position marking the end of the location |
|
inline |
Get the position marking the beginning of the location.
|
inline |
Get the position marking the end of the location.
|
inline |
Convert the location to a string representation.
|
friend |
Cast the location to its C representation.
Compare two locations.
| a | the first location to compare |
| b | the second location to compare |
Compare two locations for equality.
| a | the first location to compare |
| b | the second location to compare |