This commit is contained in:
Mars 2024-06-18 04:10:36 -04:00
parent 11096c5ec7
commit 1926ef4a92
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
4 changed files with 30 additions and 18 deletions

View file

@ -7,6 +7,8 @@
#include "util/result.h"
using WeatherOutput = Weather::WeatherOutput;
DEFINE_GETTER(Weather, const Weather::Location, Location)
DEFINE_GETTER(Weather, const std::string, ApiKey)
DEFINE_GETTER(Weather, const std::string, Units)
@ -24,8 +26,6 @@ fn WeatherImpl::from_class(const Weather& weather) noexcept -> WeatherImpl {
fn WeatherImpl::to_class() const -> Weather { return { location, api_key, units }; }
using WeatherOutput = Weather::WeatherOutput;
// Function to read cache from file
fn ReadCacheFromFile() -> Result<WeatherOutput> {
std::ifstream ifs("/tmp/weather_cache.json");