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


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

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


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

示例1: GetDestFileName

String CTransformationThread::GetDestFileName(size_t index) const
{
	ASSERT(index < files_.size());
	PhotoInfo& photo= *files_[index];
	Path output;

	if (params_.use_src_path_ == TransformationParams::USE_SRC_PATH)
	{
		output = photo.GetOriginalPath();
		if (!params_.suffix_.empty())
			output.AppendToFileName(params_.suffix_.c_str());
		if (!params_.dest_file_extension_.empty())
			output.ReplaceExtension(params_.dest_file_extension_.c_str());
	}
	else if (params_.use_src_path_ == TransformationParams::USE_DEST_PATH)
	{
		output = params_.dest_path_;
		Path name= photo.GetOriginalPath().GetFileNameAndExt();
		if (!params_.suffix_.empty())
			name.AppendToFileName(params_.suffix_.c_str());
		if (!params_.dest_file_extension_.empty())
			name.ReplaceExtension(params_.dest_file_extension_.c_str());
		output.AppendDir(name.c_str(), false);
	}
	else
	{
		ASSERT(params_.use_src_path_ == TransformationParams::USE_GIVEN_FILENAME);
		output = params_.dest_file_;
	}

	ASSERT(!output.empty());

	return output;
}
开发者ID:mikekov,项目名称:ExifPro,代码行数:34,代码来源:TransformationThread.cpp

示例2: 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

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