2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ListBase.h"
|
|
|
|
#include "StringBase.h"
|
|
|
|
#include "SpecialFolder.h"
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#undef GetCommandLine
|
|
|
|
#undef SetEnvironmentVariable
|
|
|
|
#undef GetEnvironmentVariable
|
|
|
|
#undef GetComputerName
|
|
|
|
#undef GetUserName
|
|
|
|
|
|
|
|
namespace System
|
|
|
|
{
|
|
|
|
class Environment
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Terminates the process with the given code
|
|
|
|
static void Exit(int32_t ExitCode);
|
|
|
|
|
|
|
|
// Gets the path to the specific system file folder
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetFolderPath(SpecialFolder Folder);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the application path
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetApplicationPath();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the application
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetApplication();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Rethrns the full command line string
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetCommandLine();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns a list of command line arguments
|
2022-05-21 21:51:35 +02:00
|
|
|
static List<String> GetCommandLineArgs();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the current users account name
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetUserName();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the current computer name
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetComputerName();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the total tick count since startup
|
|
|
|
static uint64_t GetTickCount();
|
|
|
|
|
|
|
|
// Sets an environment variable to the specified value
|
2022-05-21 21:51:35 +02:00
|
|
|
static void SetEnvironmentVariable(const String& Key, const String& Value);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Gets an environment variable from the specified key
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetEnvironmentVariable(const String& Key);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Expands environment variables in the given path
|
2022-05-21 21:51:35 +02:00
|
|
|
static String ExpandEnvironmentVariables(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// Returns whether or not we are a 64bit process
|
|
|
|
constexpr static bool Is64BitProcess();
|
|
|
|
|
|
|
|
// Returns a newline string for the environment
|
2022-05-21 21:51:35 +02:00
|
|
|
const static String NewLine;
|
2022-05-21 19:58:09 +02:00
|
|
|
};
|
|
|
|
}
|