当前位置: 首页>>代码示例>>C++>>正文


C++ Directory::Rewind方法代码示例

本文整理汇总了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 );
        }
    }
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:52,代码来源:HistoryProcessingUtils.cpp

示例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;
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:27,代码来源:WallpaperChangerSettings.cpp


注:本文中的Directory::Rewind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。