|
|
@@ -7,7 +7,7 @@
|
|
|
mediaManage::mediaManage()
|
|
|
{
|
|
|
m_curParse.clear();
|
|
|
- if (checkDirExist(DEFAULT_RESOURSE_PATH))
|
|
|
+ if (ExistsDirA(DEFAULT_RESOURSE_PATH))
|
|
|
{
|
|
|
//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set defaultAdvertPath:%s, defaultDownloadPath:%s", DEFAULT_RESOURSE_PATH, DEFAULT_DOWNLOAD_PATH);
|
|
|
setDefaultAddvertPath(string(DEFAULT_RESOURSE_PATH));
|
|
|
@@ -174,18 +174,11 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
|
|
|
StringToWstring(wfileName, fileName);
|
|
|
StringToWstring(wdirPath, dirPath);
|
|
|
|
|
|
- if (!checkFileExist(dirPath))
|
|
|
+ if (!ExistsFileA(dirPath.c_str()))
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("dir %s not exist!", dirPath.c_str());
|
|
|
continue;
|
|
|
}
|
|
|
-/*
|
|
|
- if (!checkFileExist(dirPath) && createDir(dirPath) && !Unzip2Folder((BSTR)wfileName.c_str(), (BSTR)wdirPath.c_str()))
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unzip %s to %s fail!", fileName.c_str(), dirPath.c_str());
|
|
|
- continue;
|
|
|
- }
|
|
|
- */
|
|
|
string configPath = "";
|
|
|
if (!findVaildConfig(dirPath, configPath))
|
|
|
{
|
|
|
@@ -219,14 +212,14 @@ void mediaManage::InitResourceListByLocal()
|
|
|
|
|
|
vector<ResourceParse> headList, branchList, networkList, allList;
|
|
|
|
|
|
- if (!checkFileExist(headFile)) {
|
|
|
+ if (!ExistsFileA(headFile.c_str())) {
|
|
|
//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("head config %s not exist!", headFile.c_str());
|
|
|
}
|
|
|
else if (!parseResourceIni(headFile.c_str(), headList)) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse head config %s fail!", headFile.c_str());
|
|
|
}
|
|
|
|
|
|
- if (!checkFileExist(branchFile)) {
|
|
|
+ if (!ExistsFileA(branchFile.c_str())) {
|
|
|
//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("branch config %s not exist!", branchFile.c_str());
|
|
|
}
|
|
|
else if (!parseResourceIni(branchFile.c_str(), branchList)) {
|
|
|
@@ -234,7 +227,7 @@ void mediaManage::InitResourceListByLocal()
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (!checkFileExist(networkFile)) {
|
|
|
+ if (!ExistsFileA(networkFile.c_str())) {
|
|
|
//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("network config %s not exist!", networkFile.c_str());
|
|
|
}
|
|
|
else if (!parseResourceIni(networkFile.c_str(), networkList)) {
|
|
|
@@ -334,17 +327,17 @@ bool mediaManage::findVaildConfig(string dirPath, string &configPath)
|
|
|
string branchFile = dirPath + SPLIT_SLASH_STR + BRANCHINI_NAME;
|
|
|
string networkFile = dirPath + SPLIT_SLASH_STR + NETWORKINI_NAME;
|
|
|
|
|
|
- if (checkFileExist(headFile))
|
|
|
+ if (ExistsFileA(headFile.c_str()))
|
|
|
{
|
|
|
configPath = headFile;
|
|
|
return true;
|
|
|
}
|
|
|
- else if (checkFileExist(branchFile))
|
|
|
+ else if (ExistsFileA(branchFile.c_str()))
|
|
|
{
|
|
|
configPath = branchFile;
|
|
|
return true;
|
|
|
}
|
|
|
- else if (checkFileExist(networkFile))
|
|
|
+ else if (ExistsFileA(networkFile.c_str()))
|
|
|
{
|
|
|
configPath = networkFile;
|
|
|
return true;
|
|
|
@@ -355,5 +348,5 @@ bool mediaManage::findVaildConfig(string dirPath, string &configPath)
|
|
|
|
|
|
bool mediaManage::IsResourceExist(string strPath, string strName)
|
|
|
{
|
|
|
- return checkFileExist(strPath + strName);
|
|
|
+ return ExistsFileA((strPath + strName).c_str());
|
|
|
}
|