blob: 9b2ae654a5b9ed68bb8b4b749c9054208a815060 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <mbgl/platform/default/settings_json.hpp>
#include <fstream>
using namespace mbgl;
Settings_JSON::Settings_JSON() { load(); }
void Settings_JSON::load() {
std::ifstream file("/tmp/mbgl-native.cfg");
if (file) {
file >> longitude;
file >> latitude;
file >> zoom;
file >> bearing;
file >> debug;
}
}
void Settings_JSON::save() {
std::ofstream file("/tmp/mbgl-native.cfg");
if (file) {
file << longitude << std::endl;
file << latitude << std::endl;
file << zoom << std::endl;
file << bearing << std::endl;
file << debug << std::endl;
}
}
void Settings_JSON::clear() {
longitude = 0;
latitude = 0;
zoom = 0;
bearing = 0;
debug = false;
}
|