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


C++ FilePath::GetRelativePathname方法代码示例

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


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

示例1: GetRelativePathToProjectPath

String CustomColorsSystem::GetRelativePathToProjectPath(const FilePath& absolutePath)
{
	if(absolutePath.IsEmpty())
		return String();

	return absolutePath.GetRelativePathname(ProjectManager::Instance()->CurProjectPath());
}
开发者ID:galek,项目名称:dava.framework,代码行数:7,代码来源:CustomColorsSystem.cpp

示例2: ValidateTexture

void SceneValidator::ValidateTexture(Texture *texture, const FilePath &texturePathname, const String &validatedObjectName, Set<String> &errorsLog)
{
	if(!texture) return;
	
	String path = texturePathname.GetRelativePathname(pathForChecking);
	String textureInfo = path + " for object: " + validatedObjectName;

	if(texture->IsPinkPlaceholder())
	{
		errorsLog.insert("Can't load texture: " + textureInfo);
	}

	bool pathIsCorrect = ValidatePathname(texturePathname, validatedObjectName);
	if(!pathIsCorrect)
	{
		errorsLog.insert("Wrong path of: " + textureInfo);
	}
	
	if(!IsPowerOf2(texture->GetWidth()) || !IsPowerOf2(texture->GetHeight()))
	{
		errorsLog.insert("Wrong size of " + textureInfo);
	}
    
    if(texture->GetWidth() > 2048 || texture->GetHeight() > 2048)
	{
		errorsLog.insert("Texture is too big. " + textureInfo);
	}
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:28,代码来源:SceneValidator.cpp

示例3: CopyCustomColorTexture

void SceneSaver::CopyCustomColorTexture(Scene *scene, const FilePath & sceneFolder, Set<String> &errorLog)
{
	Entity *land = FindLandscapeEntity(scene);
	if(!land) return;

	KeyedArchive* customProps = land->GetCustomProperties();
	if(!customProps) return;

	String pathname = customProps->GetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP);
	if(pathname.empty()) return;

    FilePath projectPath = CreateProjectPathFromPath(sceneFolder);
    if(projectPath.IsEmpty())
    {
		Logger::Error("[SceneSaver::CopyCustomColorTexture] Can't copy custom colors texture (%s)", pathname.c_str());
        return;
    }

    FilePath texPathname = projectPath + pathname;
    sceneUtils.CopyFile(texPathname, errorLog);
    
    FilePath newTexPathname = sceneUtils.GetNewFilePath(texPathname);
    FilePath newProjectPathname = CreateProjectPathFromPath(sceneUtils.dataFolder);
    if(newProjectPathname.IsEmpty())
    {
		Logger::Error("[SceneSaver::CopyCustomColorTexture] Can't save custom colors texture (%s)", pathname.c_str());
        return;
    }
    
    //save new path to custom colors texture
    customProps->SetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP, newTexPathname.GetRelativePathname(newProjectPathname));
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:32,代码来源:SceneSaver.cpp

示例4: GetRelativePathToScenePath

String CustomColorsSystem::GetRelativePathToScenePath(const FilePath &absolutePath)
{
	if(absolutePath.IsEmpty())
		return String();

	return absolutePath.GetRelativePathname(GetScenePath());
}
开发者ID:galek,项目名称:dava.framework,代码行数:7,代码来源:CustomColorsSystem.cpp

示例5: GetRelativePathToProjectPath

String LandscapeEditorCustomColors::GetRelativePathToProjectPath(const FilePath& absolutePath)
{
	if(absolutePath.IsEmpty())
		return String();

	return absolutePath.GetRelativePathname(EditorSettings::Instance()->GetProjectPath());
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:7,代码来源:LandscapeEditorCustomColors.cpp

示例6: GetRelativePathToScenePath

String LandscapeEditorCustomColors::GetRelativePathToScenePath(const FilePath &absolutePath)
{
	if(absolutePath.IsEmpty())
		return String();

	return absolutePath.GetRelativePathname(GetScenePath());
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:7,代码来源:LandscapeEditorCustomColors.cpp

示例7: StoreSaveFileName

void LandscapeEditorCustomColors::StoreSaveFileName(const FilePath& fileName)
{
	parent->GetSceneGraph()->UpdatePropertyPanel();
	if(NULL != workingLandscapeEntity)
	{
		KeyedArchive* customProps = workingLandscapeEntity->GetCustomProperties();

		FilePath projectPath = EditorSettings::Instance()->GetProjectPath();

		customProps->SetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP, fileName.GetRelativePathname(projectPath));
	}
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:12,代码来源:LandscapeEditorCustomColors.cpp

示例8: CopyFile

bool SceneUtils::CopyFile(const FilePath &filePathname, Set<String> &errorLog)
{
	String workingPathname = filePathname.GetRelativePathname(dataSourceFolder);

	PrepareFolderForCopyFile(workingPathname, errorLog);
    
    bool retCopy = FileSystem::Instance()->CopyFile(dataSourceFolder + workingPathname, dataFolder + workingPathname);
    if(!retCopy)
    {
        errorLog.insert(String(Format("Can't copy %s from %s to %s",
                                      workingPathname.c_str(),
                                      dataSourceFolder.GetAbsolutePathname().c_str(),
                                      dataFolder.GetAbsolutePathname().c_str())));
    }
    
    return retCopy;
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:17,代码来源:SceneUtils.cpp


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