A location holds the file location of an error.
More...
#include <zorba/internal/diagnostic.h>
|
column_type | column () const |
| Gets the column number, if any. More...
|
|
column_type | column_end () const |
| Gets the ending column number, if any. More...
|
|
char const * | file () const |
| Gets the file name, if any. More...
|
|
line_type | line () const |
| Gets the line number, if any. More...
|
|
line_type | line_end () const |
| Gets the ending line number, if any. More...
|
|
| location () |
| Constructs a default (empty) location. More...
|
|
| location (char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0) |
| Constructs a location. More...
|
|
template<class StringType > |
| location (StringType const &file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0) |
| Constructs a location. More...
|
|
| operator explicit_bool::type () const |
| Conversion to bool for testing whether this location has been set. More...
|
|
bool | operator! () const |
| Checks whether this location has not been set. More...
|
|
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. More...
|
|
A location holds the file location of an error.
Definition at line 47 of file internal/diagnostic.h.
zorba::internal::diagnostic::location::location |
( |
) | |
|
|
inline |
Constructs a location.
- Parameters
-
file | 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. |
Definition at line 85 of file internal/diagnostic.h.
template<class StringType >
Constructs a location.
- Template Parameters
-
StringType | The string type for file. |
- Parameters
-
file | 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. |
Definition at line 106 of file internal/diagnostic.h.
column_type zorba::internal::diagnostic::location::column |
( |
) | |
const |
|
inline |
Gets the column number, if any.
- Returns
- Returns the column number or 0 if unset.
Definition at line 136 of file internal/diagnostic.h.
column_type zorba::internal::diagnostic::location::column_end |
( |
) | |
const |
|
inline |
Gets the ending column number, if any.
- Returns
- Returns the column number or 0 if unset.
Definition at line 154 of file internal/diagnostic.h.
char const* zorba::internal::diagnostic::location::file |
( |
) | |
const |
|
inline |
Gets the file name, if any.
- Returns
- Returns the file name or the empty string if unset.
Definition at line 118 of file internal/diagnostic.h.
line_type zorba::internal::diagnostic::location::line |
( |
) | |
const |
|
inline |
Gets the line number, if any.
- Returns
- Returns the line number or 0 if unset.
Definition at line 127 of file internal/diagnostic.h.
line_type zorba::internal::diagnostic::location::line_end |
( |
) | |
const |
|
inline |
Gets the ending line number, if any.
- Returns
- Returns the line number or 0 if unset.
Definition at line 145 of file internal/diagnostic.h.
Conversion to bool
for testing whether this location has been set.
- Returns
- Returns
true
only if this location has been set.
Definition at line 163 of file internal/diagnostic.h.
bool zorba::internal::diagnostic::location::operator! |
( |
) | |
const |
|
inline |
Checks whether this location has not been set.
- Returns
- Returns
true
only if this location has not been set.
Definition at line 172 of file internal/diagnostic.h.
Sets the location information.
- Parameters
-
file | 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. |
Definition at line 187 of file internal/diagnostic.h.
void serialization::operator& |
( |
serialization::Archiver & |
, |
|
|
location & |
|
|
) |
| |
|
friend |
location const zorba::internal::diagnostic::location::empty |
|
static |
The documentation for this class was generated from the following file: