style: added platform-dependent type aliases for char and string

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
k4yt3x
2024-11-04 00:00:00 +00:00
parent 851f13bd4d
commit 1d1792d10f
10 changed files with 158 additions and 254 deletions

View File

@@ -75,7 +75,7 @@ std::filesystem::path find_resource_file(const std::filesystem::path &path) {
return get_executable_directory() / path;
}
std::string path_to_string(const std::filesystem::path &path) {
std::string path_to_u8string(const std::filesystem::path &path) {
#if _WIN32
std::wstring wide_path = path.wstring();
int buffer_size =
@@ -92,3 +92,19 @@ std::string path_to_string(const std::filesystem::path &path) {
return path.string();
#endif
}
StringType path_to_string_type(const std::filesystem::path &path) {
#if _WIN32
return path.wstring();
#else
return path.string();
#endif
}
StringType to_string_type(int value) {
#if _WIN32
return std::to_wstring(value);
#else
return std::to_string(value);
#endif
}