7 #ifndef __PREFERENCES_H__
8 #define __PREFERENCES_H__
10 #include "ErrorBase.h"
16 #include "tables/ITableListener.h"
17 #include "networktables/NetworkTable.h"
39 std::vector<std::string>
GetKeys();
40 std::string
GetString(
const char *key,
const char *defaultValue =
"");
41 int GetString(
const char *key,
char *value,
int valueSize,
const char *defaultValue =
"");
42 int GetInt(
const char *key,
int defaultValue = 0);
43 double GetDouble(
const char *key,
double defaultValue = 0.0);
44 float GetFloat(
const char *key,
float defaultValue = 0.0);
45 bool GetBoolean(
const char *key,
bool defaultValue =
false);
46 INT64
GetLong(
const char *key, INT64 defaultValue = 0);
47 void PutString(
const char *key,
const char *value);
48 void PutInt(
const char *key,
int value);
49 void PutDouble(
const char *key,
double value);
50 void PutFloat(
const char *key,
float value);
52 void PutLong(
const char *key, INT64 value);
55 void Remove(
const char *key);
57 void ValueChanged(ITable* source,
const std::string& key, EntryValue value,
bool isNew);
64 std::string Get(
const char *key);
65 void Put(
const char *key, std::string value);
70 static int InitReadTask(
Preferences *obj) {obj->ReadTaskRun();
return 0;}
71 static int InitWriteTask(
Preferences *obj) {obj->WriteTaskRun();
return 0;}
78 SEM_ID m_fileOpStarted;
81 typedef std::map<std::string, std::string> StringMap;
85 std::vector<std::string> m_keys;
89 std::string m_endComment;
std::vector< std::string > GetKeys()
Definition: Preferences.cpp:74
void Save()
Definition: Preferences.cpp:324
bool GetBoolean(const char *key, bool defaultValue=false)
Definition: Preferences.cpp:163
INT64 GetLong(const char *key, INT64 defaultValue=0)
Definition: Preferences.cpp:185
void PutBoolean(const char *key, bool value)
Definition: Preferences.cpp:290
std::string GetString(const char *key, const char *defaultValue="")
Definition: Preferences.cpp:86
void Remove(const char *key)
Definition: Preferences.cpp:345
void PutDouble(const char *key, double value)
Definition: Preferences.cpp:254
Definition: ErrorBase.h:37
float GetFloat(const char *key, float defaultValue=0.0)
Definition: Preferences.cpp:147
void PutInt(const char *key, int value)
Definition: Preferences.cpp:236
void PutLong(const char *key, INT64 value)
Definition: Preferences.cpp:306
void PutString(const char *key, const char *value)
Definition: Preferences.cpp:210
void PutFloat(const char *key, float value)
Definition: Preferences.cpp:272
double GetDouble(const char *key, double defaultValue=0.0)
Definition: Preferences.cpp:131
static Preferences * GetInstance()
Definition: Preferences.cpp:63
int GetInt(const char *key, int defaultValue=0)
Definition: Preferences.cpp:115
bool ContainsKey(const char *key)
Definition: Preferences.cpp:336
Definition: Preferences.h:34