GH #346: Make Poco::Data::Date and Poco::Data::Time compare functions const.

This commit is contained in:
Alex Fabijanic 2014-04-29 22:39:30 -05:00
parent 6ec4986fb1
commit 794ee36b3d
5 changed files with 17 additions and 16 deletions

View File

@ -58,6 +58,7 @@ Release 1.5.3 (2014-05-xx)
- fixed GH #362: Defect in Var::parseString when there is no space between value and newline
- fixed GH #314: JSON parsing bug
- added GH #313: MetaColumn additions for Data::ODBC and Data::SQLite
- fixed GH #346: Make Poco::Data::Date and Poco::Data::Time compare functions const.
Release 1.5.2 (2013-09-16)
==========================

View File

@ -99,16 +99,16 @@ public:
Date& operator = (const Poco::Dynamic::Var& var);
/// Assignment operator for Var.
bool operator == (const Date& date);
bool operator == (const Date& date) const;
/// Equality operator.
bool operator != (const Date& date);
bool operator != (const Date& date) const;
/// Inequality operator.
bool operator < (const Date& date);
bool operator < (const Date& date) const;
/// Less then operator.
bool operator > (const Date& date);
bool operator > (const Date& date) const;
/// Greater then operator.
private:
@ -153,7 +153,7 @@ inline Date& Date::operator = (const DateTime& dt)
}
inline bool Date::operator == (const Date& date)
inline bool Date::operator == (const Date& date) const
{
return _year == date.year() &&
_month == date.month() &&
@ -161,13 +161,13 @@ inline bool Date::operator == (const Date& date)
}
inline bool Date::operator != (const Date& date)
inline bool Date::operator != (const Date& date) const
{
return !(*this == date);
}
inline bool Date::operator > (const Date& date)
inline bool Date::operator > (const Date& date) const
{
return !(*this == date) && !(*this < date);
}

View File

@ -99,16 +99,16 @@ public:
Time& operator = (const Poco::Dynamic::Var& var);
/// Assignment operator for Var.
bool operator == (const Time& time);
bool operator == (const Time& time) const;
/// Equality operator.
bool operator != (const Time& time);
bool operator != (const Time& time) const;
/// Inequality operator.
bool operator < (const Time& time);
bool operator < (const Time& time) const;
/// Less then operator.
bool operator > (const Time& time);
bool operator > (const Time& time) const;
/// Greater then operator.
private:
@ -153,7 +153,7 @@ inline Time& Time::operator = (const DateTime& dt)
}
inline bool Time::operator == (const Time& time)
inline bool Time::operator == (const Time& time) const
{
return _hour == time.hour() &&
_minute == time.minute() &&
@ -161,13 +161,13 @@ inline bool Time::operator == (const Time& time)
}
inline bool Time::operator != (const Time& time)
inline bool Time::operator != (const Time& time) const
{
return !(*this == time);
}
inline bool Time::operator > (const Time& time)
inline bool Time::operator > (const Time& time) const
{
return !(*this == time) && !(*this < time);
}

View File

@ -92,7 +92,7 @@ void Date::assign(int year, int month, int day)
}
bool Date::operator < (const Date& date)
bool Date::operator < (const Date& date) const
{
int year = date.year();

View File

@ -89,7 +89,7 @@ void Time::assign(int hour, int minute, int second)
}
bool Time::operator < (const Time& time)
bool Time::operator < (const Time& time) const
{
int hour = time.hour();