static CString ExcludePath( const CString& supportPath, const CString& arxPath ) { AcStringArray cc; SplitCString( supportPath, _T( ";" ), cc ); AcStringArray paths; int n = cc.length(); for( int i = 0; i < n; i++ ) { if( cc[i].compareNoCase( arxPath ) == 0 ) continue; paths.append( cc[i] ); } CString path; n = paths.length(); for( int i = 0; i < n; i++ ) { if( i == n - 1 ) { path.AppendFormat( _T( "%s" ), paths[i].kACharPtr() ); } else { path.AppendFormat( _T( "%s;" ), paths[i].kACharPtr() ); } } return path; }
/************************************************* Function: transCStringToInt Desc: Input: Return: SUCCESS 成功 FAIL 失败 **************************************************/ int CDialogSetting::transCStringToInt(CString addstr) { DWORD add; vector<CString> ips = SplitCString(addstr,"."); add = atoi(ips[0])*256*256*256+atoi(ips[1])*256*256+atoi(ips[2])*256+atoi(ips[3]); return add; }
static bool IsPathExit( const CString& supportPath, const CString& arxPath ) { AcStringArray cc; SplitCString( supportPath, _T( ";" ), cc ); bool bFind = false; int n = cc.length(); for( int i = 0; i < n; i++ ) { if( cc[i].compareNoCase( arxPath ) == 0 ) { bFind = true; break; } } return bFind; }
BOOL CKSogoClean::CleanDbTable(std::wstring strInFile) { BOOL bRet = FALSE; sqlite3* pDb = NULL; std::vector<std::wstring> vec_String; std::string szFileName; std::string szTable; int nResult = -1; char szSql[MAX_PATH] = {0}; char* szError = NULL; if (SplitCString(strInFile, vec_String, L'|') < 2) { bRet = FALSE; goto clean0; } bRet = TRUE; szFileName = UnicodeToUtf8(vec_String[0]); szTable = UnicodeToUtf8(vec_String[1]); nResult = sqlite3_open(szFileName.c_str(), &pDb); if (nResult != SQLITE_OK) { goto clean0; } if(szTable.empty()) goto clean0; sprintf_s(szSql, "delete from %s", szTable.c_str()); nResult = sqlite3_exec(pDb, szSql, 0, 0, &szError); if (nResult != SQLITE_OK) { goto clean0; } clean0: if (pDb) { sqlite3_close(pDb); pDb = NULL; } return bRet; }