2022-07-14 07:44:53 +00:00
|
|
|
#ifndef VERSIONDLL_H
|
|
|
|
#define VERSIONDLL_H
|
|
|
|
|
|
|
|
#include "version/HGVersion.h"
|
|
|
|
#include "base/HGDll.h"
|
|
|
|
|
|
|
|
class VersionDll
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VersionDll();
|
|
|
|
~VersionDll();
|
|
|
|
|
|
|
|
HGResult Load();
|
|
|
|
HGResult Free();
|
|
|
|
HGBool IsValid();
|
|
|
|
|
2022-07-14 10:45:35 +00:00
|
|
|
HGResult GetServerConfig(HGServerConfig *config);
|
|
|
|
HGResult GetVersionList(const HGChar* appName, HGVersionInfo **info, HGUInt *count);
|
|
|
|
HGResult HttpDownload(const HGChar *url, const HGChar *saveFilePath, HGHttpDownloadFunc func, HGPointer param);
|
2022-07-14 07:44:53 +00:00
|
|
|
HGResult ReleaseVersionList(HGVersionInfo* info, HGUInt count);
|
|
|
|
HGResult GetCurrVersion(const HGChar* appName, HGChar* version, HGUInt maxLen);
|
|
|
|
HGResult CompareVersion(const HGChar* version1, const HGChar* version2, HGInt* result);
|
2022-07-14 10:45:35 +00:00
|
|
|
HGResult PostCrashInfo(const HGChar* appName, const HGChar* desc, const HGChar* crashFilePath, const HGChar* exceptionAddr);
|
|
|
|
HGResult PostUserFeedback(const HGChar* appName, const HGChar* desc, const HGChar* feedback, const HGChar* contact);
|
2022-07-14 07:44:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef HGResult (HGAPI *HGVersion_CreateMgr)(HGVersionMgr *mgr);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_DestroyMgr)(HGVersionMgr mgr);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_GetServerConfig)(HGVersionMgr mgr, HGServerConfig *config);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_GetVersionList)(HGVersionMgr mgr, const HGChar* appName, HGVersionInfo **info, HGUInt *count);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_PostCrashInfo)(HGVersionMgr mgr, const HGChar* appName, const HGChar* desc, const HGChar* crashFilePath, const HGChar* exceptionAddr);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_PostUserFeedback)(HGVersionMgr mgr, const HGChar* appName, const HGChar* desc, const HGChar* feedback, const HGChar* contact);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_HttpDownload)(HGVersionMgr mgr, const HGChar *url, const HGChar *saveFilePath, HGHttpDownloadFunc func, HGPointer param);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_ReleaseVersionList)(HGVersionInfo* info, HGUInt count);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_GetCurrVersion)(const HGChar* appName, HGChar* version, HGUInt maxLen);
|
|
|
|
typedef HGResult (HGAPI *HGVersion_CompareVersion)(const HGChar* version1, const HGChar* version2, HGInt* result);
|
|
|
|
|
|
|
|
private:
|
|
|
|
HGDll m_dll;
|
|
|
|
HGVersion_CreateMgr m_funcCreateMgr;
|
|
|
|
HGVersion_DestroyMgr m_funcDestroyMgr;
|
|
|
|
HGVersion_GetServerConfig m_funcGetServerConfig;
|
|
|
|
HGVersion_GetVersionList m_funcGetVersionList;
|
|
|
|
HGVersion_PostCrashInfo m_funcPostCrashInfo;
|
|
|
|
HGVersion_PostUserFeedback m_funcPostUserFeedback;
|
|
|
|
HGVersion_HttpDownload m_funcHttpDownload;
|
|
|
|
HGVersion_ReleaseVersionList m_funcReleaseVersionList;
|
|
|
|
HGVersion_GetCurrVersion m_funcGetCurrVersion;
|
|
|
|
HGVersion_CompareVersion m_funcCompareVersion;
|
2022-07-14 10:45:35 +00:00
|
|
|
HGVersionMgr m_mgr;
|
2022-07-14 07:44:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* VERSIONDLL_H */
|