本文整理汇总了C++中FileOperationList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ FileOperationList::push_back方法的具体用法?C++ FileOperationList::push_back怎么用?C++ FileOperationList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileOperationList
的用法示例。
在下文中一共展示了FileOperationList::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoProcessFolder
bool CFileOperationJob::DoProcessFolder(FileAction action, const CStdString& strPath, const CStdString& strDestFile, FileOperationList &fileOperations, double &totalTime)
{
// check whether this folder is a filedirectory - if so, we don't process it's contents
CFileItem item(strPath, false);
IFileDirectory *file = CFactoryFileDirectory::Create(strPath, &item);
if (file)
{
delete file;
return true;
}
CLog::Log(LOGDEBUG,"FileManager, processing folder: %s",strPath.c_str());
CFileItemList items;
//m_rootDir.GetDirectory(strPath, items);
CDirectory::GetDirectory(strPath, items, "", false, false, DIR_CACHE_ONCE, true, false, true);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
pItem->Select(true);
CLog::Log(LOGDEBUG," -- %s",pItem->m_strPath.c_str());
}
if (!DoProcess(action, items, strDestFile, fileOperations, totalTime)) return false;
if (action == ActionMove)
{
fileOperations.push_back(CFileOperation(ActionDeleteFolder, strPath, "", 1));
totalTime += 1.0;
}
return true;
}
示例2: DoProcessFolder
bool CFileOperationJob::DoProcessFolder(FileAction action, const std::string& strPath, const std::string& strDestFile, FileOperationList &fileOperations, double &totalTime)
{
// check whether this folder is a filedirectory - if so, we don't process it's contents
CFileItem item(strPath, false);
IFileDirectory *file = CFileDirectoryFactory::Create(item.GetURL(), &item);
if (file)
{
delete file;
return true;
}
CFileItemList items;
CDirectory::GetDirectory(strPath, items, "", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_GET_HIDDEN);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
pItem->Select(true);
}
if (!DoProcess(action, items, strDestFile, fileOperations, totalTime))
{
CLog::Log(LOGERROR,"FileManager: error while processing folder: %s", strPath.c_str());
return false;
}
if (action == ActionMove)
{
fileOperations.push_back(CFileOperation(ActionDeleteFolder, strPath, "", 1));
totalTime += 1.0;
}
return true;
}
示例3: DoProcessFile
bool CFileOperationJob::DoProcessFile(FileAction action, const CStdString& strFileA, const CStdString& strFileB, FileOperationList &fileOperations, double &totalTime)
{
int64_t time = 1;
if (action == ActionCopy || action == ActionReplace || (action == ActionMove && !CanBeRenamed(strFileA, strFileB)))
{
struct __stat64 data;
if(CFile::Stat(strFileA, &data) == 0)
time += data.st_size;
}
fileOperations.push_back(CFileOperation(action, strFileA, strFileB, time));
totalTime += time;
return true;
}