当前位置: 首页>>代码示例>>C++>>正文


C++ Path::makeAbsolute方法代码示例

本文整理汇总了C++中poco::Path::makeAbsolute方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::makeAbsolute方法的具体用法?C++ Path::makeAbsolute怎么用?C++ Path::makeAbsolute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在poco::Path的用法示例。


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

示例1: content

const std::string OptionsPage::GenerateContent(const std::string &method, const std::map<std::string,QueryVar> &queryvars)
{
	std::string content("");
	std::string sql("");

	if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="save" && ValidateFormPassword(queryvars))
	{
		Option option(m_db);
		option.ClearCache();
		std::vector<std::string> options;
		std::vector<std::string> oldvalues;
		std::vector<std::string> newvalues;
		CreateArgArray(queryvars,"option",options);
		CreateArgArray(queryvars,"oldvalue",oldvalues);
		CreateArgArray(queryvars,"value",newvalues);

		for(int i=0; i<options.size(); i++)
		{
			if(oldvalues[i]!=newvalues[i])
			{

				option.Set(options[i],newvalues[i]);

				// load new language immediately
				if(options[i]=="Language")
				{
					Poco::Path tdir;
					tdir.pushDirectory(global::basepath+"translations");
					tdir=tdir.makeAbsolute();
					tdir.setFileName(newvalues[i]);
					m_trans->LoadLocalizedTranslation(tdir.toString());
				}

				if(options[i]=="MessageDownloadMaxDaysBackward")
				{
					m_db->Execute("INSERT OR IGNORE\
								INTO tblMessageRequests (IdentityID, Day, RequestIndex, Found)\
								SELECT M.IdentityID, M.InsertDate, M.MessageIndex, 'true'\
								FROM tblMessage M\
								LEFT JOIN tblMessageRequests R\
									ON M.IdentityID=R.IdentityID\
									AND M.MessageIndex=R.RequestIndex\
									AND M.InsertDate=R.Day\
								WHERE R.IdentityID IS NULL\
								AND M.IdentityID IS NOT NULL\
								AND M.InsertDate >= date('now',(SELECT -MAX(OptionValue,0) FROM tblOption \
									WHERE Option='MessageDownloadMaxDaysBackward')||' days');");
				}
			}
开发者ID:steveatinfincia,项目名称:fms,代码行数:49,代码来源:optionspage.cpp

示例2: getOFRelPath

string getOFRelPath(string from){
    Poco::Path base(true);
    base.parse(from);

    Poco::Path path;
    path.parse( getOFRoot() );
    path.makeAbsolute();

    
    cout << "getOFRelPath " << base.toString() << " " << path.toString() << endl;
    
	string relPath;
	if (path.toString() == base.toString()){
		// do something.
	}

	int maxx = MAX(base.depth(), path.depth());
	for (int i = 0; i <= maxx; i++){

		bool bRunOut = false;
		bool bChanged = false;
		if (i <= base.depth() && i <= path.depth()){
			if (base.directory(i) == path.directory(i)){

			} else {
				bChanged = true;
			}
		} else {
			bRunOut = true;
		}
		if (bRunOut == true || bChanged == true){
			for (int j = i; j <= base.depth(); j++){
				relPath += "../";
			}
			for (int j = i; j <= path.depth(); j++){
				relPath += path.directory(j) + "/";
			}
			break;
		}
	}
    
    cout << relPath << " ---- " << endl;
    
    
    return relPath;
}
开发者ID:damiannz,项目名称:openFrameworks,代码行数:46,代码来源:Utils.cpp

示例3: findDataFile

Poco::Path SharedMemoryTest::findDataFile(const std::string& afile)
{
	Poco::Path root;
	root.makeAbsolute();
	Poco::Path result;
	while (!Poco::Path::find(root.toString(), "data", result))
	{
		root.makeParent();
		if (root.toString().empty() || root.toString() == "/")
			throw Poco::FileNotFoundException("Didn't find data subdir");
	}
	result.makeDirectory();
	result.setFileName(afile);
	Poco::File aFile(result.toString());
	if (!aFile.exists() || (aFile.exists() && !aFile.isFile()))
		throw Poco::FileNotFoundException("Didn't find file " + afile);
	
	return result;
}
开发者ID:,项目名称:,代码行数:19,代码来源:


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