/*! @file ******************************************************************************** <PRE> Module : CMMusic file : function : author : fedorawang ver : v1.5 -------------------------------------------------------------------------------- Copyright : GPL(General Public License) -------------------------------------------------------------------------------- </PRE> *******************************************************************************/ #ifndef HELPER_H_ #define HELPER_H_ #include "ConfigMgr.h" #define g_Helper CHelper::GetInstance() #define l2e(x,y) g_Helper->Lrc2Env(x,y) #define log g_Helper->Log #define ismode(x) (g_Helper->m_strMode.compare(x)==0) #define getpath(x) g_Helper->GetPath(x).c_str() #define g_Cfg g_Helper #define getcfgs(x)g_Cfg->GetCfgStr(x).c_str() #define getcfgi(x)g_Cfg->GetCfgInt(x) #define setcfg(x,y) g_Cfg->SetCfg(x,y) #define iskey(x,y) g_Cfg->IsKey(x,y) class CHelper : public CConfigMgr { public: CHelper(); virtual ~CHelper(); public: void Log(const char* lpszStr,...); int Lrc2Env(const char *inbuf,char *outbuf); std::string ConvertCode(const char *from_charset,const char *to_charset,const char* lpszStr); int ConvertCode(const char *from_charset,const char *to_charset, const char *inbuf,char *outbuf); std::string GetPath(const char* lpszFile); static CHelper* GetInstance(); std::string m_strEnvM; std::string m_strLrcM; std::string m_strMode; std::string m_strAppPath; private: static CHelper* m_shInstance; }; #endif /*HELPER_H_*/