|
|
@@ -14,6 +14,7 @@
|
|
|
#include "base64.h"
|
|
|
#include "digital_conv.h"
|
|
|
#include <fstream>
|
|
|
+#include "path.h"
|
|
|
|
|
|
|
|
|
|
|
|
@@ -46,7 +47,7 @@ namespace fs = boost::filesystem;
|
|
|
#define generateFilesize(fileHandle, filePath) long long nFileSize = fs::file_size(filePath.GetData())
|
|
|
#include "zip.h"
|
|
|
#include <stdlib.h>
|
|
|
-#include "../mod_upload/XZipZilb.h"
|
|
|
+#include "XZipZilb.h"
|
|
|
#define ZeroMemory(object, size) memset(object, 0, size)
|
|
|
#define WritePrivateProfileStringA(a, b, c, d) Base_writeIni(std::string(a), std::string(b), std::string(c), std::string(d))
|
|
|
|
|
|
@@ -356,7 +357,8 @@ ErrorCodeEnum CRemoteControllerCnn::HandleDelRunInfoLogReq(const CSmartPointer<I
|
|
|
CSimpleString runInfoPath;
|
|
|
pFunc->GetPath("RunInfo", runInfoPath);
|
|
|
|
|
|
- CSimpleString delFilePaht = runInfoPath + "\\runcfg\\" + strLogName + ".ini";
|
|
|
+ CSimpleString delFilePaht = runInfoPath;
|
|
|
+ delFilePaht.Append(SPLIT_SLASH_STR).Append("runcfg").Append(SPLIT_SLASH_STR).Append(strLogName).Append(".ini");
|
|
|
Dbg("curTaskId:%d ,try to delete %s, strLogName = %s", req.TaskID, delFilePaht, strLogName);
|
|
|
|
|
|
|
|
|
@@ -389,7 +391,8 @@ ErrorCodeEnum CRemoteControllerCnn::HandleTest(const CSmartPointer<IPackage> &pR
|
|
|
CSimpleString runInfoPath;
|
|
|
pFunc->GetPath("RunInfo", runInfoPath);
|
|
|
|
|
|
- CSimpleString delFilePaht = runInfoPath + "\\runcfg\\" + "MediaController" + ".ini";
|
|
|
+ CSimpleString delFilePaht = runInfoPath;
|
|
|
+ delFilePaht.Append(SPLIT_SLASH_STR).Append("runcfg").Append(SPLIT_SLASH_STR).Append("MediaController").Append(".ini");
|
|
|
Dbg("try to delete %s", delFilePaht);
|
|
|
|
|
|
if (Base_Exist(delFilePaht.GetData()))
|
|
|
@@ -693,14 +696,14 @@ ErrorCodeEnum CRemoteControllerCnn::HandleEditConfigReq(const CSmartPointer<IPac
|
|
|
auto rc = pFunc->GetPath("HardwareCfg", strCfgPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
|
|
|
- strCfgPath += "\\Root.ini";
|
|
|
+ strCfgPath.Append(SPLIT_SLASH_STR).Append("Root.ini");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("Cfg", strCfgPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
|
|
|
- strCfgPath += CSimpleStringA::Format("\\%s.ini", (const char*)strEntityName);
|
|
|
+ strCfgPath.Append(SPLIT_SLASH_STR).Append((const char*)strEntityName).Append(".ini");
|
|
|
}
|
|
|
|
|
|
char cEditType = pReq[i].EditType;
|
|
|
@@ -709,7 +712,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleEditConfigReq(const CSmartPointer<IPac
|
|
|
if (cEditType == 'A' || cEditType == 'U')
|
|
|
WritePrivateProfileStringA(pReq[i].Section, pReq[i].Key, pReq[i].Value, strCfgPath.GetData());
|
|
|
else if (cEditType == 'D')
|
|
|
- WritePrivateProfileStringA(pReq[i].Section, pReq[i].Key, NULL, strCfgPath.GetData());
|
|
|
+ WritePrivateProfileStringA(pReq[i].Section, pReq[i].Key, "", strCfgPath.GetData());
|
|
|
}
|
|
|
|
|
|
delete[] pBuf;
|
|
|
@@ -728,7 +731,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewEntityConfigReq(const CSmartPointe
|
|
|
int nLen = pRecvPkg->GetStructLen("ViewCfgR");
|
|
|
if (nLen <=0)
|
|
|
{
|
|
|
- pReplyPkg->SetErrMsg(Error_Param, 0, "get struct [ViewCfgR] fail");
|
|
|
+ pReplyPkg->SetErrMsg(Error_Param, 0, "get struct [ViewCfgR] fail");
|
|
|
SendPackage(pReplyPkg);
|
|
|
return Error_Param;
|
|
|
}
|
|
|
@@ -747,15 +750,13 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewEntityConfigReq(const CSmartPointe
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("HardwareCfg", strCfgPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
-
|
|
|
- strCfgPath += "\\Root.ini";
|
|
|
+ strCfgPath.Append(SPLIT_SLASH_STR).Append("Root.ini");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("Cfg", strCfgPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
-
|
|
|
- strCfgPath += CSimpleStringA::Format("\\%s.ini", (const char*)strEntityName);
|
|
|
+ strCfgPath.Append(SPLIT_SLASH_STR).Append((const char*)strEntityName).Append(".ini");
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strCfgPath.GetData()))
|
|
|
@@ -828,20 +829,20 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewDebugLogReq(const CSmartPointer<IP
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("Dbg", strLogPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpShell\\%s.log", (const char*)strViewDate);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpShell").Append(SPLIT_SLASH_STR).Append((const char*)strViewDate).Append(".log");
|
|
|
}
|
|
|
else if (iequals(strEntityName.GetData(), "Silverlight"))
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("Slv", strLogPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s.log", (const char*)strViewDate);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strViewDate).Append(".log");
|
|
|
}
|
|
|
else if (iequals(strEntityName.GetData(), "DualActive")|| iequals(strEntityName.GetData(), "SpHost")
|
|
|
|| iequals(strEntityName.GetData(), "SysInit") || iequals(strEntityName.GetData(), "SpBase") || iequals(strEntityName.GetData(), "guardian"))
|
|
|
{
|
|
|
auto rc = pFunc->GetPath("Dbg", strLogPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)strEntityName, (const char*)strViewDate);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strEntityName).Append(SPLIT_SLASH_STR).Append((const char*)strViewDate).Append(".log");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -857,7 +858,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewDebugLogReq(const CSmartPointer<IP
|
|
|
|
|
|
rc = pFunc->GetPath("Dbg", strLogPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)info.strSpFileName, (const char*)strViewDate);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)info.strSpFileName).Append(SPLIT_SLASH_STR).Append((const char*)strViewDate).Append(".log");
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strLogPath.GetData()))
|
|
|
@@ -888,9 +889,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewDebugLogReq(const CSmartPointer<IP
|
|
|
generateFilesize(file, strLogPath);
|
|
|
|
|
|
if (nStartPos >0 && nStartPos < nFileSize)
|
|
|
- {
|
|
|
_fseeki64(file, nStartPos, SEEK_SET);
|
|
|
- }
|
|
|
else
|
|
|
nStartPos = 0;
|
|
|
|
|
|
@@ -921,11 +920,8 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewDebugLogReq(const CSmartPointer<IP
|
|
|
BOOL bRet = TRUE;
|
|
|
do
|
|
|
{
|
|
|
- //Dbg("ftell: %d", ftell(file));
|
|
|
nReadLen = fread(pLogData+nHasRead, 1, nMaxBytes-nHasRead, file);
|
|
|
|
|
|
- //Dbg("ftell: %d", ftell(file));
|
|
|
-
|
|
|
if (nReadLen >0)
|
|
|
nHasRead += nReadLen;
|
|
|
}
|
|
|
@@ -1011,15 +1007,11 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadEventLogReq(const CSmartPointer<
|
|
|
Dbg("evtName:%d, evtLevel:%d, duration:%d, startTime:%d, endTime:%d, cusEvtFileName:%s,evtSrcEventName:%s, reversed1:%d, reversed2:%s, startPos:%d, MaxRet:%d, UploadFile:%s",
|
|
|
req.evtName, req.evtLevel, req.duration, req.startTime, req.endTime,
|
|
|
req.cusEvtFileName, req.evtSrcEventName, req.reversed1, req.reversed2, req.StartPos, req.MaxRetBytes, req.UploadFile);
|
|
|
-// Dbg("evtName:%d, evtLevel:%d, duration:%d, startTime:%d, endTime:%d, cusEvtFileName:%s,evtSrcEventName:%s, reversed1:%d, reversed2:%s",
|
|
|
-// rvcReq.evtName, rvcReq.evtLevel, rvcReq.duration, rvcReq.startTime, rvcReq.endTime,
|
|
|
-// rvcReq.cusEvtFileName.GetData(), rvcReq.evtSrcEventName.GetData(), rvcReq.reversed1, rvcReq.reversed2.GetData());
|
|
|
rc = pClient->ExtractEventLog(rvcReq, rvcAns, 60000 * 5);
|
|
|
Dbg("entries:%d, information:%s, evtLogFileName:%s", rvcAns.entries, rvcAns.information.GetData(), rvcAns.evtLogFileName.GetData());
|
|
|
pClient->GetFunction()->CloseSession();
|
|
|
|
|
|
}
|
|
|
- pClient->SafeDelete();
|
|
|
|
|
|
if (rc != Error_Succeed)
|
|
|
{
|
|
|
@@ -1037,8 +1029,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadEventLogReq(const CSmartPointer<
|
|
|
strZipFileName = CSimpleStringA::Format("%s_event_%s_%02X_%02X.zip", (const char*)sysInfo.strTerminalID, (const char*)strTodayLogName, rvcAns.entries,
|
|
|
req.evtLevel + req.duration + req.startTime + req.endTime);
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
|
|
|
strLogPath = rvcAns.evtLogFileName;
|
|
|
|
|
|
@@ -1076,8 +1067,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadEventLogReq(const CSmartPointer<
|
|
|
strZipFileName = req.UploadFile;
|
|
|
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strZipPath.GetData()))
|
|
|
@@ -1279,7 +1269,6 @@ ErrorCodeEnum CRemoteControllerCnn::HandleOperateDiskReq(const CSmartPointer<IPa
|
|
|
pClient->GetFunction()->CloseSession();
|
|
|
|
|
|
}
|
|
|
- pClient->SafeDelete();
|
|
|
|
|
|
if (rc != Error_Succeed)
|
|
|
{
|
|
|
@@ -1292,10 +1281,8 @@ ErrorCodeEnum CRemoteControllerCnn::HandleOperateDiskReq(const CSmartPointer<IPa
|
|
|
|
|
|
//添加首层目录信息
|
|
|
RvcOperateDiskRet1 ret1(req.TaskID, rvcAns.result, rvcAns.header, rvcAns.attachment1);
|
|
|
- //pReplyPkg->AddStruct("OprDkA1", false, false, (BYTE*)&ret1, sizeof(RvcOperateDiskRet1));
|
|
|
RvcOperateDiskRet2 current(rvcAns.attachment2, rvcAns.fileSize, rvcAns.ftCreate, rvcAns.ftModified,
|
|
|
rvcAns.ftAccess, rvcAns.fileAttribute, rvcAns.forbidAttribute, rvcAns.reversed1, rvcAns.reversed2);
|
|
|
- //Dbg("1:0%d, %d, %s, %d", ret1.TaskID, ret1.result, ret1.header, ret1.attachment1);
|
|
|
//添加目录具体文件信息
|
|
|
pRet2 = new RvcOperateDiskRet2[rvcAns.count + 1];
|
|
|
ZeroMemory(pRet2, sizeof(RvcOperateDiskRet2) * (rvcAns.count + 1));
|
|
|
@@ -1330,18 +1317,16 @@ ErrorCodeEnum CRemoteControllerCnn::HandleOperateDiskReq(const CSmartPointer<IPa
|
|
|
ZeroMemory(pBuf, nRetLen);
|
|
|
RvcOperateDiskJsonRet *pRet = (RvcOperateDiskJsonRet*)pBuf;
|
|
|
pRet->TaskID = req.TaskID;
|
|
|
-// pRet->jsonLength = strlen(slimJsonStr);
|
|
|
-// memcpy(pRet->jsonData, slimJsonStr, pRet->jsonLength);
|
|
|
|
|
|
auto pFunc = m_pEntity->GetFunction();
|
|
|
CSimpleStringA jsonFileName, tempDir, zipJsonName;
|
|
|
pFunc->GetPath("Temp", tempDir);
|
|
|
- jsonFileName = tempDir + "\\transfer.txt";
|
|
|
- zipJsonName = tempDir + "\\zipJson.zip";
|
|
|
+ jsonFileName.Append(tempDir).Append(SPLIT_SLASH_STR).Append("transfer.txt");
|
|
|
+ zipJsonName.Append(tempDir).Append(SPLIT_SLASH_STR).Append("zipJson.zip");
|
|
|
ofstream jsonFile(jsonFileName.GetData());
|
|
|
if (jsonFile.is_open())
|
|
|
{
|
|
|
- Dbg("%d", pRet->jsonLength);
|
|
|
+ Dbg("jsonLength:%d", pRet->jsonLength);
|
|
|
jsonFile << slimJsonStr << endl;
|
|
|
jsonFile.close();
|
|
|
}
|
|
|
@@ -1886,7 +1871,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleGetVersionReq(const CSmartPointer<IPac
|
|
|
auto rc = m_pEntity->GetFunction()->GetPath("RootVer", strPath);
|
|
|
if (rc == Error_Succeed)
|
|
|
{
|
|
|
- strPath += "\\active.txt";
|
|
|
+ strPath.Append(SPLIT_SLASH_STR).Append("active.txt");
|
|
|
FILE *pFile = fopen(strPath, "r");
|
|
|
if (pFile != NULL)
|
|
|
{
|
|
|
@@ -1939,7 +1924,8 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewRunCfgReq(const CSmartPointer<IPac
|
|
|
CSimpleStringA strCfgPath;
|
|
|
assert(Error_Succeed == pFunc->GetPath("RunInfo", strCfgPath));
|
|
|
|
|
|
- strCfgPath += CSimpleStringA::Format("\\runcfg\\%s", (const char*)strConfigName);
|
|
|
+
|
|
|
+ strCfgPath.Append(SPLIT_SLASH_STR).Append("runcfg").Append(SPLIT_SLASH_STR).Append(strConfigName);
|
|
|
|
|
|
if (!Base_Exist(strCfgPath.GetData()))
|
|
|
{
|
|
|
@@ -1995,7 +1981,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewInstallLogReq(const CSmartPointer<
|
|
|
auto rc = m_pEntity->GetFunction()->GetPath("RunInfo", strLogPath);
|
|
|
assert(rc == Error_Succeed);
|
|
|
|
|
|
- strLogPath += CSimpleStringA::Format("\\InstallLog\\%s", (const char*)strLogFile);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("InstallLog").Append(SPLIT_SLASH_STR).Append((const char*)strLogFile);
|
|
|
|
|
|
if (!Base_Exist(strLogPath.GetData()))
|
|
|
{
|
|
|
@@ -2082,7 +2068,7 @@ ErrorCodeEnum CRemoteControllerCnn::ZipFile(LPCTSTR lpszZipArchive, LPCTSTR lpsz
|
|
|
Base_CopyFile(lpszSrcFile, strCopyFile.GetData());
|
|
|
|
|
|
// use only the file name for zip file entry
|
|
|
- TCHAR * cp = (TCHAR *)strrchr(lpszSrcFile, '\\');
|
|
|
+ TCHAR * cp = (TCHAR *)strrchr(lpszSrcFile, SPLIT_SLASH);
|
|
|
if (cp == NULL)
|
|
|
cp = (TCHAR *)lpszSrcFile;
|
|
|
else
|
|
|
@@ -2102,7 +2088,7 @@ ErrorCodeEnum CRemoteControllerCnn::ZipFile(LPCTSTR lpszZipArchive, LPCTSTR lpsz
|
|
|
CloseZip(hz);
|
|
|
if (zr == ZR_OK)
|
|
|
#else
|
|
|
- auto zr = AddFileToZip(hz, getPathName(strCopyFile.GetData()).c_str(), strCopyFile.GetData());
|
|
|
+ auto zr = AddFileToZip(hz, cp, strCopyFile.GetData());
|
|
|
zipClose(hz, NULL);
|
|
|
if (zr)
|
|
|
#endif
|
|
|
@@ -2176,11 +2162,11 @@ ErrorCodeEnum CRemoteControllerCnn::BatchZipFiles(LPCTSTR lpszZipArchive, const
|
|
|
|
|
|
// use only the file name for zip file entry
|
|
|
CSimpleStringA strTmp = strSrcFile;
|
|
|
- const TCHAR * cp = strrchr(strTmp, '\\');
|
|
|
+ const TCHAR * cp = strrchr(strTmp, SPLIT_SLASH);
|
|
|
if (cp != NULL)
|
|
|
{
|
|
|
*((char*)cp) = '_';
|
|
|
- cp = (TCHAR *)strrchr(strTmp, '\\');
|
|
|
+ cp = (TCHAR *)strrchr(strTmp, SPLIT_SLASH);
|
|
|
}
|
|
|
|
|
|
if (cp != NULL)
|
|
|
@@ -2192,8 +2178,7 @@ ErrorCodeEnum CRemoteControllerCnn::BatchZipFiles(LPCTSTR lpszZipArchive, const
|
|
|
ZRESULT zr = ZipAdd(hz, cp, (void*)(const char*)strCopyFile, 0, ZIP_FILENAME);
|
|
|
CloseZip(hz);
|
|
|
#else
|
|
|
- auto zr = AddFileToZip(hz, getPathName(strCopyFile.GetData()).c_str(), strCopyFile.GetData());
|
|
|
- zipClose(hz, NULL);
|
|
|
+ auto zr = AddFileToZip(hz, cp, strCopyFile.GetData());
|
|
|
#endif
|
|
|
|
|
|
// delete .bak file
|
|
|
@@ -2223,7 +2208,7 @@ ErrorCodeEnum CRemoteControllerCnn::BatchZipFiles(LPCTSTR lpszZipArchive, const
|
|
|
{
|
|
|
Base_DeleteFile(lpszZipArchive);
|
|
|
}
|
|
|
-
|
|
|
+ zipClose(hz, NULL);
|
|
|
return bResult ? Error_Succeed : Error_Unexpect;
|
|
|
}
|
|
|
|
|
|
@@ -2269,14 +2254,14 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogByDateReq(const CSmartPointer
|
|
|
strZipFileName = CSimpleStringA::Format("%s_slv_%s.zip", (const char*)sysInfo.strTerminalID, (const char*)strTodayLogName);
|
|
|
|
|
|
pFunc->GetPath("Slv", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
else if (strReqLogName.IsEndWith(".zip", true)) // 安装包日志
|
|
|
{
|
|
|
strZipFileName = CSimpleStringA::Format("%s_pkg_%s", (const char*)sysInfo.strTerminalID, (const char*)strReqLogName);
|
|
|
|
|
|
pFunc->GetPath("RunInfo", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\InstallLog\\%s.log", (const char*)strReqLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("InstallLog").Append(SPLIT_SLASH_STR).Append((const char*)strReqLogName).Append(".log");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -2286,17 +2271,17 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogByDateReq(const CSmartPointer
|
|
|
|
|
|
pFunc->GetPath("Dbg", strLogPath);
|
|
|
if (strReqLogName.Compare("Shell", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpShell\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpShell").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("DualActive", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\DualActive\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("DualActive").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("guardian", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\guardian\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("guardian").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SpHost", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpHost\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpHost").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SysInit", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SysInit\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SysInit").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SpBase", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpBase\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpBase").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else
|
|
|
{
|
|
|
CEntityStaticInfo info = {};
|
|
|
@@ -2309,13 +2294,12 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogByDateReq(const CSmartPointer
|
|
|
return Error_NotExist;
|
|
|
}
|
|
|
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)info.strSpFileName, (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)info.strSpFileName).Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
|
|
|
if (!Base_Exist(strLogPath.GetData()))
|
|
|
{
|
|
|
@@ -2339,8 +2323,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogByDateReq(const CSmartPointer
|
|
|
strZipFileName = req.UploadFile;
|
|
|
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strZipPath.GetData()))
|
|
|
@@ -2483,7 +2466,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
strZipFileName = CSimpleStringA::Format("%s_slv_%s.zip", (const char*)sysInfo.strTerminalID, (const char*)strTodayLogName);
|
|
|
|
|
|
pFunc->GetPath("Slv", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
|
|
|
}
|
|
|
else if (strReqLogName.Compare("AllDbg", true) == 0)
|
|
|
@@ -2491,7 +2474,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
strZipFileName = CSimpleStringA::Format("%s_AllDbg_%s.zip", (const char*)sysInfo.strTerminalID, (const char*)strTodayLogName);
|
|
|
pFunc->GetPath("Dbg", strLogPath);
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += CSimpleStringA::Format("\\%s", (const char*)strZipFileName);
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append((const char*)strZipFileName);
|
|
|
try
|
|
|
{
|
|
|
std::pair<bool, std::string> result = MyZip::ZipDir(strZipPath.GetData(), strLogPath.GetData());
|
|
|
@@ -2515,12 +2498,12 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
{
|
|
|
strZipFileName = CSimpleStringA::Format("%s_runInformation_%s.zip", (const char*)sysInfo.strTerminalID, (const char*)strTodayLogName);
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += CSimpleStringA::Format("\\%s", (const char*)strZipFileName);
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append((const char*)strZipFileName);
|
|
|
vector<std::string> zipArr;
|
|
|
pFunc->GetPath("RunInfo", strLogPath);
|
|
|
zipArr.push_back(strLogPath.GetData());
|
|
|
pFunc->GetPath("HardwareCfg", strLogPath);
|
|
|
- strLogPath = strLogPath + "\\root.ini";
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("root.ini");
|
|
|
zipArr.push_back(strLogPath.GetData());
|
|
|
Dbg("%s,%s,%s", zipArr[0].c_str(), zipArr[1].c_str(), strZipPath);
|
|
|
|
|
|
@@ -2540,7 +2523,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
strZipFileName = CSimpleStringA::Format("%s_pkg_%s", (const char*)sysInfo.strTerminalID, (const char*)strReqLogName);
|
|
|
|
|
|
pFunc->GetPath("RunInfo", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\InstallLog\\%s.log", (const char*)strReqLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("InstallLog").Append(SPLIT_SLASH_STR).Append((const char*)strReqLogName).Append(".log");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -2550,17 +2533,17 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
|
|
|
pFunc->GetPath("Dbg", strLogPath);
|
|
|
if (strReqLogName.Compare("Shell", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpShell\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpShell").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("DualActive", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\DualActive\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("DualActive").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("guardian", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\guardian\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("guardian").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SpHost", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpHost\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpHost").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SysInit", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SysInit\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SysInit").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (strReqLogName.Compare("SpBase", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpBase\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpBase").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else
|
|
|
{
|
|
|
CEntityStaticInfo info = {};
|
|
|
@@ -2572,14 +2555,12 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
SendPackage(pReplyPkg);
|
|
|
return Error_NotExist;
|
|
|
}
|
|
|
-
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)info.strSpFileName, (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)info.strSpFileName).Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
|
|
|
if (!Base_Exist(strLogPath.GetData()))
|
|
|
{
|
|
|
@@ -2603,8 +2584,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleUploadLogReq(const CSmartPointer<IPack
|
|
|
strZipFileName = req.UploadFile;
|
|
|
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
- strZipPath += strZipFileName;
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR).Append(strZipFileName);
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strZipPath.GetData()))
|
|
|
@@ -2745,10 +2725,10 @@ ErrorCodeEnum CRemoteControllerCnn::HandleViewEntityStateExReq(const CSmartPoint
|
|
|
CSimpleStringA strEntCfgDir;
|
|
|
CSimpleStringA strRunCfgDir;
|
|
|
pFunc->GetPath("Cfg", strEntCfgDir);
|
|
|
- strEntCfgDir += "\\";
|
|
|
+ strEntCfgDir.Append(SPLIT_SLASH_STR);
|
|
|
|
|
|
pFunc->GetPath("RunInfo", strRunCfgDir);
|
|
|
- strRunCfgDir += "\\runcfg\\";
|
|
|
+ strRunCfgDir.Append(SPLIT_SLASH_STR).Append("runcfg").Append(SPLIT_SLASH_STR);
|
|
|
|
|
|
for (int i = 0; i<nCount - 8; i++)
|
|
|
{
|
|
|
@@ -2851,7 +2831,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsByDateReq(const CSmartP
|
|
|
CSimpleStringA strZipPath;
|
|
|
auto pFunc = m_pEntity->GetFunction();
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR);
|
|
|
CSimpleStringA strZipFileName = req.ZipFileName;
|
|
|
strZipPath += strZipFileName;
|
|
|
|
|
|
@@ -2871,31 +2851,31 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsByDateReq(const CSmartP
|
|
|
if (arrFiles[i].Compare("Silverlight", true) == 0) // slv日志
|
|
|
{
|
|
|
pFunc->GetPath("Slv", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
else if (arrFiles[i].IsEndWith(".zip", true)) // 安装包日志
|
|
|
{
|
|
|
pFunc->GetPath("RunInfo", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\InstallLog\\%s.log", (const char*)arrFiles[i]);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("InstallLog").Append(SPLIT_SLASH_STR).Append((const char*)arrFiles[i]).Append(".log");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
// 实体Dbg日志
|
|
|
pFunc->GetPath("Dbg", strLogPath);
|
|
|
if (arrFiles[i].Compare("Shell", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpShell\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpShell").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("DualActive", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\DualActive\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("DualActive").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("guardian", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\guardian\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("guardian").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SpHost", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpHost\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpHost").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SysInit", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SysInit\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SysInit").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SpBase", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpBase\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpBase").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("Root", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\Root\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("Root").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else
|
|
|
{
|
|
|
CEntityStaticInfo info = {};
|
|
|
@@ -2908,16 +2888,13 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsByDateReq(const CSmartP
|
|
|
return Error_NotExist;
|
|
|
}
|
|
|
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)info.strSpFileName, (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)info.strSpFileName).Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!Base_Exist(strLogPath.GetData()))
|
|
|
{
|
|
|
Dbg("log [%s] not exist", (const char*)strLogPath);
|
|
|
- //pReplyPkg->SetErrMsg(Error_NotExist, 0, CSimpleStringA::Format("日志文件[%s]不存在", (const char*)strLogPath));
|
|
|
- //SendPackage(pReplyPkg);
|
|
|
- //return Error_NotExist;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -2931,7 +2908,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsByDateReq(const CSmartP
|
|
|
return Error_NotExist;
|
|
|
}
|
|
|
|
|
|
- Dbg("strZipPath:%s", strZipPath);
|
|
|
+ Dbg("strZipPath:%s", strZipPath.GetData());
|
|
|
// 生成ZIP
|
|
|
auto rc = BatchZipFiles(strZipPath, listSrcFiles);
|
|
|
if (rc != Error_Succeed)
|
|
|
@@ -3074,7 +3051,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsReq(const CSmartPointer
|
|
|
CSimpleStringA strZipPath;
|
|
|
auto pFunc = m_pEntity->GetFunction();
|
|
|
pFunc->GetPath("Temp", strZipPath);
|
|
|
- strZipPath += "\\";
|
|
|
+ strZipPath.Append(SPLIT_SLASH_STR);
|
|
|
CSimpleStringA strZipFileName = req.ZipFileName;
|
|
|
strZipPath += strZipFileName;
|
|
|
|
|
|
@@ -3094,31 +3071,31 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsReq(const CSmartPointer
|
|
|
if (arrFiles[i].Compare("Silverlight", true) == 0) // slv日志
|
|
|
{
|
|
|
pFunc->GetPath("Slv", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
else if (arrFiles[i].IsEndWith(".zip", true)) // 安装包日志
|
|
|
{
|
|
|
pFunc->GetPath("RunInfo", strLogPath);
|
|
|
- strLogPath += CSimpleStringA::Format("\\InstallLog\\%s.log", (const char*)arrFiles[i]);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("InstallLog").Append(SPLIT_SLASH_STR).Append((const char*)arrFiles[i]).Append(".log");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
// 实体Dbg日志
|
|
|
pFunc->GetPath("Dbg", strLogPath);
|
|
|
if (arrFiles[i].Compare("Shell", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpShell\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpShell").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("DualActive", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\DualActive\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("DualActive").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("guardian", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\guardian\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("guardian").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SpHost", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpHost\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpHost").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SysInit", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SysInit\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SysInit").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("SpBase", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\SpBase\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("SpBase").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else if (arrFiles[i].Compare("Root", true) == 0)
|
|
|
- strLogPath += CSimpleStringA::Format("\\Root\\%s.log", (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append("Root").Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
else
|
|
|
{
|
|
|
CEntityStaticInfo info = {};
|
|
|
@@ -3131,7 +3108,7 @@ ErrorCodeEnum CRemoteControllerCnn::HandleBatchUploadLogsReq(const CSmartPointer
|
|
|
return Error_NotExist;
|
|
|
}
|
|
|
|
|
|
- strLogPath += CSimpleStringA::Format("\\%s\\%s.log", (const char*)info.strSpFileName, (const char*)strTodayLogName);
|
|
|
+ strLogPath.Append(SPLIT_SLASH_STR).Append((const char*)info.strSpFileName).Append(SPLIT_SLASH_STR).Append((const char*)strTodayLogName).Append(".log");
|
|
|
}
|
|
|
}
|
|
|
|