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


C++ Platform::Extract_Directory方法代码示例

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


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

示例1: Check_File_Timestamp

bool ResourceCompiler::Check_File_Timestamp(std::string path)
{
	Platform* platform = Platform::Get();

	std::string input_directory	= platform->Extract_Directory(path);
	std::string input_filename	= platform->Extract_Filename(path);
	std::string output_directory= Directory_To_Output_Directory(input_directory);
	std::string output_path		= platform->Join_Path(output_directory, input_filename + ".timestamp");

	// If input file dosen't exist, we can't compile.
	if (!platform->Is_File(path.c_str()))
	{
		return false;
	}

	// If output file dosen't exist, we need to compile.
	if (!platform->Is_File(output_path.c_str()))
	{
		return true;
	}

	// Check timestamps.
	u64 input_timestamp  = StreamFactory::Get_Last_Modified(path.c_str());
	u64 output_timestamp = StreamFactory::Get_Last_Modified(output_path.c_str());

	return input_timestamp > output_timestamp;
}
开发者ID:HampsterEater,项目名称:VoxelEngine,代码行数:27,代码来源:ResourceCompiler.cpp

示例2:

AtlasResourceCompiler::AtlasResourceCompiler(const char* url)
	: m_config_file(NULL)
{
	Platform*	platform	= Platform::Get();

	m_input_path			= url;
	m_input_directory		= platform->Extract_Directory(url);
	m_input_filename		= platform->Extract_Filename(url);
	m_output_directory		= Directory_To_Output_Directory(m_input_directory);
	m_output_path			= platform->Join_Path(m_output_directory, m_input_filename);
}
开发者ID:HampsterEater,项目名称:VoxelEngine,代码行数:11,代码来源:AtlasResourceCompiler.cpp

示例3: Update_File_Timestamp

void ResourceCompiler::Update_File_Timestamp(std::string path)
{
	Platform* platform = Platform::Get();
	
	std::string input_directory	= platform->Extract_Directory(path);
	std::string input_filename	= platform->Extract_Filename(path);
	std::string output_directory= Directory_To_Output_Directory(input_directory);
	std::string output_path		= platform->Join_Path(output_directory, input_filename + ".timestamp");	
	u64			input_timestamp = StreamFactory::Get_Last_Modified(path.c_str());

	Stream* stream = StreamFactory::Open(output_path.c_str(), StreamMode::Write);
	if (stream == NULL)
	{
		return;
	}

	stream->WriteInt32(input_timestamp);
	stream->Close();

	SAFE_DELETE(stream);
}
开发者ID:HampsterEater,项目名称:VoxelEngine,代码行数:21,代码来源:ResourceCompiler.cpp


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