这篇教程C++ IsFile函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中IsFile函数的典型用法代码示例。如果您正苦于以下问题:C++ IsFile函数的具体用法?C++ IsFile怎么用?C++ IsFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了IsFile函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wsprintf//---------------------------------------------------------------------------void __fastcall TCodeView::SBEditClick(TObject *Sender){ LPCSTR pName = "EUDCEDIT.EXE"; if( sys.m_Eudc.IsEmpty() ){ char dir[MAX_PATH]; char bf[512]; if( ::GetSystemDirectory(dir, sizeof(dir)) ){ wsprintf(bf, "%s//%s", dir, pName); if( IsFile(bf) ) sys.m_Eudc = bf; } if( sys.m_Eudc.IsEmpty() && ::GetWindowsDirectory(dir, sizeof(dir)) ){ wsprintf(bf, "%s//%s", dir, pName); if( IsFile(bf) ) sys.m_Eudc = bf; } if( sys.m_Eudc.IsEmpty() ){ wsprintf(bf, "%c://Program Files//Accessories//%s", dir[0], pName); if( IsFile(bf) ) sys.m_Eudc = bf; } if( sys.m_Eudc.IsEmpty() ) sys.m_Eudc = pName; } if( ::WinExec(sys.m_Eudc.c_str(), SW_SHOWDEFAULT) > 31 ){ ReqClose(); } else { SBEdit->Enabled = FALSE; sys.m_fEudc = FALSE; }}
开发者ID:mygaldre,项目名称:mmsstv,代码行数:29,
示例2: RmDirvoid RmDir(const char *path){ if(IsFile(path) || IsLnk(path)) { remove(path); return; } char filePath[PATH_MAX]; if(IsDir(path)) { DIR *dir; struct dirent *ptr; dir = opendir(path); while(ptr = readdir(dir)) { if(IsSpecial(ptr->d_name)) continue; GetFilePath(path,ptr->d_name,filePath); if(IsDir(filePath)) { RmDir(filePath); rmdir(filePath); } else if(IsFile(filePath) || IsLnk(filePath)) { remove(filePath); } } closedir(dir); }}
开发者ID:xinll,项目名称:virtualhost,代码行数:31,
示例3: Checkbool CExportImageDialog::Check(){ if ( Save2D() && IsFile( mOutputFileName2D ) ) { if ( !SimpleQuestion( "Do you want to overwrite existing file " + mOutputFileName2D + " ?" ) ) return false; } if ( Save3D() && IsFile( mOutputFileName3D ) ) { if ( !SimpleQuestion( "Do you want to overwrite existing file " + mOutputFileName3D + " ?" ) ) return false; } if ( ( Save2D() && mOutputFileName2D.empty() ) || ( Save3D() && mOutputFileName3D.empty() ) ) { SimpleErrorBox( "The output path of the file(s) to save must be specified." ); return false; } if ( mOutputFileName2D == mOutputFileName3D ) { SimpleErrorBox( "Cannot save both images to the same file" ); return false; } return true;}
开发者ID:BRAT-DEV,项目名称:main,代码行数:26,
示例4: InstallMainvoid InstallMain(char *name){ char sysdir[MAX_PATH]; char windir[MAX_PATH]; char infdir[MAX_PATH]; char otherdir[MAX_PATH]; char infname[MAX_PATH]; char deviceid[MAX_PATH]; char sysname[MAX_PATH]; if (name == NULL) { return; } if (strlen(name) == 0 || strlen(name) >= 5) { return; } GetSystemDirectory(sysdir, sizeof(sysdir)); GetDirFromPath(windir, sysdir); sprintf(infdir, "%s//inf", windir); sprintf(otherdir, "%s//other", infdir); sprintf(infname, "%s//Neo_%s.inf", infdir, name); sprintf(sysname, "%s//Neo_%s.sys", sysdir, name); sprintf(deviceid, "NeoAdapter_%s", name); if (IsFile(infname) == FALSE) { Print("Failed to open %s.", infname); return; } if (IsFile(sysname) == FALSE) { Print("Failed to open %s.", sysname); return; } if (DiInstallClass(infname, 0) != OK) { Print("Failed to register %s./n", infname); return; } if (InstallNDIDevice("Net", deviceid, NULL, NULL) != OK) { return; }}
开发者ID:benapetr,项目名称:SoftEtherVPN,代码行数:54,
示例5: testIsFileNormal_SymLink/** * /brief for function IsFile * a file */void testIsFileNormal_SymLink(){ system("echo 'hello world' > ./test.file"); char Fname[] = "./test.file"; int isFile = IsFile(Fname, 0); CU_ASSERT_EQUAL(isFile, 1); char NewFname[] = "./link.file"; symlink(Fname, NewFname); isFile = IsFile(NewFname, 1); CU_ASSERT_EQUAL(isFile, 1);#if 0#endif RemoveDir(Fname); RemoveDir(NewFname);}
开发者ID:7hibault,项目名称:fossology,代码行数:19,
示例6: sizeof bool Inode::GetSize(off_t & size) { size = 0; if ( ! IsFile() ) { if ( 0 == ::stat( Path().string().c_str(), &stat_ ) ) { size = stat_.st_size; return true; } else { size = 0; return false; } } int valuesize; bool ret = xattr_.GetValue( ATTRIBUTE_SIZE, &size, sizeof(size), valuesize ); if ( ret ) { return true; } if ( 0 == ::stat( Path().string().c_str(), &stat_ ) ) { size = stat_.st_size; } else { size = 0; } return false; }
开发者ID:BDT-GER,项目名称:SWIFT-TLC,代码行数:29,
示例7: GetSoundShaderconst SoundShaderT* SoundShaderManagerImplT::GetSoundShader(const std::string& Name){ // Ignore empty names and just return NULL. if (Name.empty()) return NULL; // Note that I'm *not* just writing return SoundShaders[Name] here, because that // would implicitly create a NULL entry for every Name that does not actually exist. std::map<std::string, SoundShaderT*>::const_iterator It=m_SoundShaders.find(Name); if (It!=m_SoundShaders.end()) return It->second; // Sound shader not found, try to interpret the name as a filename or a "capture n" string. if (IsFile(Name) || IsCapture(Name)) { SoundShaderT* AutoShader=new SoundShaderT(Name); AutoShader->AudioFile=Name; // Add auto created shader to list of shaders. m_SoundShaders[Name]=AutoShader; return AutoShader; } std::cout << "Error auto creating sound shader: File '" << Name << "' not doesn't exist./n"; return NULL;}
开发者ID:mark711,项目名称:Cafu,代码行数:26,
示例8: VLOGbool MaprFileSystem::Remove(const std::string& uri){ if (!Exists(uri)){ VLOG(2) << "Can't remove file, it doesn't exist: " << uri; return false; } std::string path = GetUriPathOrDie(uri); std::string host = "default"; hdfsFS fs = hdfsConnect(host.c_str(), 0); // use default config file settings CHECK(fs); if (IsFile(uri)){ //LOG(INFO) << "removing file: " << uri; int retval = hdfsDelete(fs, path.c_str()); CHECK_EQ(retval, 0); } else if (IsDirectory(uri)){ //LOG(INFO) << "removing dir: " << uri; std::vector<std::string> dir_file_uris; CHECK(ListDirectory(uri, &dir_file_uris)); BOOST_FOREACH(std::string file_uri, dir_file_uris){ CHECK(Remove(file_uri)); } int retval = hdfsDelete(fs, path.c_str()); CHECK_EQ(retval, 0); }
开发者ID:Minione,项目名称:iwct,代码行数:25,
示例9: Close/********************************************************************* CSVClose********************************************************************/int CSVload::Close(){ if( !IsFile() ){return 0;} if( fclose(m_filePointer) == -1){return -1;} m_filePointer = NULL; return 1;}
开发者ID:GothHarvester,项目名称:ElevatorApplication,代码行数:12,
示例10: SendMessagebool FtpConnHandler::On_RETR(){ if (*last_cmd_arg_ == '/0') return SendMessage(550, "No file specified."); std::string path; if (*last_cmd_arg_ == '/') path = last_cmd_arg_; else path = working_dir_ + "/" + last_cmd_arg_; if (!NormalizePath(path)) return SendMessage(550, "File unavailable."); if (!IsFile("." + path)) return SendMessage(550, "Not a file."); if (!OpenDataConnection()) return SendMessage(425, "Can't open data connection."); if (!SendMessage(150, "Here comes the file content.")) return false; bool succeed = SendFile("." + path, bin_mode_, sock_data_); CloseDataConnection(); if (!succeed) return SendMessage(451, "Requested action aborted: local error in processing."); return SendMessage(226, "File send OK.");}
开发者ID:kaifengz,项目名称:fasmio,代码行数:29,
示例11: checkArgs/*Function to check the validity of theusers arguments */ void checkArgs (int argc, char **argv){ //check the number of arguments. Argc must be 3 in this case if (argc != 3){ printf("Query engine only takes 3 arguments/n"); exit(1); } //check if the file given for the data is valid char *argv1 = argv[1]; if (IsFile(argv1)){ printf("%s is a file which exists/n", argv1); } else{ printf("%s does not exist. Please enter a path to a data file which exists/n", argv1); exit(1); } //Check if the second argument is a valid directory char* argv2 = argv[2]; if(IsDir(argv2)){ printf("%s is a valid directory/n", argv2); } else{ printf("%s is not a valid directory/n", argv2); exit(1); } printf("Valid Arguments. Starting indexer/n");}
开发者ID:ArminMahban,项目名称:C_code_samples,代码行数:33,
示例12: GetCurFileName//---------------------------------------------------------------------------void __fastcall TFileViewDlg::KPOLClick(TObject *Sender){ if( (m_CurFile < 0) || (pCurPage->pList == NULL) ) return; Mmsstv->AdjustPage(pgTemp); AnsiString as; GetCurFileName(as); if( IsFile(as.c_str()) ){ CDrawOle *pDraw = (CDrawOle *)Mmsstv->DrawMain.MakeItem(CM_OLE); LPCSTR pExt = GetEXT(as.c_str()); if( !strcmpi(pExt, "BMP")){ pDraw->LoadFromFile(-1, 0, as.c_str()); } else { Graphics::TBitmap *pBmp = MakeCurrentBitmap(); pDraw->LoadFromBitmap(-1, 0, pBmp); if( !strcmpi(pExt, "JPG") ){ pDraw->m_Trans = 0; pDraw->m_Stretch = 1; } delete pBmp; } Mmsstv->AddItem(pDraw, 0); }}
开发者ID:mygaldre,项目名称:mmsstv,代码行数:26,
示例13: FileInfo * VFSHandle_ZIP::Read(void){ if(IsFile(m_file) == true){ char *buffer = (char *)Read(m_length); char *filename = m_lfh[m_fileid]->filename; char *tempdir = fusion->vfs->GetTempDirectory(); if(tempdir == NULL){ fusion->vfs->SetTempDirectory("vfstemp"); tempdir = fusion->vfs->GetTempDirectory(); } char fn[256]; sprintf(fn,"%s/%s",tempdir,filename); m_handle = fusion->vfs->Open(fn,"binary",true); if(m_handle != NULL){ m_handle->Write(buffer,m_length); fusion->vfs->Close(m_handle); } m_handle = fusion->vfs->Open(fn); m_length = m_handle->Length(); delete[] buffer; return m_handle->Read(); } return NULL;}
开发者ID:christhomas,项目名称:fusionengine,代码行数:35,
示例14: CloseBitmap//---------------------------------------------------------------------------int __fastcall CThumb::UpdateBitmap(int n){ if( pBitmap == NULL ) return FALSE; CloseBitmap(); n /= THUMBWIND; if( n == m_Top ) return TRUE; m_Top = n; char name[256]; sprintf(name, "%sFindex//B%02u%u.bmp", BgnDir, m_FolderIndex, n); MultProc(); int r = FALSE; m_UpdateBmp = 1; if( IsFile(name) ){ ::LoadBitmap(pBitmap, name); MultProc(); if( (pBitmap->Width != m_XW) || (pBitmap->Height != m_SizeY) ){ pBitmap->Width = m_XW; pBitmap->Height = m_SizeY; } else { m_UpdateBmp = 0; r = TRUE; } } if( r == FALSE ){ n *= THUMBWIND; for( int i = n; i < (n + THUMBWIND); i++ ){ if( i < m_FileCount ) pITBL[i+1].crc = 0; } } MultProc(); return r;}
开发者ID:mygaldre,项目名称:mmsstv,代码行数:35,
示例15: IsDemiliter/********************************************************************* IsDemiliter********************************************************************/bool CSVload::IsDemiliter(){ if( !IsFile() ){return false;} if(m_lastChar == ','){ return true; } if(m_lastChar == '/n'){ return true; } return false;}
开发者ID:GothHarvester,项目名称:ElevatorApplication,代码行数:12,
示例16: CopyFileTobool CopyFileTo(const tstring& sFrom, const tstring& sTo, bool bOverride){ if (IsFile(sTo) && bOverride) ::DeleteFile(convert_to_wstring(sTo).c_str()); return !!CopyFile(convert_to_wstring(sFrom).c_str(), convert_to_wstring(sTo).c_str(), true);}
开发者ID:BSVino,项目名称:CodenameInfinite,代码行数:7,
示例17: ListFilesInDirRecursivevoid ListFilesInDirRecursive(const std::string &Dir, long *Epoch, Vector<std::string> *V, bool TopDir) { auto E = GetEpoch(Dir); if (Epoch) if (E && *Epoch >= E) return; DIR *D = opendir(Dir.c_str()); if (!D) { Printf("No such directory: %s; exiting/n", Dir.c_str()); exit(1); } while (auto E = readdir(D)) { std::string Path = DirPlusFile(Dir, E->d_name); if (E->d_type == DT_REG || E->d_type == DT_LNK || (E->d_type == DT_UNKNOWN && IsFile(Path))) V->push_back(Path); else if ((E->d_type == DT_DIR || (E->d_type == DT_UNKNOWN && IsDirectory(Path))) && *E->d_name != '.') ListFilesInDirRecursive(Path, Epoch, V, false); } closedir(D); if (Epoch && TopDir) *Epoch = E;}
开发者ID:sabel83,项目名称:metashell,代码行数:25,
示例18: SetTimidityEnvPathvoid SetTimidityEnvPath(const Settings & conf){ const std::string prefix_timidity = std::string("files") + SEPARATOR + std::string("timidity"); const std::string result = Settings::GetLastFile(prefix_timidity, "timidity.cfg"); if(IsFile(result)) setenv("TIMIDITY_PATH", GetDirname(result).c_str(), 1);}
开发者ID:asimonov-im,项目名称:fheroes2,代码行数:8,
示例19: SetFilenamebool VFSHandle_file::OpenLocation(std::string loc, bool create ){ SetFilename( loc ); if ( IsDirectory( m_filename ) == false && IsFile( m_filename ) == false && create == true ) CreateDir( m_filename ); return IsDirectory( m_filename );}
开发者ID:christhomas,项目名称:fusionengine,代码行数:8,
示例20: testIsFileNormal_RegulerFile/** * /brief for function IsFile * a file */void testIsFileNormal_RegulerFile(){ system("echo 'hello world' > ./test.file"); char Fname[] = "./test.file"; int isFile = IsFile(Fname, 1); CU_ASSERT_EQUAL(isFile, 1); RemoveDir(Fname);}
开发者ID:7hibault,项目名称:fossology,代码行数:12,
示例21: OnContextMenu/*------------------------------------------------ when the clock is right-clicked show pop-up menu--------------------------------------------------*/void OnContextMenu(HWND hwnd, HWND hwndClicked, int xPos, int yPos){ WIN32_FIND_DATA fd; HANDLE hfind; TPMPARAMS tpmp; LPTPMPARAMS lptpmp = NULL; SendOnContextMenu(); if(m_tcmenutxt[0] == 0 || !IsFile(m_tcmenutxt)) { // common/tclang.c FindFileWithLangCode(m_tcmenutxt, GetUserDefaultLangID(), TCMENUTXT); } hfind = FindFirstFile(m_tcmenutxt, &fd); if(hfind != INVALID_HANDLE_VALUE) { FindClose(hfind); if(m_lasttime != fd.ftLastWriteTime.dwLowDateTime) { EndContextMenu(); m_lasttime = fd.ftLastWriteTime.dwLowDateTime; } } else m_lasttime = 0; // create popup menu and append items from tcmenu.txt if(!m_hMenu) { m_hMenu = CreatePopupMenu(); if(hfind != INVALID_HANDLE_VALUE) LoadMenuFromText(m_hMenu, m_tcmenutxt, &fd); else LoadMenuFromText(m_hMenu, NULL, NULL); } CheckMenu(m_hMenu); // get keyboard input SetFocusTClockMain(hwnd); // APP key if((xPos == -1) && (yPos == -1)) { tpmp.cbSize = sizeof(tpmp); lptpmp = &tpmp; GetWindowRect(g_hwndClock, &tpmp.rcExclude); xPos = tpmp.rcExclude.right; yPos = tpmp.rcExclude.top; } // open popup menu TrackPopupMenuEx(m_hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, xPos, yPos, hwnd, lptpmp); PostMessage(hwnd, WM_NULL, 0, 0);}
开发者ID:k-takata,项目名称:TClockLight,代码行数:62,
示例22: ReadConfigsvoid ReadConfigs(void){ Settings & conf = Settings::Get(); ListFiles files = conf.GetListFiles("", "fheroes2.cfg"); for(ListFiles::const_iterator it = files.begin(); it != files.end(); ++it) if(IsFile(*it)) conf.Read(*it);}
开发者ID:asimonov-im,项目名称:fheroes2,代码行数:9,
示例23: CharGet/********************************************************************* CharGet********************************************************************/char CSVload::CharGet(){ if( !IsFile() ){ return EOF; } char result = m_lastChar; if(!IsEof()){ m_lastChar = fgetc(m_filePointer); } return result;}
开发者ID:GothHarvester,项目名称:ElevatorApplication,代码行数:14,
示例24: CtrlFiles//v4 Returns list of files in error (not found) for client code to display//bool CDataset::CtrlFiles( std::vector< std::string > &v ){ for ( CProductList::iterator it = m_files.begin(); it != m_files.end(); it++ ) { if ( !IsFile( it->c_str() ) ) v.push_back(*it); } return v.empty();}
开发者ID:BRAT-DEV,项目名称:main,代码行数:11,
示例25: bool Inode::GetTape(string & tape) { if ( ! IsFile() ) { return false; } return xattr_.GetStringValue(ATTRIBUTE_TAPE, tape); }
开发者ID:BDT-GER,项目名称:SWIFT-TLC,代码行数:9,
示例26: IsEscapeSequence/********************************************************************* IsEscapeSequence********************************************************************/bool CSVload::IsEscapeSequence(){ if( !IsFile() ){return false;} if( m_lastChar == '/r' ){ return true; } if( m_lastChar == '/t' ){ return true; } if( m_lastChar == ' ' ){ return true; } return false;}
开发者ID:GothHarvester,项目名称:ElevatorApplication,代码行数:14,
示例27: M_PROFILE_SCOPEvoid MEmbedFile::open(const char* path, const char* mode){ M_PROFILE_SCOPE(MEmbedFile::open); if(IsFile(path)) { m_Open = true; m_Ptr = m_File; }}
开发者ID:galek,项目名称:MIngEd,代码行数:9,
示例28: void PhSrvDebugInfo::CPhSrvDebugData::WriteFile(const TDesC8& aDes) { if ( IsFile() ) { TInt place =0 ; iFile->Seek( ESeekEnd,place ); iFile->Write( place, aDes ); iFile->Flush(); } }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:10,
注:本文中的IsFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ IsFileSep函数代码示例 C++ IsFeatureLevelSupported函数代码示例 |