本文整理汇总了C++中CServerPath::FormatFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ CServerPath::FormatFilename方法的具体用法?C++ CServerPath::FormatFilename怎么用?C++ CServerPath::FormatFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CServerPath
的用法示例。
在下文中一共展示了CServerPath::FormatFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FileTransfer
int CHttpControlSocket::FileTransfer(const wxString localFile, const CServerPath &remotePath,
const wxString &remoteFile, bool download,
const CFileTransferCommand::t_transferSettings& transferSettings)
{
LogMessage(Debug_Verbose, _T("CHttpControlSocket::FileTransfer()"));
LogMessage(Status, _("Downloading %s"), remotePath.FormatFilename(remoteFile).c_str());
if (!download)
{
ResetOperation(FZ_REPLY_CRITICALERROR | FZ_REPLY_NOTSUPPORTED);
return FZ_REPLY_ERROR;
}
if (m_pCurOpData)
{
LogMessage(__TFILE__, __LINE__, this, Debug_Info, _T("deleting nonzero pData"));
delete m_pCurOpData;
}
CHttpFileTransferOpData *pData = new CHttpFileTransferOpData(download, localFile, remoteFile, remotePath);
m_pCurOpData = pData;
m_pHttpOpData = pData;
if (localFile != _T(""))
{
pData->opState = filetransfer_waitfileexists;
int res = CheckOverwriteFile();
if (res != FZ_REPLY_OK)
return res;
pData->opState = filetransfer_transfer;
pData->pFile = new wxFile();
CreateLocalDir(pData->localFile);
if (!pData->pFile->Open(pData->localFile, wxFile::write))
{
LogMessage(::Error, _("Failed to open \"%s\" for writing"), pData->localFile.c_str());
ResetOperation(FZ_REPLY_ERROR);
return FZ_REPLY_ERROR;
}
}
else
pData->opState = filetransfer_transfer;
int res = InternalConnect(m_pCurrentServer->GetHost(), m_pCurrentServer->GetPort(), m_pCurrentServer->GetProtocol() == HTTPS);
if (res != FZ_REPLY_OK)
return res;
return FileTransferSend();
}