本文整理汇总了C++中Directory::Rewind方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::Rewind方法的具体用法?C++ Directory::Rewind怎么用?C++ Directory::Rewind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::Rewind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dir
/**
* Process the history directory and maintain the history file map
*
* Only handle rotated history files, those history.* that are not an
* index. For each one that is not in the history file map, create a
* new HistoryFile, poll it for entries to process, and add it to the
* map.
*/
void
aviary::history::processHistoryDirectory()
{
const char *file = NULL;
// each time through we rebuild our set of inodes
if (force_reset) {
m_historyFiles.clear();
}
Directory dir ( m_path.Value() );
dir.Rewind();
while ( ( file = dir.Next() ) )
{
// Skip all non-history files, e.g. history and history.*.idx
if ( strncmp ( file, "history.", 8 ) ||
!strncmp ( file + ( strlen ( file ) - 4 ), HISTORY_INDEX_SUFFIX, 4 ) ) continue;
HistoryFile h_file ( ( m_path + DIR_DELIM_STRING + file ).Value() );
CondorError errstack;
if ( !h_file.init ( errstack ) )
{
dprintf ( D_ALWAYS, "%s\n", errstack.getFullText().c_str() );
return;
}
errstack.clear();
long unsigned int id;
ASSERT ( h_file.getId ( id ) );
HistoryFileListType::iterator entry = m_historyFiles.find ( id );
if ( m_historyFiles.end() == entry )
{
HistoryFile::HistoryEntriesTypeIterators ij = h_file.poll ( errstack );
for ( HistoryFile::HistoryEntriesTypeIterator i = ij.first;
i != ij.second;
i++ )
{
process ( ( *i ) );
}
m_historyFiles.insert ( id );
}
}
}
示例2: LoadDirectoryList
/*************************************************
* Description: Loads the directoy contents of ~/Documents/Pictures into listview
* Author: Rick Caudill
* Date: Thu Mar 18 20:17:32 2004
**************************************************/
void WallpaperChangerSettings::LoadDirectoryList()
{
String cDir = getenv( "HOME" );
cDir += "/Pictures/";
String cFile;
Directory* pcDir = new Directory(cDir);
pcDir->Rewind();
while (pcDir->GetNextEntry(&cFile))
{
FSNode* pcNode = new FSNode(String(cDir + cFile));
if (pcNode->IsFile()) //if not a dir, link and just a regular file
{
ListViewStringRow* pcRow = new ListViewStringRow();
pcRow->AppendString(cFile);
pcDirectoryList->InsertRow(pcRow);
}
delete pcNode;
}
delete pcDir;
}