summaryrefslogtreecommitdiff
path: root/src/client/Client.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-22 00:04:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-22 00:04:55 (GMT)
commit3c91e526bb5576727e53b98fb850570074f9d036 (patch)
treede60725cad767bdb60df2bd5a9f7d5f2d430fbc4 /src/client/Client.h
parent550f6e28e012ceba8df9274fc71c7fbddfd90530 (diff)
downloadpowder-3c91e526bb5576727e53b98fb850570074f9d036.zip
powder-3c91e526bb5576727e53b98fb850570074f9d036.tar.gz
Client now provides methods for reading and saving preferences - less powerful than raw access to Cajun, (no mixed type arrays, for example) but allows other save formats to be used, such as property lists on OS X
Diffstat (limited to 'src/client/Client.h')
-rw-r--r--src/client/Client.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/client/Client.h b/src/client/Client.h
index 6cdedd4..8c1fae7 100644
--- a/src/client/Client.h
+++ b/src/client/Client.h
@@ -51,13 +51,13 @@ private:
int activeThumbRequestCompleteTimes[IMGCONNS];
std::string activeThumbRequestIDs[IMGCONNS];
void updateStamps();
-
+ static vector<std::string> explodePropertyString(std::string property);
void notifyUpdateAvailable();
-public:
- vector<ClientListener*> listeners;
//Config file handle
json::Object configDocument;
+public:
+ vector<ClientListener*> listeners;
Client();
~Client();
@@ -94,6 +94,25 @@ public:
return lastError;
}
void Tick();
+ void Shutdown();
+
+ std::string GetPrefString(std::string property, std::string defaultValue);
+ double GetPrefNumber(std::string property, double defaultValue);
+ vector<string> GetPrefStringArray(std::string property);
+ vector<double> GetPrefNumberArray(std::string property);
+ vector<bool> GetPrefBoolArray(std::string property);
+ bool GetPrefBool(std::string property, bool defaultValue);
+
+ void SetPref(std::string property, std::string value);
+ void SetPref(std::string property, double value);
+ void SetPref(std::string property, vector<string> value);
+ void SetPref(std::string property, vector<double> value);
+ void SetPref(std::string property, vector<bool> value);
+ void SetPref(std::string property, bool value);
+
+ json::UnknownElement GetPref(std::string property);
+ void setPrefR(std::deque<string> tokens, json::UnknownElement & element, json::UnknownElement & value);
+ void SetPref(std::string property, json::UnknownElement & value);
};
#endif // CLIENT_H