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


C++ SourceFile::GetDependencies方法代码示例

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


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

示例1: temppath

void
Project::Save(const char *path)
{
	BString projectPath = fPath.GetFolder();
	projectPath << "/";
	
	BString data;
	data << "NAME=" << fName << "\nTARGETNAME=" << fTargetName << "\n";
	data << "PLATFORM=" << sPlatformArray[fPlatform] << "\n";
	
	switch (fSCMType)
	{
		case SCM_HG:
		{
			data << "SCM=hg\n";
			break;
		}
		case SCM_GIT:
		{
			data << "SCM=git\n";
			break;
		}
		case SCM_SVN:
		{
			data << "SCM=svn\n";
			break;
		}
		case SCM_NONE:
		{
			data << "SCM=none\n";
			break;
		}
		default:
		{
			break;
		}
	}
	
	for (int32 i = 0; i < CountGroups(); i++)
	{
		SourceGroup *group = GroupAt(i);
		data << "GROUP=" << group->name << "\n";
		data << "EXPANDGROUP=" << (group->expanded ? "yes" : "no") << "\n";
		
		for (int32 j = 0; j < group->filelist.CountItems(); j++)
		{
			SourceFile *file = group->filelist.ItemAt(j);
			
			BString temppath(file->GetPath().GetFullPath());
			if (temppath.FindFirst(projectPath.String()) == 0)
			{
				// Absolute paths which include the project folder are stripped
				// down into relative paths
				temppath.RemoveFirst(projectPath.String());
			}
			
			data << "SOURCEFILE=" << temppath << "\n";
			if (file->GetDependencies() && strlen(file->GetDependencies()) > 0)
				data << "DEPENDENCY=" << file->GetDependencies() << "\n";
		}
	}
	
	for (int32 i = 0; i < fLocalIncludeList.CountItems(); i++)
		data << "LOCALINCLUDE=" << fLocalIncludeList.ItemAt(i)->Relative() << "\n";
	
	for (int32 i = 0; i < fSystemIncludeList.CountItems(); i++)
	{
		BString *string = fSystemIncludeList.ItemAt(i);
		BString include = *string;
		if (include[0] == '/')
			include.RemoveFirst(projectPath.String());
		data << "SYSTEMINCLUDE=" << include << "\n";
	}
	
	for (int32 i = 0; i < fLibraryList.CountItems(); i++)
	{
		SourceFile *file = (SourceFile*)fLibraryList.ItemAt(i);
		if (!file)
			continue;
		
		BString strpath(file->GetPath().GetFullPath());
		if (gPlatform == PLATFORM_ZETA)
		{
			if (strpath.FindFirst("/boot/beos/etc/develop/zeta-r1-gcc2-x86/") == 0)
				strpath.ReplaceFirst("/boot/beos/etc/develop/zeta-r1-gcc2-x86/",
										"/boot/develop/");
		}
		
		if (strpath.FindFirst(projectPath.String()) == 0)
			strpath.RemoveFirst(projectPath.String());
		data << "LIBRARY=" << strpath.String() << "\n";
	}
	
	data << "RUNARGS=" << fRunArgs << "\n";
	data << "CCDEBUG=" << (fDebug ? "yes" : "no") << "\n";
	data << "CCPROFILE=" << (fProfile ? "yes" : "no") << "\n";
	data << "CCOPSIZE=" << (fOpSize ? "yes" : "no") << "\n";
	data << "CCOPLEVEL=" << (int)fOpLevel << "\n";
	data << "CCTARGETTYPE=" << fTargetType << "\n";
	data << "CCEXTRA=" << fExtraCompilerOptions << "\n";
//.........这里部分代码省略.........
开发者ID:passick,项目名称:Paladin,代码行数:101,代码来源:Project.cpp


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