A location hold the file location of an error. More...
#include <zorba/internal/diagnostic.h>
Public Types | |
typedef unsigned short | column_type |
The column-number type. | |
typedef unsigned | line_type |
The line-number type. | |
Public Member Functions | |
column_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. | |
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. | |
operator bool () 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 (char const *file, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0) |
Sets the location information. | |
Static Public Attributes | |
static location const | empty |
A empty instance for convenience. | |
Friends | |
void | serialization::operator& (serialization::Archiver &, location &) |
A location hold the file location of an error.
Definition at line 47 of file internal/diagnostic.h.
typedef unsigned short zorba::internal::diagnostic::location::column_type |
The column-number type.
Definition at line 57 of file internal/diagnostic.h.
typedef unsigned zorba::internal::diagnostic::location::line_type |
The line-number type.
Definition at line 52 of file internal/diagnostic.h.
zorba::internal::diagnostic::location::location | ( | ) | [inline] |
Constructs a default (empty) location.
Definition at line 67 of file internal/diagnostic.h.
zorba::internal::diagnostic::location::location | ( | char const * | file, |
line_type | line, | ||
column_type | column = 0 , |
||
line_type | line_end = 0 , |
||
column_type | column_end = 0 |
||
) | [inline] |
Constructs a location.
file | The name of the file where the error occurred. |
line | The line number of the file where the expression that raises the error begins. |
column | The column number, if any, of the file where the expression that raises 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 xpression causing the error ends. |
Definition at line 83 of file internal/diagnostic.h.
zorba::internal::diagnostic::location::location | ( | StringType const & | file, |
line_type | line, | ||
column_type | column = 0 , |
||
line_type | line_end = 0 , |
||
column_type | column_end = 0 |
||
) | [inline] |
Constructs a location.
StringType | The string type for file. |
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 107 of file internal/diagnostic.h.
column_type zorba::internal::diagnostic::location::column | ( | ) | const [inline] |
Gets the column number, if any.
Definition at line 141 of file internal/diagnostic.h.
column_type zorba::internal::diagnostic::location::column_end | ( | ) | const [inline] |
Gets the ending column number, if any.
Definition at line 159 of file internal/diagnostic.h.
char const* zorba::internal::diagnostic::location::file | ( | ) | const [inline] |
Gets the file name, if any.
Definition at line 123 of file internal/diagnostic.h.
line_type zorba::internal::diagnostic::location::line | ( | ) | const [inline] |
Gets the line number, if any.
Definition at line 132 of file internal/diagnostic.h.
line_type zorba::internal::diagnostic::location::line_end | ( | ) | const [inline] |
Gets the ending line number, if any.
Definition at line 150 of file internal/diagnostic.h.
zorba::internal::diagnostic::location::operator bool | ( | ) | const [inline] |
Conversion to bool
for testing whether this location has been set.
true
only if this location has been set. Definition at line 168 of file internal/diagnostic.h.
bool zorba::internal::diagnostic::location::operator! | ( | ) | const [inline] |
Checks whether this location has not been set.
true
only if this location has not been set. Definition at line 177 of file internal/diagnostic.h.
void zorba::internal::diagnostic::location::set | ( | char const * | file, |
line_type | line, | ||
column_type | column = 0 , |
||
line_type | line_end = 0 , |
||
column_type | column_end = 0 |
||
) | [inline] |
Sets the location information.
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 192 of file internal/diagnostic.h.
void serialization::operator& | ( | serialization::Archiver & | , |
location & | |||
) | [friend] |
location const zorba::internal::diagnostic::location::empty [static] |
A empty instance for convenience.
Definition at line 62 of file internal/diagnostic.h.