mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
- Added Grid::Cell::operator==
This commit is contained in:
parent
f9ed90bee0
commit
2e047367b0
2 changed files with 32 additions and 0 deletions
30
src/Grid.cpp
30
src/Grid.cpp
|
@ -377,6 +377,36 @@ Grid::Cell::operator std::string () const
|
|||
return std::string ("");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Grid::Cell::operator== (const Grid::Cell& rhs) const
|
||||
{
|
||||
switch (mType)
|
||||
{
|
||||
case CELL_BOOL: return mBool == rhs.mBool ? true : false;
|
||||
case CELL_CHAR: return mChar == rhs.mChar ? true : false;
|
||||
case CELL_INT: return mInt == rhs.mInt ? true : false;
|
||||
case CELL_FLOAT: return mFloat == rhs.mFloat ? true : false;
|
||||
case CELL_DOUBLE: return mDouble == rhs.mDouble ? true : false;
|
||||
case CELL_STRING: return mString == rhs.mString ? true : false;
|
||||
default: break; // To prevent warnings.
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Grid::Cell::operator!= (const Grid::Cell& rhs) const
|
||||
{
|
||||
switch (mType)
|
||||
{
|
||||
case CELL_BOOL: return mBool != rhs.mBool ? true : false;
|
||||
case CELL_CHAR: return mChar != rhs.mChar ? true : false;
|
||||
case CELL_INT: return mInt != rhs.mInt ? true : false;
|
||||
case CELL_FLOAT: return mFloat != rhs.mFloat ? true : false;
|
||||
case CELL_DOUBLE: return mDouble != rhs.mDouble ? true : false;
|
||||
case CELL_STRING: return mString != rhs.mString ? true : false;
|
||||
default: break; // To prevent warnings.
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Grid::Cell::cellType Grid::Cell::type () const
|
||||
{
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
operator float () const;
|
||||
operator double () const;
|
||||
operator std::string () const;
|
||||
bool operator== (const Cell&) const;
|
||||
bool operator!= (const Cell&) const;
|
||||
|
||||
enum cellType {CELL_BOOL, CELL_CHAR, CELL_INT, CELL_FLOAT, CELL_DOUBLE, CELL_STRING};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue