00001 00014 #ifndef _cPreference_h 00015 #define _cPreference_h 00016 00017 #include "TypesDef.h" 00018 #include "wx/textfile.h" //wxTextFile 00019 #include <string> 00020 00021 using std::string; 00022 00023 class cPreference 00024 { 00025 public: 00027 static cPreference *GetPrefInstance(void); 00028 00029 00030 // All Get functions. 00031 const string GetPosterPath(void); 00032 const string GetP2PClientId(void); 00033 const string GetNetcatCmd(void); 00034 00035 // All Set functions. 00037 void SetPosterPath(const string sPosterPath); 00038 void SetP2PClientId(const string sId); 00039 void SetNetcatCmd(const string sNetCatCmd); 00040 00041 00042 void WritePreferences(void); 00043 void LoadPreferences(void); // Read data from preference file. 00044 00045 private: 00046 string m_sPosterPath; 00047 string m_sP2PClientId; 00048 string m_sNetCatCmd; 00049 00050 string m_sPrefFileName; 00051 00053 static cPreference *PrefHandler; 00054 00055 cPreference(void); 00056 ~cPreference(void); 00057 Bool IsFileExist(const string sFilename); 00058 }; 00059 #endif // _cPreference_h