OpenRCT2/src/openrct2/platform/Platform2.h

57 lines
1.7 KiB
C
Raw Normal View History

2017-04-01 14:38:52 +02:00
/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
2017-04-01 14:38:52 +02:00
#pragma once
2018-06-22 23:04:38 +02:00
#include "../common.h"
#include <ctime>
#include <string>
2017-04-01 14:38:52 +02:00
enum class SPECIAL_FOLDER
{
USER_CACHE,
USER_CONFIG,
USER_DATA,
USER_HOME,
RCT2_DISCORD,
};
2017-04-01 14:38:52 +02:00
namespace Platform
{
uint32_t GetTicks();
2018-06-22 23:04:38 +02:00
std::string GetEnvironmentVariable(const std::string& name);
std::string GetFolderPath(SPECIAL_FOLDER folder);
std::string GetInstallPath();
2018-01-21 03:13:32 +01:00
std::string GetDocsPath();
2017-12-02 00:48:46 +01:00
std::string GetCurrentExecutablePath();
2017-12-01 01:54:03 +01:00
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__)
2018-06-22 23:04:38 +02:00
std::string GetEnvironmentPath(const char* name);
2017-12-01 01:54:03 +01:00
std::string GetHomePath();
#endif
std::string FormatShortDate(std::time_t timestamp);
std::string FormatTime(std::time_t timestamp);
2018-03-12 19:00:35 +01:00
2018-05-23 20:42:42 +02:00
#ifdef _WIN32
bool IsOSVersionAtLeast(uint32_t major, uint32_t minor, uint32_t build);
void SetUpFileAssociations();
bool SetUpFileAssociation(
const std::string extension, const std::string fileTypeText, const std::string commandText,
const std::string commandArgs, const uint32_t iconIndex);
2018-05-23 20:42:42 +02:00
#endif
bool IsRunningInWine();
2018-03-12 19:00:35 +01:00
bool IsColourTerminalSupported();
bool HandleSpecialCommandLineArgument(const char* argument);
uintptr_t StrDecompToPrecomp(utf8* input);
2018-05-04 22:40:09 +02:00
} // namespace Platform