File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,16 @@ bool SimpleWeatherService::CurrentWeather::operator==(const SimpleWeatherService
158
158
this ->maxTemperature == other.maxTemperature && this ->minTemperature == other.maxTemperature &&
159
159
std::strcmp (this ->location .data (), other.location .data ()) == 0 ;
160
160
}
161
+
162
+ bool SimpleWeatherService::Forecast::Day::operator ==(const SimpleWeatherService::Forecast::Day& other) const {
163
+ return this ->iconId == other.iconId && this ->maxTemperature == other.maxTemperature && this ->minTemperature == other.maxTemperature ;
164
+ }
165
+
166
+ bool SimpleWeatherService::Forecast::operator ==(const SimpleWeatherService::Forecast& other) const {
167
+ for (int i = 0 ; i < this ->nbDays ; i++) {
168
+ if (this ->days [i] != other.days [i]) {
169
+ return false ;
170
+ }
171
+ }
172
+ return this ->timestamp == other.timestamp && this ->nbDays == other.nbDays ;
173
+ }
Original file line number Diff line number Diff line change @@ -96,9 +96,13 @@ namespace Pinetime {
96
96
int16_t minTemperature;
97
97
int16_t maxTemperature;
98
98
Icons iconId;
99
+
100
+ bool operator ==(const Day& other) const ;
99
101
};
100
102
101
103
std::array<Day, MaxNbForecastDays> days;
104
+
105
+ bool operator ==(const Forecast& other) const ;
102
106
};
103
107
104
108
std::optional<CurrentWeather> Current () const ;
You can’t perform that action at this time.
0 commit comments