diff options
author | bigbiff bigbiff <bigbiff@teamw.in> | 2013-02-19 16:09:21 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2013-02-19 19:08:03 +0100 |
commit | 2c57d789df1e23f3c311036dc5de240867142be5 (patch) | |
tree | 7fc5220eeef70f33b74ffeaf6fddf561b17e3d8f /data.cpp | |
parent | Add MTK6575/6577 EMMC partitions backup support (diff) | |
download | android_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 '')
-rw-r--r-- | data.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; |