这篇教程C++ GetFileList函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetFileList函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFileList函数的具体用法?C++ GetFileList怎么用?C++ GetFileList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetFileList函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UpdateGroupItemsstatic 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,
示例2: GetFileListvoid 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,
示例3: ensure_path_mountedvoid 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,
示例4: GetFileListRecursivevoid 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,
示例5: lockerbool 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,
示例6: delete_fnvoid 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,
示例7: nb_findfirstint 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,
示例8: GetFileListbool 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,
示例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,
示例10: GetGameStateGUnitViewer* 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,
示例11: ifvoidJVMGetSourceFileList::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,
示例12: gui_parse_textint 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,
示例13: wcscpybool 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,
示例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,
示例15: mainint 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,
示例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,
示例17: GetFileListvoid 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,
示例18: GetFileListvoid 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,
示例19: GetFileList//---------------------------------------------------------------------------bool __fastcall TRelDirSearchForm::GetFileList(AnsiString folder){ try { GetFileList(folder, folder.Length()); } catch(...) { return false; } return true;}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:13,
示例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,
示例21: while//---------------------------------------------------------------------------void __fastcall TRelDirSearchForm::GetFileList(AnsiString path, int baselen){ TSearchRec r; int done; done=FindFirst(path + "*.*" ,faAnyFile, r); try { while(!done) { if(r.FindData.cFileName[0]!='.') { if(! (r.Attr & faDirectory)) { // a file AnsiString name = AnsiString(path.c_str()+ baselen) + r.FindData.cFileName; FileList->Add(name); CurrentLabel->Caption = name; AnsiString fileext = ExtractFileExt(r.FindData.cFileName); ExtList->Add(fileext); // message processing Application->ProcessMessages(); if(Aborted) { throw EAbort("Aborted"); // raise an aborting exception } } else { // a directory if(r.Name != "." && r.Name != ".." && !(r.Name == "CVS" && FileExists(path + AnsiString("CVS//Repository")))) // ignoring CVS meta-data directory { GetFileList(path + r.FindData.cFileName+ AnsiString("//"), baselen); } } } done=FindNext(r); } } catch(Exception &e) { FindClose(r); throw Exception(e); } FindClose(r);}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:53,
示例22: OnFileListItemSelectedvoid CRapiFileDialog::OnFileListItemSelected( wxListEvent &event ){ long data=GetFileList()->GetItemData(event.GetIndex()); if(data<0 || data>=(long)m_currentpaths.size()) { return; } if(m_currentpaths[data].Last()!=wxT('//')) { SetPathName(m_currentpaths[data]); }}
开发者ID:crioux,项目名称:SpeedDemon-Profiler,代码行数:13,
示例23: CreateAttackMeshbool GFarAttack::CreateAttackMesh(gtuint uiIndex){ gstring fullName; if( GetFileList()->GetFullEffectName( uiIndex, fullName ) == false ) return false; mpsAttackMesh = Gn2DMeshObject::CreateFullPath( fullName.c_str(), true ); mOriginalAttackRect.left = 0.0f; mOriginalAttackRect.top = 0.0f; mOriginalAttackRect.right = mpsAttackMesh->GetSize().x; mOriginalAttackRect.bottom = mpsAttackMesh->GetSize().y; SetPosition( GnVector2(0.0f, 0.0f) ); return true;}
开发者ID:daoopp,项目名称:WebGame,代码行数:14,
示例24: forEachFile void forEachFile(const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth) { GSList* list = GetFileList(basedir, extension, depth); for(GSList* i = list; i != 0; i = g_slist_next(i)) { const char* name = reinterpret_cast<const char*>((*i).data); if(extension_equal(path_get_extension(name), extension)) { callback(name); } } ClearFileDirList(&list); }
开发者ID:clbr,项目名称:netradiant,代码行数:15,
示例25: printfvoid CLogDelOperate::GetFileList(const string& strFullPath, const string& strFileType, unsigned int keep_Time, vector<string> & vFileInfoList, int nMaxFileNum, int & nCurrentCount){ string strCondition = strFullPath + "//*.log"; struct _finddata_t file_data; intptr_t hFile; hFile = ::_findfirst(strCondition.c_str(), &file_data); if(-1L != hFile ) { do{ printf("GetFileList(%s), file :%s, attrib=%d.current count=%d/n", strFullPath.c_str(), file_data.name, file_data.attrib, nCurrentCount); if(_A_SUBDIR != file_data.attrib) //如果不是目录文件,就将该文件的相关信息放入lstFilesList中 { if(strstr(file_data.name, strFileType.c_str()) == NULL) continue; string strFileName = strFullPath + "/" + file_data.name; time_t writeTime = file_data.time_write; time_t keepTime; keepTime = time(NULL) - keep_Time*24*60*60; //按天数保存,保存日志期限,换算成秒 if(writeTime < keepTime) { //超过保留时间,需要删除 //logger.info("[file delete] need remove file(%s),current count=%d/n", strFileName.c_str(), nCurrentCount); vFileInfoList.push_back(strFileName); if(++nCurrentCount >= nMaxFileNum) { ::_findclose(hFile); nCurrentCount = 0; //返回前计数器要清空! return; } } } else //如果是目录文件,就递归调用GetFileList函数,读取目录中的文件 { if(file_data.name[0] == '.') continue; //每个目录下面都有两个默认目录就是..和.分别表示上一级目录和当前目录 string strSubPath = strFullPath + "/" + file_data.name; GetFileList(strSubPath, strFileType, keep_Time, vFileInfoList, nMaxFileNum, nCurrentCount); } } while(0 == _findnext(hFile, &file_data)); ::_findclose(hFile); nCurrentCount = 0;//返回前计数器要清空! }}
开发者ID:allenhfchen,项目名称:glog,代码行数:48,
示例26: OnFileListItemActivatedvoid CRapiFileDialog::OnFileListItemActivated( wxListEvent &event ){ long data=GetFileList()->GetItemData(event.GetIndex()); if(data<0 || data>=(long)m_currentpaths.size()) { return; } bool bDone=m_currentpaths[data].Last()!=wxT('//'); SetPathName(m_currentpaths[data]); if(bDone) { EndModal(wxID_OK); }}
开发者ID:crioux,项目名称:SpeedDemon-Profiler,代码行数:16,
示例27: DebugMsgvoid FileBrowser::DebugOut(){ DebugMsg("FileBrowser","Listing %s",GetCurrentPath().c_str()); vector<string> folders = GetFolderList(); DebugMsg("FileBrowser","Folders : "); for(unsigned int x=0;x<folders.size();x++) { DebugMsg("FileBrowser","%s",folders.at(x).c_str()); } vector<string> files = GetFileList(); DebugMsg("FileBrowser","Files : "); for(unsigned int x=0;x<files.size();x++) { DebugMsg("FileBrowser","%s",files.at(x).c_str()); }}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:16,
注:本文中的GetFileList函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetFileNumber函数代码示例 C++ GetFileLength函数代码示例 |