您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DirectoryExists函数代码示例

51自学网 2021-06-01 20:28:05
  C++
这篇教程C++ DirectoryExists函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ExpandFileName

//---------------------------------------------------------------------------void __fastcall TChatRoomForm::ProxyButtonClick(TObject *Sender){  TDSJavaScriptProxyWriter *JSProxy;  String OutputFile;  OutputFile = ExpandFileName(ServerContainerForm->ChatRoomFileDispatcher->RootDirectory);  JSProxy = new TDSJavaScriptProxyWriter();  try  {    if (!DirectoryExists(OutputFile))      ForceDirectories(OutputFile);    if ( !AnsiEndsStr("//", OutputFile) &&      !AnsiEndsStr("/", OutputFile))      OutputFile = OutputFile + Sysutils::PathDelim;    //put the proxy file in a subdirectory of the root folder    OutputFile = OutputFile + Sysutils::PathDelim + "webfiles" + Sysutils::PathDelim;    //name the proxy file    OutputFile = OutputFile + "JSProxy.js";    ProxyConnection->Connected = true;    JSProxy->UpdateJSProxyFile(ProxyConnection->DBXConnection, OutputFile);    ProxyConnection->Close();  }  __finally  {    JSProxy->Free();  }}
开发者ID:SkylineNando,项目名称:Delphi,代码行数:35,


示例2: SendMessage

//---------------------------------------------------------------------------void __fastcall TfrmMain::FormCreate(TObject *Sender){	cb_key1->Items->AddStrings(Keys);	cb_key2->Items->AddStrings(Keys);	cb_key3->Items->AddStrings(Keys);	cb_key4->Items->AddStrings(Keys);	cb_pick->Items->AddStrings(Keys);    cb_att->Items->AddStrings(Keys);	cb_key1->ItemIndex = 0;	cb_key1->ItemIndex = 1;	cb_key1->ItemIndex = 2;	cb_key1->ItemIndex = 3;	cb_pick->ItemIndex = 4;	cb_att->ItemIndex = 5;	UI->Enabled = true;	SendMessage(FmxHandleToHWND(this->Handle), WM_SETICON, ICON_BIG, (LPARAM) hIcon1);	SendMessage(FmxHandleToHWND(this->Handle), WM_SETICON, ICON_SMALL, (LPARAM) hIcon1);	SendMessage(FmxHandleToHWND(this->Handle), WM_SETICON, ICON_SMALL2, (LPARAM) hIcon1);	this->Caption = String("RwBox ++ - ") +  GameAccount;	if( !DirectoryExists( String(LoginerPath) + "//Data//" + GameAccount))	{		CreateDir(String(LoginerPath) + "//Data//");		CreateDir(String(LoginerPath) + "//Data//" + GameAccount + "//");	}		Load->Enabled = true;}
开发者ID:taida957789,项目名称:Deprecated-RwBox-Plus,代码行数:28,


示例3: ListSources

void __fastcall TForm1::TBItem1Click(TObject *Sender){ _di_IXMLNode ANode; AnsiString fname; ArticleList->Clear(); if(XMLDoc->FileName == NULL) {  Application->MessageBoxA("News Turkey can't get news unless a source to get news from is selected.", "News Turkey Error", NULL);  return; } XMLDoc->Active = TRUE; if(XMLDoc->Active == FALSE) { //This is to predvent Access Violations if there is a problem parsing the file  return; } ListSources(); ANode = RSSChannel->ChildNodes->FindNode("title"); if(DirectoryExists(ANode->Text) == FALSE) {  CreateDir(ANode->Text); } XMLDoc->SaveToFile(fname.sprintf("CNET News.com - Front Door//feed.xml")); XMLDoc->Active = FALSE;        }
开发者ID:BackupTheBerlios,项目名称:newsturkey,代码行数:30,


示例4: GetMatlab6Root

//---------------------------------------------------------------------------AnsiString __fastcall GetMatlab6Root(void){   AnsiString S = "";   __TRY   TRegistry *RR = new TRegistry();   try    {    // Для Matlab 6.5     RR->RootKey = HKEY_CLASSES_ROOT;     if (RR->OpenKey("//Matlab.Application.Single.6//CLSID",false))       S = RR->ReadString("");     if (RR->OpenKey("//CLSID//"+S+"//LocalServer32",false))       S = RR->ReadString("");     int ps = S.AnsiPos("matlab.exe");     if (ps) {      S = S.SubString( 1, ps-2);     // S содержит размещение matlab.exe (полный путь)      S = ExtractFileDir(S);      S = ExtractFileDir(S);      }    }      __finally {      delete RR;      }  if (!DirectoryExists(S)) {    S = "";    }  __CATCH  return S;}
开发者ID:GraffLittle,项目名称:first,代码行数:32,


示例5: FRecurse

bool IPlatformFile::DeleteDirectoryRecursively(const TCHAR* Directory){	class FRecurse : public FDirectoryVisitor	{	public:		IPlatformFile&		PlatformFile;		FRecurse(IPlatformFile&	InPlatformFile)			: PlatformFile(InPlatformFile)		{		}		virtual bool Visit(const TCHAR* FilenameOrDirectory, bool bIsDirectory)		{			if (bIsDirectory)			{				PlatformFile.IterateDirectory(FilenameOrDirectory, *this);				PlatformFile.DeleteDirectory(FilenameOrDirectory);			}			else			{				PlatformFile.SetReadOnly(FilenameOrDirectory, false);				PlatformFile.DeleteFile(FilenameOrDirectory);			}			return true; // continue searching		}	};	FRecurse Recurse(*this);	Recurse.Visit(Directory, true);	return !DirectoryExists(Directory);}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:29,


示例6: exit

void Runtime::Debugger::Debug() {  wcout << L"-------------------------------------" << endl;  wcout << L"Objeck " << VERSION_STRING << L" - Interactive Debugger" << endl;  wcout << L"-------------------------------------" << endl << endl;  if(FileExists(program_file, true) && DirectoryExists(base_path)) {    wcout << L"loaded executable: file='" << program_file << L"'" << endl;    wcout << L"source files: path='" << base_path << L"'" << endl << endl;    // clear arguments    arguments.clear();    arguments.push_back(L"obr");    arguments.push_back(program_file);  }  else {    wcerr << L"unable to load executable or locate base path." << endl;    exit(1);  }  // enter feedback loop  ClearProgram();  wcout << L"> ";  while(true) {        wstring line;    getline(wcin, line);    if(line.size() > 0) {      ProcessCommand(line);      wcout << L"> ";    }  }}
开发者ID:8l,项目名称:objeck-lang,代码行数:30,


示例7: path

void ComposerShellMenu::SetStatus(){    m_Status.invalid = false;    // See if we are in vendor directory    std::wstring path(m_TargetDir + L"//");    size_t pos = path.rfind(L"//vendor//");    if (std::wstring::npos != pos)    {        path.resize(pos);        m_Status.invalid = DirectoryExists(path + L"//vendor//composer");    }        if (m_Status.invalid)        return;            m_Status.composer = FileExists(m_TargetDir + L"//composer.json");    if (m_Status.composer)    {        // We have a composer.json. Check if we have installed it        m_Status.installed = FileExists(m_TargetDir + L"//vendor//composer//installed.json");                /*        //std::wstring composerJson = ReadComposerJson();        m_Status.project = std::wstring::npos == composerJson.find(L"/"name/":");        m_Status.package = !m_Status.project;        */    }}
开发者ID:AlexRee,项目名称:windows-setup,代码行数:30,


示例8: IsSvnDir2

bool IsSvnDir2(const String& p){ // this is a cope of usvn/IsSvnDir to avoid modular issues	if(IsNull(p))		return false;	if(DirectoryExists(AppendFileName(p, ".svn")) || DirectoryExists(AppendFileName(p, "_svn")))		return true;	String path = p;	String path0;	while(path != path0) {		path0 = path;		path = GetFileFolder(path);		if(DirectoryExists(AppendFileName(path, ".svn")))			return true;	}	return false;}
开发者ID:ultimatepp,项目名称:mirror,代码行数:16,


示例9: worker_fetch_partition_file

/* * worker_fetch_partition_file fetches a partition file from the remote node. * The function assumes an upstream compute task depends on this partition file, * and therefore directly fetches the file into the upstream task's directory. */Datumworker_fetch_partition_file(PG_FUNCTION_ARGS){	uint64 jobId = PG_GETARG_INT64(0);	uint32 partitionTaskId = PG_GETARG_UINT32(1);	uint32 partitionFileId = PG_GETARG_UINT32(2);	uint32 upstreamTaskId = PG_GETARG_UINT32(3);	text *nodeNameText = PG_GETARG_TEXT_P(4);	uint32 nodePort = PG_GETARG_UINT32(5);	char *nodeName = NULL;	/* remote filename is <jobId>/<partitionTaskId>/<partitionFileId> */	StringInfo remoteDirectoryName = TaskDirectoryName(jobId, partitionTaskId);	StringInfo remoteFilename = PartitionFilename(remoteDirectoryName, partitionFileId);	/* local filename is <jobId>/<upstreamTaskId>/<partitionTaskId> */	StringInfo taskDirectoryName = TaskDirectoryName(jobId, upstreamTaskId);	StringInfo taskFilename = TaskFilename(taskDirectoryName, partitionTaskId);	/*	 * If we are the first function to fetch a file for the upstream task, the	 * task directory does not exist. We then lock and create the directory.	 */	bool taskDirectoryExists = DirectoryExists(taskDirectoryName);	if (!taskDirectoryExists)	{		InitTaskDirectory(jobId, upstreamTaskId);	}	nodeName = text_to_cstring(nodeNameText);	FetchRegularFile(nodeName, nodePort, remoteFilename, taskFilename);	PG_RETURN_VOID();}
开发者ID:amosbird,项目名称:citus,代码行数:39,


示例10: DirectoryExists

// Check if the specified directory existsbool MassStorage::DirectoryExists(const char *path) const{	// Remove any trailing '/' from the directory name, it sometimes (but not always) confuses f_opendir	String<MaxFilenameLength> loc;	loc.copy(path);	return DirectoryExists(loc.GetRef());}
开发者ID:dc42,项目名称:RepRapFirmware,代码行数:8,


示例11: PathConform

SString SharedUtil::MakeUniquePath(const SString& strInPathFilename){    const SString strPathFilename = PathConform(strInPathFilename);    SString strBeforeUniqueChar, strAfterUniqueChar;    SString strPath, strFilename;    ExtractFilename(strPathFilename, &strPath, &strFilename);    SString strMain, strExt;    if (ExtractExtension(strFilename, &strMain, &strExt))    {        strBeforeUniqueChar = PathJoin(strPath, strMain);        strAfterUniqueChar = "." + strExt;    }    else    {        strBeforeUniqueChar = strPathFilename;        strAfterUniqueChar = "";    }    SString strTest = strPathFilename;    int     iCount = 1;#ifdef WIN32    while (GetFileAttributes(strTest) != INVALID_FILE_ATTRIBUTES)#else    while (DirectoryExists(strTest) || FileExists(strTest))#endif    {        strTest = SString("%s_%d%s", strBeforeUniqueChar.c_str(), iCount++, strAfterUniqueChar.c_str());    }    return strTest;}
开发者ID:Necktrox,项目名称:mtasa-blue,代码行数:33,


示例12: TForm

//---------------------------------------------------------------------------////---------------------------------------------------------------------------__fastcall TDialogProjectNew::TDialogProjectNew(TComponent* Owner)  : TForm(Owner){  TemplatePath = Usul()->Ini->ReadString("Settings", "PathTemplatesProjects", TemplatePath = Usul()->Path + "//Templates//Projects");  PageControl->ActivePageIndex = 0;  TSearchRec SearchRec;  if (FindFirst(TemplatePath + "//*", faDirectory, SearchRec) == 0) {    do {      if (SearchRec.Name[1] != '.') {        TListItem *ListItem = ListView->Items->Add();        ListItem->Caption = SearchRec.Name;        ListItem->ImageIndex = 1;      }    } while (FindNext(SearchRec) == 0);  }  FindClose(SearchRec);  if (Usul()->HasWriteAccessToExeDirectrory())    Edit->Text = Usul()->Path + "//New project";  else    Edit->Text = Usul()->PathDocuments + "//New project";  for (int I = 2;;I++) {    bool IsDirectoryExists = DirectoryExists(Edit->Text);    bool IsFileExists = FileExists(Edit->Text);    if (!IsDirectoryExists && !IsFileExists) break;    Edit->Text = Usul()->Path + "//New project" + String(I);  }}
开发者ID:NogsIoT,项目名称:Nogs-IDE,代码行数:31,


示例13: while

void TProfileToGui::_removeNonExistentDirsFromList(std::vector<String> &list){	unsigned int i = 0;	while (i < list.size())	{		if (!DirectoryExists(list[i]))		{			f_Main->statusNotif( ASPF(_("Directory does not exist: %s"),                ecc::QuoteStr(list[i])) + " - ");                ++i; 			if (PGlobals->RemoveNonExistingSourceDirs)			{				std::vector<String>::iterator pos = &list[i];				list.erase(pos);				f_Main->statusNotif( _("Removed from Profile."), -1);			}			else			{				f_Main->statusNotif( _("Ok."), -1);				++i;			}		}		else ++i;	}}
开发者ID:ChakaZulu,项目名称:abakt,代码行数:25,


示例14: populate_dir

void populate_dir (void){  char buf[MAX_PATH];  char mask[MAX_MASK_LEN];  GetWindowText(GetDlgItem(hMainWindow, IDC_MANPATH), buf, sizeof(buf));  GetWindowText(GetDlgItem(hMainWindow, IDC_MASK), mask, sizeof(mask));  if (!DirectoryExists(buf))  {    current_path_to_edit ();    strcpy (buf, CurrentPath);  }  else  {    size_t off;    off = strlen(buf);    if ((off) && (buf[off-1] != '//') && (buf[off-1] != '/')) {      buf[off] = '//';      buf[off+1] = 0;    }    strcpy (CurrentPath, buf);    current_path_to_edit ();  }  DlgDirListComboBox(hMainWindow, buf, IDC_DRIVES, 0, DDL_DRIVES);  DlgDirList (hMainWindow, buf, IDC_DIRS, 0, DDL_DIRECTORY + DDL_EXCLUSIVE);  /* if you want to show only files that match mask - uncomment next line */  //strcat (buf, mask);  DlgDirList (hMainWindow, buf, IDC_FILES, IDC_REALPATH, 0x27);  snprintf (mask, sizeof(mask), "[-%c-]", 'a' +_getdrive() - 1);  ComboBox_SelectString (GetDlgItem(hMainWindow, IDC_DRIVES), 0, mask);}
开发者ID:goriy,项目名称:sif,代码行数:29,


示例15: GetDlgItemTextA

void ProjectConfigDialog::onSelectScriptFile(void){    char buff[MAX_PATH + 1] = {0};    char projdir[MAX_PATH + 1] = {0};    GetDlgItemTextA(m_hwndDialog, IDC_EDIT_PROJECT_DIR, projdir, MAX_PATH);    OPENFILENAMEA ofn = {0};    ofn.lStructSize = sizeof(ofn);    ofn.hwndOwner = m_hwndDialog;    ofn.lpstrFilter = "Lua Script File (*.lua)/0*.lua/0";    ofn.lpstrTitle = "Select Script File";    if (DirectoryExists(projdir))    {        ofn.lpstrInitialDir = projdir;    }    ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;    ofn.lpstrFile = buff;    ofn.nMaxFile = MAX_PATH;    if (GetOpenFileNameA(&ofn))    {        m_project.setScriptFile(buff);        updateScriptFile();    }}
开发者ID:AlexYanJianhua,项目名称:quick-cocos2d-x,代码行数:25,


示例16: CheckDataDirectory

static int CheckDataDirectory(TCascStorage * hs, TCHAR * szDirectory){    TCHAR * szDataPath;    int nError = ERROR_FILE_NOT_FOUND;    // Try all known subdirectories    for(size_t i = 0; DataDirs[i] != NULL; i++)    {        // Create the eventual data path        szDataPath = CombinePath(szDirectory, DataDirs[i]);        if(szDataPath != NULL)        {            // Does that directory exist?            if(DirectoryExists(szDataPath))            {                hs->szDataPath = szDataPath;                return ERROR_SUCCESS;            }            // Free the data path            CASC_FREE(szDataPath);        }    }    return nError;}
开发者ID:Keader,项目名称:TrinityCore,代码行数:26,


示例17: PathConform

//// Ensure all directories exist to the file//void SharedUtil::MakeSureDirExists ( const SString& strPath ){    std::vector < SString > parts;    PathConform ( strPath ).Split ( PATH_SEPERATOR, parts );    // Find first dir that already exists    int idx = parts.size () - 1;    for ( ; idx >= 0 ; idx-- )    {        SString strTemp = SString::Join ( PATH_SEPERATOR, parts, 0, idx );        if ( DirectoryExists ( strTemp ) )            break;            }    // Make non existing dirs only    idx++;    for ( ; idx < (int)parts.size () ; idx++ )    {        SString strTemp = SString::Join ( PATH_SEPERATOR, parts, 0, idx );        // Call mkdir on this path        #ifdef WIN32            mkdir ( strTemp );        #else            mkdir ( strTemp ,0775 );        #endif    }}
开发者ID:qaisjp,项目名称:green-candy,代码行数:30,


示例18: while

bool CFileSystemWin32::CreateDirectory(const nString& Path){#ifdef UNICODE#define CreateDirectory  CreateDirectoryW#else#define CreateDirectory  CreateDirectoryA#endif	nArray<nString> DirStack;	nString AbsPath = DataSrv->ManglePath(Path);	while (!DirectoryExists(AbsPath))	{		AbsPath.StripTrailingSlash();		int LastSepIdx = AbsPath.GetLastDirSeparatorIndex();		DirStack.PushBack(AbsPath.ExtractRange(LastSepIdx + 1, AbsPath.Length() - (LastSepIdx + 1)));		AbsPath = AbsPath.ExtractRange(0, LastSepIdx);	}	while (DirStack.Size())	{		AbsPath += "/" + DirStack.Back();		DirStack.Erase(DirStack.Size() - 1);		if (!CreateDirectory(AbsPath.Get(), NULL)) FAIL;	}	OK;}
开发者ID:moltenguy1,项目名称:deusexmachina,代码行数:27,


示例19: ShowMessage

//---------------------------------------------------------------------------void __fastcall TForm1::Button2Click(TObject *Sender){        Memo3->Clear();        Image1->Visible=false;        Image2->Visible=true;        //ADOQuery2->SQL->Text="delete from ErrorReport";        //ADOQuery2->ExecSQL();        //ADOQuery1->ExecSQL();        //ADOConnection1->Connected=false;        //ADOConnection1->Connected=true;        FunctionQuit=0;        Button2->Enabled=false;        Button3->Enabled=true;        if(!DirectoryExists(Edit1->Text))                {                        ShowMessage("目录不正确,请检查后重新启动");                        return;                }        scanDir(Edit1->Text);        Button3->Enabled=false;        Button2->Enabled=true;        StatusBar1->SimpleText="文件扫描检查完成!";        Image1->Visible=true;        Image2->Visible=false;}
开发者ID:rogertl,项目名称:cbuilder,代码行数:29,


示例20: _outp

__fastcall TLoggerFile::TLoggerFile(const TPropertyMap &Init) : _outp(0), _max_file_count(Init["MaxFileCount"].ToInt()), _file_name(Init["Name"]) {  if(_file_name.IsEmpty())    _file_name = ExtractFilePath(GetModuleName(0))+"log//"+Now().FormatString("yyyymmdd")+".log";  _path = ExtractFilePath(_file_name);  if(!DirectoryExists(_path)) CreateDirectory(_path.c_str(), 0);  Reset();  Info(String().sprintf("%s запуск", GetModuleName(0)));}
开发者ID:heimdallr,项目名称:home_compa_dev,代码行数:8,


示例21: GetHomeDirectory

std::string cXdg::GetHomeVideosDirectory(){    const std::string sHome = GetHomeDirectory();    std::string sDirectory = sHome + "/Videos";    if (!DirectoryExists(sDirectory)) sDirectory = GetDirectory("VIDEOS");    return sDirectory;}
开发者ID:pilkch,项目名称:library,代码行数:8,


示例22: ShellTreeViewChange

//---------------------------------------------------------------------------void __fastcall TRelFolderSelectorForm::ShellTreeViewChange(	  TObject *Sender, TTreeNode *Node){	if(ShellTreeView->Path != "" && DirectoryExists(ShellTreeView->Path))		OKButton->Enabled = true;	else		OKButton->Enabled = false;}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:9,


示例23: SaveMacroses

//---------------------------------------------------------------------------void __fastcall TfrmMacros::SaveMacroses(void){String Folder=ExtractFilePath(Application->ExeName)+"Macroses";if (!DirectoryExists(Folder))    CreateDir(Folder);for (int i=0;i<FMacrosList->Count;i++)    FMacrosList->Items[i]->SaveToFile(Folder);}
开发者ID:SevenLines,项目名称:RSign,代码行数:9,



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


C++ Disable函数代码示例
C++ Direction函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。