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

C++ AppendFileName函数代码示例

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

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



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

示例1: AppendFileName

void Updater::DO_Uninstall(void)
{
	// removes executable
	String path;
#ifdef PLATFORM_POSIX
			path = AppendFileName(GetProgramsFolder(), appName);
#else
			path = AppendFileName(GetProgramsFolder(), appName + "/" + appName + ".exe");
#endif
	FileDelete(path);
	
	// removes system config folder
	// leaves user one alone, it can contain user data
	// (on win32, that's also the program folder)
	DeleteFolderDeep(systemConfigPath);
	
	// unlink application from shess
	ShellUnlink();

	// signal op success and leave
	// as it was uninstalling, it will restart
	// launching app (uninstaller, possibily)
	SucceedUpdate();
	RestartApp(RestartTemp);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:25,代码来源:Updater.cpp


示例2: LocalHost

String MakeBuild::OutDir(const Index<String>& cfg, const String& package, const VectorMap<String, String>& bm,
                   bool use_target)
{
	Index<String> excl;
	excl.Add(bm.Get("BUILDER", "GCC"));
	excl.Add("MSC");
	LocalHost().AddFlags(excl);
	Vector<String> x;
	bool dbg = cfg.Find("DEBUG_FULL") >= 0 || cfg.Find("DEBUG_MINIMAL") >= 0;
	if(cfg.Find("DEBUG") >= 0) {
		excl.Add("BLITZ");
		if(cfg.Find("BLITZ") < 0)
			x.Add("NOBLITZ");
	}
	else
		if(dbg)
			x.Add("RELEASE");
	if(use_target)
		excl.Add("MAIN");
	for(int i = 0; i < cfg.GetCount(); i++)
		if(excl.Find(cfg[i]) < 0)
			x.Add(cfg[i]);
	Sort(x);
	for(int i = 0; i < x.GetCount(); i++)
		x[i] = InitCaps(x[i]);
	String outdir = GetVar("OUTPUT");
	if(output_per_assembly)
		outdir = AppendFileName(outdir, GetVarsName());
	if(!use_target)
		outdir = AppendFileName(outdir, package);
	outdir = AppendFileName(outdir, GetFileTitle(method) + "." + Join(x, "."));
	outdir = Filter(outdir, CharFilterSlash);
	return outdir;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:34,代码来源:Build.cpp


示例3: Exclamation

void MapEditor::OnLevelMapCalc(Level& level, int number)
{
	if (level.GetMapBG().IsEmpty())
	{
		Exclamation(NFormat(t_("Please, select the image for level: %s"), level.GetName()));
		return;
	}

	String fp = AppendFileName( AppendFileName( GetFileDirectory(GetExeFilePath()), "Maps"),
		level.GetMapBG());

	if (!FileExists(fp))
	{
		Exclamation(NFormat(t_("Image file not exist: %s"), fp));
		return;
	}

	String name = level.GetName();
	double zx   = level.GetZoomDX();
	Size   pz   = level.GetPageSize();
	Size   sz   = level.GetCellSize();

	FileIn in(fp);
	One<StreamRaster> r = StreamRaster::OpenAny(in);
	if (!r)
	{
		Exclamation(NFormat(t_("Error while loading image file: %s"), fp));
		return;
	}

	Image img = r->GetImage();
	Calculate(sz.cx, sz.cy, pz.cx, pz.cy, zx,
		NFormat("%s-%d", _map.GetName(), number + 1), img);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:34,代码来源:MapEditorLevel.cpp


示例4: SaveFile

void Ide::ExportProject(const String& ep, bool all, bool gui, bool deletedir)
{
	SaveFile(false);
	::Workspace wspc;
	wspc.Scan(main);
	Index<String> used;
	HdependClearDependencies();
	for(int i = 0; i < wspc.GetCount(); i++) {
		const Package& p = wspc.GetPackage(i);
		String pn = wspc[i];
		for(int j = 0; j < p.GetCount(); j++) {
			const Package::File& f = p[j];
			if(!f.separator) {
				String p = SourcePath(pn, f);
				used.FindAdd(p);
				Vector<String> d = HdependGetDependencies(p);
				for(int q = 0; q < d.GetCount(); q++)
					used.FindAdd(d[q]);
				for(int q = 0; q < f.depends.GetCount(); q++)
					used.FindAdd(SourcePath(pn, f.depends[q].text));
			}
		}
	}
	if(FileExists(ep)) {
		if(gui && !PromptYesNo(DeQtf(ep) + " is existing file.&"
		                "Do you want to delete it?")) return;
		FileDelete(ep);
	}
	if(deletedir && DirectoryExists(ep)) {
		if(gui && !PromptYesNo(DeQtf(ep) + " is existing directory.&"
		                "Do you want to replace it?")) return;
		DeleteFolderDeep(ep);
	}

	Progress pi("Exporting project");
	pi.SetTotal(wspc.GetCount());
	for(int i = 0; i < wspc.GetCount(); i++) {
		if(gui && pi.StepCanceled())
			return;
		CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, all, true);
	}
	Vector<String> upp = GetUppDirs();
	for(int i = 0; i < upp.GetCount(); i++) {
		if(gui && pi.StepCanceled())
			return;
		String d = upp[i];
		FindFile ff(AppendFileName(d, "*"));
		while(ff) {
			if(ff.IsFile()) {
				String fn = ff.GetName();
				String path = AppendFileName(d, fn);
				if(all || used.Find(path) >= 0)
					CopyFile(AppendFileName(ep, fn), path, true);
			}
			ff.Next();
		}
		CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, all, true);
	}
	ExportMakefile(ep);
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:60,代码来源:Export.cpp


示例5: ToUpper

void CodeBrowser::Load()
{
	String find = ToUpper((String)~search);
	String match = ToUpper((String)~search_scope);
	String pm = GetPm();
	Vector<String> txt;
	Vector<Value>  ndx;
	Index<int>     fi;
	Index<String>  fs;
	for(int i = 0; i < CodeBase().GetCount(); i++) {
		String s = CodeBase().GetKey(i);
		const Array<CppItem>& n = CodeBase()[i];
		if(s.GetCount())
			if(MatchCib(s, match) && (MatchCib(s, find) || HasItem(n, find)) && MatchPm(n, pm)) {
				txt.Add(s);
				ndx.Add(s);
			}
		for(int i = 0; i < n.GetCount(); i++) {
			int f = n[i].file;
			if(fi.Find(f) < 0) {
				String s = GetFileText(GetSourceFilePath(f));
				if(s.StartsWith(pm) && MatchCib(s, match) &&
				   (IsNull(find) || MatchCib(s, find) || n[i].uname.StartsWith(find))) {
					txt.Add(s);
					ndx.Add(f);
					fs.Add(s);
					fi.Add(f);
				}
			}
		}
	}
	const Workspace& wspc = GetIdeWorkspace();
	for(int i = 0; i < wspc.GetCount(); i++) {
		String pn = wspc[i];
		const Package& p = wspc.GetPackage(i);
		String pp = PackageDirectory(pn);
		for(int j = 0; j < p.GetCount(); j++)
			if(!p[j].separator) {
				String fn = AppendFileName(pp, p[j]);
				String s = GetFileText(AppendFileName(pn, p[j]));
				if(fs.Find(s) < 0 && (IsNull(find) || MatchCib(s, find)) && MatchCib(s, match) && MatchPm(fn, pm)) {
					int f = GetSourceFileIndex(SourcePath(pn, p[j]));
					txt.Add(s);
					ndx.Add(f);
					fs.Add(s);
				}
			}
	}
	IndexSort(txt, ndx, ScopeLess());
	Value key = scope.GetKey();
	int sc = scope.GetCursorSc();
	scope.Clear();
	for(int i = 0; i < txt.GetCount(); i++)
		scope.Add(IsString(ndx[i]) ? ndx[i] : Null, txt[i], ndx[i]);
	if(scope.FindSetCursor(key))
		scope.ScCursor(sc);
//	clear.Enable(IsSearch());
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:58,代码来源:CodeBrowser.cpp


示例6: InstallProgramGroup

bool InstallProgramGroup(const char *exe, const char *groupname, const char *lnk, int icon)
{
	String dir = GetShellFolder("Common Programs", HKEY_LOCAL_MACHINE);
	if(groupname) {
		dir = AppendFileName(dir, groupname);
		CreateDirectory(dir, NULL);
	}
	return CreateShellLink(exe, AppendFileName(dir, lnk), "", icon);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:9,代码来源:Shell.cpp


示例7: AppendFileName

void GrabScreen::Init(GrabYourScreen &_program) {
	program = &_program;
	editFileNameGrab <<= AppendFileName(GetDesktopFolder(), "ScreenGrab.avi");
	editFileNameGrab.Type(t_("Video file"), ".avi");
	editTime <<= 5;
	editFrameRate <<= 1; 
	opGrabMouse <<= true;
	swGrabMode.Add("Desktop");
	swGrabMode.Add("Window");
#if defined(PLATFORM_WIN32) 
	swGrabMode.Add("Rectangle");
#endif
	swGrabMode.MinCaseHeight(20);
	swGrabMode.SetData(0);
	swGrabMode.WhenAction = THISBACK(SwGrabMode_Action);
	SwGrabMode_Action();
#if defined(PLATFORM_WIN32) 	
	butGrab.WhenPush = THISBACK(ButGrab_Push);
#else
	butGrab.Enable(false);
	editFileNameGrab.Enable(false);
	editTime.Enable(false);
	editFrameRate.Enable(false);
	opGrabMouse.Enable(false);
	editLeft.Hide();
	editTop.Hide();
	editWidth.Hide();
	editHeight.Hide();
	left.Hide();
	top.Hide();
	width.Hide();
	height.Hide();
#endif
	
	editLeft <<= 100;
	editWidth <<= 1000;
	editTop <<= 100;
	editHeight <<= 900;
	
	String extension;
	editFileNameSnap <<= AppendFileName(GetDesktopFolder(), "ScreenSnap.jpg");
	editFileNameSnap.Type(t_("Image file"), ".jpg");
	butSnap.WhenPush = THISBACK(ButSnap_Push);
	
	Array<int64> hWnd, processId;
	Array<String> name, fileName, caption;
	GetWindowsList(hWnd, processId, name, fileName, caption, false);
	Sort(caption);
	for (int i = 0; i < caption.GetCount(); ++i) {
		if (!Trim(caption[i]).IsEmpty())
			editWindowTitle.Add(caption[i]);
	}
	editWindowTitle.SetData(editWindowTitle.GetValue(0));
	
	SetTimeCallback(-1000, THISBACK(Timer));
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:56,代码来源:GrabScreen.cpp


示例8: AppendFileName

int DlgCompareDir::Refresh(String rel_path, int parent)
{
	FindFile ff;
	VectorMap<String, FileInfo> afile, bfile;
	VectorMap<String, String> adir, bdir;
	String arel = AppendFileName(pa, rel_path);
	String brel = AppendFileName(pb, rel_path);
	int done = 0;
	if(!FetchDir(arel, afile, adir))
		done |= 2;
	if(!FetchDir(brel, bfile, bdir))
		done |= 1;

	Index<String> dir_index;
	dir_index <<= adir.GetIndex();
	FindAppend(dir_index, bdir.GetKeys());
	Vector<String> dirs(dir_index.PickKeys());
	Sort(dirs, GetLanguageInfo());
	for(int i = 0; i < dirs.GetCount(); i++) {
		int fa = adir.Find(dirs[i]), fb = bdir.Find(dirs[i]);
		String dn = (fb >= 0 ? bdir[fb] : adir[fa]);
		int dirpar = tree.Add(parent, CtrlImg::Dir(), dn);
		int dirdone = Refresh(AppendFileName(rel_path, dirs[i]), dirpar);
		done |= dirdone;
		switch(dirdone) {
		case 0: tree.Remove(dirpar); break;
		case 1: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::a_dir()).Set(dn)); break;
		case 2: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::b_dir()).Set(dn)); break;
		case 3: tree.SetNode(dirpar, TreeCtrl::Node().SetImage(CompDirImg::ab_dir()).Set(dn)); break;
		}
	}
	Index<String> name_index;
	name_index <<= afile.GetIndex();
	FindAppend(name_index, bfile.GetKeys());
	Vector<String> names(name_index.PickKeys());
	Sort(names, GetLanguageInfo());
	for(int i = 0; i < names.GetCount(); i++) {
		int fa = afile.Find(names[i]), fb = bfile.Find(names[i]);
		if(fa < 0) {
			tree.Add(parent, CompDirImg::b_file(), NFormat("%s: B (%`, %0n)", bfile[fb].name, bfile[fb].time, bfile[fb].size));
			done |= 2;
		}
		else if(fb < 0) {
			tree.Add(parent, CompDirImg::a_file(), NFormat("%s: A (%`, %0n)", afile[fa].name, afile[fa].time, afile[fa].size));
			done |= 1;
		}
		else if(afile[fa].size != bfile[fb].size
		|| LoadFile(AppendFileName(arel, names[i])) != LoadFile(AppendFileName(brel, names[i]))) {
			tree.Add(parent, CompDirImg::ab_file(), NFormat("%s: A (%`, %0n), B (%`, %0n)",
				bfile[fb].name, afile[fa].time, afile[fa].size, bfile[fb].time, bfile[fb].size));
			done |= 3;
		}
	}
	return done;
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:55,代码来源:main.cpp


示例9: GetTreePath

void DlgCompareDir::DoTreeCursor()
{
	String s = GetTreePath();
	if(IsNull(s))
		return;
	String fa = AppendFileName(pa, s), fb = AppendFileName(pb, s);
	String da = LoadFile(fa), db = LoadFile(fb);
	if(!IsNull(da) || !IsNull(db)) {
		if(IsNull(da) || IsNull(db)) {
			qtf.Hide();
			lineedit.Show();
			lineedit <<= Nvl(db, da);
		}
		else {
			lineedit.Hide();
			qtf.Show();
			String comptext = "[C2 ";
			Vector<String> la = GetStringLineMap(da), lb = GetStringLineMap(db);
			Array<TextSection> sections = CompareLineMaps(la, lb);
			for(int s = 0; s < sections.GetCount(); s++) {
				const TextSection& sec = sections[s];
				if(sec.same) {
					comptext << "[@(0.0.0) \1";
					if(sec.count1 <= 6)
						for(int i = 0; i < sec.count1; i++)
							comptext << ExpandTabs(la[i + sec.start1]) << '\n';
					else {
						for(int i = 0; i < 3; i++)
							comptext << ExpandTabs(la[i + sec.start1]) << '\n';
						comptext << "...\n";
						for(int i = -3; i < 0; i++)
							comptext << ExpandTabs(la[i + sec.start1 + sec.count1]) << '\n';
					}
					comptext << "\1]";
				}
				else {
					if(sec.count1) {
						comptext << "[@(0.160.0) \1";
						for(int i = 0; i < sec.count1; i++)
							comptext << ExpandTabs(la[sec.start1 + i]) << '\n';
						comptext << "\1]";
					}
					if(sec.count2) {
						comptext << "[@(0.0.255) \1";
						for(int i = 0; i < sec.count2; i++)
							comptext << ExpandTabs(lb[sec.start2 + i]) << '\n';
						comptext << "\1]";
					}
				}
			}
			qtf.SetQTF(comptext);
		}
	}
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:54,代码来源:main.cpp


示例10: FetchMaxValidVersion

// fetch the new app version from server
// and replaces older one
// if ver is not specified, fetches the maximum available
// one but which is less than or equal maxVersion
bool Updater::FetchApp(ProductVersion ver, bool devel)
{
	int err = 0;

	if(!ver)
		ver = FetchMaxValidVersion(acceptDevelVersions);
	if(!ver)
		return false;

	String appServerPath, destPath;
	#ifdef PLATFORM_POSIX
		appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName;
		destPath = AppendFileName(GetProgramsFolder(), appName);
	#else
		appServerPath = GetPlatformRoot() + ver.ToString() + "/" + appName + ".exe";
		destPath = AppendFileName(GetProgramsFolder(), appName + "\\" + appName + ".exe");
		RealizePath(destPath);
	#endif

	if(isWebServer)
	{
		http.Url(appServerPath);
		http.Timeout(1000*60*30);
		http.MaxContentSize(100000000);
		http.WhenDo = THISBACK(doProgress);

		// fetch version file from server
		appBuffer = http.Execute();
		err = http.GetStatusCode();
		if(err != 200 || http.IsAbort() || http.IsError())
		{
			appBuffer = "";
			return false;
		}
	
		// replaces/installs app
		if(!SaveFile(destPath, appBuffer))
			return false;
	}
	else
		FileCopy(appServerPath, destPath);
#ifdef PLATFORM_POSIX
	if(chmod(~destPath, 0755) != 0)
		return false;
#endif

	// stores current version inside system config path
	if(!SaveFile(AppendFileName(systemConfigPath, "version"), ver.ToString()))
		return false;

	installedVersion = ver;

	return true;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:58,代码来源:Updater.cpp


示例11: START_Uninstall

// app started, must check for update/install requests
// returns true if app must continue execution, false otherwise
bool Updater::DO_NormalRun(void)
{
	// we now check if we just want to uninstall app
	// it can be done by command line --UNINSTALL option
	if(CommandLine().GetCount() && CommandLine()[0] == "--UNINSTALL")
		return START_Uninstall();
	
	// if app not installed, we shall install it
	// (if any available version is present on server....)
	if(!appInstalled)
	{
		// fetch available application versions
		ProductVersions versions = FetchVersions();
	
		// if versions present on server, install latest
		if(versions.GetCount())
			return START_Install();
		// otherwise resume execution -- it's an uninstalled run
		else
			return true;
	}
	
	// not installing nor uninstalling
	
	// we shall check which kind of update is enabled
	String updateMode;
	if(!FileExists(AppendFileName(userConfigPath, "UPDATER_MODE")))
	{
		updateMode = "ASK";
		SaveFile(AppendFileName(userConfigPath, "UPDATER_MODE"), updateMode);
	}
	else
		updateMode = LoadFile(AppendFileName(userConfigPath, "UPDATER_MODE"));

	// if updates are disabled, just do nothing
	if(updateMode == "DISABLED")
		return true;
	
	// if we don't have a new version available, just do nothing
	ProductVersion maxVer;
	if( (maxVer = FetchMaxValidVersion(acceptDevelVersions)) <= installedVersion)
		return true;
	
	// if we want manual updates, just ask
	if(updateMode == "ASK")
		if(!PromptYesNo(Format(t_("New version '%s' is available&Install it ?"), maxVer.ToString())))
			return true;
	
	// updater enabled, start it
	// if update failed, resume normal run, otherwise exit
	// as the app will be launched again by updater itself
	return START_Update();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:55,代码来源:Updater.cpp


示例12: InitWwwTpp

void InitWwwTpp()
{
	String wwwtpp = AppendFileName(uppbox, "uppweb/www.tpp");
	FindFile ff(AppendFileName(wwwtpp, "*"));
	static Vector<String> data;
	while(ff) {
		RLOG(ff.GetName());
		Topic p = ReadTopic0(LoadFile(AppendFileName(wwwtpp, ff.GetName())));
		data.Add(p.text);
		RegisterTopic__("<uppweb/www.tpp/all.i>", GetFileTitle(ff.GetName()), p.title, data.Top(), data.Top().GetCount());
		ff.Next();
	}
};
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:13,代码来源:topic1.cpp


示例13: NativePath

String Nest::PackagePath0(const String& name)
{
	String uppfile = NativePath(name);
	if(IsFullPath(uppfile)) return NormalizePath(uppfile);
	Vector<String> d = GetUppDirs();
	String p;
	for(int i = 0; i < d.GetCount(); i++) {
		p = NormalizePath(AppendFileName(AppendFileName(d[i], uppfile),
		                  GetFileName(uppfile)) + ".upp");
		if(FileExists(p)) return p;
	}
	return d.GetCount() ? NormalizePath(AppendFileName(AppendFileName(d[0], uppfile),
		                                GetFileName(uppfile)) + ".upp") : "";
}
开发者ID:kolyden,项目名称:mirror,代码行数:14,代码来源:Workspace.cpp


示例14: SearchForFiles

void SearchForFiles(Index<String>& files, String dir, String mask, int readonly, Progress& pi) {
	FindFile ff(AppendFileName(dir, "*.*"));
	while(ff) {
		if(ff.IsFolder() && *ff.GetName() != '.')
			SearchForFiles(files, AppendFileName(dir, ff.GetName()), mask, readonly, pi);
		else
		if(ff.IsFile() && PatternMatchMulti(mask, ff.GetName())) {
			if(IsNull(readonly) || !!readonly == !!ff.IsReadOnly()) {
				if(pi.StepCanceled()) return;
				files.FindAdd(AppendFileName(dir, ff.GetName()));
			}
		}
		ff.Next();
	}
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:15,代码来源:FindInFiles.cpp


示例15: UrpMain

//==============================================================================================
int UrpMain(UrpTopWindow &ctrlMain) {
	// When the dev version is run, it uses the config files in that folder so as to avoid
	// disturbing the useful user settings on the same computer for the app installed in 
	// "Program Files".
	
	ASSERT(&ctrlMain);
	ctrlMain.configFileNameBase = ToLower(UrpString::GetWord(ctrlMain.Name(), 1)); // Get 2nd word in string (index zero-based)
	
	ctrlMain.binConfigFile = AppendFileName(ctrlMain.configFileFolder, ctrlMain.configFileNameBase + BIN_TAIL);
	ctrlMain.xmlConfigFile = AppendFileName(ctrlMain.configFileFolder, ctrlMain.configFileNameBase + XML_TAIL);
	
	RunWithConfig(ctrlMain, CONFIGACTION_LOAD_AND_SAVE, WINDOWINSTANCINGMETHOD_RUN);
	
	return 0;  // Default exit code historically means success (MS-DOS)
};
开发者ID:radtek,项目名称:lister,代码行数:16,代码来源:UrpMain.cpp


示例16: CalculateAllPrompt

void MapEditor::OnSaveMap()
{
	CalculateAllPrompt();

	if (!StoreAsXMLFile(_map, _map.GetName(),
		AppendFileName(
			AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"),
			_map.GetName() + ".map"
		)))
	{
		Exclamation(t_("Error while saving map to file!"));
	}

	UpdateEditorCtrls();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:15,代码来源:MapEditorMap.cpp


示例17: GetName

bool FindFile::IsSymLink() const
{
	String name = GetName();
	if(GetFileExt(name) != ".lnk")
		return false;
	return sGetSymLinkPath0(AppendFileName(path, name), NULL);
}
开发者ID:pedia,项目名称:raidget,代码行数:7,代码来源:Path.cpp


示例18: LOG

bool MapBG::Load(const char* fp)
{
	if (!FileExists(fp))
	{
		LOG(NFormat("MapBG: File not exists, \"%s\"", fp));
		return false;
	}

	if (!LoadFromXMLFile(_levels, fp))
	{
		LOG("MapBG: Error while loading map from XML-file!");
		return false;
	}

	_mapDir = AppendFileName(GetFileDirectory(fp), GetFileTitle(fp));
	_currLevel = _levels.GetCount() > 0 ? 0 : -1;
	if (_currLevel < 0)
	{
		LOG("MapBG: No zoom levels found in map!");
		return false;
	}
	_recalc = true;

	return true;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:25,代码来源:MapBG.cpp


示例19: GetExeFilePath

String GetExeFilePath()
{
	static String exepath;
	ONCELOCK {
		const char *exe = procexepath_();
		if(*exe)
			exepath = exe;
		else {
			String x = Argv0__;
			if(IsFullPath(x) && FileExists(x))
				exepath = x;
			else {
				exepath = GetHomeDirFile("upp");
				Vector<String> p = Split(FromSystemCharset(Environment().Get("PATH")), ':');
				if(x.Find('/') >= 0)
					p.Add(GetCurrentDirectory());
				for(int i = 0; i < p.GetCount(); i++) {
					String ep = NormalizePath(AppendFileName(p[i], x));
					if(FileExists(ep))
						exepath = ep;
				}
			}
		}
	}
	return exepath;
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:26,代码来源:App.cpp


示例20: User

		std::string User( std::string subdirectory, bool roaming, std::string filename )
		{
			std::string full_directory = "./";

			char * home_path = getenv( "XDG_DATA_HOME" );
			/* If XDG_DATA_HOME not set use HOME instead  */
			if ( home_path == NULL )
			{
				home_path = getenv( "HOME" );
				if ( home_path )
				{
					full_directory.assign(home_path);
					full_directory.append("/.local/share");
				}
				else
				{
					/* Fallback to current directory */
					full_directory.assign("./");
				}
			}
			else
			{
				full_directory.assign(home_path);
			}

			#endif

			AppendDirectoryAndCreate( full_directory, elix::program::_user );
			AppendDirectoryAndCreate( full_directory, subdirectory );
			AppendFileName( full_directory, filename );


			return full_directory;
		}
开发者ID:lukesalisbury,项目名称:luxengine,代码行数:34,代码来源:elix_directory_std.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AppendImageToList函数代码示例发布时间:2022-05-30
下一篇:
C++ AppendDevicePathNode函数代码示例发布时间: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