本文整理汇总了C++中CArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CArray::IsEmpty方法的具体用法?C++ CArray::IsEmpty怎么用?C++ CArray::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArray
的用法示例。
在下文中一共展示了CArray::IsEmpty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDeleteUI
void CUIDesignerView::OnDeleteUI()
{
CArray<CControlUI*,CControlUI*> arrSelected;
m_MultiTracker.GetSelected(arrSelected);
RemoveForm(arrSelected);
if(arrSelected.IsEmpty())
return;
m_UICommandHistory.Begin(arrSelected, actionDelete);
for(int i=0; i<arrSelected.GetSize(); i++)
{
CControlUI* pControl = arrSelected[i];
CControlUI* pParent=pControl->GetParent();
HTREEITEM hDelete=(HTREEITEM)(((ExtendedAttributes*)pControl->GetTag())->hItem);
g_pClassView->RemoveUITreeItem(hDelete);
DeleteUI(pControl);
if(pParent)
pParent->NeedUpdate();
}
m_UICommandHistory.End();
g_pPropertiesWnd->ShowProperty(NULL);
m_MultiTracker.RemoveAll();
this->GetDocument()->SetModifiedFlag();
}
示例2: GetPartHashs
bool CAICHRecoveryHashSet::GetPartHashs(CArray<CAICHHash>& rResult) const
{
ASSERT( m_pOwner );
ASSERT( rResult.IsEmpty() );
rResult.RemoveAll();
if (m_pOwner->IsPartFile() || m_eStatus != AICH_HASHSETCOMPLETE){
ASSERT( false );
return false;
}
uint32 uPartCount = (uint16)(((uint64)m_pOwner->GetFileSize() + (PARTSIZE - 1)) / PARTSIZE);
if (uPartCount <= 1)
return true; // No AICH Part Hashs
for (uint32 nPart = 0; nPart < uPartCount; nPart++)
{
uint64 nPartStartPos = (uint64)nPart*PARTSIZE;
uint32 nPartSize = (uint32)min(PARTSIZE, (uint64)m_pOwner->GetFileSize()-nPartStartPos);
const CAICHHashTree* pPartHashTree = m_pHashTree.FindExistingHash(nPartStartPos, nPartSize);
if (pPartHashTree != NULL && pPartHashTree->m_bHashValid)
rResult.Add(pPartHashTree->m_Hash);
else
{
rResult.RemoveAll();
ASSERT( false );
return false;
}
}
return true;
}
示例3: OnAlignVertical
void CUIDesignerView::OnAlignVertical()
{
CArray<CControlUI*,CControlUI*> arrSelected;
m_MultiTracker.GetSelected(arrSelected);
RemoveForm(arrSelected);
if(arrSelected.IsEmpty())
return;
m_UICommandHistory.Begin(arrSelected, actionModify);
m_LayoutManager.AlignVertical(m_MultiTracker.GetFocused(),arrSelected);
m_UICommandHistory.End();
this->GetDocument()->SetModifiedFlag();
}
示例4: CheckAction
// 检查开始,传出检查结果
int CSDDrawingFakeDimCheck::CheckAction(void *pData, const CheckRule &checkRule, CheckResult &checkResult)
{
ProMdl pMdl = (ProMdl)pData;
if (NULL == pMdl)
{
checkResult.nResultType = CHECK_RESULT_INVALID_MODEL;
return checkResult.nResultType;
}
if (!IsMdlTypeValid(pMdl, checkRule.dwMdlFilter))
{
checkResult.nResultType = CHECK_RESULT_INVALID_MODEL;
return checkResult.nResultType;
}
checkRule;
ProDrawing pDrw = (ProDrawing)pData;
checkResult.nResultType = CHECK_RESULT_NO_ERROR;
//修改
checkResult.arrErrorItems.RemoveAll();
ErrorItem errItem;
CArray<ProDimension> arrDrwDim;
ProDrawingDimensionVisit(pDrw, PRO_REF_DIMENSION, DimVisitAction, DimVisitFilter, &arrDrwDim);
ProDrawingDimensionVisit(pDrw, PRO_DIMENSION, DimVisitAction, DimVisitFilter, &arrDrwDim);
ProSolid pDrwSld;
ProError err = ProDrawingCurrentsolidGet(pDrw, &pDrwSld);
if (err != PRO_TK_NO_ERROR)
{
checkResult.nResultType = CHECK_RESULT_INVALID_INPUT;
return checkResult.nResultType;
}
ProSolidDimensionVisit(pDrwSld, PRO_B_FALSE, DimVisitAction, DimVisitFilter, &arrDrwDim);
ProSolidDimensionVisit(pDrwSld, PRO_B_TRUE, DimVisitAction, DimVisitFilter, &arrDrwDim);
if (!arrDrwDim.IsEmpty())
{
for (int i = 0; i < arrDrwDim.GetSize(); i ++)
{
// checkResult.arrErrorIDs.Add(arrDrwDim[i].id);
//修改
errItem.nID = arrDrwDim[i].id;
checkResult.arrErrorItems.Add(errItem);
}
checkResult.nResultType = CHECK_RESULT_INVALID_VALUE;
}
return checkResult.nResultType;
}
示例5: ExecuteHistorical
ERMsg CUIEnvCanRadar::ExecuteHistorical(CCallback& callback)
{
ERMsg msg;
string workingDir = GetDir(WORKING_DIR);
CreateMultipleDir(workingDir);
CInternetSessionPtr pSession;
CHttpConnectionPtr pConnection;
msg = GetHttpConnection(SERVER_NAME[as<size_t>(TYPE)], pConnection, pSession);
if (!msg)
return msg;
callback.AddMessage(GetString(IDS_UPDATE_DIR));
callback.AddMessage(workingDir, 1);
callback.AddMessage(GetString(IDS_UPDATE_FROM));
callback.AddMessage(SERVER_NAME[as<size_t>(TYPE)], 1);
callback.AddMessage("");
//Get remote station list
StringVector imageList;
if (msg)
msg = GetRadarList(imageList, callback);
if (msg)
msg = CleanRadarList(imageList, callback);
if (!msg)
return msg;
callback.PushTask("Download historical radar images (" + ToString(imageList.size())+ ")", imageList.size());
//callback.SetNbStep(imageList.size());
int nbRun = 0;
int curI = 0;
while (curI<imageList.size() && msg)
{
nbRun++;
CInternetSessionPtr pSession;
CHttpConnectionPtr pConnection;
msg = GetHttpConnection(SERVER_NAME[as<size_t>(TYPE)], pConnection, pSession);
if (msg)
{
TRY
{
for (int i = curI; i<imageList.size() && msg; i++)
{
string filePath = GetOutputFilePath(as<size_t>(TYPE), imageList[i]);
msg += CreateMultipleDir(GetPath(filePath));
//msg += CopyFile(pConnection, imageList[i], filePath, INTERNET_FLAG_TRANSFER_BINARY | WININET_API_FLAG_SYNC);
CString URL(imageList[i].c_str());
CHttpFile* pURLFile = pConnection->OpenRequest(_T("GET"), URL, NULL, 1, NULL, NULL, INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_TRANSFER_BINARY | WININET_API_FLAG_SYNC | INTERNET_FLAG_NEED_FILE);
//CStdioFile* pURLFile = pSession->OpenURL(UtilWin::Convert(imageList[i]), 0, INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_EXISTING_CONNECT);
bool bRep = false;
if (pURLFile != NULL)
{
if (pURLFile->SendRequest() != 0)
{
CArray<char> source;
int len = 0;
CArray<char> tmp;
tmp.SetSize(50);
DWORD dwStatusCode = 0;
pURLFile->QueryInfoStatusCode(dwStatusCode);
ULONGLONG length = pURLFile->GetLength();
while (length > 0)
{
pURLFile->Read(tmp.GetData(), 50);
source.Append(tmp);
length = pURLFile->GetLength();
}
pURLFile->QueryInfoStatusCode(dwStatusCode);
pURLFile->Close();
ofStream file;
msg = file.open(filePath, ios::out | ios::binary);
if (msg)
{
if (!source.IsEmpty())
file.write(source.GetData(), (UINT)source.GetSize());
file.close();
//.........这里部分代码省略.........
示例6: ApplyDocToTaskMgr
//.........这里部分代码省略.........
psdl->iCat = 0;
psdl->iState = iState;
psdl->strName = strFileName;
arrSpDownLinks.Add(psdl);
}
break;
case FILESTATE_DOWNLOADED_SHARE:
case FILESTATE_SHARE_TASK_DELED:
case FILESTATE_DELETED:
case FILESTATE_ZEROSIZE_DOWNLOADED:
{
strFileName = CGlobalVariable::filemgr.GetUrlFileName(strUrl);
SSpDownLink* psdl = new SSpDownLink;
psdl->iLinkType = 1;
psdl->strLink = strUrl;
psdl->iCat = 0;
psdl->iState = iState;
psdl->strName = strFileName;
arrReDownLinks.Add(psdl);
}
break;
default:
CmdFuncs::ActualllyAddUrlDownload(strUrl,lpszLocation);
break;
}
}
}
// URL tasks <end>
int i;
CString strPrompt;
if (!arrSpDownLinks.IsEmpty())
{
strPrompt = GetResString(IDS_ALREADY_DOWNLOAD);
for (i = 0; i < arrSpDownLinks.GetCount(); i++)
{
if(arrSpDownLinks[i]->iLinkType==1)
strPrompt += arrSpDownLinks[i]->strLink;
else
strPrompt += arrSpDownLinks[i]->strName;
strPrompt += _T("\n");
}
for (i = 0; i < arrSpDownLinks.GetCount(); i++)
delete arrSpDownLinks[i];
arrSpDownLinks.RemoveAll();
}
UINT iTooBigDownLinks = 0;
if (!arrTooBigDownLinks.IsEmpty())
{
iTooBigDownLinks =arrTooBigDownLinks.GetCount();
if (!strPrompt.IsEmpty())
strPrompt += _T("\n\n");
strPrompt = GetResString(IDS_ERR_FSCANTHANDLEFILE);
strPrompt += _T("\n");
for (i = 0; i < arrTooBigDownLinks.GetCount(); i++)
{
if(arrTooBigDownLinks[i]->iLinkType==1)
strPrompt += arrTooBigDownLinks[i]->strLink;
else
strPrompt += arrTooBigDownLinks[i]->strName;
示例7: CleanedFillupBug
BOOL CUPnpMgr::CleanedFillupBug()
{
CSingleLock localLock(&m_cs, TRUE);
if (FAILED(m_nat.SearchDevice()))
return FALSE;
HRESULT hr;
USHORT usIndex;
USHORT usExternalPort;
CString strProtocol;
CString strDesc;
CString strInternalClient;
CString strLocalIP;
CArray<CUPnpNatMapping, const CUPnpNatMapping&> arrMapping;
CUPnpNatMapping mapping;
strLocalIP = GetLocalIPStr();
for (usIndex = 0; usIndex < 128; usIndex++) // 最多查询128项,以防止有些路由器可能会一直返回成功。
{
hr = m_nat.GetGenericPortMappingEntry(usIndex, NULL, &usExternalPort, &strProtocol,
NULL, &strInternalClient, NULL, &strDesc);
if (-1 != strDesc.Find(_T("eMule ("))) // 描述里包含指定字样
{
if (strInternalClient == strLocalIP) // 是本机添加的映射
m_nat.DeletePortMapping(CString(_T("")),usExternalPort, strProtocol);
else
{
mapping.m_strInternalClient = strInternalClient;
mapping.m_wExternalPort = usExternalPort;
mapping.m_strProtocol = strProtocol;
arrMapping.Add(mapping);
}
}
if (FAILED(hr)) // 返回Failed结果,表示已经全部取完了。
break;
}
// 如果同一ip做的eMule映射超过3项,则很有可能是以前的bug所致。则清除。<begin>
int i;
int iMappingCount;
CString strTestIp;
while (! arrMapping.IsEmpty())
{
strTestIp = arrMapping[0].m_strInternalClient;
iMappingCount = 0;
for (i = 0; i < arrMapping.GetCount(); i++)
{
if (strTestIp == arrMapping[i].m_strInternalClient)
iMappingCount++;
}
for (i = arrMapping.GetCount() - 1; i >= 0; i--)
{
if (strTestIp == arrMapping[i].m_strInternalClient)
{
if (iMappingCount > 3)
{
m_nat.DeletePortMapping(CString(_T("")),
arrMapping[i].m_wExternalPort,
arrMapping[i].m_strProtocol);
}
arrMapping.RemoveAt(i);
}
}
}
// 如果同一ip做的eMule映射超过3项,则很有可能是以前的bug所致。则清除。<end>
return TRUE;
}