本文整理汇总了C++中CFileList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileList::size方法的具体用法?C++ CFileList::size怎么用?C++ CFileList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileList
的用法示例。
在下文中一共展示了CFileList::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRecursiveDir
void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, bool bRootCall, CProgressWindow * progress)
{
neutrino_msg_t msg;
neutrino_msg_data_t data;
int n;
//printf("addRecursiveDir %s\n",rpath.c_str());
if (bRootCall) bCancel=false;
g_RCInput->getMsg_us(&msg, &data, 1);
if (msg==CRCInput::RC_home)
{
// home key cancel scan
bCancel=true;
}
else if (msg!=CRCInput::RC_timeout)
{
// other event, save to low priority queue
g_RCInput->postMsg( msg, data, false );
}
if(bCancel)
return;
if ((m_Mode != ModeSC) && ((rpath.empty()) || ((*rpath.rbegin()) != '/')))
{
rpath += '/';
}
CFileList tmplist;
if(!readDir(rpath, &tmplist))
{
perror(("Recursive scandir: "+rpath).c_str());
}
else
{
n = tmplist.size();
if(progress)
{
progress->showStatusMessageUTF(FILESYSTEM_ENCODING_TO_UTF8_STRING(rpath));
}
for(int i = 0; i < n;i++)
{
if(progress)
{
progress->showGlobalStatus(100/n*i);
}
std::string basename = tmplist[i].Name.substr(tmplist[i].Name.rfind('/')+1);
if( basename != ".." )
{
if(Filter != NULL && (!S_ISDIR(tmplist[i].Mode)) && use_filter)
{
if(!Filter->matchFilter(tmplist[i].Name))
{
continue;
}
}
if(!S_ISDIR(tmplist[i].Mode))
re_filelist->push_back(tmplist[i]);
else
addRecursiveDir(re_filelist,tmplist[i].Name, false, progress);
}
}
}
}
示例2: addRecursiveDir
void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, bool bRootCall)
{
neutrino_msg_t msg;
neutrino_msg_data_t data;
int n;
dprintf(DEBUG_INFO, "CFileBrowser::addRecursiveDir %s\n", rpath.c_str());
if (bRootCall)
bCancel = false;
g_RCInput->getMsg_us(&msg, &data, 1);
if (msg == CRCInput::RC_home)
{
// home key cancel scan
bCancel = true;
}
else if (msg != CRCInput::RC_timeout)
{
// other event, save to low priority queue
g_RCInput->postMsg( msg, data, false );
}
if(bCancel)
return;
if ( ((rpath.empty()) || ((*rpath.rbegin()) != '/')))
{
rpath += '/';
}
CFileList tmplist;
if(!readDir(rpath, &tmplist))
{
perror(("Recursive scandir: " + rpath).c_str());
}
else
{
n = tmplist.size();
for(int i = 0; i < n;i++)
{
std::string basename = tmplist[i].Name.substr(tmplist[i].Name.rfind('/')+1);
if( basename != ".." )
{
if(Filter != NULL && (!S_ISDIR(tmplist[i].Mode)) && use_filter)
{
if(!Filter->matchFilter(tmplist[i].Name))
{
continue;
}
}
if(!S_ISDIR(tmplist[i].Mode))
re_filelist->push_back(tmplist[i]);
else
addRecursiveDir(re_filelist,tmplist[i].Name, false);
}
}
}
}