position
¶position
: filename_type ¶The base type for file names. Defaults to const std::string
.
See api.filename.type
, to change its definition.
position
: counter_type ¶The type used to store line and column numbers. Defined as int
.
position
: position (filename_type*
file = nullptr, counter_type
line = 1, counter_type
col = 1)
¶Create a position
denoting a given point. Note that file
is
not reclaimed when the position
is destroyed: memory managed must be
handled elsewhere.
position
: void
initialize (filename_type*
file = nullptr, counter_type
line = 1, counter_type
col = 1)
¶Reset the position to the given values.
position
: filename_type*
file ¶The name of the file. It will always be handled as a pointer, the parser will never duplicate nor deallocate it.
position
: counter_type
line ¶The line, starting at 1.
position
: void
lines (counter_type
height = 1)
¶If height is not null, advance by height lines, resetting the column number. The resulting line number cannot be less than 1.
position
: counter_type
column ¶The column, starting at 1.
position
: void
columns (counter_type
width = 1)
¶Advance by width columns, without changing the line number. The resulting column number cannot be less than 1.
position
: position&
operator+= (counter_type
width)
¶position
: position
operator+ (counter_type
width)
¶position
: position&
operator-= (counter_type
width)
¶position
: position
operator- (counter_type
width)
¶Various forms of syntactic sugar for columns
.
position
: bool
operator== (const position&
that)
¶position
: bool
operator!= (const position&
that)
¶Whether *this
and that
denote equal/different positions.
std::ostream&
operator<< (std::ostream&
o, const position&
p)
¶Report p on o like this: ‘file:line.column’, or ‘line.column’ if file is null.