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

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

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

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

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

示例1: autosprintf

bool cTriggerConsole::CheckData(cfBase *cmd, cTrigger &data){	if(data.mDefinition.empty()) {		*cmd->mOS << _("The definition is empty or not specified. Please define it with -d option.");		return false;	}	size_t pos = data.mDefinition.rfind("dbconfig");	if(pos != string::npos) {		*cmd->mOS << _("It's not allowed to define dbconfig file as trigger.") << "/n";		cConnDC *conn = (cConnDC *) cmd->mConn;		ostringstream message;		message << autosprintf(_("User '%s' tried to define dbconfig as trigger"), conn->mpUser->mNick.c_str());		mOwner->mServer->ReportUserToOpchat(conn, message.str());		return false;	}	FilterPath(data.mDefinition);	string vPath(mOwner->mServer->mConfigBaseDir), triggerPath, triggerName;	ExpandPath(vPath);	GetPath(data.mDefinition, triggerPath, triggerName);	ReplaceVarInString(triggerPath, "CFG", triggerPath, vPath);	ExpandPath(triggerPath);	if ((triggerPath.substr(0, vPath.length()) != vPath)) {		(*cmd->mOS) << autosprintf(_("The file %s for the trigger %s must be located in %s configuration folder, use %%[CFG] variable, for example: %%[CFG]/%s"), data.mDefinition.c_str(), data.mCommand.c_str(), HUB_VERSION_NAME, triggerName.c_str());		return false;	}	return true;}
开发者ID:Eco-logical,项目名称:verlihub,代码行数:29,


示例2: Allocate

/** Get tokens from a menu include (either dynamic or static). */TokenNode *ParseMenuIncludeHelper(const TokenNode *tp, const char *command){   FILE *fd;   char *path;   char *buffer;   TokenNode *start;   buffer = NULL;   if(!strncmp(command, "exec:", 5)) {      path = Allocate(strlen(command) - 5 + 1);      strcpy(path, command + 5);      ExpandPath(&path);      fd = popen(path, "r");      if(JLIKELY(fd)) {         buffer = ReadFile(fd);         pclose(fd);      } else {         ParseError(tp, "could not execute included program: %s", path);      }   } else {      path = CopyString(command);      ExpandPath(&path);      fd = fopen(path, "r");      if(JLIKELY(fd)) {         buffer = ReadFile(fd);         fclose(fd);      } else {         ParseError(NULL, "could not open include: %s", path);      }   }   if(JUNLIKELY(!buffer)) {      Release(path);      return NULL;   }   start = Tokenize(buffer, path);   Release(buffer);   Release(path);   if(JUNLIKELY(!start || start->type != TOK_JWM))   {      ParseError(tp, "invalid include: %s", command);      ReleaseTokens(start);      return NULL;   }   return start;}
开发者ID:Nehamkin,项目名称:jwm,代码行数:56,


示例3: ExpandPathW

int CFolderItem::FolderCreateDirectory(int showFolder){	int res = FOLDER_SUCCESS;	if (IsUnicode())		{			wchar_t buffer[MAX_FOLDER_SIZE];			if (szFormatW)				{					ExpandPathW(buffer, szFormatW, MAX_FOLDER_SIZE);					CreateDirectories(buffer);					if (showFolder)						{							ShellExecuteW(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);						}					res = (DirectoryExists(buffer)) ? FOLDER_SUCCESS : FOLDER_FAILURE;				}		}		else{			char buffer[MAX_FOLDER_SIZE];			if (szFormat)				{					ExpandPath(buffer, szFormat, MAX_FOLDER_SIZE);					CreateDirectories(buffer);					if (showFolder)						{							ShellExecuteA(NULL, "explore", buffer, NULL, NULL, SW_SHOW);						}					res = (DirectoryExists(buffer)) ? FOLDER_SUCCESS : FOLDER_FAILURE;				}		}	return res;}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:32,


示例4: cd_cmd

/** *	@public *	@brief	Changes the Current Working Directory * *	To change the directory, we simply check the provided path, if it exists, *	then we change the environment's working directory to that path. * **/int cd_cmd(int argc, char **argv, FF_ENVIRONMENT *pEnv) {	FF_IOMAN *pIoman = pEnv->pIoman;	FF_T_INT8	path[FF_MAX_PATH];	int i;	if(argc == 2) {		ProcessPath(path, argv[1], pEnv);	// Make path absolute if relative.		ExpandPath(path);	// Remove any relativity from the path (../ or ../).				if(FF_FindDir(pIoman, path, (FF_T_UINT16) strlen(path))) {	// Check if path is valid.			i = strlen(path) - 1;	// Path found, change the directory.			if(i) {				if(path[i] == '//' || path[i] == '/') {					path[i] = '/0';				}			}			strcpy(pEnv->WorkingDir, path);			//sprintf(pEnv->WorkingDir, path);		} else {			cons_printf("Path /"%s/" not found./n", path);		}	} else {		cons_printf("Usage: %s [path]/n", argv[0]);	}	return 0;}
开发者ID:bicepjai,项目名称:nanos,代码行数:37,


示例5: ParseInclude

/** Parse an include. */void ParseInclude(const TokenNode *tp, int depth) {   char *temp;   Assert(tp);   if(JUNLIKELY(!tp->value)) {      ParseError(tp, "no include file specified");   } else {      temp = CopyString(tp->value);      ExpandPath(&temp);      if(JUNLIKELY(!ParseFile(temp, depth))) {         ParseError(tp, "could not open included file %s", temp);      }      Release(temp);   }}
开发者ID:Nehamkin,项目名称:jwm,代码行数:26,


示例6: OpenDir

int EView::OpenDir(char *Path) {    char XPath[MAXPATH];    EDirectory *dir = 0;    if (ExpandPath(Path, XPath, sizeof(XPath)) == -1)        return 0;    {        EModel *x = Model;        while (x) {            if (x->GetContext() == CONTEXT_DIRECTORY) {                if (filecmp(((EDirectory *)x)->Path, XPath) == 0) {                    dir = (EDirectory *)x;                    break;                }            }            x = x->Next;            if (x == Model)                break;        }    }    if (dir == 0)        dir = new EDirectory(0, &ActiveModel, XPath);    SelectModel(dir);    return 1;}
开发者ID:mongrelx,项目名称:efte,代码行数:25,


示例7: TEST

static	voidTEST(	char	*orig,	char	*base){	printf("[%s] = [%s]/n",orig,ExpandPath(orig,base));}
开发者ID:ogochan,项目名称:libmondai,代码行数:7,


示例8: RefreshPreview

static void RefreshPreview(HWND hWnd){	TCHAR tmp[MAX_FOLDER_SIZE], res[MAX_FOLDER_SIZE];	GetEditText(hWnd, tmp, MAX_FOLDER_SIZE);	ExpandPath(res, tmp, MAX_FOLDER_SIZE);	SetWindowText(GetDlgItem(hWnd, IDC_PREVIEW_EDIT), res);}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:7,


示例9: AddScriptToStack

/*==============AddScriptToStack==============*/void AddScriptToStack (char *filename, ScriptPathMode_t pathMode = SCRIPT_USE_ABSOLUTE_PATH){	int            size;	script++;	if (script == &scriptstack[MAX_INCLUDES])		Error ("script file exceeded MAX_INCLUDES");		if ( pathMode == SCRIPT_USE_RELATIVE_PATH )		Q_strncpy( script->filename, filename, sizeof( script->filename ) );	else		Q_strncpy (script->filename, ExpandPath (filename), sizeof( script->filename ) );	size = LoadFile (script->filename, (void **)&script->buffer);	// printf ("entering %s/n", script->filename);	if ( g_pfnCallback )	{		if ( script == scriptstack + 1 )			g_pfnCallback( script->filename, NULL, 0 );		else			g_pfnCallback( script->filename, script[-1].filename, script[-1].line );	}	script->line = 1;	script->script_p = script->buffer;	script->end_p = script->buffer + size;}
开发者ID:Baer42,项目名称:source-sdk-2013,代码行数:34,


示例10: strcpy

int EDirectory::FmMkDir() {    char Dir[MAXPATH];    char Dir2[MAXPATH];    strcpy(Dir, Path);    if (View->MView->Win->GetStr("New directory name", sizeof(Dir), Dir, HIST_PATH) == 0) {        return 0;    }    if (ExpandPath(Dir, Dir2, sizeof(Dir2)) == -1) {        Msg(S_INFO, "Failed to create directory, path did not expand");        return 0;    }#if defined(MSVC) || defined(BCPP) || defined(WATCOM) || defined(__WATCOM_CPLUSPLUS__)    int status = mkdir(Dir2);#else    int status = mkdir(Dir2, 509);#endif    if (status == 0) {        return RescanDir();    }    Msg(S_INFO, "Failed to create directory %s", Dir2);    return 0;}
开发者ID:mongrelx,项目名称:efte,代码行数:26,


示例11: ExpandPath

voidVisItDataServerPrivate::OpenDatabase(const std::string &filename, int timeState){    // Determine the file and file format.    if(openFile.empty())    {        // Expand the filename.        std::string expandedFile = ExpandPath(filename);        // Determine the file format.        const avtDatabaseMetaData *md = mdserver.GetMDServerMethods()->GetMetaData(expandedFile);        if(md == NULL)        {            EXCEPTION1(VisItException, "Can't get the metadata.");        }        openFile = expandedFile;        openFileFormat = md->GetFileFormat();    }    openTimeState = timeState;    // Set some default arguments.    bool createMeshQualityExpressions = false;    bool createTimeDerivativeExpressions = false;    bool ignoreExtents = true;    //    // Open the database on the engine.    //    engine.GetEngineMethods()->OpenDatabase(openFileFormat,                        openFile,                        openTimeState,                        createMeshQualityExpressions,                        createTimeDerivativeExpressions,                        ignoreExtents);}
开发者ID:ahota,项目名称:visit_intel,代码行数:35,


示例12: LCMTest_ExpandPath

MI_Result NITS_CALL LCMTest_ExpandPath(_In_z_ const MI_Char * pathIn,                     _Outptr_result_maybenull_z_ MI_Char **expandedPath,                      _Outptr_result_maybenull_ MI_Instance **cimErrorDetails){    return ExpandPath( pathIn, expandedPath, cimErrorDetails);}
开发者ID:40a,项目名称:WPSDSCLinux,代码行数:7,


示例13: AddScriptToStack

/*==============AddScriptToStack==============*/void AddScriptToStack (const char *filename, int index){  int size;  script++;  if (script == &scriptstack[MAX_INCLUDES])    Error ("script file exceeded MAX_INCLUDES");  strcpy (script->filename, ExpandPath (filename));  size = vfsLoadFile (script->filename, (void **)&script->buffer, index);  if (size == -1)    Sys_Printf ("Script file %s was not found/n", script->filename);  else  {    if (index > 0)      Sys_Printf ("entering %s (%d)/n", script->filename, index+1);    else      Sys_Printf ("entering %s/n", script->filename);  }  script->line = 1;  script->script_p = script->buffer;  script->end_p = script->buffer + size;}
开发者ID:clbr,项目名称:netradiant,代码行数:30,


示例14: ExpandPath

int FTPCache::AddPathMap(PathMap pathmap) {	TCHAR * expPath = ExpandPath(pathmap.localpath);	if (expPath != NULL) {		pathmap.localpathExpanded = expPath;	}	m_vCachePaths.push_back(pathmap);	return 0;}
开发者ID:Praymundo,项目名称:NppFTP,代码行数:8,


示例15: ExpandDir

void wxGenericDirCtrl::ExpandRoot(){    ExpandDir(m_rootId); // automatically expand first level    // Expand and select the default path    if (!m_defaultPath.empty())    {        ExpandPath(m_defaultPath);    }#ifdef __UNIX__    else    {        // On Unix, there's only one node under the (hidden) root node. It        // represents the / path, so the user would always have to expand it;        // let's do it ourselves        ExpandPath( wxT("/") );    }#endif}
开发者ID:drvo,项目名称:wxWidgets,代码行数:19,


示例16: WriteFile

/*===========WriteFileSave as a seperate file instead of as a wadfile lump===========*/void WriteFile (void){	char	filename[1024];	char	*exp;	sprintf (filename,"%s/%s.lmp", destfile, lumpname);	exp = ExpandPath(filename);	printf ("saved %s/n", exp);	SaveFile (exp, lumpbuffer, lump_p-lumpbuffer);		}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:17,


示例17: GetCreateProcessInfo

void GetCreateProcessInfo(LPVOID* p, LPTSTR* pApplicationName, LPTSTR* pCommandLine){   LPTSTR ImageName = GetString(p);   LPTSTR CmdLine = GetString(p);   ExpandPath(pApplicationName, ImageName);   LPTSTR ExpandedCommandLine;   ExpandPath(&ExpandedCommandLine, CmdLine);   LPTSTR MyCmdLine = GetCommandLine();   LPTSTR MyArgs = SkipArg(MyCmdLine);      *pCommandLine = LocalAlloc(LMEM_FIXED, lstrlen(ExpandedCommandLine) + sizeof(TCHAR) + lstrlen(MyArgs) + sizeof(TCHAR));   lstrcpy(*pCommandLine, ExpandedCommandLine);   lstrcat(*pCommandLine, _T(" "));   lstrcat(*pCommandLine, MyArgs);      LocalFree(ExpandedCommandLine);}
开发者ID:Epictetus,项目名称:ocra,代码行数:20,


示例18: LoadSeg

/************* * DESCRIPTION:   load texture * INPUT:         texture     texture * OUTPUT:        FALSE if failed else TRUE *************/BOOL IPREVIEW_TEXTURE::Load(TEXTURE *texture){	/* Load Imagine texture  */#ifdef __AMIGA__	IM_TTABLE* (*texture_init)(LONG arg0);	seglist = LoadSeg(texture->name);	if(!seglist)		return FALSE;	*(ULONG*)(&texture_init) = 4*seglist+4;#ifdef __PPC__	ttable = ITextureInit(texture_init);#else	ttable = texture_init(0x60FFFF);#endif#else	INQUIRETEXTURE InquireTexture;	PREFS prefs;	char szBuffer[256];	prefs.id = ID_TXTP;	if (prefs.GetPrefs())		ExpandPath((char *)prefs.data, texture->name, szBuffer);	else		strcpy(szBuffer, texture->name);	prefs.data = NULL; // VERY important !	hInst = LoadLibrary(szBuffer);	if (!hInst)		return FALSE;	InquireTexture = (INQUIRETEXTURE)GetProcAddress(hInst, "InquireTexture");	if (!InquireTexture)		return FALSE;	ttable = InquireTexture(0x70, 0x1);#endif	if(!ttable)		return FALSE;	// copy parameters	memcpy(params, ((IMAGINE_TEXTURE*)texture)->params, 16*sizeof(float));	form.pos = pos;	form.orient_x = orient_x;	form.orient_y = orient_y;	form.orient_z = orient_z;	form.size = size;	return TRUE;}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:59,


示例19: EList

EDirectory::EDirectory(int createFlags, EModel **ARoot, char *aPath): EList(createFlags, ARoot, aPath) {    char XPath[MAXPATH];    Files = 0;    FCount = 0;    SearchLen = 0;    ExpandPath(aPath, XPath, sizeof(XPath));    Slash(XPath, 1);    Path = strdup(XPath);    RescanList();}
开发者ID:lecheel,项目名称:fte-fork,代码行数:11,


示例20: buffer

int CFolderItem::FolderCreateDirectory(int showFolder){	if (m_tszFormat == NULL)		return FOLDER_SUCCESS;	CMString buffer(ExpandPath(m_tszFormat));	CreateDirectoryTreeT(buffer);	if (showFolder)		ShellExecute(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);	return (DirectoryExists(buffer)) ? FOLDER_SUCCESS : FOLDER_FAILURE;}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:12,


示例21: StartReplay

void StartReplay(const std::string &filename, bool reveal){	std::string replay;	CleanPlayers();	ExpandPath(replay, filename);	LoadReplay(replay);	ReplayRevealMap = reveal;	StartMap(CurrentMapPath, false);}
开发者ID:akien-mga,项目名称:Wyrmgus,代码行数:12,


示例22: StartSavedGame

void StartSavedGame(const std::string &filename){	std::string path;	SaveGameLoading = true;	CleanPlayers();	ExpandPath(path, filename);	LoadGame(path);	StartMap(filename, false);	//SetDefaultTextColors(nc, rc);}
开发者ID:stefanhendriks,项目名称:stratagus,代码行数:12,


示例23: ProcessPath

void ProcessPath(char *dest, const char *src, FF_ENVIRONMENT *pEnv) {	if(src[0] != '//' && src[0] != '/') {		if(strlen(pEnv->WorkingDir) == 1) {			sprintf(dest, "//%s", src);		} else {			sprintf(dest, "%s//%s", pEnv->WorkingDir, src);		}	} else {		sprintf(dest, "%s", src);	}	ExpandPath(dest);	// Remove all relativity from the path.}
开发者ID:8bitgeek,项目名称:fullfat,代码行数:13,


示例24: ExpandPath

int CFolderItem::FolderCreateDirectory(int showFolder){	if (m_tszFormat == NULL)		return FOLDER_SUCCESS;	TCHAR buffer[MAX_FOLDER_SIZE];	ExpandPath(buffer, m_tszFormat, SIZEOF(buffer));	CreateDirectoryTreeT(buffer);	if (showFolder)		ShellExecute(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);	return (DirectoryExists(buffer)) ? FOLDER_SUCCESS : FOLDER_FAILURE;}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:13,


示例25: is

TupleArcFst* TuneSet::LoadLattice (const Sid s) const {  boost::iostreams::filtering_streambuf<boost::iostreams::input> in;  in.push (boost::iostreams::gzip_decompressor() );  in.push (boost::iostreams::file_source (ExpandPath (m_pattern, s) ) );  std::istream is (&in);  TupleArcFst32* fst32 = TupleArcFst32::Read (is, fst::FstReadOptions() );  TopSort (fst32);  if (!fst32) {    cerr << "ERROR: unable to load vector lattice: " << ExpandPath (m_pattern,         s) << '/n';    exit (1);  }  if (fst32->Properties (fst::kNotTopSorted, true) ) {    cerr << "ERROR: Input lattices are not topologically sorted: " << '/n';    exit (1);  }  TupleArcFst* fst = new TupleArcFst;  fst::Expand m;  fst::Map (*fst32, fst, fst::ExpandMapper (m) );  delete fst32;  return fst;}
开发者ID:Libardo1,项目名称:ucam-smt,代码行数:22,



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


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