diff options
Diffstat (limited to 'libforecastio/forecasts.c')
-rw-r--r-- | libforecastio/forecasts.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libforecastio/forecasts.c b/libforecastio/forecasts.c index d7cb908..623a2d6 100644 --- a/libforecastio/forecasts.c +++ b/libforecastio/forecasts.c @@ -48,6 +48,26 @@ void cForecasts::SetForecast(json_t *forecast) { } } +int cForecasts::NumHourly(void) { + int num = 0; + cForecast *f = GetFirstHourly(); + while (f) { + num++; + f = GetNext(); + } + return num; +} + +int cForecasts::NumDaily(void) { + int num = 0; + cForecast *f = GetFirstDaily(); + while (f) { + num++; + f = GetNext(); + } + return num; +} + cForecast *cForecasts::GetForecast(int dataPoint) { if (!dataPoints) return NULL; |