本文整理汇总了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');");
}
}
示例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;
}
示例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;
}