![]() |
Gorgon Game Engine
|
This namespace contains operating system related functionality. More...
Namespaces | |
User | |
Contains user related information and services. | |
Classes | |
struct | Info |
This structure represents the version of the operating system. More... | |
Functions | |
void | DisplayMessage (const std::string &message) |
This function shows a OS message box to display errors, for other messages its better to use in-game dialogs. More... | |
std::string | GetAppDataPath () |
Returns the directory where the system wide application data is stored. More... | |
std::string | GetAppSettingPath () |
Returns the directory where the system wide application settings is stored. More... | |
std::string | GetEnvVar (const std::string &var) |
Returns the value of an environment variable. More... | |
Info | GetInfo () |
Returns information related with the operating system, including version, name, and architecture. More... | |
std::string | GetName () |
Returns the name of the current operating system in human readable form. More... | |
void | Initialize () |
Initializes operating system module. More... | |
bool | Open (const std::string &file) |
Opens the given file with the related application. More... | |
void | OpenTerminal () |
Opens a terminal window to display output from the stdout. More... | |
void | processmessages () |
This method will notify the system should process any messages that coming from the operating system. More... | |
bool | Start (const std::string &name, const std::vector< std::string > &args=std::vector< std::string >()) |
Starts the given application. More... | |
bool | Start (const std::string &name, std::streambuf *&buf, const std::vector< std::string > &args) |
This variant of start enables reading output of the application, buf is returned, ownership lies with the caller of the function. More... | |
This namespace contains operating system related functionality.
All functions here behaves same way in all supported operating systems.
void DisplayMessage | ( | const std::string & | message | ) |
This function shows a OS message box to display errors, for other messages its better to use in-game dialogs.
std::string GetAppDataPath | ( | ) |
Returns the directory where the system wide application data is stored.
Most probably it will be read only
std::string GetAppSettingPath | ( | ) |
Returns the directory where the system wide application settings is stored.
Most probably it will be read only
std::string GetEnvVar | ( | const std::string & | var | ) |
Returns the value of an environment variable.
Info Gorgon::OS::GetInfo | ( | ) |
Returns information related with the operating system, including version, name, and architecture.
std::string GetName | ( | ) |
Returns the name of the current operating system in human readable form.
Might change from installation to installation.
References Gorgon::String::Extract(), and Gorgon::String::TrimStart().
void Initialize | ( | ) |
Initializes operating system module.
Initializes the filesystem module.
Gorgon system requires every module to have initialization function even if they are not used. Currently used for following tasks:
Set startup directory
There is a mechanism to ensure initialization is performed once.
bool Open | ( | const std::string & | file | ) |
Opens the given file with the related application.
This can also be a URI.
References GetEnvVar(), and Start().
void OpenTerminal | ( | ) |
Opens a terminal window to display output from the stdout.
This is not required for most operating systems and will not perform anything unless its necessary.
void processmessages | ( | ) |
This method will notify the system should process any messages that coming from the operating system.
Internally used. Should only be used when necessary.
References Window::Windows.
bool Start | ( | const std::string & | name, |
const std::vector< std::string > & | args = std::vector<std::string>() |
||
) |
Starts the given application.
This application is searched from the installed applications unless it includes a path. You may use ./appname
to start the appname from the current directory. The application is started in a separate process and the current process does not stop to wait its execution.
References Gorgon::Filesystem::GetFilename().
bool Gorgon::OS::Start | ( | const std::string & | name, |
std::streambuf *& | buf, | ||
const std::vector< std::string > & | args | ||
) |
This variant of start enables reading output of the application, buf is returned, ownership lies with the caller of the function.
References Gorgon::Filesystem::GetFilename().