nis-util
1.0.D108
|
#include <source_location.h>
Public Member Functions | |
virtual | ~source_location () |
source_location () | |
source_location (const rcstring &file_name, int line_number) | |
source_location (const source_location &rhs) | |
source_location & | operator= (const source_location &rhs) |
rcstring | get_file_name (void) const |
int | get_line_number (void) const |
rcstring | get_both (void) const |
source_location | operator+ (int nlines) const |
Private Attributes | |
rcstring | file_name |
int | line_number |
The source_location class is used to represent the position of an something within a source text file, identified by file name and line number.
Definition at line 29 of file source_location.h.
source_location::~source_location | ( | ) | [virtual] |
The destructor.
Definition at line 25 of file source_location.cc.
The default constructor.
Definition at line 30 of file source_location.cc.
source_location::source_location | ( | const rcstring & | file_name, |
int | line_number | ||
) |
The constructor.
file_name | The name of the source file in which the thing appears. |
line_number | The number of the line within the source file in which the thing appears. |
Definition at line 37 of file source_location.cc.
source_location::source_location | ( | const source_location & | rhs | ) |
The copy constructor.
rhs | The right hand side of the initialization. |
Definition at line 48 of file source_location.cc.
rcstring source_location::get_both | ( | void | ) | const |
The get_both method is used to obtain both the file name and the line number, formatted as "%s: %d" for use in error messages.
Definition at line 68 of file source_location.cc.
rcstring source_location::get_file_name | ( | void | ) | const [inline] |
The get_file_name method is used to obtain the name of the source file in which the thing appears.
Definition at line 73 of file source_location.h.
int source_location::get_line_number | ( | void | ) | const [inline] |
The get_line_number method is used to obtain the number of the line within the source file in which the thing appears.
Definition at line 79 of file source_location.h.
source_location source_location::operator+ | ( | int | nlines | ) | const |
The addition operator is used to create a new source location by adding the given number of lines to this location.
Definition at line 80 of file source_location.cc.
source_location & source_location::operator= | ( | const source_location & | rhs | ) |
The assignment operator.
rhs | The right hand side of the assignment. |
Definition at line 56 of file source_location.cc.
rcstring source_location::file_name [private] |
The file_name instance variable is used to remember the name of the source file in which the thing appears.
Definition at line 98 of file source_location.h.
int source_location::line_number [private] |
The line_number instance variable is used to remember the number (starting from 1) of the line within the source file in which the thing appears.
Definition at line 105 of file source_location.h.