mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
HostInterface: Add a helper function for generating timestamp-based filenames
This commit is contained in:
parent
c7a74cabaa
commit
198a64eb5e
|
@ -696,6 +696,15 @@ std::string HostInterface::GetUserDirectoryRelativePath(const char* format, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TinyString HostInterface::GetTimestampStringForFileName()
|
||||||
|
{
|
||||||
|
const Timestamp ts(Timestamp::Now());
|
||||||
|
|
||||||
|
TinyString str;
|
||||||
|
ts.ToString(str, "%Y-%m-%d_%H-%M-%S");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
std::string HostInterface::GetSettingsFileName() const
|
std::string HostInterface::GetSettingsFileName() const
|
||||||
{
|
{
|
||||||
return GetUserDirectoryRelativePath("settings.ini");
|
return GetUserDirectoryRelativePath("settings.ini");
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "common/string.h"
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
@ -86,6 +87,9 @@ public:
|
||||||
/// Returns a path relative to the user directory.
|
/// Returns a path relative to the user directory.
|
||||||
std::string GetUserDirectoryRelativePath(const char* format, ...) const;
|
std::string GetUserDirectoryRelativePath(const char* format, ...) const;
|
||||||
|
|
||||||
|
/// Returns a string which can be used as part of a filename, based on the current date/time.
|
||||||
|
static TinyString GetTimestampStringForFileName();
|
||||||
|
|
||||||
/// Displays a loading screen with the logo, rendered with ImGui. Use when executing possibly-time-consuming tasks
|
/// Displays a loading screen with the logo, rendered with ImGui. Use when executing possibly-time-consuming tasks
|
||||||
/// such as compiling shaders when starting up.
|
/// such as compiling shaders when starting up.
|
||||||
void DisplayLoadingScreen(const char* message, int progress_min = -1, int progress_max = -1, int progress_value = -1);
|
void DisplayLoadingScreen(const char* message, int progress_min = -1, int progress_max = -1, int progress_value = -1);
|
||||||
|
|
Loading…
Reference in a new issue