summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2013-02-19 16:09:21 +0100
committerDees_Troy <dees_troy@teamw.in>2013-02-19 19:08:03 +0100
commit2c57d789df1e23f3c311036dc5de240867142be5 (patch)
tree7fc5220eeef70f33b74ffeaf6fddf561b17e3d8f /data.cpp
parentAdd MTK6575/6577 EMMC partitions backup support (diff)
downloadandroid_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.gz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.bz2
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.lz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.xz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.zst
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.zip
Diffstat (limited to 'data.cpp')
-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;