My Project
 
Loading...
Searching...
No Matches
preferences.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <boost/property_tree/ptree.hpp>
6
7class Preferences{
8private:
9 static Preferences* _inst;
10 Preferences();
11
12 boost::property_tree::ptree pt;
13
14 void flush();
15public:
16 static const std::string KEY_LANDSCAPE;
17 static const std::string KEY_IMMERSIVE;
18 static const std::string KEY_GOOGLE_PLAY;
19 static const std::string KEY_SCALE_UP;
20 static const std::string KEY_MUSIC;
21 static const std::string KEY_SOUND_FX;
22 static const std::string KEY_ZOOM;
23 static const std::string KEY_LAST_CLASS;
24 static const std::string KEY_CHALLENGES;
25 static const std::string KEY_DONATED;
26 static const std::string KEY_INTRO;
27 static const std::string KEY_BRIGHTNESS;
28
29 static Preferences* get();
30 int getInt(const std::string& key, int defValue);
31 bool getBool(const std::string& key, bool defValue);
32 std::string getString(const std::string& key, const std::string& defValue);
33 void put(const std::string& key, int value);
34 void put(const std::string& key, bool value);
35 void put(const std::string& key, const std::string& value);
36};
static const std::string KEY_GOOGLE_PLAY
Definition preferences.h:18
void put(const std::string &key, int value)
Definition preferences.cpp:57
static const std::string KEY_IMMERSIVE
Definition preferences.h:17
static const std::string KEY_INTRO
Definition preferences.h:26
bool getBool(const std::string &key, bool defValue)
Definition preferences.cpp:47
static const std::string KEY_DONATED
Definition preferences.h:25
std::string getString(const std::string &key, const std::string &defValue)
Definition preferences.cpp:52
static const std::string KEY_LANDSCAPE
Definition preferences.h:16
int getInt(const std::string &key, int defValue)
Definition preferences.cpp:42
static const std::string KEY_LAST_CLASS
Definition preferences.h:23
static const std::string KEY_SOUND_FX
Definition preferences.h:21
static const std::string KEY_MUSIC
Definition preferences.h:20
static const std::string KEY_CHALLENGES
Definition preferences.h:24
static const std::string KEY_SCALE_UP
Definition preferences.h:19
static Preferences * get()
Definition preferences.cpp:35
static const std::string KEY_BRIGHTNESS
Definition preferences.h:27
static const std::string KEY_ZOOM
Definition preferences.h:22