Skip to content
Snippets Groups Projects
Commit 87503d25 authored by Theodoros Katzalis's avatar Theodoros Katzalis
Browse files

Minor changes

parent f8f60426
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/** /**
* A class that represents the time and date. * A class that represents the time and date.
* *
* @notes * @note
* This struct is similar to the `struct tm` of <ctime> library but it is more embedded-friendly * This struct is similar to the `struct tm` of <ctime> library but it is more embedded-friendly
*/ */
class TimeAndDate { class TimeAndDate {
......
...@@ -60,7 +60,7 @@ private: ...@@ -60,7 +60,7 @@ private:
* @todo check if we need to change the epoch to ,the recommended from the standard, 1 January * @todo check if we need to change the epoch to ,the recommended from the standard, 1 January
* 1958 * 1958
*/ */
TimeAndDate utcTime(uint32_t seconds); TimeAndDate utcTime(uint32_t seconds);
public: public:
......
#include "Helpers/TimeHelper.hpp" #include "Helpers/TimeHelper.hpp"
bool TimeAndDate::operator<(const TimeAndDate &Date) { bool TimeAndDate::operator<(const TimeAndDate &Date) {
//@note clang tidy complaints when using else after return so that's why there are these
// numerous if checks. Sorry for the ugly code...
// compare years // compare years
if (this->year < Date.year) { if (this->year < Date.year) {
return true; return true;
...@@ -50,13 +47,9 @@ bool TimeAndDate::operator<(const TimeAndDate &Date) { ...@@ -50,13 +47,9 @@ bool TimeAndDate::operator<(const TimeAndDate &Date) {
} }
return false; return false;
} }
bool TimeAndDate::operator>(const TimeAndDate &Date) { bool TimeAndDate::operator>(const TimeAndDate &Date) {
//@note clang tidy complaints when using else after return so that's why there are these
// numerous if checks. Sorry for the ugly code...
// compare years // compare years
if (this->year > Date.year) { if (this->year > Date.year) {
return true; return true;
...@@ -103,13 +96,9 @@ bool TimeAndDate::operator>(const TimeAndDate &Date) { ...@@ -103,13 +96,9 @@ bool TimeAndDate::operator>(const TimeAndDate &Date) {
} }
return false; return false;
} }
bool TimeAndDate::operator<=(const TimeAndDate &Date) { bool TimeAndDate::operator<=(const TimeAndDate &Date) {
//@note clang tidy complaints when using else after return so that's why there are these
// numerous if checks. Sorry for the ugly code...
// compare years // compare years
if (this->year < Date.year) { if (this->year < Date.year) {
return true; return true;
...@@ -159,13 +148,9 @@ bool TimeAndDate::operator<=(const TimeAndDate &Date) { ...@@ -159,13 +148,9 @@ bool TimeAndDate::operator<=(const TimeAndDate &Date) {
} }
return true; return true;
} }
bool TimeAndDate::operator>=(const TimeAndDate &Date) { bool TimeAndDate::operator>=(const TimeAndDate &Date) {
//@note clang tidy complaints when using else after return so that's why there are these
// numerous if checks. Sorry for the ugly code...
// compare years // compare years
if (this->year > Date.year) { if (this->year > Date.year) {
return true; return true;
...@@ -215,7 +200,6 @@ bool TimeAndDate::operator>=(const TimeAndDate &Date) { ...@@ -215,7 +200,6 @@ bool TimeAndDate::operator>=(const TimeAndDate &Date) {
} }
return true; return true;
} }
bool TimeAndDate::operator==(const TimeAndDate &Date) { bool TimeAndDate::operator==(const TimeAndDate &Date) {
...@@ -250,5 +234,4 @@ bool TimeAndDate::operator==(const TimeAndDate &Date) { ...@@ -250,5 +234,4 @@ bool TimeAndDate::operator==(const TimeAndDate &Date) {
} }
return true; return true;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment