Weather App
 
Loading...
Searching...
No Matches
LocalDB.h
Go to the documentation of this file.
1
5
6 #pragma once
7 #include <string>
8 #include <nlohmann/json.hpp>
9 #include <wx/string.h>
10 #include <wx/wx.h>
11 #include <vector>
12 #include <fstream>
13
18 class LocalDB {
19 public:
24 static void UpdateIndex(std::string data);
25
31 static void UpdateStation(std::string stationId, std::string data);
32
38 static void UpdateSensor(std::string sensorId, std::string data);
39
45 static bool LoadIndex(nlohmann::json& data);
46
53 static bool LoadStation(nlohmann::json& data, std::string stationId);
54
61 static bool LoadSensor(nlohmann::json& data, std::string sensorId);
62 };
63
Provides methods to update and load station and sensor data stored locally in JSON format.
Definition LocalDB.h:18
static void UpdateIndex(std::string data)
Updates the index file with new data.
static bool LoadSensor(nlohmann::json &data, std::string sensorId)
Loads a specific sensor's data from the local JSON file.
static bool LoadStation(nlohmann::json &data, std::string stationId)
Loads a specific station's data from the local JSON file.
static void UpdateStation(std::string stationId, std::string data)
Updates a specific station's data file.
static bool LoadIndex(nlohmann::json &data)
Loads the index data from the local JSON file.
static void UpdateSensor(std::string sensorId, std::string data)
Updates a specific sensor's data file.