DataManager Updates

The goal of this change is to make DataManager use InfoManager to reduce
code duplication.

Change-Id: Ia4f4c4324453a192995e0f442db0a03628c13e46
diff --git a/data.hpp b/data.hpp
index 2ec2174..790efc9 100644
--- a/data.hpp
+++ b/data.hpp
@@ -20,9 +20,8 @@
 #define _DATAMANAGER_HPP_HEADER
 
 #include <string>
-#include <utility>
-#include <map>
 #include <pthread.h>
+#include "infomanager.hpp"
 
 using namespace std;
 
@@ -30,30 +29,30 @@
 {
 public:
 	static int ResetDefaults();
-	static int LoadValues(const string filename);
+	static int LoadValues(const string& filename);
 	static int Flush();
 
 	// Core get routines
-	static int GetValue(const string varName, string& value);
-	static int GetValue(const string varName, int& value);
-	static int GetValue(const string varName, float& value);
-	static unsigned long long GetValue(const string varName, unsigned long long& value);
+	static int GetValue(const string& varName, string& value);
+	static int GetValue(const string& varName, int& value);
+	static int GetValue(const string& varName, float& value);
+	static unsigned long long GetValue(const string& varName, unsigned long long& value);
 
 	// Helper functions
-	static string GetStrValue(const string varName);
-	static int GetIntValue(const string varName);
+	static string GetStrValue(const string& varName);
+	static int GetIntValue(const string& varName);
 
 	// Core set routines
-	static int SetValue(const string varName, string value, int persist = 0);
-	static int SetValue(const string varName, int value, int persist = 0);
-	static int SetValue(const string varName, float value, int persist = 0);
-	static int SetValue(const string varName, unsigned long long value, int persist = 0);
-	static int SetProgress(float Fraction);
-	static int ShowProgress(float Portion, float Seconds);
+	static int SetValue(const string& varName, const string& value, const int persist = 0);
+	static int SetValue(const string& varName, const int value, const int persist = 0);
+	static int SetValue(const string& varName, const float value, const int persist = 0);
+	static int SetValue(const string& varName, const unsigned long long& value, const int persist = 0);
+	static int SetProgress(const float Fraction);
+	static int ShowProgress(const float Portion, const float Seconds);
 
 	static void DumpValues();
 	static void update_tz_environment_variables();
-	static void Vibrate(const string varName);
+	static void Vibrate(const string& varName);
 	static void SetBackupFolder();
 	static void SetDefaultValues();
 	static void Output_Version(void); // Outputs the version to a file in the TWRP folder
@@ -63,18 +62,18 @@
 	static string GetSettingsStoragePath(void);
 
 protected:
-	typedef pair<string, int> TStrIntPair;
-	typedef pair<string, TStrIntPair> TNameValuePair;
-	static map<string, TStrIntPair> mValues;
 	static string mBackingFile;
 	static int mInitialized;
+	static InfoManager mPersist;
+	static InfoManager mData;
+	static InfoManager mConst;
 
 	static map<string, string> mConstValues;
 
 protected:
 	static int SaveValues();
 
-	static int GetMagicValue(string varName, string& value);
+	static int GetMagicValue(const string& varName, string& value);
 
 private:
 	static void sanitize_device_id(char* device_id);