本文整理汇总了C++中Platform::Join_Path方法的典型用法代码示例。如果您正苦于以下问题:C++ Platform::Join_Path方法的具体用法?C++ Platform::Join_Path怎么用?C++ Platform::Join_Path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Platform
的用法示例。
在下文中一共展示了Platform::Join_Path方法的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;
}
示例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);
}
示例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);
}