File indexing completed on 2024-05-05 16:49:22
0001 /* 0002 * SPDX-FileCopyrightText: 2020-2021 Han Young <hanyoung@protonmail.com> 0003 * SPDX-FileCopyrightText: 2020 Devin Lin <espidev@gmail.com> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 #include "locationqueryresult.h" 0008 #include <memory> 0009 namespace KWeatherCore 0010 { 0011 class LocationQueryResult::LocationQueryResultPrivate 0012 { 0013 public: 0014 double latitude, longitude; 0015 QString toponymName, name, countryCode, countryName, geonameId; 0016 }; 0017 LocationQueryResult::LocationQueryResult() 0018 : d(std::make_unique<LocationQueryResultPrivate>()) 0019 { 0020 } 0021 LocationQueryResult::LocationQueryResult(LocationQueryResult &&other) = default; 0022 LocationQueryResult::LocationQueryResult(double latitude, 0023 double longitude, 0024 QString toponymName, 0025 QString name, 0026 QString countryCode, 0027 QString countryName, 0028 QString geonameId) 0029 : d(std::make_unique<LocationQueryResultPrivate>()) 0030 { 0031 d->latitude = latitude; 0032 d->longitude = longitude; 0033 d->toponymName = std::move(toponymName); 0034 d->name = std::move(name); 0035 d->countryCode = std::move(countryCode); 0036 d->countryName = std::move(countryName); 0037 d->geonameId = std::move(geonameId); 0038 } 0039 LocationQueryResult::LocationQueryResult(const LocationQueryResult &other) 0040 : d(std::make_unique<LocationQueryResultPrivate>()) 0041 { 0042 *d = *other.d; 0043 } 0044 LocationQueryResult::~LocationQueryResult() = default; 0045 LocationQueryResult & 0046 LocationQueryResult::operator=(const LocationQueryResult &other) 0047 { 0048 *d = *other.d; 0049 return *this; 0050 } 0051 LocationQueryResult & 0052 LocationQueryResult::operator=(LocationQueryResult &&other) = default; 0053 double LocationQueryResult::latitude() const 0054 { 0055 return d->latitude; 0056 } 0057 double LocationQueryResult::longitude() const 0058 { 0059 return d->longitude; 0060 } 0061 const QString &LocationQueryResult::toponymName() const 0062 { 0063 return d->toponymName; 0064 } 0065 const QString &LocationQueryResult::name() const 0066 { 0067 return d->name; 0068 } 0069 const QString &LocationQueryResult::countryCode() const 0070 { 0071 return d->countryCode; 0072 } 0073 const QString &LocationQueryResult::countryName() const 0074 { 0075 return d->countryName; 0076 } 0077 const QString &LocationQueryResult::geonameId() const 0078 { 0079 return d->geonameId; 0080 } 0081 }