zorba::internal::diagnostic::location

#include <zorba/internal/diagnostic.h>

Public Types

unsigned short

column_type

The column-number type.

unsigned

line_type

The line-number type.

Public Static Attributes

location const

empty

A empty instance for convenience.

Public 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.

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.

Friend Classes

friend bool

operator==(location const &, location const &)

friend void

serialization::operator&(serialization::Archiver &, location &)

Private Types

explicit_bool

ztd::explicit_bool explicit_bool

Public Types

column_type

unsigned short column_type

The column-number type.

line_type

unsigned line_type

The line-number type.

Public Static Attributes

empty

location const empty

A empty instance for convenience.

Private Attributes

column_

column_type column_

column_end_

column_type column_end_

file_

std::string file_

line_

line_type line_

line_end_

line_type line_end_

Public Functions

column

column_type column() const

Gets the column number, if any.

Returns

Returns the column number or 0 if unset.

column_end

column_type column_end() const

Gets the ending column number, if any.

Returns

Returns the column number or 0 if unset.

file

char const * file() const

Gets the file name, if any.

Returns

Returns the file name or the empty string if unset.

line

line_type line() const

Gets the line number, if any.

Returns

Returns the line number or 0 if unset.

line_end

line_type line_end() const

Gets the ending line number, if any.

Returns

Returns 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.

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.

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.

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.

operator explicit_bool::type

 operator explicit_bool::type() const

Conversion to bool for testing whether this location has been set.

Returns

Returns true only if this location has been set.

operator!

bool operator!() const

Checks whether this location has not been set.

Returns

Returns true only if this location has not been set.

set

void set(line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)

Sets the location information.

Parameters

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.

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.

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.

set

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.

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 of the file where the error occured.
column_end The column number, if any, where the error ends. occurred.

Friend Classes

operator==

friend bool operator==(location const &, location const &)

serialization::operator&

friend void serialization::operator&(serialization::Archiver &, location &)