Browse Source

#IQRV #comment 升级和VTMLoad跨平台差异标注

80374374 5 months ago
parent
commit
556464ade1

+ 5 - 4
Module/mod_upload/UploadFSM.cpp

@@ -7,8 +7,6 @@
 #ifdef RVC_OS_WIN
 #include <cstdlib>
 #include <ctime> 
-#include "EventCode.h"
-
 #else
 #include <thread>
 #include "upload.h"
@@ -22,9 +20,8 @@
 #include <cstdio>
 #include <iostream>
 #include <errno.h>
-#include "EventCode.h"
-
 #endif
+#include "EventCode.h"
 
 #define UPLOAD_CONTENT_EACH_LEN 512*1024
 
@@ -625,6 +622,7 @@ namespace Task
 				string destDir="";
 				//根据路径类型组成最后移动路径
 				if(m_fsm->m_currUploadFile->path_type=="R"){
+					//TODO: CrossPlaform  [Gifur@202571]
 #ifdef RVC_OS_WIN
 					destPath = m_fsm->m_rootPath+"\\"+m_fsm->m_currUploadFile->after_deal_text+"\\"+m_fsm->m_currUploadFile->fileName;
 					destDir = m_fsm->m_rootPath+"\\"+m_fsm->m_currUploadFile->after_deal_text;
@@ -633,6 +631,7 @@ namespace Task
 					destDir = m_fsm->m_rootPath + SPLIT_SLASH_STR + m_fsm->m_currUploadFile->after_deal_text;
 #endif
 				}else{
+					//TODO: CrossPlaform  [Gifur@202571]
 #ifdef RVC_OS_WIN
 					destPath = m_fsm->m_currUploadFile->after_deal_text+"\\"+m_fsm->m_currUploadFile->fileName;
 #else
@@ -881,6 +880,7 @@ ErrorCodeEnum UploadFSM::OnInit()
 		if(Error_Succeed == Error){
 			if(!runPath.IsNullOrEmpty()){
 				string runPathStr = runPath.GetData();
+				//TODO: CrossPlaform  [Gifur@202571]
 #ifdef RVC_OS_WIN
 				int pos = runPathStr.find_last_of('\\');
 #else
@@ -1443,6 +1443,7 @@ void UploadFSM::scanFile()
 		//构建初始的扫描根路径
 		string path="";
 		if(up->path_type=="R"){
+			//TODO: CrossPlaform  [Gifur@202571]
 #ifdef RVC_OS_WIN
 			path = m_rootPath + "\\" + up->path_name;
 #else

+ 0 - 13
Module/mod_upload/mod_upload.h

@@ -4,11 +4,6 @@
 #include "stdafx.h"
 #include "SpBase.h"
 #include "SpIni.h"
-#ifdef RVC_OS_WIN
-#else
-#include "SpTest.h"
-#include "modVer.h"
-#endif
 
 #include "UploadFSM.h"
 #include "Upload_server_g.h"
@@ -39,15 +34,7 @@ public:
 	virtual ~CUploadEntity() {}
 	virtual const char* GetEntityName() const { return "Upload"; }
 	virtual bool IsService()const { return true; }
-#ifdef RVC_OS_WIN
-#else
-	const char* GetEntityVersion() const override
-	{
-		return MODULE_VERSION_FULL;
-	}
 
-	ON_ENTITYT_TEST()
-#endif
 	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		ErrorCodeEnum Error = Error_Succeed;

+ 0 - 148
Module/mod_upload/upload.cpp

@@ -20,146 +20,7 @@
 #include "EventCode.h"
 #endif // RVC_OS_WIN
 
-
 using namespace std;
-//获取文件夹实际路径
-//static ErrorCodeEnum expand_dir(IEntityFunction *pEntityFunc, const char *str, CSimpleStringA &out)
-//{
-//	ErrorCodeEnum Error = Error_Unexpect;
-//	if (str) {
-//		const char *p = str;
-//		const char *sfirst;
-//		int first = 0;
-//		char tmp[1024];
-//		int k = 0;
-//		while (*p) {
-//			if (first) {
-//				if (*p == ')') {
-//					char key[MAX_PATH];
-//					key[0] = 0;
-//					CSimpleStringA strKeyPath;;
-//					memcpy(key, sfirst, p - sfirst);
-//					key[p-sfirst] = 0;
-//					Error = pEntityFunc->GetPath(key, strKeyPath);
-//					if (Error != Error_Succeed) {
-//						//Dbg("sys path $(%s)$ cannot evaluate!", key);
-//						DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("expand_dir")("sys path $(%s)$ cannot evaluate!", key);
-//						return Error;
-//					}
-//					strcpy(&tmp[k], (LPCSTR)strKeyPath); 
-//					k += strKeyPath.GetLength();
-//					first = 0;
-//				}
-//			} else {
-//				if (*p == '$' && *(p+1) == '(') {
-//					p++;
-//					first = 1;
-//					sfirst = p+1;
-//				} else {
-//					tmp[k++] = *p;
-//				}
-//			}
-//			p++;
-//		}
-//		if (k != 0) {
-//			tmp[k] = 0;
-//			out = tmp;
-//			return Error_Succeed;
-//		}
-//	} else {
-//		return Error_Param;
-//	}
-//	return Error;
-//}
-
-//static upload_dir_t *upload_dir_load(IEntityFunction *pEntityFunc, const char *dir, int default_silent_time, int default_limitation)
-//{
-//	upload_dir_t *updir = ZALLOC_T(upload_dir_t);
-//	if (updir) 
-//	{
-//		CSimpleStringA str;
-//
-//		std::map<std::string, std::string> macroPath;
-//		macroPath["SysLog"] = "$(SysLog)"; //TODO
-//		macroPath["InterLog"] = "$(InterLog)"; //TODO
-//		macroPath["Photo"] = "$(UploadPhoto)";
-//		macroPath["Video"] = "$(UploadVideo)";
-//		macroPath["SilverlightDebug"] = "$(slv)"; //TODO
-//		macroPath["Debug"] = "$(dbg)";
-//
-//		std::map<std::string, bool> macroZip;
-//		macroZip["SysLog"] = true;
-//		macroZip["InterLog"] = true;
-//		macroZip["Photo"] = false;
-//		macroZip["Video"] = false;
-//		macroZip["SilverlightDebug"] = true;
-//		macroZip["Debug"] = true;
-//
-//		ErrorCodeEnum Error = Error_Succeed;
-//		if (macroPath.find(dir) == macroPath.end()) {
-//			return updir;
-//		}
-//		str = macroPath[dir].c_str();
-//
-//		INIT_LIST_HEAD(&updir->candidate_list);
-//		CSimpleStringA strRealPath;
-//		Error = expand_dir(pEntityFunc, (LPCSTR)str, strRealPath);
-//		if (Error == Error_Succeed) {
-//			INIT_LIST_HEAD(&updir->candidate_list);
-//			updir->name = _strdup(dir);
-//			updir->path = _strdup(strRealPath);
-//
-//			if (strcmp(dir, "Video") == 0) {
-//				str = "$(LocalVideo)";
-//				updir->flags |= UPLOAD_FLAG_MOVEPATH;
-//				Error = expand_dir(pEntityFunc, str, strRealPath);
-//				if (Error != Error_Succeed) {
-//					return NULL;
-//				}
-//				updir->movepath = _strdup(strRealPath);
-//			} else {
-//				updir->flags |= UPLOAD_FLAG_AUTODELETE;
-//			}
-//			if (macroZip.find(dir) != macroZip.end() && macroZip[dir]) {
-//				updir->flags |= UPLOAD_FLAG_ZIP;
-//			}
-//			if (strcmp("SilverlightDebug", dir) == 0 || strcmp("Debug", dir) == 0) {
-//				updir->silent_time = 86400;
-//			} else {
-//				updir->silent_time = 900;
-//			}
-//			updir->child_count_limitation = default_limitation;
-//			updir->fileCount = 0;//初始化设置为0
-//			updir->fileLenSum = 0;//初始化设置为0
-//		}
-//	}
-//	return updir;
-//}
-
-//初始化要上传的文件夹配置
-//int upload_create(struct list_head *list, IEntityFunction *pEntityFunc, CSimpleStringA &checkDir)
-//{
-//	assert(list_empty(list));
-//	char type_str[1024];
-//	char *p, *c;
-//	int default_silent_time = 3600;
-//	int default_limitation = 256;
-//	strcpy(type_str, "SysLog,InterLog,Photo,Video,SilverlightDebug,Debug");
-//	p = strtok_s(type_str, ", ", &c);
-//	while (p) {
-//		upload_dir_t *dir = upload_dir_load(pEntityFunc, p, default_silent_time, default_limitation);
-//		if (!dir) 
-//		{
-//			return Error_Unexpect;
-//		}
-//		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("upload_create")("load %s ok", p);
-//		list_add_tail(&dir->entry, list);
-//		p = strtok_s(NULL, ", ", &c);
-//	}
-//	return 0;
-//}
-
-
 
 #ifdef RVC_OS_WIN
 #define FT_2000_1_1_0_0_0	125911584000000000UL
@@ -202,20 +63,11 @@ static int check_zero_ref(const char *path)
 
 
 
-
-
-	
-
-
-
-
-
 #ifdef RVC_OS_WIN
 
 #else
 
 
-
 int changeFileAtt(const char* path)
 {
 	struct stat attr_of_del;

+ 1 - 0
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -2915,6 +2915,7 @@ void CVtmLoaderFSM::CopyDepFilesToNewDepPath()
 
 	if (!CreateDirA(csPath.GetData(), TRUE))
 	{
+		//TODO: CrossPlaform  [Gifur@202571]
 #ifdef RVC_OS_WIN
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create default dep version dir fail: %d", GetLastError());
 #else