@@ -427,6 +427,8 @@ bool CAPIHelp_Api::APIHelp_Api_Boundary(XCHAR*** ppptszList, int nListCount, XCH
427427*********************************************************************/
428428bool CAPIHelp_Api::APIHelp_Api_GetDIRSize (LPCXSTR lpszDIRStr, __int64u* pInt_DIRSize)
429429{
430+ APIHelp_IsErrorOccur = false ;
431+
430432 int nListCount = 0 ;
431433 int nPathType = 0 ;
432434 __int64u nDirCount = 0 ; // 当前目录大小
@@ -453,5 +455,50 @@ bool CAPIHelp_Api::APIHelp_Api_GetDIRSize(LPCXSTR lpszDIRStr, __int64u* pInt_DIR
453455 }
454456 BaseLib_OperatorMemory_Free ((XPPPMEM)&ppListFile, nListCount);
455457 *pInt_DIRSize = nDirCount;
458+ return true ;
459+ }
460+ /* *******************************************************************
461+ 函数名称:APIHelp_Api_UrlStr
462+ 函数功能:获取URL的KEY
463+ 参数.一:ptszKeyStr
464+ In/Out:Out
465+ 类型:字符指针
466+ 可空:N
467+ 意思:输出获取到的数据
468+ 参数.二:lpszUrl
469+ In/Out:In
470+ 类型:常量字符指针
471+ 可空:N
472+ 意思:输入要获取的数据
473+ 返回值
474+ 类型:逻辑型
475+ 意思:是否成功
476+ 备注:
477+ *********************************************************************/
478+ bool CAPIHelp_Api::APIHelp_Api_UrlStr (XCHAR* ptszKeyStr, LPCXSTR lpszUrl)
479+ {
480+ APIHelp_IsErrorOccur = false ;
481+
482+ XCHAR tszUrlStr[MAX_PATH] = {};
483+ _tcsxcpy (tszUrlStr, lpszUrl);
484+ // 查找第一个 '/' 的位置
485+ XCHAR *ptszFirstStr = _tcsxchr (tszUrlStr, ' /' );
486+ if (ptszFirstStr == NULL )
487+ {
488+ return false ;
489+ }
490+ // 查找第二个 '/' 的位置
491+ XCHAR* ptszSecondStr = _tcsxchr (ptszFirstStr + 1 , ' /' );
492+ if (ptszSecondStr == NULL )
493+ {
494+ return false ;
495+ }
496+ // 计算提取字符串的长度
497+ int nLen = ptszSecondStr - ptszFirstStr - 1 ;
498+ // 复制字符串
499+ _tcsxncpy (ptszKeyStr, ptszFirstStr + 1 , nLen);
500+ // 添加字符串结束符
501+ ptszKeyStr[nLen] = ' \0 ' ;
502+
456503 return true ;
457504}
0 commit comments