summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--data.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/data.cpp b/data.cpp
index 9e9120cb8..6566bcd22 100644
--- a/data.cpp
+++ b/data.cpp
@@ -358,6 +358,17 @@ int DataManager::GetValue(const string varName, int& value)
return 0;
}
+unsigned long long DataManager::GetValue(const string varName, unsigned long long& value)
+{
+ string data;
+
+ if (GetValue(varName,data) != 0)
+ return -1;
+
+ value = strtoull(data.c_str(), NULL, 10);
+ return 0;
+}
+
// This is a dangerous function. It will create the value if it doesn't exist so it has a valid c_str
string& DataManager::GetValueRef(const string varName)
{
@@ -458,6 +469,13 @@ int DataManager::SetValue(const string varName, float value, int persist /* = 0
return SetValue(varName, valStr.str(), persist);;
}
+int DataManager::SetValue(const string varName, unsigned long long value, int persist /* = 0 */)
+{
+ ostringstream valStr;
+ valStr << value;
+ return SetValue(varName, valStr.str(), persist);;
+}
+
void DataManager::DumpValues()
{
map<string, TStrIntPair>::iterator iter;