• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetFileList函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetFileList函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFileList函数的具体用法?C++ GetFileList怎么用?C++ GetFileList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetFileList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UpdateGroupItems

static void UpdateGroupItems(std::vector<CProject::Group>& m_Groups)
{
  std::vector<std::string> folderlist = GetFolderList("*");
  for (unsigned int i = 0; i < folderlist.size(); i++) {
    if (!strcmp(folderlist[i].c_str(), ".")
     || !strcmp(folderlist[i].c_str(), "..")) {
      continue;
    }
    // insert files into that folder
    char directory[MAX_PATH] = {0};
    GetCurrentDirectory(MAX_PATH, directory);
    SetCurrentDirectory(folderlist[i].c_str());
    std::vector<std::string> filelist = GetFileList("*");
    if (1) {
      CProject::Group current;
      current.FolderName = folderlist[i];
      current.Files = GetFileList("*");
      m_Groups.push_back(current);
    }
    filelist.clear();
    if (GetFolderList("*").size() > 0) {
      UpdateGroupItems(m_Groups);
    }
    SetCurrentDirectory(directory);
  }
}
开发者ID:FlyingJester,项目名称:sphere,代码行数:26,代码来源:Project.cpp


示例2: GetFileList

void GUIFileSelector::SetPageFocus(int inFocus)
{
	if (inFocus)
	{
		std::string value;
		DataManager::GetValue(mPathVar, value);
		if (GetFileList(value) != 0 && (mShowNavFolders != 0 || mShowFiles != 0)) {
			GetFileList(DataManager::GetCurrentStoragePath());
			DataManager::SetValue(mPathVar, DataManager::GetCurrentStoragePath());
		}
	}
}
开发者ID:1998-yhf,项目名称:Team-Win-Recovery-Project,代码行数:12,代码来源:fileselector.cpp


示例3: ensure_path_mounted

void GUIFileSelector::SetPageFocus(int inFocus)
{
    if (inFocus)
    {
        std::string value;
        DataManager::GetValue(mPathVar, value);

        // This is because some installers will unmount the sdcard
        ensure_path_mounted("/sdcard");
        if (GetFileList(value) != 0 && (mShowNavFolders != 0 || mShowFiles != 0))
			GetFileList("/sdcard");
    }
}
开发者ID:Dees-Troy,项目名称:RecoverWin,代码行数:13,代码来源:fileselector.cpp


示例4: GetFileListRecursive

void GetFileListRecursive(std::string dir, StringList& files, bool withQueriedDir /* = false */)
{
    std::stack<std::string> stk;

    if(withQueriedDir)
    {
        stk.push(dir);
        while(stk.size())
        {
            dir = stk.top();
            stk.pop();
            MakeSlashTerminated(dir);

            StringList li;
            GetFileList(dir.c_str(), li);
            for(std::deque<std::string>::iterator it = li.begin(); it != li.end(); ++it)
                files.push_back(dir + *it);

            li.clear();
            GetDirList(dir.c_str(), li, true);
            for(std::deque<std::string>::iterator it = li.begin(); it != li.end(); ++it)
                stk.push(dir + *it);
        }
    }
    else
    {
        std::string topdir = dir;
        MakeSlashTerminated(topdir);
        stk.push("");
        while(stk.size())
        {
            dir = stk.top();
            stk.pop();
            MakeSlashTerminated(dir);

            StringList li;
            dir = topdir + dir;
            GetFileList(dir.c_str(), li);
            for(std::deque<std::string>::iterator it = li.begin(); it != li.end(); ++it)
                files.push_back(dir + *it);

            li.clear();
            GetDirList(dir.c_str(), li, true);
            for(std::deque<std::string>::iterator it = li.begin(); it != li.end(); ++it)
                stk.push(dir + *it);
        }
    }
}
开发者ID:4nakin,项目名称:Aquaria_clean,代码行数:48,代码来源:VFSTools.cpp


示例5: locker

bool wxGISDataset::Delete(int iLayer, ITrackCancel* const pTrackCancel)
{
	wxCriticalSectionLocker locker(m_CritSect);

    Close();

    if(!DeleteFile(m_sPath))
        return false;

    char** papszFileList = GetFileList();
    if(papszFileList)
    {
		IProgressor* pProgressor(NULL);
		if(pTrackCancel)
		{
			pProgressor = pTrackCancel->GetProgressor();
			if(pProgressor)
				pProgressor->SetRange(CSLCount(papszFileList));
		}
        for(int i = 0; papszFileList[i] != NULL; ++i )
		{
			DeleteFile(papszFileList[i]);
			if(pProgressor)
				pProgressor->SetValue(i);
		}
        CSLDestroy( papszFileList );
    }
	return true;
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:29,代码来源:dataset.cpp


示例6: delete_fn

void delete_fn(file_info *finfo, const char *name, void *state)
{
    int     rc;
    char    temp[512];
    char    s[1024];
    char    FileName[128];
    DWORD   gle;

    sprintf(FileName, "Thread_%05d.log", ProcessNumber);

    if (finfo->mode & aDIR) 
    {
        char s2[1024];
        sprintf(s2, "%s\\*", name);
        GetFileList(s2, delete_fn, NULL);
        sprintf(s, "%s", &name[strlen(AfsLocker)]);
        nb_rmdir(s);
    }
    else
    {
        rc = DeleteFile(name);
        gle = GetLastError();
        if (!rc)
        {
            LeaveThread(0, "", CMD_UNLINK);
            sprintf(temp, "FILE: DeleteFile %s failed GLE(0x%x)\n", name, gle);
            if (verbose)
                printf("%s", temp);
            LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
            return;
        }
    }
    return;
}
开发者ID:snktagarwal,项目名称:openafs,代码行数:34,代码来源:nbio.c


示例7: nb_findfirst

int nb_findfirst(char *mask)
{
    int     rc;
    char    FileName[128];
    char    NewMask[512];
    char    temp[512];

    if (strstr(mask, "<.JNK"))
        return(0);

    sprintf(FileName, "Thread_%05d.log", ProcessNumber);

    strcpy(NewMask, AfsLocker);
    strcat(NewMask, mask);

    StartFirstTimer();
    rc = GetFileList(NewMask, (void *)find_fn, NULL);

    if (!rc)
    {
        EndFirstTimer(CMD_FIND_FIRST, 0);
        sprintf(temp, "File: findfirst cannot find for %s\n", mask);
        if (verbose)
            printf("%s", temp);
        LeaveThread(1, temp, CMD_FIND_FIRST);
        LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
        return(-1);
    }
    EndFirstTimer(CMD_FIND_FIRST, 1);
    return(0);
}
开发者ID:snktagarwal,项目名称:openafs,代码行数:31,代码来源:nbio.c


示例8: GetFileList

bool MemoryCardDriverThreaded_Linux::USBStorageDevicesChanged()
{
	RString sThisDevices;

	/* If a device is removed and reinserted, the inode of the /sys/block entry
	 * will change. */
	RString sDevicePath = "/sys/block/";
	
	vector<RString> asDevices;
	GetFileList( sDevicePath, asDevices );

	for( unsigned i = 0; i < asDevices.size(); ++i )
	{
		struct stat buf;
		if( stat( sDevicePath + asDevices[i], &buf ) == -1 )
			continue; // XXX warn

		sThisDevices += ssprintf( "%i,", (int) buf.st_ino );
	}
	       
	bool bChanged = sThisDevices != m_sLastDevices;
	m_sLastDevices = sThisDevices;
	if( bChanged )
		LOG->Trace( "Change in USB storage devices detected." );
	return bChanged;
}
开发者ID:AratnitY,项目名称:stepmania,代码行数:26,代码来源:MemoryCardDriverThreaded_Linux.cpp


示例9: GetFileList

 size_t GetFileList( const char *_path, std::vector<std::string> &list, bool recur )
 {
     size_t s = list.size();
     char path[MAX_PATH], n[128];
     strcpy( path, _path );
     int pos = SplitFileName( path );
     path[pos] = '\0';
     strcpy( n, &path[pos+1] );
     WIN32_FIND_DATA fdata;
     HANDLE h = FindFirstFile( _path, &fdata );
     if( h == INVALID_HANDLE_VALUE ) return list.size() - s;
     do
     {
         char p[MAX_PATH];
         sprintf( p, "%s\\%s", path, fdata.cFileName );
         list.push_back( p );
         if( recur && 
             fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
             strcmp( "..", fdata.cFileName ) &&
             strcmp( ".", fdata.cFileName ) )
         {
             char p[MAX_PATH];
             sprintf( p, "%s\\%s\\%s", path, fdata.cFileName, n );
             GetFileList( p, list, recur );
         }
     } while( FindNextFile( h, &fdata ) );
     FindClose( h );
     return list.size() - s;
 }
开发者ID:Caoxuyang,项目名称:klcommon,代码行数:29,代码来源:win32funcs.cpp


示例10: GetGameState

GUnitViewer* GUnitViewer::CreateUnitViewer(GnList<GUserHaveItem::Item>& cUnitItems)
{
	GetGameState()->SetGameScale( 0.7f );
	
	GUnitViewer* thisObject = GnNew GUnitViewer();	
	
	GnListIterator<GUserHaveItem::Item> iter = cUnitItems.GetIterator();
	gtint itemCount = 0;
	while( iter.Valid() )
	{
		guint32 unitIndex = iter.Item().mIndex;
		gchar idName[16] = { 0, };
		GetFileList()->GetForcesFileName( (gtuint)unitIndex, idName, sizeof( idName ) );
		GForcesController* controller = GForcesController::Create( idName, 1 );
		if( controller )
		{
			GnVector2 pos( 340.0f, 150.0f );
			if( itemCount == 0 )			
				pos.x -= 10.0f;
				
			controller->SetPosition( pos );
			controller->GetMesh()->SetVisible( false );
			thisObject->AddMeshToParentNode( controller->GetMesh() );
			controller->GetActor()->SetTargetAnimation( GAction::ANI_ATTACK );
			thisObject->AddActorCtlr( unitIndex, controller );
		}
		iter.Forth();
		++itemCount;
	}
	
	GetGameState()->SetGameScale( 1.0f );
	return thisObject;
}
开发者ID:daoopp,项目名称:WebGame,代码行数:33,代码来源:GUnitViewer.cpp


示例11: if

void
JVMGetSourceFileList::ScanDirectory
	(
	const JCharacter* path
	)
{
	JDirInfo* info;
	if (!JDirInfo::Create(path, &info))
		{
		return;
		}

	JXFileListTable* table = (GetFileList())->GetTable();

	const JSize count = info->GetEntryCount();
	for (JIndex i=1; i<=count; i++)
		{
		const JDirEntry& e = info->GetEntry(i);
		if (e.GetType() == JDirEntry::kFile)
			{
			const CBTextFileType fileType =
				(CMGetPrefsManager())->GetFileType(e.GetName());
			if (fileType == kCBJavaSourceFT)
				{
				table->AddFile(e.GetFullName());
				}
			}
		else if (e.GetType() == JDirEntry::kDir)
			{
			ScanDirectory(e.GetFullName());
			}
		}

	delete info;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:35,代码来源:JVMGetSourceFileList.cpp


示例12: gui_parse_text

int GUIFileSelector::NotifyVarChange(std::string varName, std::string value)
{
	if (varName.empty())
	{
		// Always clear the data variable so we know to use it
		DataManager::SetValue(mVariable, "");
	}
	if (!mHeaderIsStatic) {
		std::string newValue = gui_parse_text(mHeaderText);
		if (mLastValue != newValue) {
			mLastValue = newValue;
			mStart = 0;
			scrollingY = 0;
			scrollingSpeed = 0;
			mUpdate = 1;
		}
	}
	if (varName == mPathVar || varName == mSortVariable)
	{
		DataManager::GetValue(mPathVar, value);  // sometimes the value will be the sort order instead of the path, so we read the path everytime
		DataManager::GetValue(mSortVariable, mSortOrder);
		mStart = 0;
		scrollingY = 0;
		scrollingSpeed = 0;
		GetFileList(value);
		mUpdate = 1;
		return 0;
	}
	return 0;
}
开发者ID:1998-yhf,项目名称:Team-Win-Recovery-Project,代码行数:30,代码来源:fileselector.cpp


示例13: wcscpy

bool CSVFile::GetPathFromSettings(const TCHAR *lr2Path, TCHAR *out) {
	// first of all, get setting and replace path
	std::wstring keyval;
	bool foundSetting = false;
	if (CSVSettings::GetPathValue(lr2Path, keyval)) {
		std::wstring wpath = lr2Path;
		int p = wpath.find(L'*');
		if (p != std::wstring::npos) {
			wpath.replace(p, 1, keyval);
			if (boost::filesystem::exists(wpath)) {
				wcscpy(out, wpath.c_str());
				foundSetting = true;
			}
		}
	}

	if (foundSetting)
		return true;

	// when no setting found, then get default value
	std::vector<std::wstring> files;
	GetFileList(lr2Path, files);

	if (files.size() == 0) {
		return false;
	} else if (files.size() == 1) {
		wcscpy(out, files[0].c_str());
		return true;
	} else {
		// index 0 is default
		wcscpy(out, files[0].c_str());
		return true;
	}
}
开发者ID:kuna,项目名称:LR2csv,代码行数:34,代码来源:CSVFile.cpp


示例14: strcpy

//-----------------------------------------------------------------------------
// Purpose: Generate a list of file matching mask
//-----------------------------------------------------------------------------
int CScriptLib::FindFiles( char* pFileMask, bool bRecurse, CUtlVector<fileList_t> &fileList )
{
	char	dirPath[MAX_PATH];
	char	pattern[MAX_PATH];
	char	extension[MAX_PATH];

	// get path only
	strcpy( dirPath, pFileMask );
	V_StripFilename( dirPath );

	// get pattern only
	V_FileBase( pFileMask, pattern, sizeof( pattern ) );
	V_ExtractFileExtension( pFileMask, extension, sizeof( extension ) );
	if ( extension[0] )
	{
		strcat( pattern, "." );
		strcat( pattern, extension );
	}

	if ( !bRecurse )
	{
		GetFileList( dirPath, pattern, fileList );
	}
	else
	{
		// recurse and get the tree
		CUtlVector< fileList_t > tempList;
		CUtlVector< CUtlString > dirList;
		RecurseFileTree_r( dirPath, 0, dirList );
		for ( int i=0; i<dirList.Count(); i++ )
		{
			// iterate each directory found
			tempList.Purge();
			tempList.EnsureCapacity( dirList.Count() );

			GetFileList( dirList[i].String(), pattern, tempList );

			int start = fileList.AddMultipleToTail( tempList.Count() );
			for ( int j=0; j<tempList.Count(); j++ )
			{
				fileList[start+j] = tempList[j];
			}
		}	
	}

	return fileList.Count();
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:50,代码来源:scriplib.cpp


示例15: main

int main( int argc, char ** argv )
{
    int nLibIndex = ParseArgs( argc, argv );
    if( nLibIndex == 0 )
        return -1;

    if( g_fDiag )
        Diags( argc, argv );

    Logger logger;
    GetLinuxPwd();
    for( ; nLibIndex < argc; nLibIndex++ )
    {
        StringList files = GetFileList( argv[nLibIndex] );
        for( StringList::const_iterator it=files.begin(); it!=files.end(); ++it )
        {
            std::string library = *it;

            std::cout << "Loading Library: " << library << std::endl;
            DllHandle hModule = LOAD_LIBRARY( library.c_str() );
            DLERROR_CHECK;

            if( !hModule )
            {
                std::cout<<"ERROR: Failed to load "<< *it << std::endl; 
                std::cout.flush(); 
                continue;
            }

            RunAllFn pRunAll = (RunAllFn)GET_PROC_ADDRESS( hModule, "RunAll" );
            if( pRunAll == NULL )
            {
                std::cerr << std::endl << "Function RunAll() not found in library " << library << "!" << std::endl;
                FREE_LIBRARY( hModule );
                continue;
            }
            pRunAll( &logger, g_configFileName.c_str() );
            
            FREE_LIBRARY( hModule );
        } // next library
    } // next arg

    if( g_fCSV )
    {
        try 
        {
            std::ofstream log(g_logPath.c_str());
            GenerateReportCSV( logger, log, g_fNoHeader );
        }
        catch(...)
        {
            std::cerr << "Error writing log file " << g_logPath << "!" << std::endl;
        }
    }
    
    std::cout << std::endl;
}
开发者ID:hksonngan,项目名称:framewave,代码行数:57,代码来源:UnitTestApp.cpp


示例16: GetClwFile

//开始分析   
bool AnalyseClassCallRelation::Analyse()
{
	//是否获取读取clw文件 
	//不从clw文件获取类与资源的关系
	/*
	if ( m_vRelationData.empty() )
	{
		GetClwFile(); 
	}
	*/
	//获取文件列表 
	vector<ClassSource> vFileList; 
	if (! GetFileList(vFileList))
	{
		return false; 
	}
	//先分配7K的内存用来存放文件
	GetMemory(40*1024);
	//对文件列表里文件做处理
	vector<string> vClass;
	vector<ClassSource>::iterator iter = vFileList.begin(); 
	FILE *fp; 
	fp = fopen("Test.data", "w"); 
	while (iter != vFileList.end() )
	{
		//获取头文件信息, 得出该文件需要分析的类 
		vClass.clear();
		string strFileName = iter->strName + ".h"; 

		DWORD dwFileStartTime = GetTickCount();  
		if (! GetClassFromHeader(strFileName, vClass) )
		{
			++ iter ;
			continue; 
		}
		//判断是否为clw中的类
		vector<string>::iterator strIter = vClass.begin(); 
		while (strIter != vClass.end() )
		{

//			if (IsClwClass(*strIter))
			{
				//是clw中的类,分析, 传入类实现文件 头文件和实现文件只有后缀区别
				Analyse(iter->strName, *strIter); 
			}
			++ strIter; 
		}
		
		++ iter ;
		DWORD dwFileEndTime = GetTickCount(); 
		fprintf(fp, "%s %d\n", strFileName.c_str(), dwFileEndTime-dwFileStartTime); 

	}
	fclose(fp); 
	return true; 
}
开发者ID:anzizhao,项目名称:MFCSofewareQuery,代码行数:57,代码来源:CreateClassData.cpp


示例17: GetFileList

void CLogDelOperate::DeleteBackupLogFile(const string & strLogPath, unsigned int keep_days)
{
	vector<string>  vFileInfoList;
	int count = 0;
	GetFileList(strLogPath, string(".log"), keep_days, vFileInfoList, 100, count);

	for(size_t i = 0; i < vFileInfoList.size(); i++)
	{
		::remove(vFileInfoList[i].c_str());
	}
}
开发者ID:allenhfchen,项目名称:glog,代码行数:11,代码来源:LogDelOperate.cpp


示例18: GetFileList

void CRapiFileDialog::OnFileListColClick( wxListEvent &event )
{
    if(event.GetColumn()==m_nSortColumn)
	{
		m_bSortDirection=!m_bSortDirection;
	}
	else
	{
		m_nSortColumn=event.GetColumn();
	}
    GetFileList()->SortItems(ListCompareFunction,(long)this);
}
开发者ID:crioux,项目名称:SpeedDemon-Profiler,代码行数:12,代码来源:RapiFileDialog.cpp


示例19: GetFileList

//---------------------------------------------------------------------------
bool __fastcall TRelDirSearchForm::GetFileList(AnsiString folder)
{
	try
	{
		GetFileList(folder, folder.Length());
	}
	catch(...)
	{
		return false;
	}
	return true;
}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:13,代码来源:RelDirSearchUnit.cpp


示例20: SendFileListToServer

/**************************************************************
 * * Entry:
 * *  sockfd - the socket to send the file list to.
 * *
 * * Exit:
 * *  n/a
 * *
 * * Purpose:
 * * 	Sends the server's directory list to the client
 * *
 * ***************************************************************/
void SendFileListToServer(int sockfd)
{
	char fileList[FILELISTLENGTH];
	bzero(fileList, FILELISTLENGTH);
	GetFileList(fileList);
	
	int sendSize = FILELISTLENGTH;
	if (send(sockfd, fileList, sendSize, 0) < 0)
	{
		printf("Error: Failed to send directory list.\n");
	}
}
开发者ID:kevinto,项目名称:cs372Project2,代码行数:23,代码来源:ftserver.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetFileNumber函数代码示例发布时间:2022-05-30
下一篇:
C++ GetFileLength函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap