KWeatherCore::WeatherForecast

Search for usage in LXR

KWeatherCore::WeatherForecast Class Reference

#include <weatherforecast.h>

Public Member Functions

 WeatherForecast ()
 
 WeatherForecast (const WeatherForecast &other)
 
const QDateTimecreatedTime () const
 
const std::vector< DailyWeatherForecast > & dailyWeatherForecast () const
 
double latitude () const
 
double longitude () const
 
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 setTimezone (QString timezone)
 
const QStringtimezone () const
 
QJsonObject toJson () const
 

Static Public Member Functions

static WeatherForecast fromJson (const QJsonObject &obj)
 

Detailed Description

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

See also
WeatherForecastSource
Author
Han Young hanyo.nosp@m.ung@.nosp@m.proto.nosp@m.nmai.nosp@m.l.com

Definition at line 22 of file weatherforecast.h.

Constructor & Destructor Documentation

◆ WeatherForecast() [1/2]

KWeatherCore::WeatherForecast::WeatherForecast ( )

construct an empty object

Definition at line 20 of file weatherforecast.cpp.

◆ WeatherForecast() [2/2]

KWeatherCore::WeatherForecast::WeatherForecast ( const WeatherForecast & other)

Definition at line 25 of file weatherforecast.cpp.

◆ ~WeatherForecast()

KWeatherCore::WeatherForecast::~WeatherForecast ( )

Definition at line 39 of file weatherforecast.cpp.

Member Function Documentation

◆ createdTime()

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

Definition at line 84 of file weatherforecast.cpp.

◆ dailyWeatherForecast()

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

Definition at line 72 of file weatherforecast.cpp.

◆ fromJson()

WeatherForecast KWeatherCore::WeatherForecast::fromJson ( const QJsonObject & obj)
static

construct from json

Definition at line 58 of file weatherforecast.cpp.

◆ latitude()

double KWeatherCore::WeatherForecast::latitude ( ) const

Definition at line 76 of file weatherforecast.cpp.

◆ longitude()

double KWeatherCore::WeatherForecast::longitude ( ) const

Definition at line 80 of file weatherforecast.cpp.

◆ operator+=()

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

merge HourlyWeatherForecast, new day is created when required

Definition at line 109 of file weatherforecast.cpp.

◆ operator=()

WeatherForecast & KWeatherCore::WeatherForecast::operator= ( const WeatherForecast & other)

Definition at line 30 of file weatherforecast.cpp.

◆ setCoordinate()

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

setCoordinate

Definition at line 92 of file weatherforecast.cpp.

◆ setDailyWeatherForecast() [1/2]

void KWeatherCore::WeatherForecast::setDailyWeatherForecast ( const std::vector< DailyWeatherForecast > & forecast)

Definition at line 101 of file weatherforecast.cpp.

◆ setDailyWeatherForecast() [2/2]

void KWeatherCore::WeatherForecast::setDailyWeatherForecast ( std::vector< DailyWeatherForecast > && forecast)

Definition at line 105 of file weatherforecast.cpp.

◆ setTimezone()

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

Definition at line 97 of file weatherforecast.cpp.

◆ timezone()

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

IANA Time Zone ID.

Returns

Definition at line 88 of file weatherforecast.cpp.

◆ toJson()

QJsonObject KWeatherCore::WeatherForecast::toJson ( ) const

convert to QJsonObject

Definition at line 43 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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.