bool MEmblemMgr::GetEmblemPath(char* pszFilePath, const char* pszURL) { //// Parse URL ////////////////// #define URLPATH_LEN 256 char szFileName[URLPATH_LEN] = ""; URL_COMPONENTS uc; ZeroMemory(&uc, sizeof uc); uc.dwStructSize = sizeof uc; uc.lpszUrlPath = szFileName; uc.dwUrlPathLength = URLPATH_LEN; if (!InternetCrackUrl(pszURL, lstrlen(pszURL), ICU_DECODE, &uc)) { // GetLastError() return false; } PathStripPath(szFileName); char szFullPath[_MAX_DIR]; strcpy(szFullPath, GetEmblemBaseDir()); strcat(szFullPath, "/"); strcat(szFullPath, szFileName); // out strcpy(pszFilePath, szFullPath); return true; }
bool MEmblemMgr::GetEmblemPath(char* pszFilePath, size_t maxlen, const char* pszURL) { char szFileName[256]; MUrl::GetPath(szFileName, pszURL); sprintf_safe(pszFilePath, maxlen, "%s/%s", GetEmblemBaseDir(), szFileName); return true; }
void MEmblemMgr::Create() { InitDefaut(); m_nTotalRequest = 0; m_nCachedRequest = 0; m_HttpSpooler.SetBasePath(GetEmblemBaseDir()); m_HttpSpooler.Create(); }