Gorgon Game Engine
OS.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <string>
7 #include <vector>
8 
9 namespace Gorgon {
13  namespace OS {
14 
16  void Initialize();
17 
19  namespace User {
21  std::string GetUsername();
22 
24  std::string GetName();
25 
27  std::string GetDocumentsPath();
28 
30  std::string GetHomePath();
31 
35  std::string GetDataPath();
36 
37 
42  bool IsAdmin();
43  }
44 
47  void OpenTerminal();
48 
51  void DisplayMessage(const std::string &message);
52 
55  std::string GetAppDataPath();
56 
59  std::string GetAppSettingPath();
60 
62  std::string GetEnvVar(const std::string &var);
63 
66  std::string GetName();
67 
69  struct Info {
70  enum Type {
72  Linux
73  };
74 
77 
79  std::string name;
80 
82  int major;
83 
85  int minor;
86 
88  int revision;
89 
92 
95  int archbits;
96 
99  std::string arch;
100  };
101 
104 
113  bool Start(const std::string &name, const std::vector<std::string> &args=std::vector<std::string>());
114 
118  bool Open(const std::string &file);
119 
122  void processmessages();
123  }
124 }
Gorgon::OS::User::GetDocumentsPath
std::string GetDocumentsPath()
Returns the path where documents of the user should be saved.
Definition: Linux.cpp:41
Gorgon::OS::Info::arch
std::string arch
The name of the architecture, this number is independent of compiled platform of Gorgon Library.
Definition: OS.h:99
Gorgon::OS::Info::major
int major
Major version.
Definition: OS.h:82
Gorgon::OS::Info::revision
int revision
Revision.
Definition: OS.h:88
Gorgon::OS::GetName
std::string GetName()
Returns the name of the current operating system in human readable form.
Definition: Linux.cpp:65
Gorgon::OS::Open
bool Open(const std::string &file)
Opens the given file with the related application.
Definition: Linux.cpp:268
Gorgon::OS::GetEnvVar
std::string GetEnvVar(const std::string &var)
Returns the value of an environment variable.
Definition: Linux.cpp:17
Gorgon::OS::Start
bool Start(const std::string &name, const std::vector< std::string > &args=std::vector< std::string >())
Starts the given application.
Definition: Linux.cpp:116
Gorgon::OS::DisplayMessage
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 ...
Definition: Linux.cpp:104
Gorgon::OS::Info
This structure represents the version of the operating system.
Definition: OS.h:69
Gorgon::OS::GetAppDataPath
std::string GetAppDataPath()
Returns the directory where the system wide application data is stored.
Definition: Linux.cpp:108
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::OS::Info::Type
Type
Definition: OS.h:70
Gorgon::OS::User::GetUsername
std::string GetUsername()
Returns the current username.
Definition: Linux.cpp:27
Gorgon::OS::GetInfo
Info GetInfo()
Returns information related with the operating system, including version, name, and architecture.
Gorgon::OS::GetAppSettingPath
std::string GetAppSettingPath()
Returns the directory where the system wide application settings is stored.
Definition: Linux.cpp:112
Gorgon::OS::User::GetDataPath
std::string GetDataPath()
Returns the path where applications can save data related to this user.
Definition: Linux.cpp:53
Gorgon::OS::Info::Linux
@ Linux
Definition: OS.h:72
Gorgon::OS::User::GetHomePath
std::string GetHomePath()
Returns the home directory of the user.
Definition: Linux.cpp:49
Gorgon::OS::User::IsAdmin
bool IsAdmin()
Check if the currently logged in user is an administrator.
Definition: Linux.cpp:57
Gorgon::OS::Info::buildnumber
int buildnumber
Build number.
Definition: OS.h:91
Gorgon::OS::Info::name
std::string name
Name of the current operating system.
Definition: OS.h:79
Gorgon::OS::processmessages
void processmessages()
This method will notify the system should process any messages that coming from the operating system.
Definition: Linux.cpp:281
Gorgon::OS::Info::archbits
int archbits
Number of bits in the architecture, this number is independent of compiled platform of Gorgon Library...
Definition: OS.h:95
Gorgon::OS::Info::minor
int minor
Minor version.
Definition: OS.h:85
Gorgon::OS::Info::Windows
@ Windows
Definition: OS.h:71
Gorgon::OS::OpenTerminal
void OpenTerminal()
Opens a terminal window to display output from the stdout.
Definition: Linux.cpp:101
Gorgon::OS::Initialize
void Initialize()
Initializes operating system module.
Definition: Linux.cpp:62
Gorgon::OS::Info::type
Type type
Identifier for the current operating system.
Definition: OS.h:76
Gorgon::OS::User::GetName
std::string GetName()
Returns the name of the current user.
Definition: Linux.cpp:33