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


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

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


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

示例1: BuildModule

void BuildTool::BuildModule( const std::vector<FileToBuild>& buildFileList,
							 const std::vector<FileSystemUtils::Path>& includeDirList,
							 const std::vector<FileSystemUtils::Path>& libraryDirList,
							 const std::vector<FileSystemUtils::Path>& linkLibraryList,
							 const char* pCompileOptions,
							 const char* pLinkOptions,
							 const FileSystemUtils::Path& moduleName )
{
	// Initial version is very basic, simply compiles them.
	Path objectFileExtension = m_Compiler.GetObjectFileExtension();
	vector<Path> compileFileList;			// List of files we pass to the compiler
	compileFileList.reserve( buildFileList.size() );
	vector<Path> forcedCompileFileList;		// List of files which must be compiled even if object file exists
	vector<Path> nonForcedCompileFileList;	// List of files which can be linked if already compiled

	// Seperate into seperate file lists of force and non-forced,
	// so we can ensure we don't have the same file in both
	for( size_t i = 0; i < buildFileList.size(); ++i )
	{
		Path buildFile = buildFileList[i].filePath;
		if( buildFileList[i].forceCompile )
		{
			if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
			{
				forcedCompileFileList.push_back( buildFile );
			}
		}
		else
		{
			if( find( nonForcedCompileFileList.begin(), nonForcedCompileFileList.end(), buildFile ) == nonForcedCompileFileList.end() )
			{
				nonForcedCompileFileList.push_back( buildFile );
			}
		}
	}
	
	// Add all forced compile files to build list
	for( size_t i = 0; i < forcedCompileFileList.size(); ++i )
	{
		compileFileList.push_back(  forcedCompileFileList[i] );
	}

	// Add non forced files, but only if they don't exist in forced compile list
    Path runtimeFolder = m_Compiler.GetRuntimeIntermediatePath();
	for( size_t i = 0; i < nonForcedCompileFileList.size(); ++i )
	{
		Path buildFile = nonForcedCompileFileList[i];
		if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
		{
			// Check if we have a pre-compiled object version of this file, and if so use that.
			Path objectFileName = runtimeFolder/buildFile.Filename();
			objectFileName.ReplaceExtension(objectFileExtension.c_str());

			if( objectFileName.Exists() && buildFile.Exists() )
            {
                FileSystemUtils::filetime_t objTime = objectFileName.GetLastWriteTime();
                if( objTime > m_InitTime && objTime > buildFile.GetLastWriteTime() )
 			    {
                    // we only want to use the object file if it's newer than our start-up time so
                    // we know it's from the current session (so likely compiled with same settings),
                    // and it's newer than the source file
				    buildFile = objectFileName;
			    }
            }
			compileFileList.push_back(buildFile);
		}
	}

	m_Compiler.RunCompile( compileFileList, includeDirList, libraryDirList, linkLibraryList, pCompileOptions, pLinkOptions, moduleName );
}
开发者ID:OToL,项目名称:RuntimeCompiledCPlusPlus,代码行数:70,代码来源:BuildTool.cpp

示例2: BuildModule

void BuildTool::BuildModule( const std::vector<FileToBuild>&		buildFileList_, 
							 const CompilerOptions&					compilerOptions_,
							 std::vector<FileSystemUtils::Path>		linkLibraryList_,
							 const FileSystemUtils::Path&			moduleName_  )
{
	// Initial version is very basic, simply compiles them.
	Path objectFileExtension = m_Compiler.GetObjectFileExtension();
	vector<Path> compileFileList;			// List of files we pass to the compiler
	compileFileList.reserve( buildFileList_.size() );
	vector<Path> forcedCompileFileList;		// List of files which must be compiled even if object file exists
	vector<Path> nonForcedCompileFileList;	// List of files which can be linked if already compiled

	// Seperate into seperate file lists of force and non-forced,
	// so we can ensure we don't have the same file in both
	for( size_t i = 0; i < buildFileList_.size(); ++i )
	{
		Path buildFile = buildFileList_[i].filePath;
		if( buildFileList_[i].forceCompile )
		{
			if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
			{
				forcedCompileFileList.push_back( buildFile );
			}
		}
		else
		{
			if( find( nonForcedCompileFileList.begin(), nonForcedCompileFileList.end(), buildFile ) == nonForcedCompileFileList.end() )
			{
				nonForcedCompileFileList.push_back( buildFile );
			}
		}
	}
	
	// Add all forced compile files to build list
	for( size_t i = 0; i < forcedCompileFileList.size(); ++i )
	{
		compileFileList.push_back(  forcedCompileFileList[i] );
	}

	// runtime folder needs to be aware of compilation level and debug/

	// Add non forced files, but only if they don't exist in forced compile list
	for( size_t i = 0; i < nonForcedCompileFileList.size(); ++i )
	{
		Path buildFile = nonForcedCompileFileList[i];
		if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
		{
			// Check if we have a pre-compiled object version of this file, and if so use that.
			Path objectFileName = compilerOptions_.intermediatePath / buildFile.Filename();
			objectFileName.ReplaceExtension(objectFileExtension.c_str());

			if( objectFileName.Exists() && buildFile.Exists() )
            {
                FileSystemUtils::filetime_t objTime = objectFileName.GetLastWriteTime();
                if( objTime > buildFile.GetLastWriteTime() )
 			    {
                    // we only want to use the object file if it's newer than the source file
				    buildFile = objectFileName;
			    }
            }
			compileFileList.push_back(buildFile);
		}
	}

	m_Compiler.RunCompile( compileFileList, compilerOptions_, linkLibraryList_, moduleName_ );
}
开发者ID:AmesianX,项目名称:RuntimeCompiledCPlusPlus,代码行数:66,代码来源:BuildTool.cpp


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