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


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

本文整理汇总了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);
   }
开发者ID:Yadoms,项目名称:yadoms,代码行数:8,代码来源:Extract.cpp

示例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;
   }
开发者ID:drunner,项目名称:drunner,代码行数:18,代码来源:utils.cpp

示例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());
      }
   }
开发者ID:drunner,项目名称:drunner,代码行数:16,代码来源:drunner_setup.cpp

示例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();
}
开发者ID:subwolf,项目名称:ofxMightyUI,代码行数:68,代码来源:MUI.cpp


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