File indexing completed on 2024-06-16 11:34:36

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by David Saxton                                    *
0003  *   david@bluehaze.org                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #include "sourceline.h"
0012 
0013 // BEGIN class SourceLine
0014 SourceLine::SourceLine()
0015     : m_line(-1)
0016 {
0017 }
0018 
0019 SourceLine::SourceLine(const QString &fileName, int line)
0020     : m_fileName(fileName)
0021     , m_line(line)
0022 {
0023 }
0024 
0025 bool SourceLine::operator<(const SourceLine &sourceLine) const
0026 {
0027     return (m_fileName < sourceLine.fileName()) || (m_fileName == sourceLine.fileName() && m_line < sourceLine.line());
0028 }
0029 
0030 bool SourceLine::operator==(const SourceLine &sourceLine) const
0031 {
0032     return (sourceLine.fileName() == fileName()) && (sourceLine.line() == line());
0033 }
0034 // END class SourceLine