Example #1
0
void DemoCollection::PopulateList( void ) {
	std::string fullPath = std::string( PATH_ROOT ) + ( IsRoot() ? "" : "/" + path );

	// populate the list of directories and demo files
	demoList.clear();

	if( !IsRoot() ) {
		// back dir ".."
		demoList.push_back( PATH_PARENT );
	}

	DirList dirList;
	dirList.clear();

	getFileList( dirList, fullPath, "/", true );
	for( DirList::iterator it = dirList.begin(); it != dirList.end(); ++it ) {
		std::string fullName = *it + "/";
		demoList.push_back( fullName );
	}

	// populate directories
	numDirectories = demoList.size();

	getFileList( demoList, fullPath, demoExtension.c_str(), true );
}
	bool findDir(DirList::iterator &it, const string &dir)
	{
		it = dirs.find(dir);
		if(it == dirs.end())
			return false;

		return true;
	}