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


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

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


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

示例1: inputPath

std::string mui::Helpers::muiPath( std::string path ){
	// pretty much copy&pasted from OF
	Poco::Path outputPath;
	Poco::Path inputPath(path);
	string strippedDataPath = mui::MuiConfig::dataPath.toString();
	strippedDataPath = ofFilePath::removeTrailingSlash(strippedDataPath);
	if (inputPath.toString().find(strippedDataPath) != 0) {
		outputPath = mui::MuiConfig::dataPath;
		outputPath.resolve(inputPath);
	} else {
		outputPath = inputPath;
	}
	
	if( !ofFile(outputPath.absolute().toString(), ofFile::Reference).exists() ){
		// maybe in the data dir?
		string dataFile = ofToDataPath(path, true);
		if( ofFile(dataFile,ofFile::Reference).exists() ){
			outputPath = Poco::Path(dataFile);
		}
	}
	
	if( mui::MuiConfig::logLevel <= OF_LOG_NOTICE ){
		cout << "loading path: " << outputPath.toString() << " || " << outputPath.absolute().toString() << " || " << path << endl;
	}
	return outputPath.absolute().toString();
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例2:

CameraImageToDisplayImagePass::CameraImageToDisplayImagePass(Poco::Path shader_dir,
                                                             osg::ref_ptr<osg::Texture> live_camera_texture,
                                                             std::string p2c_filename,
															 bool UseHDR) :
	_live_camera_texture(live_camera_texture), _UseHDR(UseHDR)
{
	double scale_width = live_camera_texture->getTextureWidth();
	double scale_height = live_camera_texture->getTextureHeight();
	osg::ref_ptr<osg::Image> image = load_exr( p2c_filename, _display_width, _display_height, scale_width, scale_height );
	_p2c_texture = new osg::Texture2D;
	_p2c_texture->setTextureSize( _display_width, _display_height);
	_p2c_texture->setInternalFormat(GL_RGB32F);
	_p2c_texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
	_p2c_texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

	_p2c_texture->setImage(image);

	create_output_texture();
	_camera = new osg::Camera;
	setup_camera();
	osg::ref_ptr<osg::Group> g = create_input_geometry();
	_camera->addChild( g.get() );

	_top = new osg::Group;
	_top->addDescription("CameraImageToDisplayImagePass top node");
	_top->addChild( _camera );
	set_shader( shader_dir.absolute().append("CameraImageToDisplayImagePass.vert").toString(),
				shader_dir.absolute().append("CameraImageToDisplayImagePass.frag").toString() );

}
开发者ID:FreemooVR,项目名称:FreemooVR,代码行数:30,代码来源:CameraImageToDisplayImagePass.cpp

示例3: getModulePaths

void Pothos::PluginLoader::loadModules(void)
{
    Poco::Path libPath = Pothos::System::getRootPath();
    libPath.append("[email protected][email protected]");
    libPath.append("Pothos");
    libPath.append("modules");
    const auto paths = getModulePaths(libPath.absolute());

    //TODO load user built modules -- when we have a comprehension for them

    //spawn futures and wait for completion of load
    std::vector<std::future<void>> futures;
    for (const auto &path : paths)
    {
        futures.push_back(std::async(std::launch::async, &loadModuleAtPath, path.toString()));
    }
    for (auto &future : futures) future.wait();
}
开发者ID:hailynch,项目名称:pothos,代码行数:18,代码来源:Loader.in.cpp

示例4: DoImportGameScripts

    int CStatsUtil::DoImportGameScripts()
    {
        //Validate output + input paths
        Poco::Path inpath(m_inputPath);
        Poco::Path outpath;

        if( m_outputPath.empty() )
            throw runtime_error("CStatsUtil::DoImportGameScripts() : Output path is empty!");
            
        if( !utils::isFolder( m_outputPath ) )
            throw runtime_error("CStatsUtil::DoImportGameScripts() : Output path doesn't exist, or isn't a directory!");

        outpath = Poco::Path(m_outputPath);

        //Setup the script handler
        GameScripts scripts( outpath.absolute().toString() );

        //Import from XML
        scripts.ImportScriptsFromXML( inpath.absolute().toString() );

        return 0;
    }
开发者ID:SeredithM,项目名称:ppmdu,代码行数:22,代码来源:statsutil.cpp

示例5: determineFileLocs

/**
 * Determine the location of the collection and cache files.
 */
void MantidHelpWindow::determineFileLocs()
{
    // determine collection file location
    string binDir = Mantid::Kernel::ConfigService::Instance().getDirectoryOfExecutable();
    this->findCollectionFile(binDir);
    if (m_collectionFile.empty())
    {
        // clear out the other filenames
        m_cacheFile = "";
        return;
    }
    g_log.debug() << "Using collection file \"" << m_collectionFile << "\"\n";

    // determine cache file location
    m_cacheFile = COLLECTION_FILE.toStdString();
    QString dataLoc = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
    if (dataLoc.endsWith("mantidproject"))
    {
        Poco::Path path (dataLoc.toStdString(), m_cacheFile);
        m_cacheFile = path.absolute().toString();
    }
    else if (dataLoc.endsWith("MantidPlot")) // understood to end in "Mantid/MantidPlot"
    {
        Poco::Path path(dataLoc.toStdString());
        path = path.parent(); // drop off "MantidPlot"
        path = path.parent(); // drop off "Mantid"
        path = Poco::Path(path, "mantidproject");
        path = Poco::Path(path, m_cacheFile);
        m_cacheFile = path.absolute().toString();
    }
    else
    {
        g_log.debug() << "Failed to determine help cache file location\n"; // REMOVE
        Poco::Path path(dataLoc.toStdString(), "mantidproject");
        path = Poco::Path(path, COLLECTION_FILE.toStdString());
        m_cacheFile = path.absolute().toString();
    }
}
开发者ID:jkrueger1,项目名称:mantid,代码行数:41,代码来源:MantidHelpWindow.cpp

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