Next: , Previous: , Up: C++ Location Values   [Contents][Index]


10.1.3.2 C++ location

Constructor on location: location (const position& begin, const position& end)

Create a Location from the endpoints of the range.

Constructor on location: location (const position& pos = position())
Constructor on location: location (std::string* file, uint line, uint col)

Create a Location denoting an empty range located at a given point.

Method on location: void initialize (std::string* file = 0, uint line = 1, uint col = 1)

Reset the location to an empty range at the given values.

Instance Variable of location: position begin
Instance Variable of location: position end

The first, inclusive, position of the range, and the first beyond.

Method on location: void columns (int width = 1)
Method on location: void lines (int height = 1)

Forwarded to the end position.

Method on location: location operator+ (int width)
Method on location: location operator+= (int width)
Method on location: location operator- (int width)
Method on location: location operator-= (int width)

Various forms of syntactic sugar for columns.

Method on location: location operator+ (const location& end)
Method on location: location operator+= (const location& end)

Join two locations: starts at the position of the first one, and ends at the position of the second.

Method on location: void step ()

Move begin onto end.

Method on location: bool operator== (const location& that)
Method on location: bool operator!= (const location& that)

Whether *this and that denote equal/different ranges of positions.

Function: std::ostream& operator<< (std::ostream& o, const location& p)

Report p on o, taking care of special cases such as: no filename defined, or equal filename/line or column.


Next: , Previous: , Up: C++ Location Values   [Contents][Index]