Member Function Documentation
Location::Location()
Constructs an empty location.
Location::Location(const QString & fileName)
Constructs a location with (fileName, 1, 1) on its file position stack.
Location::Location(const Location & other)
The copy constructor copies the contents of other into this Location using the assignment operator.
Location::~Location()
void Location::advance(QChar ch)
Advance the current file position, using ch to decide how to do that. If ch is a '\\n', increment the current line number and set the column number to 1. If \ch
is a '\\t', increment to the next tab column. Otherwise, increment the column number by 1.
The current file position is the one on top of the position stack.
void Location::advanceLines(int n)
int Location::columnNo() const
Returns the current column number. Must not be called on an empty Location object.
See also setColumnNo(), filePath(), and lineNo().
int Location::depth() const
void Location::error(const QString & message, const QString & details = QString()) const
Writes message and detals to stderr as a formatted error message.
bool Location::etc() const
See also setEtc().
void Location::fatal(const QString & message, const QString & details = QString()) const
Writes message and detals to stderr as a formatted error message and then exits the program.
QString Location::fileName() const
Returns the file name part of the file path, ie the current file. Must not be called on an empty Location object.
const QString & Location::filePath() const
Returns the current path and file name. Must not be called on an empty Location object.
See also lineNo() and columnNo().
void Location::information(const QString & message) [static]
Prints message to stdout followed by a '\n'.
void Location::initialize(const Config & config) [static]
Gets several parameters from the config, including tab size, program name, and a regular expression that appears to be used for matching certain error messages so that emitMessage() can avoid printing them.
void Location::internalError(const QString & hint) [static]
Report a program bug, including the hint.
bool Location::isEmpty() const
Returns true if there is no file name set yet; returns false otherwise. The functions filePath(), lineNo() and columnNo() must not be called on an empty Location object.
int Location::lineNo() const
Returns the current line number. Must not be called on an empty Location object.
See also setLineNo(), filePath(), and columnNo().
void Location::pop()
Pops the top of the internal stack. The current file position becomes the next one in the new top of stack.
See also push().
void Location::push(const QString & filePath)
Pushes filePath onto the file position stack. The current file position becomes (filePath, 1, 1).
See also pop().
void Location::setColumnNo(int no)
See also columnNo().
void Location::setEtc(bool etc)
See also etc().
void Location::setLineNo(int no)
See also lineNo().
void Location::start()
If the file position on top of the stack has a line number less than 1, set its line number to 1 and its column number to 1. Otherwise, do nothing.
void Location::terminate() [static]
Apparently, all this does is delete the regular expression used for intercepting certain error messages that should not be emitted by emitMessage().
void Location::warning(const QString & message, const QString & details = QString()) const
Writes message and detals to stderr as a formatted warning message.
Location & Location::operator=(const Location & other)
The assignment operator does a deep copy of the entire state of other into this Location.