KDevelop API Documentation

caret.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2002 by Jakob Simon-Gaarde                              *
00003  *   jsgaarde@tdcspace.dk                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 
00013 #include "caret.h"
00014 
00015 Caret::Caret() : m_row(0), m_idx(0)
00016 {}
00017 
00018 Caret::Caret(const int row, const int idx) : m_row(row), m_idx(idx)
00019 {}
00020 
00021 Caret::Caret(const Caret& value) : m_row(value.m_row), m_idx(value.m_idx)
00022 {}
00023 
00024 bool Caret::operator<(const Caret& compare)
00025 {
00026   if (m_row<compare.m_row)
00027     return true;
00028   else if (m_row==compare.m_row &&
00029            m_idx<compare.m_idx)
00030     return true;
00031   return false;
00032 }
00033 
00034 bool Caret::operator>(const Caret& compare)
00035 {
00036   if (m_row>compare.m_row)
00037     return true;
00038   else if (m_row==compare.m_row &&
00039            m_idx>compare.m_idx)
00040     return true;
00041   return false;
00042 }
00043 
00044 bool Caret::operator<=(const Caret& compare)
00045 {
00046   if (*this < compare ||
00047       *this == compare)
00048     return true;
00049   return false;
00050 }
00051 
00052 bool Caret::operator>=(const Caret& compare)
00053 {
00054   if (*this > compare ||
00055       *this == compare)
00056     return true;
00057   return false;
00058 }
00059 
00060 bool Caret::operator==(const Caret& compare)
00061 {
00062   if (m_row==compare.m_row &&
00063       m_idx==compare.m_idx)
00064     return true;
00065   return false;
00066 }
00067 
00068 bool Caret::operator!=(const Caret& compare)
00069 {
00070   if (m_row!=compare.m_row ||
00071       m_idx!=compare.m_idx)
00072     return true;
00073   return false;
00074 }
00075 
00076 Caret Caret::operator=(const Caret& value)
00077 {
00078   
00079   m_row=value.m_row;
00080   m_idx=value.m_idx;
00081   return Caret(m_row,m_idx);
00082 }
00083 
00084 Caret Caret::operator+(const Caret& value)
00085 {
00086   return Caret(m_row+value.m_row,m_idx+value.m_idx);
00087 }
00088 
00089 Caret Caret::operator-(const Caret& value)
00090 {
00091   return Caret(m_row-value.m_row,m_idx-value.m_idx);
00092 }
00093 
00094 
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:22 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003