本文整理汇总了C++中poco::Path::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::parent方法的具体用法?C++ Path::parent怎么用?C++ Path::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poco::Path
的用法示例。
在下文中一共展示了Path::parent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: makedirectory
cResult makedirectory(Poco::Path d, mode_t mode)
{
Poco::File f(d);
if (!f.exists())
{
if (!utils::fileexists(d.parent()))
return cError("Parent directoy doesn't exist: " + d.parent().toString());
f.createDirectory();
logdbg("Created " + d.toString());
}
#ifndef _WIN32
if (chmod(d.toString().c_str(), mode) != 0)
return cError("Unable to change permissions on " + d.toString());
#endif
return kRSuccess;
}
示例3: _copyexe
void _copyexe()
{
Poco::Path currentexe = drunnerPaths::getPath_Exe();
try
{
if (currentexe.parent().toString().compare(drunnerPaths::getPath_Bin().toString()) != 0)
Poco::File(currentexe).copyTo(drunnerPaths::getPath_Bin().toString());
logdbg("Copied drunner to " + drunnerPaths::getPath_Bin().toString());
drunner_assert(utils::fileexists(drunnerPaths::getPath_Exe_Target()), "Failed to install drunner.exe");
}
catch (const Poco::FileException & e)
{
logmsg(kLWARN, std::string("Couldn't copy exe to bin directory: ") + e.what());
}
}
示例4: mui_init
void mui_init(){
#if TARGET_OS_IPHONE
if( mui::MuiConfig::detectRetina ){
ofAppiOSWindow * w = ofAppiOSWindow::getInstance();
if( w->isRetinaEnabled() ){
mui::MuiConfig::scaleFactor = 2;
mui::MuiConfig::useRetinaAssets = true;
}
}
#endif
//TODO: allow retina in osx too!
Poco::Path appPath;
#if TARGET_OS_IPHONE
// http://www.cocoabuilder.com/archive/cocoa/193451-finding-out-executable-location-from-c-program.html
CFBundleRef bundle = CFBundleGetMainBundle();
CFURLRef url = CFBundleCopyExecutableURL(bundle); // CFBundleCopyResourcesDirectoryURL(bundle);
CFURLRef absolute = CFURLCopyAbsoluteURL(url);
CFStringRef path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
CFIndex maxLength = CFStringGetMaximumSizeOfFileSystemRepresentation(path);
char *result = (char*)malloc(maxLength);
if(result) {
if(!CFStringGetFileSystemRepresentation(path,result, maxLength)) {
free(result);
result = NULL;
}
}
CFRelease(path);
CFRelease(url);
CFRelease(absolute);
appPath = Poco::Path(result);
appPath = appPath.parent();
#elif TARGET_OS_MAC
// http://www.cocoabuilder.com/archive/cocoa/193451-finding-out-executable-location-from-c-program.html
CFBundleRef bundle = CFBundleGetMainBundle();
CFURLRef url = CFBundleCopyExecutableURL(bundle); // CFBundleCopyResourcesDirectoryURL(bundle);
CFURLRef absolute = CFURLCopyAbsoluteURL(url);
CFStringRef path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
CFIndex maxLength = CFStringGetMaximumSizeOfFileSystemRepresentation(path);
char *result = (char*)malloc(maxLength);
if(result) {
if(!CFStringGetFileSystemRepresentation(path,result, maxLength)) {
free(result);
result = NULL;
}
}
CFRelease(path);
CFRelease(url);
CFRelease(absolute);
appPath = Poco::Path(result);
appPath = appPath.parent().parent().pushDirectory("Resources");
if( mui::MuiConfig::detectRetina ){
ofAppGLFWWindow * window = dynamic_cast<ofAppGLFWWindow*>(ofGetWindowPtr());
if( window != NULL ){
mui::MuiConfig::scaleFactor = window->getPixelScreenCoordScale();
}
}
#else
appPath = Poco::Path(ofToDataPath("", true));
#endif
mui::MuiConfig::dataPath = appPath.absolute();
}