KWeatherCore::WeatherForecast

Search for usage in LXR

KWeatherCore::WeatherForecast Class Reference

#include <weatherforecast.h>

Inheritance diagram for KWeatherCore::WeatherForecast:

Public Member Functions

 WeatherForecast ()
 
 WeatherForecast (const WeatherForecast &other)
 
 WeatherForecast (WeatherForecast &&other)
 
const QDateTimecreatedTime () const
 
const std::vector< DailyWeatherForecast > & dailyWeatherForecast () const
 
double latitude () const
 
double longitude () const
 
WeatherForecastoperator+= (const DailyWeatherForecast &forecast)
 
WeatherForecastoperator+= (DailyWeatherForecast &&forecast)
 
WeatherForecastoperator+= (const HourlyWeatherForecast &forecast)
 
WeatherForecastoperator+= (HourlyWeatherForecast &&forecast)
 
WeatherForecastoperator= (const WeatherForecast &other)
 
void setCoordinate (double latitude, double longitude)
 
void setDailyWeatherForecast (const std::vector< DailyWeatherForecast > &forecast)
 
void setDailyWeatherForecast (std::vector< DailyWeatherForecast > &&forecast)
 
void setSunriseForecast (const std::vector< Sunrise > &sunrise)
 
void setSunriseForecast (std::vector< Sunrise > &&sunrise)
 
void setTimezone (QString timezone)
 
const QStringtimezone () const
 
QJsonObject toJson () const
 
- Public Member Functions inherited from QSharedData
 QSharedData (const QSharedData &)
 

Static Public Member Functions

static QExplicitlySharedDataPointer< WeatherForecastfromJson (QJsonObject obj)
 

Detailed Description

The WeatherForecast class contains the weather information of one location for days.

See also
WeatherForecastSource
Author
Han Young hanyo[email protected][email protected][email protected]proto[email protected]nmai[email protected]l.com

Definition at line 22 of file weatherforecast.h.

Constructor & Destructor Documentation

KWeatherCore::WeatherForecast::WeatherForecast ( )

construct an empty object

Definition at line 20 of file weatherforecast.cpp.

Member Function Documentation

const QDateTime & KWeatherCore::WeatherForecast::createdTime ( ) const
Returns
the time this forecast object was created, this value won't change once constructed

Definition at line 80 of file weatherforecast.cpp.

const std::vector< DailyWeatherForecast > & KWeatherCore::WeatherForecast::dailyWeatherForecast ( ) const
Returns
daily weather forecast

Definition at line 68 of file weatherforecast.cpp.

QExplicitlySharedDataPointer< WeatherForecast > KWeatherCore::WeatherForecast::fromJson ( QJsonObject  obj)
static

construct from json

Definition at line 52 of file weatherforecast.cpp.

WeatherForecast & KWeatherCore::WeatherForecast::operator+= ( const DailyWeatherForecast forecast)

merge DailyWeatherForecast

Definition at line 131 of file weatherforecast.cpp.

WeatherForecast & KWeatherCore::WeatherForecast::operator+= ( DailyWeatherForecast &&  forecast)

overloaded version

Definition at line 144 of file weatherforecast.cpp.

WeatherForecast & KWeatherCore::WeatherForecast::operator+= ( const HourlyWeatherForecast forecast)

merge HourlyWeatherForecast, new day is created when required

Definition at line 158 of file weatherforecast.cpp.

WeatherForecast & KWeatherCore::WeatherForecast::operator+= ( HourlyWeatherForecast &&  forecast)

overloaded version

Definition at line 177 of file weatherforecast.cpp.

void KWeatherCore::WeatherForecast::setCoordinate ( double  latitude,
double  longitude 
)

setCoordinate

Definition at line 88 of file weatherforecast.cpp.

void KWeatherCore::WeatherForecast::setSunriseForecast ( const std::vector< Sunrise > &  sunrise)

the vector should be sorted

Definition at line 107 of file weatherforecast.cpp.

void KWeatherCore::WeatherForecast::setSunriseForecast ( std::vector< Sunrise > &&  sunrise)

overloaded version

Definition at line 117 of file weatherforecast.cpp.

void KWeatherCore::WeatherForecast::setTimezone ( QString  timezone)
Parameters
timezonevalid IANA Time Zone ID

Definition at line 93 of file weatherforecast.cpp.

const QString & KWeatherCore::WeatherForecast::timezone ( ) const

IANA Time Zone ID.

Returns

Definition at line 84 of file weatherforecast.cpp.

QJsonObject KWeatherCore::WeatherForecast::toJson ( ) const

convert to QJsonObject

Definition at line 37 of file weatherforecast.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jul 27 2021 23:03:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.