本文整理汇总了C++中poco::Path::getBaseName方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::getBaseName方法的具体用法?C++ Path::getBaseName怎么用?C++ Path::getBaseName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poco::Path
的用法示例。
在下文中一共展示了Path::getBaseName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: here
Poco::Path CExtract::here(Poco::Path & downloadedPackage)
{
//pour l'instant on prend ce qu'il y a dans temp sans faire l'extraction en attendant poco
Poco::Path extractPath(downloadedPackage.parent());
extractPath.pushDirectory(downloadedPackage.getBaseName());
return to(downloadedPackage, extractPath);
}
示例2: doClone
void CloneMDWorkspace::doClone(const typename MDEventWorkspace<MDE, nd>::sptr ws)
{
std::string outWSName = getPropertyValue("OutputWorkspace");
Progress prog(this, 0.0, 10.0, 100);
BoxController_sptr bc = ws->getBoxController();
if (!bc) throw std::runtime_error("Error with InputWorkspace: no BoxController!");
if (bc->isFileBacked())
{
// Generate a new filename to copy to
prog.report("Copying File");
std::string originalFile = bc->getFilename();
std::string outFilename = getPropertyValue("Filename");
if (outFilename.empty())
{
// Auto-generated name
Poco::Path path = Poco::Path(originalFile).absolute();
std::string newName = path.getBaseName() + "_clone." + path.getExtension();
path.setFileName(newName);
outFilename = path.toString();
}
// Perform the copying
g_log.notice() << "Cloned workspace file being copied to: " << outFilename << std::endl;
Poco::File(originalFile).copyTo(outFilename);
g_log.information() << "File copied successfully." << std::endl;
// Now load it back
IAlgorithm_sptr alg = createSubAlgorithm("LoadMD", 0.5, 1.0, false);
alg->setPropertyValue("Filename", outFilename);
alg->setPropertyValue("FileBackEnd", "1");
alg->setPropertyValue("Memory", "0"); //TODO: How much memory?
alg->setPropertyValue("OutputWorkspace", outWSName);
alg->executeAsSubAlg();
// Set the output workspace to this
IMDEventWorkspace_sptr outWS = alg->getProperty("OutputWorkspace");
this->setProperty("OutputWorkspace", outWS);
}
else
{
// Perform the clone in memory.
boost::shared_ptr<MDEventWorkspace<MDE,nd> > outWS(new MDEventWorkspace<MDE,nd>(*ws));
this->setProperty("OutputWorkspace", boost::dynamic_pointer_cast<IMDEventWorkspace>(outWS) );
}
}