zorba::internal::diagnostic::location
#include <zorba/internal/diagnostic.h>
Public Functionscolumn_type | column() const
Gets the column number, if any. | column_type | column_end() const
Gets the ending column number, if any. | char const * | file() const
Gets the file name, if any. | line_type | line() const
Gets the line number, if any. | line_type | line_end() const
Gets the ending line number, if any. | | location()
Constructs a default (empty) location. | | location(char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Constructs a location. | | location(StringType const &file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Constructs a location. | | operator explicit_bool::type() const
Conversion to bool for testing whether this location has been set. | bool | operator!() const
Checks whether this location has not been set. | void | set(line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information. | void | set(char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information. | std::enable_if< ZORBA_HAS_C_STR(StringType), void >::type | set(StringType const &file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information. |
Public Typescolumn_typeunsigned short column_type line_typeunsigned line_type Public Static Attributesempty
A empty instance for convenience.
Public Functionscolumn
Gets the column number, if any.
ReturnsReturns the column number or 0 if unset.
column_end
Gets the ending column number, if any.
ReturnsReturns the column number or 0 if unset.
filechar const * file() const
Gets the file name, if any.
ReturnsReturns the file name or the empty string if unset.
line
Gets the line number, if any.
ReturnsReturns the line number or 0 if unset.
line_end
Gets the ending line number, if any.
ReturnsReturns the line number or 0 if unset.
location location()
Constructs a default (empty) location.
location location(char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Constructs a location.
Parametersfile |
The name of the file where the expression causing the error occurred. | line |
The line number of the file where the expression causing the error begins. | column |
The column number, if any, of the file where the expression causing the error begins. | line_end |
The end line number, if any, of the file where the expression causing the error ends. | column_end |
The end column number, if any, of the file where the expression causing the error ends. |
location location(StringType const &file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Constructs a location.
ParametersStringType |
The string type for file. |
Parametersfile |
The name of the file where the error occurred. | line |
The line number of the file where the error occurred. | column |
The column number, if any, of the file where the error occurred. | line_end |
The end line number, if any, of the file where the expression causing the error ends. | column_end |
The end column number, if any, of the file where the xpression causing the error ends. |
operator explicit_bool::type operator explicit_bool::type() const
Conversion to bool for testing whether this location has been set.
ReturnsReturns true only if this location has been set.
operator!bool operator!() const
Checks whether this location has not been set.
ReturnsReturns true only if this location has not been set.
setvoid set(line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information.
Parametersline |
The line number of the file where the error occurred. | column |
The column number, if any, of the file where the error occurred. | line_end |
The end line of the file where the error occured. | column_end |
The column number, if any, where the error ends. occurred. |
setvoid set(char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information.
Parametersfile |
The name of the file where the error occurred. | line |
The line number of the file where the error occurred. | column |
The column number, if any, of the file where the error occurred. | line_end |
The end line of the file where the error occured. | column_end |
The column number, if any, where the error ends. occurred. |
setstd::enable_if< ZORBA_HAS_C_STR(StringType), void >::type set(StringType const &file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
Sets the location information.
ParametersStringType |
The string type for file. |
Parametersfile |
The name of the file where the error occurred. | line |
The line number of the file where the error occurred. | column |
The column number, if any, of the file where the error occurred. | line_end |
The end line of the file where the error occured. | column_end |
The column number, if any, where the error ends. occurred. |
Friend Classesoperator==friend bool operator==(location const &, location const &) serialization::operator&friend void serialization::operator&(serialization::Archiver &, location &) |