![]() |
Gorgon Game Engine
|
Contains user related information and services. More...
Functions | |
std::string | GetDataPath () |
Returns the path where applications can save data related to this user. More... | |
std::string | GetDocumentsPath () |
Returns the path where documents of the user should be saved. More... | |
std::string | GetHomePath () |
Returns the home directory of the user. More... | |
std::string | GetName () |
Returns the name of the current user. More... | |
std::string | GetUsername () |
Returns the current username. More... | |
bool | IsAdmin () |
Check if the currently logged in user is an administrator. More... | |
Contains user related information and services.
std::string GetDataPath | ( | ) |
Returns the path where applications can save data related to this user.
This path could simply be user's home directory. Best practice would be creating a directory that starts with a "." such as .gorgon
References Gorgon::OS::GetEnvVar().
std::string GetDocumentsPath | ( | ) |
Returns the path where documents of the user should be saved.
References Gorgon::OS::GetEnvVar(), and Gorgon::Filesystem::IsDirectory().
std::string GetHomePath | ( | ) |
Returns the home directory of the user.
References Gorgon::OS::GetEnvVar().
std::string GetName | ( | ) |
Returns the name of the current user.
std::string GetUsername | ( | ) |
Returns the current username.
bool IsAdmin | ( | ) |
Check if the currently logged in user is an administrator.
If you are looking to perform an elevated operation, you best try to perform the operation without checking if the user is an admin first. It might be possible for a regular user to have extra permissions. Check this function afterwards before asking for elevation.