本文整理汇总了C++中CDirectoryCache::UpdateFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CDirectoryCache::UpdateFile方法的具体用法?C++ CDirectoryCache::UpdateFile怎么用?C++ CDirectoryCache::UpdateFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDirectoryCache
的用法示例。
在下文中一共展示了CDirectoryCache::UpdateFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetOperation
int CControlSocket::ResetOperation(int nErrorCode)
{
LogMessage(MessageType::Debug_Verbose, _T("CControlSocket::ResetOperation(%d)"), nErrorCode);
if (nErrorCode & FZ_REPLY_WOULDBLOCK)
{
LogMessage(MessageType::Debug_Warning, _T("ResetOperation with FZ_REPLY_WOULDBLOCK in nErrorCode (%d)"), nErrorCode);
}
if (m_pCurOpData && m_pCurOpData->holdsLock)
UnlockCache();
if (m_pCurOpData && m_pCurOpData->pNextOpData)
{
COpData *pNext = m_pCurOpData->pNextOpData;
m_pCurOpData->pNextOpData = 0;
delete m_pCurOpData;
m_pCurOpData = pNext;
if (nErrorCode == FZ_REPLY_OK ||
nErrorCode == FZ_REPLY_ERROR ||
nErrorCode == FZ_REPLY_CRITICALERROR)
{
return ParseSubcommandResult(nErrorCode);
}
else
return ResetOperation(nErrorCode);
}
wxString prefix;
if ((nErrorCode & FZ_REPLY_CRITICALERROR) == FZ_REPLY_CRITICALERROR &&
(!m_pCurOpData || m_pCurOpData->opId != Command::transfer))
{
prefix = _("Critical error:") + _T(" ");
}
if (m_pCurOpData)
{
const Command commandId = m_pCurOpData->opId;
switch (commandId)
{
case Command::none:
if( !prefix.empty() ) {
LogMessage(MessageType::Error, _("Critical error"));
}
break;
case Command::connect:
if ((nErrorCode & FZ_REPLY_CANCELED) == FZ_REPLY_CANCELED)
LogMessage(MessageType::Error, prefix + _("Connection attempt interrupted by user"));
else if (nErrorCode != FZ_REPLY_OK)
LogMessage(MessageType::Error, prefix + _("Could not connect to server"));
break;
case Command::list:
if ((nErrorCode & FZ_REPLY_CANCELED) == FZ_REPLY_CANCELED)
LogMessage(MessageType::Error, prefix + _("Directory listing aborted by user"));
else if (nErrorCode != FZ_REPLY_OK)
LogMessage(MessageType::Error, prefix + _("Failed to retrieve directory listing"));
else
LogMessage(MessageType::Status, _("Directory listing successful"));
break;
case Command::transfer:
{
CFileTransferOpData *pData = static_cast<CFileTransferOpData *>(m_pCurOpData);
if (!pData->download && pData->transferInitiated)
{
if (!m_pCurrentServer)
LogMessage(__TFILE__, __LINE__, this, MessageType::Debug_Warning, _T("m_pCurrentServer is 0"));
else
{
CDirectoryCache cache;
bool updated = cache.UpdateFile(*m_pCurrentServer, pData->remotePath, pData->remoteFile, true, CDirectoryCache::file, (nErrorCode == FZ_REPLY_OK) ? pData->localFileSize : -1);
if (updated)
m_pEngine->SendDirectoryListingNotification(pData->remotePath, false, true, false);
}
}
LogTransferResultMessage(nErrorCode, pData);
}
break;
default:
if ((nErrorCode & FZ_REPLY_CANCELED) == FZ_REPLY_CANCELED)
LogMessage(MessageType::Error, prefix + _("Interrupted by user"));
break;
}
delete m_pCurOpData;
m_pCurOpData = 0;
}
ResetTransferStatus();
SetWait(false);
if (m_invalidateCurrentPath) {
m_CurrentPath.clear();
m_invalidateCurrentPath = false;
}
return m_pEngine->ResetOperation(nErrorCode);
}