diff --git a/docs/d0/dd7/_version_8h_source.html b/docs/d0/dd7/_version_8h_source.html index e1f053d..0690826 100644 --- a/docs/d0/dd7/_version_8h_source.html +++ b/docs/d0/dd7/_version_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Version.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
21 
22 #pragma once
23 
24 //MUtils
25 #include <MUtils/Global.h>
26 
27 //Qt
28 #include <QString>
29 #include <QDate>
30 #include <QTime>
31 
32 namespace MUtils
33 {
34  class Version
35  {
36  public:
37  //Get Library Version Numbers
38  MUTILS_API static const quint32 &lib_version_major(void);
39  MUTILS_API static const quint32 &lib_version_minor(void);
40 
41  //Get Library Build Date/Time
42  MUTILS_API static const QDate lib_build_date(void);
43  MUTILS_API static const QTime lib_build_time(void);
44 
45  //Get Application Build Date/Time
46  MUTILS_API static const QDate app_build_date(const char *const date_str = build_date_raw());
47  MUTILS_API static const QTime app_build_time(const char *const time_str = build_time_raw());
48 
49  //Compiler detection
50  static const char *const compiler_version(void)
51  {
52  static const char *const COMPILER_VERS =
53  #if defined(__INTEL_COMPILER)
54  #if (__INTEL_COMPILER >= 1500)
55  "ICL 15." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
56  #elif (__INTEL_COMPILER >= 1400)
57  "ICL 14." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
58  #elif (__INTEL_COMPILER >= 1300)
59  "ICL 13." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
60  #elif (__INTEL_COMPILER >= 1200)
61  "ICL 12." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
62  #elif (__INTEL_COMPILER >= 1100)
63  "ICL 11.x";
64  #elif (__INTEL_COMPILER >= 1000)
65  "ICL 10.x";
66  #else
67  #error Compiler is not supported!
68  #endif
69  #elif defined(_MSC_VER)
70  #if (_MSC_VER == 1920)
71  #if((_MSC_FULL_VER >= 192027508) && (_MSC_FULL_VER <= 192027508))
72  "MSVC 2019.0";
73  #else
74  #error Compiler version is not supported yet!
75  #endif
76  #elif (_MSC_VER == 1916)
77  #if((_MSC_FULL_VER >= 191627024) && (_MSC_FULL_VER <= 191627031))
78  "MSVC 2017.9";
79  #else
80  #error Compiler version is not supported yet!
81  #endif
82  #elif (_MSC_VER == 1915)
83  #if((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732))
84  "MSVC 2017.8";
85  #else
86  #error Compiler version is not supported yet!
87  #endif
88  #elif (_MSC_VER == 1914)
89  #if((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433))
90  "MSVC 2017.7";
91  #else
92  #error Compiler version is not supported yet!
93  #endif
94  #elif (_MSC_VER == 1913)
95  #if((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132))
96  "MSVC 2017.6";
97  #else
98  #error Compiler version is not supported yet!
99  #endif
100  #elif (_MSC_VER == 1912)
101  #if((_MSC_FULL_VER >= 191225830) && (_MSC_FULL_VER <= 191225835))
102  "MSVC 2017.5";
103  #else
104  #error Compiler version is not supported yet!
105  #endif
106  #elif (_MSC_VER == 1911)
107  #if((_MSC_FULL_VER >= 191125542) && (_MSC_FULL_VER <= 191125547))
108  "MSVC 2017.4";
109  #elif((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508))
110  "MSVC 2017.3";
111  #else
112  #error Compiler version is not supported yet!
113  #endif
114  #elif (_MSC_VER == 1910)
115  #if ((_MSC_FULL_VER >= 191025017) && (_MSC_FULL_VER <= 191025019))
116  "MSVC 2017.2";
117  #else
118  #error Compiler version is not supported yet!
119  #endif
120  #elif (_MSC_VER == 1900)
121  #if (_MSC_FULL_VER == 190023026)
122  "MSVC 2015";
123  #elif (_MSC_FULL_VER == 190023506)
124  "MSVC 2015.1";
125  #elif (_MSC_FULL_VER == 190023918)
126  "MSVC 2015.2";
127  #elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215)
128  "MSVC 2015.3";
129  #else
130  #error Compiler version is not supported yet!
131  #endif
132  #elif (_MSC_VER == 1800)
133  #if (_MSC_FULL_VER == 180021005)
134  "MSVC 2013";
135  #elif (_MSC_FULL_VER == 180030501)
136  "MSVC 2013.2";
137  #elif (_MSC_FULL_VER == 180030723)
138  "MSVC 2013.3";
139  #elif (_MSC_FULL_VER == 180031101)
140  "MSVC 2013.4";
141  #elif (_MSC_FULL_VER == 180040629)
142  "MSVC 2013.5";
143  #else
144  #error Compiler version is not supported yet!
145  #endif
146  #elif (_MSC_VER == 1700)
147  #if (_MSC_FULL_VER == 170050727)
148  "MSVC 2012";
149  #elif (_MSC_FULL_VER == 170051106)
150  "MSVC 2012.1";
151  #elif (_MSC_FULL_VER == 170060315)
152  "MSVC 2012.2";
153  #elif (_MSC_FULL_VER == 170060610)
154  "MSVC 2012.3";
155  #elif (_MSC_FULL_VER == 170061030)
156  "MSVC 2012.4";
157  #else
158  #error Compiler version is not supported yet!
159  #endif
160  #elif (_MSC_VER == 1600)
161  #if (_MSC_FULL_VER >= 160040219)
162  "MSVC 2010-SP1";
163  #else
164  "MSVC 2010";
165  #endif
166  #else
167  #error Compiler is not supported!
168  #endif
169  #else
170  #error Compiler is not supported!
171  #endif
172  return COMPILER_VERS;
173  }
174 
175  //Architecture detection
176  static const char *const compiler_arch(void)
177  {
178  static const char *const COMPILER_ARCH =
179  #if defined(_M_X64)
180  "x64";
181  #elif defined(_M_IX86)
182  "x86";
183  #else
184  #error Architecture is not supported!
185  #endif
186  return COMPILER_ARCH;
187  }
188 
189  private:
190  //Raw Build date
191  static const char *const build_date_raw(void)
192  {
193  static const char *const RAW_BUILD_DATE = __DATE__;
194  return RAW_BUILD_DATE;
195  }
196 
197  //Raw Build time
198  static const char *const build_time_raw(void)
199  {
200  static const char *const RAW_BUILD_TIME = __TIME__;
201  return RAW_BUILD_TIME;
202  }
203 
204  //Disable construction
205  Version(void) { throw 666; }
206  Version(const Version&) { throw 666; }
207  };
208 }
209 
Definition: Version.h:34
+
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
21 
22 #pragma once
23 
24 //MUtils
25 #include <MUtils/Global.h>
26 
27 //Qt
28 #include <QString>
29 #include <QDate>
30 #include <QTime>
31 
32 namespace MUtils
33 {
34  class Version
35  {
36  public:
37  //Get Library Version Numbers
38  MUTILS_API static const quint32 &lib_version_major(void);
39  MUTILS_API static const quint32 &lib_version_minor(void);
40 
41  //Get Library Build Date/Time
42  MUTILS_API static const QDate lib_build_date(void);
43  MUTILS_API static const QTime lib_build_time(void);
44 
45  //Get Application Build Date/Time
46  MUTILS_API static const QDate app_build_date(const char *const date_str = build_date_raw());
47  MUTILS_API static const QTime app_build_time(const char *const time_str = build_time_raw());
48 
49  //Compiler detection
50  static const char *const compiler_version(void)
51  {
52  static const char *const COMPILER_VERS =
53  #if defined(__INTEL_COMPILER)
54  #if (__INTEL_COMPILER >= 1500)
55  "ICL 15." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
56  #elif (__INTEL_COMPILER >= 1400)
57  "ICL 14." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
58  #elif (__INTEL_COMPILER >= 1300)
59  "ICL 13." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
60  #elif (__INTEL_COMPILER >= 1200)
61  "ICL 12." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
62  #elif (__INTEL_COMPILER >= 1100)
63  "ICL 11.x";
64  #elif (__INTEL_COMPILER >= 1000)
65  "ICL 10.x";
66  #else
67  #error Compiler is not supported!
68  #endif
69  #elif defined(_MSC_VER)
70  #if (_MSC_VER == 1922)
71  #if((_MSC_FULL_VER >= 192227905) && (_MSC_FULL_VER <= 192227905))
72  "MSVC 2019.2";
73  #else
74  #error Compiler version is not supported yet!
75  #endif
76  #elif (_MSC_VER == 1921)
77  #if((_MSC_FULL_VER >= 192127702) && (_MSC_FULL_VER <= 192127702))
78  "MSVC 2019.1";
79  #else
80  #error Compiler version is not supported yet!
81  #endif
82  #elif (_MSC_VER == 1920)
83  #if((_MSC_FULL_VER >= 192027508) && (_MSC_FULL_VER <= 192027508))
84  "MSVC 2019.0";
85  #else
86  #error Compiler version is not supported yet!
87  #endif
88  #elif (_MSC_VER == 1916)
89  #if((_MSC_FULL_VER >= 191627024) && (_MSC_FULL_VER <= 191627032))
90  "MSVC 2017.9";
91  #else
92  #error Compiler version is not supported yet!
93  #endif
94  #elif (_MSC_VER == 1915)
95  #if((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732))
96  "MSVC 2017.8";
97  #else
98  #error Compiler version is not supported yet!
99  #endif
100  #elif (_MSC_VER == 1914)
101  #if((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433))
102  "MSVC 2017.7";
103  #else
104  #error Compiler version is not supported yet!
105  #endif
106  #elif (_MSC_VER == 1913)
107  #if((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132))
108  "MSVC 2017.6";
109  #else
110  #error Compiler version is not supported yet!
111  #endif
112  #elif (_MSC_VER == 1912)
113  #if((_MSC_FULL_VER >= 191225830) && (_MSC_FULL_VER <= 191225835))
114  "MSVC 2017.5";
115  #else
116  #error Compiler version is not supported yet!
117  #endif
118  #elif (_MSC_VER == 1911)
119  #if((_MSC_FULL_VER >= 191125542) && (_MSC_FULL_VER <= 191125547))
120  "MSVC 2017.4";
121  #elif((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508))
122  "MSVC 2017.3";
123  #else
124  #error Compiler version is not supported yet!
125  #endif
126  #elif (_MSC_VER == 1910)
127  #if ((_MSC_FULL_VER >= 191025017) && (_MSC_FULL_VER <= 191025019))
128  "MSVC 2017.2";
129  #else
130  #error Compiler version is not supported yet!
131  #endif
132  #elif (_MSC_VER == 1900)
133  #if (_MSC_FULL_VER == 190023026)
134  "MSVC 2015";
135  #elif (_MSC_FULL_VER == 190023506)
136  "MSVC 2015.1";
137  #elif (_MSC_FULL_VER == 190023918)
138  "MSVC 2015.2";
139  #elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215)
140  "MSVC 2015.3";
141  #else
142  #error Compiler version is not supported yet!
143  #endif
144  #elif (_MSC_VER == 1800)
145  #if (_MSC_FULL_VER == 180021005)
146  "MSVC 2013";
147  #elif (_MSC_FULL_VER == 180030501)
148  "MSVC 2013.2";
149  #elif (_MSC_FULL_VER == 180030723)
150  "MSVC 2013.3";
151  #elif (_MSC_FULL_VER == 180031101)
152  "MSVC 2013.4";
153  #elif (_MSC_FULL_VER == 180040629)
154  "MSVC 2013.5";
155  #else
156  #error Compiler version is not supported yet!
157  #endif
158  #elif (_MSC_VER == 1700)
159  #if (_MSC_FULL_VER == 170050727)
160  "MSVC 2012";
161  #elif (_MSC_FULL_VER == 170051106)
162  "MSVC 2012.1";
163  #elif (_MSC_FULL_VER == 170060315)
164  "MSVC 2012.2";
165  #elif (_MSC_FULL_VER == 170060610)
166  "MSVC 2012.3";
167  #elif (_MSC_FULL_VER == 170061030)
168  "MSVC 2012.4";
169  #else
170  #error Compiler version is not supported yet!
171  #endif
172  #elif (_MSC_VER == 1600)
173  #if (_MSC_FULL_VER >= 160040219)
174  "MSVC 2010-SP1";
175  #else
176  "MSVC 2010";
177  #endif
178  #else
179  #error Compiler is not supported!
180  #endif
181  #else
182  #error Compiler is not supported!
183  #endif
184  return COMPILER_VERS;
185  }
186 
187  //Architecture detection
188  static const char *const compiler_arch(void)
189  {
190  static const char *const COMPILER_ARCH =
191  #if defined(_M_X64)
192  "x64";
193  #elif defined(_M_IX86)
194  "x86";
195  #else
196  #error Architecture is not supported!
197  #endif
198  return COMPILER_ARCH;
199  }
200 
201  private:
202  //Raw Build date
203  static const char *const build_date_raw(void)
204  {
205  static const char *const RAW_BUILD_DATE = __DATE__;
206  return RAW_BUILD_DATE;
207  }
208 
209  //Raw Build time
210  static const char *const build_time_raw(void)
211  {
212  static const char *const RAW_BUILD_TIME = __TIME__;
213  return RAW_BUILD_TIME;
214  }
215 
216  //Disable construction
217  Version(void) { throw 666; }
218  Version(const Version&) { throw 666; }
219  };
220 }
221 
Definition: Version.h:34
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d2/df4/namespace_m_utils_1_1_o_s.html b/docs/d2/df4/namespace_m_utils_1_1_o_s.html index 8977550..90836ed 100644 --- a/docs/d2/df4/namespace_m_utils_1_1_o_s.html +++ b/docs/d2/df4/namespace_m_utils_1_1_o_s.html @@ -93,6 +93,11 @@ typedef bool(* progress_ca + + + + + @@ -401,6 +409,28 @@ MUTILS_API void 

Enumerations

enum  os_arch_t { ARCH_X86 = 1, +ARCH_X64 = 2 + }
 This enumeration specifies possible operating system architectures. More...
 
enum  known_folder_t {
  FOLDER_PROFILE_USER = 1, FOLDER_PROFILE_PUBL = 2, @@ -173,6 +178,9 @@ MUTILS_API const char * 
os
MUTILS_API const bool & running_on_wine (void)
 
+MUTILS_API const os_arch_tos_architecture (void)
 
MUTILS_API const QString & known_folder (const known_folder_t folder_id)
 
fatal_exit
+
+ + +

§ os_arch_t

+ +
+
+ + + + +
enum MUtils::OS::os_arch_t
+
+ +

This enumeration specifies possible operating system architectures.

+ + + +
Enumerator
ARCH_X86 

Intel x86 or compatible [32-bit].

+
ARCH_X64 

x86-64, aka AMD64, aka Intel 64 [64-bit]

+
+

Function Documentation

diff --git a/docs/d3/dc1/_o_s_support_8h.html b/docs/d3/dc1/_o_s_support_8h.html index 8483f93..b337e9e 100644 --- a/docs/d3/dc1/_o_s_support_8h.html +++ b/docs/d3/dc1/_o_s_support_8h.html @@ -123,6 +123,11 @@ Enumerations } This enumeration specifies the type of the underlaying operating system. More...
  +enum  MUtils::OS::os_arch_t { MUtils::OS::ARCH_X86 = 1, +MUtils::OS::ARCH_X64 = 2 + } This enumeration specifies possible operating system architectures. More...
+ +  enum  MUtils::OS::known_folder_t {
  MUtils::OS::FOLDER_PROFILE_USER = 1, MUtils::OS::FOLDER_PROFILE_PUBL = 2, @@ -203,6 +208,9 @@ MUTILS_API const char * MU MUTILS_API const bool & MUtils::OS::running_on_wine (void)   + +MUTILS_API const os_arch_t & MUtils::OS::os_architecture (void) +  MUTILS_API const QString & MUtils::OS::known_folder (const known_folder_t folder_id)   diff --git a/docs/d3/dc1/_o_s_support_8h_source.html b/docs/d3/dc1/_o_s_support_8h_source.html index aae2084..8dd8756 100644 --- a/docs/d3/dc1/_o_s_support_8h_source.html +++ b/docs/d3/dc1/_o_s_support_8h_source.html @@ -67,63 +67,66 @@ $(function() {
OSSupport.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
21 
27 #pragma once
28 
29 //MUtils
30 #include <MUtils/Global.h>
31 
32 //Qt
33 #include <QString>
34 #include <QMap>
35 #include <QDate>
36 #include <QWidget>
37 
38 //Forward declaration
39 class QFile;
40 
42 
46 namespace MUtils
47 {
51  namespace OS
52  {
56  namespace Version
57  {
61  typedef enum
62  {
63  OS_UNKNOWN = 0,
65  }
66  os_type_t;
67 
71  typedef struct _os_version_t
72  {
73  unsigned int type;
74  unsigned int versionMajor;
75  unsigned int versionMinor;
76  unsigned int versionBuild;
77  unsigned int versionSPack;
78  bool overrideFlag;
79 
80  MUTILS_API bool operator== (const _os_version_t &rhs) const;
81  MUTILS_API bool operator!= (const _os_version_t &rhs) const;
82  MUTILS_API bool operator> (const _os_version_t &rhs) const;
83  MUTILS_API bool operator>= (const _os_version_t &rhs) const;
84  MUTILS_API bool operator< (const _os_version_t &rhs) const;
85  MUTILS_API bool operator<= (const _os_version_t &rhs) const;
86  }
88 
89  //Known Windows NT versions
90  MUTILS_API extern const os_version_t WINDOWS_WIN2K;
91  MUTILS_API extern const os_version_t WINDOWS_WINXP;
92  MUTILS_API extern const os_version_t WINDOWS_XPX64;
93  MUTILS_API extern const os_version_t WINDOWS_VISTA;
94  MUTILS_API extern const os_version_t WINDOWS_WIN70;
95  MUTILS_API extern const os_version_t WINDOWS_WIN80;
96  MUTILS_API extern const os_version_t WINDOWS_WIN81;
97  MUTILS_API extern const os_version_t WINDOWS_WN100;
98 
99  //Unknown OS
100  MUTILS_API extern const os_version_t UNKNOWN_OPSYS;
101  }
102 
106  typedef enum
107  {
128  }
130 
134  typedef enum
135  {
139  }
141 
145  typedef enum
146  {
153  }
154  drive_type_t;
155 
156  //System message
157  MUTILS_API void system_message_nfo(const wchar_t *const title, const wchar_t *const text);
158  MUTILS_API void system_message_wrn(const wchar_t *const title, const wchar_t *const text);
159  MUTILS_API void system_message_err(const wchar_t *const title, const wchar_t *const text);
160 
161  //CLI Arguments
162  typedef QMap<QString,QString> ArgumentMap;
163  MUTILS_API const QStringList crack_command_line(const QString &command_line = QString());
164  MUTILS_API const ArgumentMap &arguments(void);
165 
166  //Copy file
167  typedef bool (*progress_callback_t)(const double &progress, void *const userData);
168  MUTILS_API bool copy_file(const QString &sourcePath, const QString &outputPath, const bool &overwrite = true, const progress_callback_t callback = NULL, void *const userData = NULL);
169 
170  //Get file version
171  MUTILS_API bool get_file_version(const QString fileName, quint16 *const major = NULL, quint16 *const minor = NULL, quint16 *const patch = NULL, quint16 *const build = NULL);
172 
173  //Get the OS version
174  MUTILS_API const Version::os_version_t &os_version(void);
175  MUTILS_API const char *os_friendly_name(const MUtils::OS::Version::os_version_t &os_version);
176  MUTILS_API const bool &running_on_wine(void);
177 
178  //Get known Folder
179  MUTILS_API const QString &known_folder(const known_folder_t folder_id);
180 
181  //Current Date & Time
182  MUTILS_API QDate current_date(void);
183  MUTILS_API quint64 current_file_time(void);
184 
185  //Check for process elevation
186  MUTILS_API bool is_elevated(bool *bIsUacEnabled = NULL);
187  MUTILS_API bool user_is_admin(void);
188 
196  MUTILS_API int network_status(void);
197 
198  //Message handler
199  MUTILS_API bool handle_os_message(const void *const message, long *result);
200 
210  MUTILS_API void sleep_ms(const size_t &duration);
211 
212  //Is executable/library file?
213  MUTILS_API bool is_executable_file(const QString &path);
214  MUTILS_API bool is_library_file(const QString &path);
215 
216  //Shutdown & Hibernation
217  MUTILS_API bool is_hibernation_supported(void);
218  MUTILS_API bool shutdown_computer(const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate);
219 
220  //Free diskspace
221  MUTILS_API bool free_diskspace(const QString &path, quint64 &freeSpace);
222 
234  MUTILS_API drive_type_t get_drive_type(const QString &path, bool *fast_seeking = NULL);
235 
236  //Shell open
237  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const bool explore = false);
238  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const QString &parameters, const QString &directory, const bool explore = false);
239 
240  //Open media file
241  MUTILS_API bool open_media_file(const QString &mediaFilePath);
242 
243  //Process priority
244  MUTILS_API bool change_process_priority(const int priority);
245  MUTILS_API bool change_process_priority(const QProcess *proc, const int priority);
246 
247  //Process ID
248  MUTILS_API quint32 process_id(void);
249  MUTILS_API quint32 process_id(const QProcess *const proc);
250 
251  //Thread ID
252  MUTILS_API quint32 thread_id(void);
253  MUTILS_API quint32 thread_id(const QProcess *const proc);
254 
255  //Suspend or resume processv
256  MUTILS_API bool suspend_process(const QProcess *proc, const bool suspend);
257 
258  //System timer resolution
259  MUTILS_API bool setup_timer_resolution(const quint32 &interval = 1);
260  MUTILS_API bool reset_timer_resolution(const quint32 &interval = 1);
261 
262  //Set file time
263  MUTILS_API bool set_file_time(const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
264  MUTILS_API bool set_file_time(const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
265 
266  //Keyboard support
267  MUTILS_API bool check_key_state_esc(void);
268 
269  //Shell notification
270  MUTILS_API void shell_change_notification(void);
271 
272  //Get file path from descriptor
273  MUTILS_API QString get_file_path(const int &fd);
274 
275  //WOW64 redirection
276  MUTILS_API bool wow64fsredir_disable(uintptr_t &oldValue);
277  MUTILS_API bool wow64fsredir_revert (const uintptr_t oldValue);
278 
279  //Environment variables
280  MUTILS_API QString get_envvar(const QString &name);
281  MUTILS_API bool set_envvar(const QString &name, const QString &value);
282 
283  //NULL device
284  MUTILS_API const QLatin1String &null_device(void);
285 
286  //Check if debugger is present
287  MUTILS_API void check_debugger(void);
288 
289  //Error handling
290  MUTILS_API void fatal_exit(const wchar_t* const errorMessage);
291  }
292 }
293 
The "all users" Documents directory.
Definition: OSSupport.h:113
+Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
21 
27 #pragma once
28 
29 //MUtils
30 #include <MUtils/Global.h>
31 
32 //Qt
33 #include <QString>
34 #include <QMap>
35 #include <QDate>
36 #include <QWidget>
37 
38 //Forward declaration
39 class QFile;
40 
42 
46 namespace MUtils
47 {
51  namespace OS
52  {
56  namespace Version
57  {
61  typedef enum
62  {
63  OS_UNKNOWN = 0,
65  }
66  os_type_t;
67 
71  typedef struct _os_version_t
72  {
73  unsigned int type;
74  unsigned int versionMajor;
75  unsigned int versionMinor;
76  unsigned int versionBuild;
77  unsigned int versionSPack;
78  bool overrideFlag;
79 
80  MUTILS_API bool operator== (const _os_version_t &rhs) const;
81  MUTILS_API bool operator!= (const _os_version_t &rhs) const;
82  MUTILS_API bool operator> (const _os_version_t &rhs) const;
83  MUTILS_API bool operator>= (const _os_version_t &rhs) const;
84  MUTILS_API bool operator< (const _os_version_t &rhs) const;
85  MUTILS_API bool operator<= (const _os_version_t &rhs) const;
86  }
88 
89  //Known Windows NT versions
90  MUTILS_API extern const os_version_t WINDOWS_WIN2K;
91  MUTILS_API extern const os_version_t WINDOWS_WINXP;
92  MUTILS_API extern const os_version_t WINDOWS_XPX64;
93  MUTILS_API extern const os_version_t WINDOWS_VISTA;
94  MUTILS_API extern const os_version_t WINDOWS_WIN70;
95  MUTILS_API extern const os_version_t WINDOWS_WIN80;
96  MUTILS_API extern const os_version_t WINDOWS_WIN81;
97  MUTILS_API extern const os_version_t WINDOWS_WN100;
98 
99  //Unknown OS
100  MUTILS_API extern const os_version_t UNKNOWN_OPSYS;
101  }
102 
106  typedef enum
107  {
108  ARCH_X86 = 1,
109  ARCH_X64 = 2
110  }
111  os_arch_t;
112 
116  typedef enum
117  {
138  }
140 
144  typedef enum
145  {
149  }
151 
155  typedef enum
156  {
163  }
164  drive_type_t;
165 
166  //System message
167  MUTILS_API void system_message_nfo(const wchar_t *const title, const wchar_t *const text);
168  MUTILS_API void system_message_wrn(const wchar_t *const title, const wchar_t *const text);
169  MUTILS_API void system_message_err(const wchar_t *const title, const wchar_t *const text);
170 
171  //CLI Arguments
172  typedef QMap<QString,QString> ArgumentMap;
173  MUTILS_API const QStringList crack_command_line(const QString &command_line = QString());
174  MUTILS_API const ArgumentMap &arguments(void);
175 
176  //Copy file
177  typedef bool (*progress_callback_t)(const double &progress, void *const userData);
178  MUTILS_API bool copy_file(const QString &sourcePath, const QString &outputPath, const bool &overwrite = true, const progress_callback_t callback = NULL, void *const userData = NULL);
179 
180  //Get file version
181  MUTILS_API bool get_file_version(const QString fileName, quint16 *const major = NULL, quint16 *const minor = NULL, quint16 *const patch = NULL, quint16 *const build = NULL);
182 
183  //Get the OS version
184  MUTILS_API const Version::os_version_t &os_version(void);
185  MUTILS_API const char *os_friendly_name(const MUtils::OS::Version::os_version_t &os_version);
186  MUTILS_API const bool &running_on_wine(void);
187  MUTILS_API const os_arch_t &os_architecture(void);
188 
189  //Get known Folder
190  MUTILS_API const QString &known_folder(const known_folder_t folder_id);
191 
192  //Current Date & Time
193  MUTILS_API QDate current_date(void);
194  MUTILS_API quint64 current_file_time(void);
195 
196  //Check for process elevation
197  MUTILS_API bool is_elevated(bool *bIsUacEnabled = NULL);
198  MUTILS_API bool user_is_admin(void);
199 
207  MUTILS_API int network_status(void);
208 
209  //Message handler
210  MUTILS_API bool handle_os_message(const void *const message, long *result);
211 
221  MUTILS_API void sleep_ms(const size_t &duration);
222 
223  //Is executable/library file?
224  MUTILS_API bool is_executable_file(const QString &path);
225  MUTILS_API bool is_library_file(const QString &path);
226 
227  //Shutdown & Hibernation
228  MUTILS_API bool is_hibernation_supported(void);
229  MUTILS_API bool shutdown_computer(const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate);
230 
231  //Free diskspace
232  MUTILS_API bool free_diskspace(const QString &path, quint64 &freeSpace);
233 
245  MUTILS_API drive_type_t get_drive_type(const QString &path, bool *fast_seeking = NULL);
246 
247  //Shell open
248  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const bool explore = false);
249  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const QString &parameters, const QString &directory, const bool explore = false);
250 
251  //Open media file
252  MUTILS_API bool open_media_file(const QString &mediaFilePath);
253 
254  //Process priority
255  MUTILS_API bool change_process_priority(const int priority);
256  MUTILS_API bool change_process_priority(const QProcess *proc, const int priority);
257 
258  //Process ID
259  MUTILS_API quint32 process_id(void);
260  MUTILS_API quint32 process_id(const QProcess *const proc);
261 
262  //Thread ID
263  MUTILS_API quint32 thread_id(void);
264  MUTILS_API quint32 thread_id(const QProcess *const proc);
265 
266  //Suspend or resume processv
267  MUTILS_API bool suspend_process(const QProcess *proc, const bool suspend);
268 
269  //System timer resolution
270  MUTILS_API bool setup_timer_resolution(const quint32 &interval = 1);
271  MUTILS_API bool reset_timer_resolution(const quint32 &interval = 1);
272 
273  //Set file time
274  MUTILS_API bool set_file_time(const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
275  MUTILS_API bool set_file_time(const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
276 
277  //Keyboard support
278  MUTILS_API bool check_key_state_esc(void);
279 
280  //Shell notification
281  MUTILS_API void shell_change_notification(void);
282 
283  //Get file path from descriptor
284  MUTILS_API QString get_file_path(const int &fd);
285 
286  //WOW64 redirection
287  MUTILS_API bool wow64fsredir_disable(uintptr_t &oldValue);
288  MUTILS_API bool wow64fsredir_revert (const uintptr_t oldValue);
289 
290  //Environment variables
291  MUTILS_API QString get_envvar(const QString &name);
292  MUTILS_API bool set_envvar(const QString &name, const QString &value);
293 
294  //NULL device
295  MUTILS_API const QLatin1String &null_device(void);
296 
297  //Check if debugger is present
298  MUTILS_API void check_debugger(void);
299 
300  //Error handling
301  MUTILS_API void fatal_exit(const wchar_t* const errorMessage);
302  }
303 }
304 
The "all users" Documents directory.
Definition: OSSupport.h:123
MUTILS_API int network_status(void)
Check the network status.
MUTILS_API const os_version_t UNKNOWN_OPSYS
Operating system version constant.
-
Program files.
Definition: OSSupport.h:124
+
Program files.
Definition: OSSupport.h:134
unsigned int versionMinor
The minor version of the underlaying operating system.
Definition: OSSupport.h:75
-
The user&#39;s Music directory.
Definition: OSSupport.h:117
-
The "all users" Video directory.
Definition: OSSupport.h:121
+
The user&#39;s Music directory.
Definition: OSSupport.h:127
+
The "all users" Video directory.
Definition: OSSupport.h:131
unsigned int versionBuild
The build number of the underlaying operating system.
Definition: OSSupport.h:76
Definition: Version.h:34
This file contains miscellaneous functions that are generally useful for Qt-based applications...
MUTILS_API void sleep_ms(const size_t &duration)
Suspend calling thread.
-
System "root" directory.
Definition: OSSupport.h:125
+
System "root" directory.
Definition: OSSupport.h:135
struct MUtils::OS::Version::_os_version_t os_version_t
This struct contains version information about the underlaying operating system. See _os_version_t fo...
-
The user&#39;s Music directory.
Definition: OSSupport.h:116
+
The user&#39;s Music directory.
Definition: OSSupport.h:126
unsigned int versionMajor
The major version of the underlaying operating system.
Definition: OSSupport.h:74
-
drive_type_t
This enumeration specifies drive types.
Definition: OSSupport.h:145
-
Local application data (non-roaming)
Definition: OSSupport.h:111
+
drive_type_t
This enumeration specifies drive types.
Definition: OSSupport.h:155
+
Local application data (non-roaming)
Definition: OSSupport.h:121
MUTILS_API const os_version_t WINDOWS_WIN70
Operating system version constant.
+
x86-64, aka AMD64, aka Intel 64 [64-bit]
Definition: OSSupport.h:109
MUTILS_API const os_version_t WINDOWS_WIN80
Operating system version constant.
-
System directory for x86 (32-Bit)
Definition: OSSupport.h:127
+
System directory for x86 (32-Bit)
Definition: OSSupport.h:137
MUTILS_API const os_version_t WINDOWS_WIN2K
Operating system version constant.
-
Hard Disk drive or Solid-State Drive.
Definition: OSSupport.h:149
-
The user&#39;s profile folder.
Definition: OSSupport.h:108
-
The user&#39;s Music directory.
Definition: OSSupport.h:118
-
Optical disk srive, e.g. CD or DVD.
Definition: OSSupport.h:151
+
Hard Disk drive or Solid-State Drive.
Definition: OSSupport.h:159
+
The user&#39;s profile folder.
Definition: OSSupport.h:118
+
The user&#39;s Music directory.
Definition: OSSupport.h:128
+
Optical disk srive, e.g. CD or DVD.
Definition: OSSupport.h:161
Unknown operating system.
Definition: OSSupport.h:63
-
Application-specific data.
Definition: OSSupport.h:110
-
The "all users" Music directory.
Definition: OSSupport.h:119
+
Application-specific data.
Definition: OSSupport.h:120
+
Intel x86 or compatible [32-bit].
Definition: OSSupport.h:108
+
The "all users" Music directory.
Definition: OSSupport.h:129
MUTILS_API const os_version_t WINDOWS_WN100
Operating system version constant.
-
Program files.
Definition: OSSupport.h:122
+
Program files.
Definition: OSSupport.h:132
os_type_t
This enumeration specifies the type of the underlaying operating system.
Definition: OSSupport.h:61
MUTILS_API const os_version_t WINDOWS_WIN81
Operating system version constant.
This struct contains version information about the underlaying operating system. See _os_version_t fo...
Definition: OSSupport.h:71
+
os_arch_t
This enumeration specifies possible operating system architectures.
Definition: OSSupport.h:106
unsigned int versionSPack
The service pack version of the underlaying operating system.
Definition: OSSupport.h:77
-
The "all users" Desktop directory.
Definition: OSSupport.h:115
-
The user&#39;s Video directory.
Definition: OSSupport.h:120
-
Remote/Network drive.
Definition: OSSupport.h:150
+
The "all users" Desktop directory.
Definition: OSSupport.h:125
+
The user&#39;s Video directory.
Definition: OSSupport.h:130
+
Remote/Network drive.
Definition: OSSupport.h:160
MUTILS_API const os_version_t WINDOWS_VISTA
Operating system version constant.
Global MUtils namespace.
Definition: CPUFeatures.h:37
-
Computer is not connected to a network.
Definition: OSSupport.h:137
-
System directory.
Definition: OSSupport.h:126
-
The drive type cannot be determined.
Definition: OSSupport.h:147
-
The user&#39;s Documents directory.
Definition: OSSupport.h:112
+
Computer is not connected to a network.
Definition: OSSupport.h:147
+
System directory.
Definition: OSSupport.h:136
+
The drive type cannot be determined.
Definition: OSSupport.h:157
+
The user&#39;s Documents directory.
Definition: OSSupport.h:122
MUTILS_API const os_version_t WINDOWS_WINXP
Operating system version constant.
-
Floppy Drive, or Flash Card reader.
Definition: OSSupport.h:148
-
The user&#39;s Desktop directory.
Definition: OSSupport.h:114
-
The "all users" profile folder.
Definition: OSSupport.h:109
-
RAM disk.
Definition: OSSupport.h:152
+
Floppy Drive, or Flash Card reader.
Definition: OSSupport.h:158
+
The user&#39;s Desktop directory.
Definition: OSSupport.h:124
+
The "all users" profile folder.
Definition: OSSupport.h:119
+
RAM disk.
Definition: OSSupport.h:162
MUTILS_API drive_type_t get_drive_type(const QString &path, bool *fast_seeking=NULL)
Detect drive type.
-
network_type_t
This enumeration specifies network connection types.
Definition: OSSupport.h:134
-
Computer is connected to a network.
Definition: OSSupport.h:138
+
network_type_t
This enumeration specifies network connection types.
Definition: OSSupport.h:144
+
Computer is connected to a network.
Definition: OSSupport.h:148
Microsoft(R) Windows.
Definition: OSSupport.h:64
unsigned int type
The type of the underlaying operating system, as os_type_t
Definition: OSSupport.h:73
-
Program files.
Definition: OSSupport.h:123
-
known_folder_t
This enumeration specifies "known" folder identifiers.
Definition: OSSupport.h:106
+
Program files.
Definition: OSSupport.h:133
+
known_folder_t
This enumeration specifies "known" folder identifiers.
Definition: OSSupport.h:116
MUTILS_API const os_version_t WINDOWS_XPX64
Operating system version constant.
-
Network connection is unknown.
Definition: OSSupport.h:136
+
Network connection is unknown.
Definition: OSSupport.h:146