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


C++ FileList::GetPathname方法代码示例

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


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

示例1: DeleteDirectoryFiles

uint32 FileSystem::DeleteDirectoryFiles(const String & path, bool isRecursive)
{
	uint32 fileCount = 0; 
	
	FileList * fileList = new FileList(path);
	for(int i = 0; i < fileList->GetCount(); ++i)
	{
		if(fileList->IsDirectory(i))
		{
			if(!fileList->IsNavigationDirectory(i))
			{
				if(isRecursive)
				{
					fileCount += DeleteDirectoryFiles(fileList->GetPathname(i), isRecursive);
				}
			}
		}
		else 
		{
			bool success = DeleteFile(fileList->GetPathname(i));
			if(success)fileCount++;
		}
	}
	SafeRelease(fileList);

	return fileCount;
}
开发者ID:dima-belsky,项目名称:dava.framework,代码行数:27,代码来源:FileSystem.cpp

示例2: StartRecord

void Replay::StartRecord(const FilePath & dirName)
{
    DVASSERT(!isRecord);
    DVASSERT(!isPlayback);
    isRecord = true;
    pauseReplay = false;

    FileSystem::Instance()->DeleteDirectoryFiles(dirName, false);
    FileSystem::Instance()->CreateDirectory(dirName);

    FileList * list = new FileList("~doc:/");
    int32 listSize = list->GetCount();
    for(int32 i = 0; i < listSize; ++i)
    {
        String fileName = list->GetFilename(i);
        if(!list->IsNavigationDirectory(i) && !list->IsDirectory(i) && fileName != "LastReplay.rep")
        {
            FileSystem::Instance()->CopyFile(list->GetPathname(i), dirName + fileName);
        }
    }

    list->Release();

    FilePath filePath = dirName + "LastReplay.rep";
    file = File::Create(filePath, File::CREATE | File::WRITE);

    Random::Instance()->Seed();
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例3: DeleteDirectory

bool FileSystem::DeleteDirectory(const String & path, bool isRecursive)
{
	FileList * fileList = new FileList(path);
	for(int i = 0; i < fileList->GetCount(); ++i)
	{
		if(fileList->IsDirectory(i))
		{
			if(!fileList->IsNavigationDirectory(i))
			{
				if(isRecursive)
				{
//					Logger::Debug("- try to delete directory: %s / %s", fileList->GetPathname(i).c_str(), fileList->GetFilename(i).c_str());
					bool success = DeleteDirectory(fileList->GetPathname(i), isRecursive);
//					Logger::Debug("- delete directory: %s / %s- %d", fileList->GetPathname(i).c_str(), fileList->GetFilename(i).c_str(), success ? (1): (0));
					if (!success)return false;
				}
			}
		}
		else 
		{
			bool success = DeleteFile(fileList->GetPathname(i));
//			Logger::Debug("- delete file: %s / %s- %d", fileList->GetPathname(i).c_str(), fileList->GetFilename(i).c_str(), success ? (1): (0));
			if(!success)return false;
		}
	}
	SafeRelease(fileList);
#ifdef __DAVAENGINE_WIN32__
	String sysPath = SystemPathForFrameworkPath(path);
	int32 chmodres = _chmod(sysPath.c_str(), _S_IWRITE); // change read-only file mode
	int32 res = _rmdir(sysPath.c_str());
	return (res == 0);
	/*int32 res = ::RemoveDirectoryA(path.c_str());
	if (res == 0)
	{
		Logger::Warning("Failed to delete directory: %s error: 0x%x", path.c_str(), GetLastError());
	}
	return (res != 0);*/
#elif defined(__DAVAENGINE_MACOS__) || defined(__DAVAENGINE_IPHONE__) || defined(__DAVAENGINE_ANDROID__)
	int32 res = rmdir(SystemPathForFrameworkPath(path).c_str());
	return (res == 0);
#endif //PLATFORMS
}
开发者ID:dima-belsky,项目名称:dava.framework,代码行数:42,代码来源:FileSystem.cpp

示例4: ParseSpriteDescriptors

void LightmapsPacker::ParseSpriteDescriptors()
{
	FileList * fileList = new FileList(outputDir);

	char8 buf[512];
	uint32 readSize; 

	int32 itemsCount = fileList->GetCount();
	for(int32 i = 0; i < itemsCount; ++i)
	{
		const FilePath & filePath = fileList->GetPathname(i);
		if(fileList->IsDirectory(i) || !filePath.IsEqualToExtension(".txt"))
		{
			continue;
		}

		LightmapAtlasingData data;

		data.meshInstanceName = filePath.GetBasename();
        
		File * file = File::Create(filePath, File::OPEN | File::READ);
		
		file->ReadLine(buf, sizeof(buf)); //textures count

		readSize = file->ReadLine(buf, sizeof(buf)); //texture name
		FilePath originalTextureName = outputDir + String(buf, readSize);
		data.textureName = originalTextureName;

		file->ReadLine(buf, sizeof(buf)); //image size

		file->ReadLine(buf, sizeof(buf)); //frames count

		file->ReadLine(buf, sizeof(buf)); //frame rect
		int32 x, y, dx, dy, unused0, unused1, unused2;
		sscanf(buf, "%d %d %d %d %d %d %d", &x, &y, &dx, &dy, &unused0, &unused1, &unused2);
		dx++;//cause TexturePacker::ReduceRectToOriginalSize removed one pixel by default
		dy++;

		Vector2 textureSize = GetTextureSize(originalTextureName);
		data.uvOffset = Vector2((float32)x/textureSize.x, (float32)y/textureSize.y);
		data.uvScale = Vector2((float32)dx/textureSize.x, (float32)dy/textureSize.y);
		
		file->Release();

		atlasingData.push_back(data);

		FileSystem::Instance()->DeleteFile(filePath);
	}

	fileList->Release();
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:51,代码来源:LightmapsPacker.cpp

示例5: RecursiveTreeWalk

void UIFileTree::RecursiveTreeWalk(const String & path, UITreeItemInfo * current)
{
	FileList * fileList = new FileList(path);
	
	// Find flags and setup them
	for (int fi = 0; fi < fileList->GetCount(); ++fi)
	{
		bool addElement = true;
		if (!fileList->IsDirectory(fi))
		{
			size_t extsSize = extensions.size();
			if (extsSize > 0)
			{
				addElement = false;
				String ext = FileSystem::GetExtension(fileList->GetFilename(fi));
				for (size_t ei = 0; ei < extsSize; ++ei)
					if (extensions[ei] == ext)
					{
						addElement = true;
						break;
					}
			}
		}
		if (!isFolderNavigationEnabled)
			if (fileList->IsNavigationDirectory(fi))
				addElement = false;

		if (fileList->GetFilename(fi) == ".")
			addElement = false;

		if (addElement)
		{
			UITreeItemInfo *child = new UITreeItemInfo(this);
			child->Set(current->GetLevel() + 1, fileList->GetFilename(fi), fileList->GetPathname(fi), fileList->IsDirectory(fi));
			current->AddChild(child);

//			if (fileList->IsDirectory(fi) )
//			{
//				if (!fileList->IsNavigationDirectory(fi))
//				{
//					RecursiveTreeWalk(path + String("/") + fileList->GetFilename(fi), child);
//				}
//			}
		}
	}
	SafeRelease(fileList);
}
开发者ID:dheerendra1,项目名称:dava.framework,代码行数:47,代码来源:UIFileTree.cpp

示例6: CreateDescriptors

void LightmapsPacker::CreateDescriptors()
{
	FileList * fileList = new FileList(outputDir);

	int32 itemsCount = fileList->GetCount();
	for(int32 i = 0; i < itemsCount; ++i)
	{
		const FilePath & filePath = fileList->GetPathname(i);
		if(fileList->IsDirectory(i) || !filePath.IsEqualToExtension(".png"))
		{
			continue;
		}

		TextureDescriptor descriptor;
        descriptor.Save(TextureDescriptor::GetDescriptorPathname(filePath));
	}

	fileList->Release();
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:19,代码来源:LightmapsPacker.cpp

示例7: CopyCompressionParamsForFolder

void TextureDescriptorUtils::CopyCompressionParamsForFolder(const FilePath &folderPathname)
{
	FileList * fileList = new FileList(folderPathname);

	for (int32 fi = 0; fi < fileList->GetCount(); ++fi)
	{
		const FilePath &pathname = fileList->GetPathname(fi);
		if(IsCorrectDirectory(fileList, fi))
		{
			CopyCompressionParamsForFolder(pathname);
		}
		else if(IsDescriptorPathname(pathname))
        {
            CopyCompressionParams(pathname);
        }
	}
    
	SafeRelease(fileList);
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:19,代码来源:TextureDescriptorUtils.cpp

示例8: SetCompressionParamsForFolder

void TextureDescriptorUtils::SetCompressionParamsForFolder( const FilePath &folderPathname, const DAVA::Map<DAVA::eGPUFamily, DAVA::TextureDescriptor::Compression> & compressionParams, bool convertionEnabled, bool force )
{
	FileList * fileList = new FileList(folderPathname);
	if(!fileList) return;

	for (int32 fi = 0; fi < fileList->GetCount(); ++fi)
	{
		const FilePath &pathname = fileList->GetPathname(fi);
		if(IsCorrectDirectory(fileList, fi))
		{
			SetCompressionParamsForFolder(pathname, compressionParams, convertionEnabled, force);
		}
		else if(IsDescriptorPathname(pathname))
		{
			SetCompressionParams(pathname, compressionParams, convertionEnabled, force);
		}
	}

	SafeRelease(fileList);
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:20,代码来源:TextureDescriptorUtils.cpp

示例9: CreateDescriptorsForFolder

void TextureDescriptorUtils::CreateDescriptorsForFolder(const FilePath &folderPathname)
{
	FileList * fileList = new FileList(folderPathname);
    if(!fileList) return;
    
	for (int32 fi = 0; fi < fileList->GetCount(); ++fi)
	{
		const FilePath &pathname = fileList->GetPathname(fi);
		if(IsCorrectDirectory(fileList, fi))
		{
			CreateDescriptorsForFolder(pathname);
		}
        else if(pathname.IsEqualToExtension(".png"))
        {
            CreateDescriptorIfNeed(pathname);
        }
	}
    
	SafeRelease(fileList);
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:20,代码来源:TextureDescriptorUtils.cpp


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