From ca093ae096bb3685afa157c42650a889166b2894 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Thu, 2 May 2019 13:29:07 +0200 Subject: [PATCH] Updated copyright year. --- README.html | 2 +- README.md | 2 +- docs/d0/dd7/_version_8h_source.html | 2 +- docs/d1/d0a/_taskbar7_8h_source.html | 2 +- docs/d1/d93/_i_p_c_channel_8h_source.html | 2 +- docs/d2/d13/_startup_8h_source.html | 2 +- docs/d2/dad/_hash_8h_source.html | 2 +- docs/d2/db5/_c_p_u_features_8h_source.html | 2 +- docs/d3/d5c/_registry_8h_source.html | 2 +- docs/d3/dc1/_o_s_support_8h_source.html | 2 +- docs/d3/dd5/_error_handler_8h_source.html | 2 +- docs/d4/d85/_job_object_8h_source.html | 2 +- docs/d5/d3b/_global_8h_source.html | 2 +- docs/d5/db0/_sound_8h_source.html | 2 +- docs/d6/d83/_update_checker_8h_source.html | 2 +- docs/d6/ddd/_terminal_8h_source.html | 2 +- docs/d7/d73/_translation_8h_source.html | 2 +- docs/d8/d4d/_lazy_8h_source.html | 2 +- docs/da/d5d/_g_u_i_8h_source.html | 2 +- docs/df/d98/_exception_8h_source.html | 2 +- include/MUtils/CPUFeatures.h | 2 +- include/MUtils/ErrorHandler.h | 2 +- include/MUtils/Exception.h | 2 +- include/MUtils/GUI.h | 2 +- include/MUtils/Global.h | 2 +- include/MUtils/Hash.h | 2 +- include/MUtils/IPCChannel.h | 2 +- include/MUtils/JobObject.h | 2 +- include/MUtils/Lazy.h | 2 +- include/MUtils/OSSupport.h | 2 +- include/MUtils/Registry.h | 2 +- include/MUtils/Sound.h | 2 +- include/MUtils/Startup.h | 2 +- include/MUtils/Taskbar7.h | 2 +- include/MUtils/Terminal.h | 2 +- include/MUtils/Translation.h | 2 +- include/MUtils/UpdateChecker.h | 2 +- include/MUtils/Version.h | 2 +- src/CPUFeatures_Win32.cpp | 2 +- src/Config.h | 2 +- src/CriticalSection_Win32.h | 2 +- src/DLLMain.cpp | 2 +- src/DirLocker.h | 2 +- src/ErrorHandler_Win32.cpp | 2 +- src/GUI.cpp | 2 +- src/GUI_Win32.cpp | 2 +- src/Global.cpp | 2 +- src/Hash.cpp | 2 +- src/Hash_Blake2.cpp | 2 +- src/Hash_Blake2.h | 2 +- src/Hash_Keccak.cpp | 2 +- src/Hash_Keccak.h | 2 +- src/IPCChannel.cpp | 2 +- src/Internal.h | 2 +- src/JobObject_Win32.cpp | 2 +- src/OSSupport_Win32.cpp | 2 +- src/Registry_Win32.cpp | 2 +- src/Sound_Win32.cpp | 2 +- src/Startup.cpp | 2 +- src/Taskbar7_Win32.cpp | 2 +- src/Terminal_Win32.cpp | 2 +- src/Translation.cpp | 2 +- src/UpdateChecker.cpp | 2 +- src/Utils_Win32.cpp | 2 +- src/Utils_Win32.h | 2 +- src/Version.cpp | 2 +- test/src/GlobalTest.cpp | 2 +- test/src/HashTest.cpp | 2 +- test/src/MUtilsTest.h | 2 +- test/src/Main.cpp | 4 ++-- 70 files changed, 71 insertions(+), 71 deletions(-) diff --git a/README.html b/README.html index 9d97ca0..b0736ab 100644 --- a/README.html +++ b/README.html @@ -86,7 +86,7 @@ int main(int argc, char **argv)

5 License

This library is free software. It is released under the terms of the GNU Lesser General Public License (LGPL), Version 2.1.

MUtilities - MuldeR's Utilities for Qt
-Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.
+Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
diff --git a/README.md b/README.md
index f263405..a6d5851 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ A fully-fledged documentation of the *MUtilities* programming interface (API) is
 This library is free software. It is released under the terms of the [*GNU Lesser General Public License (LGPL), Version 2.1*](https://www.gnu.org/licenses/lgpl-2.1.html).
 
     MUtilities - MuldeR's Utilities for Qt
-    Copyright (C) 2004-2018 LoRd_MuldeR . Some rights reserved.
+    Copyright (C) 2004-2019 LoRd_MuldeR . Some rights reserved.
     
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
diff --git a/docs/d0/dd7/_version_8h_source.html b/docs/d0/dd7/_version_8h_source.html
index d453d16..258ae95 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-2018 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 == 1916)
71  #if((_MSC_FULL_VER >= 191627024) && (_MSC_FULL_VER <= 191627024))
72  "MSVC 2017.9";
73  #else
74  #error Compiler version is not supported yet!
75  #endif
76  #elif (_MSC_VER == 1915)
77  #if((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732))
78  "MSVC 2017.8";
79  #else
80  #error Compiler version is not supported yet!
81  #endif
82  #elif (_MSC_VER == 1914)
83  #if((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433))
84  "MSVC 2017.7";
85  #else
86  #error Compiler version is not supported yet!
87  #endif
88  #elif (_MSC_VER == 1913)
89  #if((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132))
90  "MSVC 2017.6";
91  #else
92  #error Compiler version is not supported yet!
93  #endif
94  #elif (_MSC_VER == 1912)
95  #if((_MSC_FULL_VER >= 191225830) && (_MSC_FULL_VER <= 191225835))
96  "MSVC 2017.5";
97  #else
98  #error Compiler version is not supported yet!
99  #endif
100  #elif (_MSC_VER == 1911)
101  #if((_MSC_FULL_VER >= 191125542) && (_MSC_FULL_VER <= 191125547))
102  "MSVC 2017.4";
103  #elif((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508))
104  "MSVC 2017.3";
105  #else
106  #error Compiler version is not supported yet!
107  #endif
108  #elif (_MSC_VER == 1910)
109  #if ((_MSC_FULL_VER >= 191025017) && (_MSC_FULL_VER <= 191025019))
110  "MSVC 2017.2";
111  #else
112  #error Compiler version is not supported yet!
113  #endif
114  #elif (_MSC_VER == 1900)
115  #if (_MSC_FULL_VER == 190023026)
116  "MSVC 2015";
117  #elif (_MSC_FULL_VER == 190023506)
118  "MSVC 2015.1";
119  #elif (_MSC_FULL_VER == 190023918)
120  "MSVC 2015.2";
121  #elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215)
122  "MSVC 2015.3";
123  #else
124  #error Compiler version is not supported yet!
125  #endif
126  #elif (_MSC_VER == 1800)
127  #if (_MSC_FULL_VER == 180021005)
128  "MSVC 2013";
129  #elif (_MSC_FULL_VER == 180030501)
130  "MSVC 2013.2";
131  #elif (_MSC_FULL_VER == 180030723)
132  "MSVC 2013.3";
133  #elif (_MSC_FULL_VER == 180031101)
134  "MSVC 2013.4";
135  #elif (_MSC_FULL_VER == 180040629)
136  "MSVC 2013.5";
137  #else
138  #error Compiler version is not supported yet!
139  #endif
140  #elif (_MSC_VER == 1700)
141  #if (_MSC_FULL_VER == 170050727)
142  "MSVC 2012";
143  #elif (_MSC_FULL_VER == 170051106)
144  "MSVC 2012.1";
145  #elif (_MSC_FULL_VER == 170060315)
146  "MSVC 2012.2";
147  #elif (_MSC_FULL_VER == 170060610)
148  "MSVC 2012.3";
149  #elif (_MSC_FULL_VER == 170061030)
150  "MSVC 2012.4";
151  #else
152  #error Compiler version is not supported yet!
153  #endif
154  #elif (_MSC_VER == 1600)
155  #if (_MSC_FULL_VER >= 160040219)
156  "MSVC 2010-SP1";
157  #else
158  "MSVC 2010";
159  #endif
160  #elif (_MSC_VER == 1500)
161  #if (_MSC_FULL_VER >= 150030729)
162  "MSVC 2008-SP1";
163  #else
164  "MSVC 2008";
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 == 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 <= 191627030))
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
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d1/d0a/_taskbar7_8h_source.html b/docs/d1/d0a/_taskbar7_8h_source.html index 551b833..3aedf94 100644 --- a/docs/d1/d0a/_taskbar7_8h_source.html +++ b/docs/d1/d0a/_taskbar7_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Taskbar7.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 #include <MUtils/Global.h>
25 
26 class QWidget;
27 class QIcon;
28 
29 namespace MUtils
30 {
31  class MUTILS_API Taskbar7_Private;
32 
33  class MUTILS_API Taskbar7
34  {
35  public:
36  //Taskbar states
37  typedef enum
38  {
39  TASKBAR_STATE_NONE = 0,
40  TASKBAR_STATE_NORMAL = 1,
41  TASKBAR_STATE_INTERMEDIATE = 2,
42  TASKBAR_STATE_PAUSED = 3,
43  TASKBAR_STATE_ERROR = 4
44  }
45  taskbarState_t;
46 
47  //Constructor
48  Taskbar7(QWidget *const window);
49  ~Taskbar7(void);
50 
51  //Public interface
52  bool setTaskbarState(const taskbarState_t &state);
53  bool setTaskbarProgress(const quint64 &currentValue, const quint64 &maximumValue);
54  bool setOverlayIcon(const QIcon *const icon, const QString &info = QString());
55 
56  private:
57  Taskbar7_Private *const p;
58  QWidget *const m_window;
59 
60  inline bool initialize(void);
61  };
62 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 #include <MUtils/Global.h>
25 
26 class QWidget;
27 class QIcon;
28 
29 namespace MUtils
30 {
31  class MUTILS_API Taskbar7_Private;
32 
33  class MUTILS_API Taskbar7
34  {
35  public:
36  //Taskbar states
37  typedef enum
38  {
39  TASKBAR_STATE_NONE = 0,
40  TASKBAR_STATE_NORMAL = 1,
41  TASKBAR_STATE_INTERMEDIATE = 2,
42  TASKBAR_STATE_PAUSED = 3,
43  TASKBAR_STATE_ERROR = 4
44  }
45  taskbarState_t;
46 
47  //Constructor
48  Taskbar7(QWidget *const window);
49  ~Taskbar7(void);
50 
51  //Public interface
52  bool setTaskbarState(const taskbarState_t &state);
53  bool setTaskbarProgress(const quint64 &currentValue, const quint64 &maximumValue);
54  bool setOverlayIcon(const QIcon *const icon, const QString &info = QString());
55 
56  private:
57  Taskbar7_Private *const p;
58  QWidget *const m_window;
59 
60  inline bool initialize(void);
61  };
62 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: Taskbar7.h:33
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d1/d93/_i_p_c_channel_8h_source.html b/docs/d1/d93/_i_p_c_channel_8h_source.html index ece989d..74bf3ef 100644 --- a/docs/d1/d93/_i_p_c_channel_8h_source.html +++ b/docs/d1/d93/_i_p_c_channel_8h_source.html @@ -67,7 +67,7 @@ $(function() {
IPCChannel.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 <QtGlobal>
29 #include <QStringList>
30 
31 namespace MUtils
32 {
33  class MUTILS_API IPCChannel_Private;
34 
35  class MUTILS_API IPCChannel
36  {
37  public:
38  static const quint32 MAX_PARAM_LEN = 4096;
39  static const quint32 MAX_PARAM_CNT = 4;
40 
41  typedef enum
42  {
43  RET_SUCCESS_MASTER = 0,
44  RET_SUCCESS_SLAVE = 1,
45  RET_ALREADY_INITIALIZED = 2,
46  RET_FAILURE = 3
47  }
48  ipc_result_t;
49 
50  IPCChannel(const QString &applicationId, const quint32 &versionNo, const QString &channelId);
51  ~IPCChannel(void);
52 
53  int initialize(void);
54 
55  bool send(const quint32 &command, const quint32 &flags, const QStringList &params = QStringList());
56  bool read(quint32 &command, quint32 &flags, QStringList &params);
57 
58  private:
59  IPCChannel(const IPCChannel&) : p(NULL), m_appVersionNo(-1) { throw "Constructor is disabled!"; }
60  IPCChannel &operator=(const IPCChannel&) { throw "Assignment operator is disabled!"; return *this; }
61 
62  const QString m_applicationId;
63  const QString m_channelId;
64  const unsigned int m_appVersionNo;
65  const QByteArray m_headerStr;
66 
67  IPCChannel_Private *const p;
68  };
69 }
Definition: IPCChannel.h:35
+
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 <QtGlobal>
29 #include <QStringList>
30 
31 namespace MUtils
32 {
33  class MUTILS_API IPCChannel_Private;
34 
35  class MUTILS_API IPCChannel
36  {
37  public:
38  static const quint32 MAX_PARAM_LEN = 4096;
39  static const quint32 MAX_PARAM_CNT = 4;
40 
41  typedef enum
42  {
43  RET_SUCCESS_MASTER = 0,
44  RET_SUCCESS_SLAVE = 1,
45  RET_ALREADY_INITIALIZED = 2,
46  RET_FAILURE = 3
47  }
48  ipc_result_t;
49 
50  IPCChannel(const QString &applicationId, const quint32 &versionNo, const QString &channelId);
51  ~IPCChannel(void);
52 
53  int initialize(void);
54 
55  bool send(const quint32 &command, const quint32 &flags, const QStringList &params = QStringList());
56  bool read(quint32 &command, quint32 &flags, QStringList &params);
57 
58  private:
59  IPCChannel(const IPCChannel&) : p(NULL), m_appVersionNo(-1) { throw "Constructor is disabled!"; }
60  IPCChannel &operator=(const IPCChannel&) { throw "Assignment operator is disabled!"; return *this; }
61 
62  const QString m_applicationId;
63  const QString m_channelId;
64  const unsigned int m_appVersionNo;
65  const QByteArray m_headerStr;
66 
67  IPCChannel_Private *const p;
68  };
69 }
Definition: IPCChannel.h:35
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/d13/_startup_8h_source.html b/docs/d2/d13/_startup_8h_source.html index 946c26c..d49e6c6 100644 --- a/docs/d2/d13/_startup_8h_source.html +++ b/docs/d2/d13/_startup_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Startup.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 //Forward Declarations
28 class QApplication;
29 
31 
32 namespace MUtils
33 {
34  namespace Startup
35  {
36  //Main Function
37  typedef int (main_function_t)(int &argc, char **argv);
38 
39  //Startup Application
40  MUTILS_API int startup(int &argc, char **argv, main_function_t *const entry_point, const char* const appName, const bool &debugConsole);
41 
42  //Initialize Qt
43  MUTILS_API QApplication *create_qt(int &argc, char **argv, const QString &appName, const QString &appAuthor = QLatin1String("LoRd_MuldeR"), const QString &appDomain = QLatin1String("muldersoft.com"), const bool xpSupport = true);
44  }
45 }
46 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 //Forward Declarations
28 class QApplication;
29 
31 
32 namespace MUtils
33 {
34  namespace Startup
35  {
36  //Main Function
37  typedef int (main_function_t)(int &argc, char **argv);
38 
39  //Startup Application
40  MUTILS_API int startup(int &argc, char **argv, main_function_t *const entry_point, const char* const appName, const bool &debugConsole);
41 
42  //Initialize Qt
43  MUTILS_API QApplication *create_qt(int &argc, char **argv, const QString &appName, const QString &appAuthor = QLatin1String("LoRd_MuldeR"), const QString &appDomain = QLatin1String("muldersoft.com"), const bool xpSupport = true);
44  }
45 }
46 
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/dad/_hash_8h_source.html b/docs/d2/dad/_hash_8h_source.html index e4e2d20..c766025 100644 --- a/docs/d2/dad/_hash_8h_source.html +++ b/docs/d2/dad/_hash_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Hash.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
29 #pragma once
30 
31 //MUtils
32 #include <MUtils/Global.h>
33 
34 //Qt
35 #include <QByteArray>
36 #include <QFile>
37 
38 namespace MUtils
39 {
40  namespace Hash
41  {
42  static const quint16 HASH_BLAKE2_512 = 0x0000U;
43  static const quint16 HASH_KECCAK_224 = 0x0100U;
44  static const quint16 HASH_KECCAK_256 = 0x0101U;
45  static const quint16 HASH_KECCAK_384 = 0x0102U;
46  static const quint16 HASH_KECCAK_512 = 0x0103U;
47 
57  class MUTILS_API Hash
58  {
59  public:
60  virtual ~Hash(void) {};
61 
73  bool update(const quint8 *const data, const quint32 len) { return process(data, len); }
74 
84  bool update(const QByteArray &data) { return process(((const quint8*)data.constData()), ((quint32)data.length())); }
85 
95  bool update(QFile &file);
96 
106  QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); }
107 
108  protected:
109  Hash(const char* key = NULL) {/*nothing to do*/};
110  virtual bool process(const quint8 *const data, const quint32 len) = 0;
111  virtual QByteArray finalize(void) = 0;
112 
113  private:
115  };
116 
128  MUTILS_API Hash *create(const quint16 &hashId, const char *const key = NULL);
129  }
130 }
bool update(const QByteArray &data)
Process the next chunk of input data.
Definition: Hash.h:84
+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 
29 #pragma once
30 
31 //MUtils
32 #include <MUtils/Global.h>
33 
34 //Qt
35 #include <QByteArray>
36 #include <QFile>
37 
38 namespace MUtils
39 {
40  namespace Hash
41  {
42  static const quint16 HASH_BLAKE2_512 = 0x0000U;
43  static const quint16 HASH_KECCAK_224 = 0x0100U;
44  static const quint16 HASH_KECCAK_256 = 0x0101U;
45  static const quint16 HASH_KECCAK_384 = 0x0102U;
46  static const quint16 HASH_KECCAK_512 = 0x0103U;
47 
57  class MUTILS_API Hash
58  {
59  public:
60  virtual ~Hash(void) {};
61 
73  bool update(const quint8 *const data, const quint32 len) { return process(data, len); }
74 
84  bool update(const QByteArray &data) { return process(((const quint8*)data.constData()), ((quint32)data.length())); }
85 
95  bool update(QFile &file);
96 
106  QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); }
107 
108  protected:
109  Hash(const char* key = NULL) {/*nothing to do*/};
110  virtual bool process(const quint8 *const data, const quint32 len) = 0;
111  virtual QByteArray finalize(void) = 0;
112 
113  private:
115  };
116 
128  MUTILS_API Hash *create(const quint16 &hashId, const char *const key = NULL);
129  }
130 }
bool update(const QByteArray &data)
Process the next chunk of input data.
Definition: Hash.h:84
This file contains miscellaneous functions that are generally useful for Qt-based applications...
bool update(const quint8 *const data, const quint32 len)
Process the next chunk of input data.
Definition: Hash.h:73
static const quint16 HASH_BLAKE2_512
Hash algorithm identifier.
Definition: Hash.h:42
diff --git a/docs/d2/db5/_c_p_u_features_8h_source.html b/docs/d2/db5/_c_p_u_features_8h_source.html index 1b1b7cc..7d7edad 100644 --- a/docs/d2/db5/_c_p_u_features_8h_source.html +++ b/docs/d2/db5/_c_p_u_features_8h_source.html @@ -67,7 +67,7 @@ $(function() {
CPUFeatures.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
29 #pragma once
30 
31 //MUtils
32 #include <MUtils/Global.h>
33 
34 //Qt
35 #include <QStringList>
36 
37 namespace MUtils
38 {
44  namespace CPUFetaures
45  {
46  // CPU vendor flag
47  static const quint8 VENDOR_INTEL = 0x01U;
48  static const quint8 VENDOR_AMD = 0x02U;
49 
50  // CPU feature flag
51  static const quint32 FLAG_CMOV = 0x001U;
52  static const quint32 FLAG_MMX = 0x002U;
53  static const quint32 FLAG_SSE = 0x004U;
54  static const quint32 FLAG_SSE2 = 0x008U;
55  static const quint32 FLAG_SSE3 = 0x010U;
56  static const quint32 FLAG_SSSE3 = 0x020U;
57  static const quint32 FLAG_SSE41 = 0x040U;
58  static const quint32 FLAG_SSE42 = 0x080U;
59  static const quint32 FLAG_AVX = 0x100U;
60  static const quint32 FLAG_AVX2 = 0x200U;
61  static const quint32 FLAG_FMA3 = 0x400U;
62  static const quint32 FLAG_LZCNT = 0x800U;
63 
67  typedef struct _cpu_info_t
68  {
69  quint32 family;
70  quint32 model;
71  quint32 stepping;
72  quint32 count;
73  quint32 features;
74  bool x64;
75  quint8 vendor;
76  char idstr[13];
77  char brand[48];
78  }
79  cpu_info_t;
80 
88  MUTILS_API cpu_info_t detect(void);
89  }
90 }
quint32 family
CPU family indicator, which specifies the processor "generation" to which the CPU belongs...
Definition: CPUFeatures.h:69
+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 
29 #pragma once
30 
31 //MUtils
32 #include <MUtils/Global.h>
33 
34 //Qt
35 #include <QStringList>
36 
37 namespace MUtils
38 {
44  namespace CPUFetaures
45  {
46  // CPU vendor flag
47  static const quint8 VENDOR_INTEL = 0x01U;
48  static const quint8 VENDOR_AMD = 0x02U;
49 
50  // CPU feature flag
51  static const quint32 FLAG_CMOV = 0x001U;
52  static const quint32 FLAG_MMX = 0x002U;
53  static const quint32 FLAG_SSE = 0x004U;
54  static const quint32 FLAG_SSE2 = 0x008U;
55  static const quint32 FLAG_SSE3 = 0x010U;
56  static const quint32 FLAG_SSSE3 = 0x020U;
57  static const quint32 FLAG_SSE41 = 0x040U;
58  static const quint32 FLAG_SSE42 = 0x080U;
59  static const quint32 FLAG_AVX = 0x100U;
60  static const quint32 FLAG_AVX2 = 0x200U;
61  static const quint32 FLAG_FMA3 = 0x400U;
62  static const quint32 FLAG_LZCNT = 0x800U;
63 
67  typedef struct _cpu_info_t
68  {
69  quint32 family;
70  quint32 model;
71  quint32 stepping;
72  quint32 count;
73  quint32 features;
74  bool x64;
75  quint8 vendor;
76  char idstr[13];
77  char brand[48];
78  }
79  cpu_info_t;
80 
88  MUTILS_API cpu_info_t detect(void);
89  }
90 }
quint32 family
CPU family indicator, which specifies the processor "generation" to which the CPU belongs...
Definition: CPUFeatures.h:69
This file contains miscellaneous functions that are generally useful for Qt-based applications...
quint32 stepping
CPU stepping indicator, which is used to distinguish "revisions" of a certain processor model...
Definition: CPUFeatures.h:71
static const quint32 FLAG_SSE
CPU feature flag.
Definition: CPUFeatures.h:53
diff --git a/docs/d3/d5c/_registry_8h_source.html b/docs/d3/d5c/_registry_8h_source.html index f8d1809..da08704 100644 --- a/docs/d3/d5c/_registry_8h_source.html +++ b/docs/d3/d5c/_registry_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Registry.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
28 
29 namespace MUtils
30 {
31  namespace Registry
32  {
33  //Regsitry root
34  typedef enum
35  {
36  root_classes = 0,
37  root_user = 1,
38  root_machine = 2,
39  }
40  reg_root_t;
41 
42  //Regsitry access
43  typedef enum
44  {
45  access_readonly = 0,
46  access_writeonly = 1,
47  access_readwrite = 2,
48  access_enumerate = 3
49  }
50  reg_access_t;
51 
52  //Regsitry scope
53  typedef enum
54  {
55  scope_default = 0,
56  scope_wow_x32 = 1,
57  scope_wow_x64 = 2
58  }
59  reg_scope_t;
60 
61  //Forward declaration
62  namespace Internal
63  {
64  class RegistryKeyPrivate;
65  }
66 
67  //Registry key class
68  class MUTILS_API RegistryKey
69  {
70  public:
71  RegistryKey(const reg_root_t &rootKey, const QString &keyName, const reg_access_t &access, const reg_scope_t &scope = scope_default);
72  ~RegistryKey(void);
73 
74  inline bool isOpen(void);
75 
76  bool value_write(const QString &valueName, const quint32 &value);
77  bool value_write(const QString &valueName, const QString &value);
78 
79  bool value_read(const QString &valueName, quint32 &value) const;
80  bool value_read(const QString &valueName, QString &value) const;
81 
82  bool enum_values (QStringList &list) const;
83  bool enum_subkeys(QStringList &list) const;
84 
85  private:
86  Internal::RegistryKeyPrivate *const p;
87  };
88 
89  //Regsitry functions
90  MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const quint32 &value, const reg_scope_t &scope = scope_default);
91  MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const QString &value, const reg_scope_t &scope = scope_default);
92  MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, quint32 &value, const reg_scope_t &scope = scope_default);
93  MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, QString &value, const reg_scope_t &scope = scope_default);
94  MUTILS_API bool reg_key_exists (const reg_root_t &rootKey, const QString &keyName, const reg_scope_t &scope = scope_default);
95  MUTILS_API bool reg_key_delete (const reg_root_t &rootKey, const QString &keyName, const bool &recusrive = true, const bool &ascend = false, const reg_scope_t &scope = scope_default);
96  MUTILS_API bool reg_enum_values (const reg_root_t &rootKey, const QString &keyName, QStringList &list, const reg_scope_t &scope = scope_default);
97  MUTILS_API bool reg_enum_subkeys(const reg_root_t &rootKey, const QString &keyName, QStringList &list, const reg_scope_t &scope = scope_default);
98  }
99 }
100 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 
28 
29 namespace MUtils
30 {
31  namespace Registry
32  {
33  //Regsitry root
34  typedef enum
35  {
36  root_classes = 0,
37  root_user = 1,
38  root_machine = 2,
39  }
40  reg_root_t;
41 
42  //Regsitry access
43  typedef enum
44  {
45  access_readonly = 0,
46  access_writeonly = 1,
47  access_readwrite = 2,
48  access_enumerate = 3
49  }
50  reg_access_t;
51 
52  //Regsitry scope
53  typedef enum
54  {
55  scope_default = 0,
56  scope_wow_x32 = 1,
57  scope_wow_x64 = 2
58  }
59  reg_scope_t;
60 
61  //Forward declaration
62  namespace Internal
63  {
64  class RegistryKeyPrivate;
65  }
66 
67  //Registry key class
68  class MUTILS_API RegistryKey
69  {
70  public:
71  RegistryKey(const reg_root_t &rootKey, const QString &keyName, const reg_access_t &access, const reg_scope_t &scope = scope_default);
72  ~RegistryKey(void);
73 
74  inline bool isOpen(void);
75 
76  bool value_write(const QString &valueName, const quint32 &value);
77  bool value_write(const QString &valueName, const QString &value);
78 
79  bool value_read(const QString &valueName, quint32 &value) const;
80  bool value_read(const QString &valueName, QString &value) const;
81 
82  bool enum_values (QStringList &list) const;
83  bool enum_subkeys(QStringList &list) const;
84 
85  private:
86  Internal::RegistryKeyPrivate *const p;
87  };
88 
89  //Regsitry functions
90  MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const quint32 &value, const reg_scope_t &scope = scope_default);
91  MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const QString &value, const reg_scope_t &scope = scope_default);
92  MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, quint32 &value, const reg_scope_t &scope = scope_default);
93  MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, QString &value, const reg_scope_t &scope = scope_default);
94  MUTILS_API bool reg_key_exists (const reg_root_t &rootKey, const QString &keyName, const reg_scope_t &scope = scope_default);
95  MUTILS_API bool reg_key_delete (const reg_root_t &rootKey, const QString &keyName, const bool &recusrive = true, const bool &ascend = false, const reg_scope_t &scope = scope_default);
96  MUTILS_API bool reg_enum_values (const reg_root_t &rootKey, const QString &keyName, QStringList &list, const reg_scope_t &scope = scope_default);
97  MUTILS_API bool reg_enum_subkeys(const reg_root_t &rootKey, const QString &keyName, QStringList &list, const reg_scope_t &scope = scope_default);
98  }
99 }
100 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: Registry.h:68
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d3/dc1/_o_s_support_8h_source.html b/docs/d3/dc1/_o_s_support_8h_source.html index 58000b8..964bb93 100644 --- a/docs/d3/dc1/_o_s_support_8h_source.html +++ b/docs/d3/dc1/_o_s_support_8h_source.html @@ -67,7 +67,7 @@ $(function() {
OSSupport.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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  {
112  }
114 
118  typedef enum
119  {
123  }
125 
129  typedef enum
130  {
137  }
138  drive_type_t;
139 
140  //System message
141  MUTILS_API void system_message_nfo(const wchar_t *const title, const wchar_t *const text);
142  MUTILS_API void system_message_wrn(const wchar_t *const title, const wchar_t *const text);
143  MUTILS_API void system_message_err(const wchar_t *const title, const wchar_t *const text);
144 
145  //CLI Arguments
146  typedef QMap<QString,QString> ArgumentMap;
147  MUTILS_API const QStringList crack_command_line(const QString &command_line = QString());
148  MUTILS_API const ArgumentMap &arguments(void);
149 
150  //Copy file
151  typedef bool (*progress_callback_t)(const double &progress, void *const userData);
152  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);
153 
154  //Get file version
155  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);
156 
157  //Get the OS version
158  MUTILS_API const Version::os_version_t &os_version(void);
159  MUTILS_API const char *os_friendly_name(const MUtils::OS::Version::os_version_t &os_version);
160  MUTILS_API const bool &running_on_wine(void);
161 
162  //Get known Folder
163  MUTILS_API const QString &known_folder(known_folder_t folder_id);
164 
165  //Current Date & Time
166  MUTILS_API QDate current_date(void);
167  MUTILS_API quint64 current_file_time(void);
168 
169  //Check for process elevation
170  MUTILS_API bool is_elevated(bool *bIsUacEnabled = NULL);
171  MUTILS_API bool user_is_admin(void);
172 
180  MUTILS_API int network_status(void);
181 
182  //Message handler
183  MUTILS_API bool handle_os_message(const void *const message, long *result);
184 
194  MUTILS_API void sleep_ms(const size_t &duration);
195 
196  //Is executable/library file?
197  MUTILS_API bool is_executable_file(const QString &path);
198  MUTILS_API bool is_library_file(const QString &path);
199 
200  //Shutdown & Hibernation
201  MUTILS_API bool is_hibernation_supported(void);
202  MUTILS_API bool shutdown_computer(const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate);
203 
204  //Free diskspace
205  MUTILS_API bool free_diskspace(const QString &path, quint64 &freeSpace);
206 
218  MUTILS_API drive_type_t get_drive_type(const QString &path, bool *fast_seeking = NULL);
219 
220  //Shell open
221  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const bool explore = false);
222  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const QString &parameters, const QString &directory, const bool explore = false);
223 
224  //Open media file
225  MUTILS_API bool open_media_file(const QString &mediaFilePath);
226 
227  //Process priority
228  MUTILS_API bool change_process_priority(const int priority);
229  MUTILS_API bool change_process_priority(const QProcess *proc, const int priority);
230 
231  //Process ID
232  MUTILS_API quint32 process_id(void);
233  MUTILS_API quint32 process_id(const QProcess *const proc);
234 
235  //Thread ID
236  MUTILS_API quint32 thread_id(void);
237  MUTILS_API quint32 thread_id(const QProcess *const proc);
238 
239  //Suspend or resume processv
240  MUTILS_API bool suspend_process(const QProcess *proc, const bool suspend);
241 
242  //System timer resolution
243  MUTILS_API bool setup_timer_resolution(const quint32 &interval = 1);
244  MUTILS_API bool reset_timer_resolution(const quint32 &interval = 1);
245 
246  //Set file time
247  MUTILS_API bool set_file_time(const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
248  MUTILS_API bool set_file_time(const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
249 
250  //Keyboard support
251  MUTILS_API bool check_key_state_esc(void);
252 
253  //Shell notification
254  MUTILS_API void shell_change_notification(void);
255 
256  //Get file path from descriptor
257  MUTILS_API QString get_file_path(const int &fd);
258 
259  //WOW64 redirection
260  MUTILS_API bool wow64fsredir_disable(void *oldValue);
261  MUTILS_API bool wow64fsredir_revert (void *oldValue);
262 
263  //Environment variables
264  MUTILS_API QString get_envvar(const QString &name);
265  MUTILS_API bool set_envvar(const QString &name, const QString &value);
266 
267  //NULL device
268  MUTILS_API const QLatin1String &null_device(void);
269 
270  //Check if debugger is present
271  MUTILS_API void check_debugger(void);
272 
273  //Error handling
274  MUTILS_API void fatal_exit(const wchar_t* const errorMessage);
275  }
276 }
277 
MUTILS_API int network_status(void)
Check the network status.
+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  {
112  }
114 
118  typedef enum
119  {
123  }
125 
129  typedef enum
130  {
137  }
138  drive_type_t;
139 
140  //System message
141  MUTILS_API void system_message_nfo(const wchar_t *const title, const wchar_t *const text);
142  MUTILS_API void system_message_wrn(const wchar_t *const title, const wchar_t *const text);
143  MUTILS_API void system_message_err(const wchar_t *const title, const wchar_t *const text);
144 
145  //CLI Arguments
146  typedef QMap<QString,QString> ArgumentMap;
147  MUTILS_API const QStringList crack_command_line(const QString &command_line = QString());
148  MUTILS_API const ArgumentMap &arguments(void);
149 
150  //Copy file
151  typedef bool (*progress_callback_t)(const double &progress, void *const userData);
152  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);
153 
154  //Get file version
155  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);
156 
157  //Get the OS version
158  MUTILS_API const Version::os_version_t &os_version(void);
159  MUTILS_API const char *os_friendly_name(const MUtils::OS::Version::os_version_t &os_version);
160  MUTILS_API const bool &running_on_wine(void);
161 
162  //Get known Folder
163  MUTILS_API const QString &known_folder(known_folder_t folder_id);
164 
165  //Current Date & Time
166  MUTILS_API QDate current_date(void);
167  MUTILS_API quint64 current_file_time(void);
168 
169  //Check for process elevation
170  MUTILS_API bool is_elevated(bool *bIsUacEnabled = NULL);
171  MUTILS_API bool user_is_admin(void);
172 
180  MUTILS_API int network_status(void);
181 
182  //Message handler
183  MUTILS_API bool handle_os_message(const void *const message, long *result);
184 
194  MUTILS_API void sleep_ms(const size_t &duration);
195 
196  //Is executable/library file?
197  MUTILS_API bool is_executable_file(const QString &path);
198  MUTILS_API bool is_library_file(const QString &path);
199 
200  //Shutdown & Hibernation
201  MUTILS_API bool is_hibernation_supported(void);
202  MUTILS_API bool shutdown_computer(const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate);
203 
204  //Free diskspace
205  MUTILS_API bool free_diskspace(const QString &path, quint64 &freeSpace);
206 
218  MUTILS_API drive_type_t get_drive_type(const QString &path, bool *fast_seeking = NULL);
219 
220  //Shell open
221  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const bool explore = false);
222  MUTILS_API bool shell_open(const QWidget *parent, const QString &url, const QString &parameters, const QString &directory, const bool explore = false);
223 
224  //Open media file
225  MUTILS_API bool open_media_file(const QString &mediaFilePath);
226 
227  //Process priority
228  MUTILS_API bool change_process_priority(const int priority);
229  MUTILS_API bool change_process_priority(const QProcess *proc, const int priority);
230 
231  //Process ID
232  MUTILS_API quint32 process_id(void);
233  MUTILS_API quint32 process_id(const QProcess *const proc);
234 
235  //Thread ID
236  MUTILS_API quint32 thread_id(void);
237  MUTILS_API quint32 thread_id(const QProcess *const proc);
238 
239  //Suspend or resume processv
240  MUTILS_API bool suspend_process(const QProcess *proc, const bool suspend);
241 
242  //System timer resolution
243  MUTILS_API bool setup_timer_resolution(const quint32 &interval = 1);
244  MUTILS_API bool reset_timer_resolution(const quint32 &interval = 1);
245 
246  //Set file time
247  MUTILS_API bool set_file_time(const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
248  MUTILS_API bool set_file_time(const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime());
249 
250  //Keyboard support
251  MUTILS_API bool check_key_state_esc(void);
252 
253  //Shell notification
254  MUTILS_API void shell_change_notification(void);
255 
256  //Get file path from descriptor
257  MUTILS_API QString get_file_path(const int &fd);
258 
259  //WOW64 redirection
260  MUTILS_API bool wow64fsredir_disable(void *oldValue);
261  MUTILS_API bool wow64fsredir_revert (void *oldValue);
262 
263  //Environment variables
264  MUTILS_API QString get_envvar(const QString &name);
265  MUTILS_API bool set_envvar(const QString &name, const QString &value);
266 
267  //NULL device
268  MUTILS_API const QLatin1String &null_device(void);
269 
270  //Check if debugger is present
271  MUTILS_API void check_debugger(void);
272 
273  //Error handling
274  MUTILS_API void fatal_exit(const wchar_t* const errorMessage);
275  }
276 }
277 
MUTILS_API int network_status(void)
Check the network status.
MUTILS_API const os_version_t UNKNOWN_OPSYS
Operating system version constant.
Local application data (non-roaming)
Definition: OSSupport.h:108
unsigned int versionMinor
The minor version of the underlaying operating system.
Definition: OSSupport.h:75
diff --git a/docs/d3/dd5/_error_handler_8h_source.html b/docs/d3/dd5/_error_handler_8h_source.html index 17c008c..620706c 100644 --- a/docs/d3/dd5/_error_handler_8h_source.html +++ b/docs/d3/dd5/_error_handler_8h_source.html @@ -67,7 +67,7 @@ $(function() {
ErrorHandler.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
28 
29 namespace MUtils
30 {
31  namespace ErrorHandler
32  {
33  //Setup Error Handlers
34  MUTILS_API void initialize(void);
35  }
36 }
37 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 
28 
29 namespace MUtils
30 {
31  namespace ErrorHandler
32  {
33  //Setup Error Handlers
34  MUTILS_API void initialize(void);
35  }
36 }
37 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d4/d85/_job_object_8h_source.html b/docs/d4/d85/_job_object_8h_source.html index 5020edd..a299102 100644 --- a/docs/d4/d85/_job_object_8h_source.html +++ b/docs/d4/d85/_job_object_8h_source.html @@ -67,7 +67,7 @@ $(function() {
JobObject.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
31 #pragma once
32 
33 #include <MUtils/Global.h>
34 
35 class QProcess;
36 
37 namespace MUtils
38 {
46  class MUTILS_API JobObject
47  {
48  public:
54  JobObject(void);
55 
61  ~JobObject(void);
62 
70  bool isObjectCreated(void);
71 
81  bool addProcessToJob(const QProcess *const process);
82 
92  bool terminateJob(const quint32 &exitCode);
93 
94  private:
95  uintptr_t m_jobPtr;
97  };
98 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+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 
31 #pragma once
32 
33 #include <MUtils/Global.h>
34 
35 class QProcess;
36 
37 namespace MUtils
38 {
46  class MUTILS_API JobObject
47  {
48  public:
54  JobObject(void);
55 
61  ~JobObject(void);
62 
70  bool isObjectCreated(void);
71 
81  bool addProcessToJob(const QProcess *const process);
82 
92  bool terminateJob(const quint32 &exitCode);
93 
94  private:
95  uintptr_t m_jobPtr;
97  };
98 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
This class represents a job object.
Definition: JobObject.h:46
Global MUtils namespace.
Definition: CPUFeatures.h:37
#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:405
diff --git a/docs/d5/d3b/_global_8h_source.html b/docs/d5/d3b/_global_8h_source.html index d958c12..d917e0a 100644 --- a/docs/d5/d3b/_global_8h_source.html +++ b/docs/d5/d3b/_global_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Global.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 #include <QString>
30 
31 //Forward Declarations
32 class QProcess;
33 class QDir;
34 template<typename K, typename V> class QHash;
35 
37 
41 //MUtils API
42 #ifdef _MSC_VER
43 # ifdef MUTILS_DLL_EXPORT
44 # define MUTILS_API __declspec(dllexport)
45 # else
46 # ifndef MUTILS_STATIC_LIB
47 # define MUTILS_API __declspec(dllimport)
48 # else
49 # define MUTILS_API /*static lib*/
50 # endif
51 # endif
52 #else
53 # define MUTILS_API
54 #endif
55 
56 #define MUTILS_MAKE_STRING_HELPER(X) #X
57 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
58 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
59 
60 //Check Debug Flags
61 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
62 # define MUTILS_DEBUG (1)
63 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG))
64 # error Inconsistent DEBUG flags have been detected!
65 # endif
66 #else
67 # define MUTILS_DEBUG (0)
68 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG)
69 # error Inconsistent DEBUG flags have been detected!
70 # endif
71 #endif
72 
73 //Check CPU options
74 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP)
75  #if (_M_IX86_FP != 0)
76  #error We should not enabled SSE or SSE2 in release builds!
77  #endif
78 #endif
79 
83 
88 namespace MUtils
89 {
93  typedef struct _fp_parts_t { double parts[2]; } fp_parts_t;
94 
102  MUTILS_API const QString& temp_folder(void);
103 
117  MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL, const QHash<QString, QString> *const extraEnv = NULL);
118 
126  MUTILS_API quint32 next_rand_u32(void);
127  MUTILS_API quint32 next_rand_u32(const quint32 max);
128 
136  MUTILS_API quint64 next_rand_u64(void);
137 
147  MUTILS_API QString next_rand_str(const bool &bLong = false);
148 
162  MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false);
163  MUTILS_API QString make_temp_file(const QDir &basePath, const QString &extension, const bool placeholder = false);
164 
180  MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false);
181  MUTILS_API QString make_unique_file(const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false);
182 
190  MUTILS_API bool parity(quint32 value);
191 
201  MUTILS_API bool remove_file(const QString &fileName);
202 
214  MUTILS_API bool remove_directory(const QString &folderPath, const bool &recursive);
215 
225  MUTILS_API QString& trim_right(QString &str);
226 
236  MUTILS_API QString& trim_left(QString &str);
237 
247  MUTILS_API QString trim_right(const QString &str);
248 
258  MUTILS_API QString trim_left(const QString &str);
259 
269  MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase);
270 
282  MUTILS_API QString clean_file_name(const QString &name, const bool &pretty);
283 
295  MUTILS_API QString clean_file_path(const QString &path, const bool &pretty);
296 
308  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value);
309  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 &value);
310  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value, const size_t &offset);
311  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 &value, const size_t &offset);
312 
326  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &count);
327  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 *values, const size_t &count);
328  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &offset, const size_t &count);
329  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 *values, const size_t &offset, const size_t &count);
330 
340  MUTILS_API QStringList available_codepages(const bool &noAliases = true);
341 
351  MUTILS_API fp_parts_t break_fp(const double value);
352 
353  //Internal
354  namespace Internal
355  {
356  MUTILS_API int selfTest(const char *const buildKey, const bool debug);
357  static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
358  }
359 }
360 
362 
365 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0)
366 
369 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0)
370 
373 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR)))
374 
377 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
378 
381 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData())
382 
385 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData())
386 
389 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))
390 
393 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0")
394 
397 #define MUTILS_BOOLIFY(X) (!(!(X)))
398 
401 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0]))
402 
405 #define MUTILS_NO_COPY(CLASS) \
406  CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \
407  CLASS &operator=(const CLASS &) { throw "Assignment operator is disabled!"; }
MUTILS_API QStringList available_codepages(const bool &noAliases=true)
Retrieve a list of all available codepages.
+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 #include <QString>
30 
31 //Forward Declarations
32 class QProcess;
33 class QDir;
34 template<typename K, typename V> class QHash;
35 
37 
41 //MUtils API
42 #ifdef _MSC_VER
43 # ifdef MUTILS_DLL_EXPORT
44 # define MUTILS_API __declspec(dllexport)
45 # else
46 # ifndef MUTILS_STATIC_LIB
47 # define MUTILS_API __declspec(dllimport)
48 # else
49 # define MUTILS_API /*static lib*/
50 # endif
51 # endif
52 #else
53 # define MUTILS_API
54 #endif
55 
56 #define MUTILS_MAKE_STRING_HELPER(X) #X
57 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
58 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
59 
60 //Check Debug Flags
61 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
62 # define MUTILS_DEBUG (1)
63 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG))
64 # error Inconsistent DEBUG flags have been detected!
65 # endif
66 #else
67 # define MUTILS_DEBUG (0)
68 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG)
69 # error Inconsistent DEBUG flags have been detected!
70 # endif
71 #endif
72 
73 //Check CPU options
74 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP)
75  #if (_M_IX86_FP != 0)
76  #error We should not enabled SSE or SSE2 in release builds!
77  #endif
78 #endif
79 
83 
88 namespace MUtils
89 {
93  typedef struct _fp_parts_t { double parts[2]; } fp_parts_t;
94 
102  MUTILS_API const QString& temp_folder(void);
103 
117  MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL, const QHash<QString, QString> *const extraEnv = NULL);
118 
126  MUTILS_API quint32 next_rand_u32(void);
127  MUTILS_API quint32 next_rand_u32(const quint32 max);
128 
136  MUTILS_API quint64 next_rand_u64(void);
137 
147  MUTILS_API QString next_rand_str(const bool &bLong = false);
148 
162  MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false);
163  MUTILS_API QString make_temp_file(const QDir &basePath, const QString &extension, const bool placeholder = false);
164 
180  MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false);
181  MUTILS_API QString make_unique_file(const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false);
182 
190  MUTILS_API bool parity(quint32 value);
191 
201  MUTILS_API bool remove_file(const QString &fileName);
202 
214  MUTILS_API bool remove_directory(const QString &folderPath, const bool &recursive);
215 
225  MUTILS_API QString& trim_right(QString &str);
226 
236  MUTILS_API QString& trim_left(QString &str);
237 
247  MUTILS_API QString trim_right(const QString &str);
248 
258  MUTILS_API QString trim_left(const QString &str);
259 
269  MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase);
270 
282  MUTILS_API QString clean_file_name(const QString &name, const bool &pretty);
283 
295  MUTILS_API QString clean_file_path(const QString &path, const bool &pretty);
296 
308  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value);
309  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 &value);
310  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value, const size_t &offset);
311  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 &value, const size_t &offset);
312 
326  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &count);
327  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 *values, const size_t &count);
328  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &offset, const size_t &count);
329  MUTILS_API bool regexp_parse_int32(const QRegExp &regexp, qint32 *values, const size_t &offset, const size_t &count);
330 
340  MUTILS_API QStringList available_codepages(const bool &noAliases = true);
341 
351  MUTILS_API fp_parts_t break_fp(const double value);
352 
353  //Internal
354  namespace Internal
355  {
356  MUTILS_API int selfTest(const char *const buildKey, const bool debug);
357  static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
358  }
359 }
360 
362 
365 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0)
366 
369 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0)
370 
373 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR)))
374 
377 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
378 
381 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData())
382 
385 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData())
386 
389 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))
390 
393 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0")
394 
397 #define MUTILS_BOOLIFY(X) (!(!(X)))
398 
401 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0]))
402 
405 #define MUTILS_NO_COPY(CLASS) \
406  CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \
407  CLASS &operator=(const CLASS &) { throw "Assignment operator is disabled!"; }
MUTILS_API QStringList available_codepages(const bool &noAliases=true)
Retrieve a list of all available codepages.
struct MUtils::_fp_parts_t fp_parts_t
This struct containes the parts (integral and fractional part) of a floating-point number...
MUTILS_API QString next_rand_str(const bool &bLong=false)
Generates a random string.
MUTILS_API bool remove_file(const QString &fileName)
Deletes the specified file.
diff --git a/docs/d5/db0/_sound_8h_source.html b/docs/d5/db0/_sound_8h_source.html index 18ef669..9f87320 100644 --- a/docs/d5/db0/_sound_8h_source.html +++ b/docs/d5/db0/_sound_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Sound.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 
28 
29 namespace MUtils
30 {
31  namespace Sound
32  {
33  enum beep_t
34  {
35  BEEP_NFO = 0,
36  BEEP_WRN = 1,
37  BEEP_ERR = 2
38  };
39 
40  //Simple beep
41  MUTILS_API bool beep(const beep_t &beepType);
42 
43  //Play built-in sound by name
44  MUTILS_API bool play_sound(const QString &name, const bool &bAsync);
45 
46  //Play system sound by name
47  MUTILS_API bool play_system_sound(const QString &alias, const bool &bAsync);
48 
49  //Play sound from file
50  MUTILS_API bool play_sound_file(const QString &library, const unsigned short uiSoundIdx, const bool &bAsync);
51  }
52 }
53 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 
28 
29 namespace MUtils
30 {
31  namespace Sound
32  {
33  enum beep_t
34  {
35  BEEP_NFO = 0,
36  BEEP_WRN = 1,
37  BEEP_ERR = 2
38  };
39 
40  //Simple beep
41  MUTILS_API bool beep(const beep_t &beepType);
42 
43  //Play built-in sound by name
44  MUTILS_API bool play_sound(const QString &name, const bool &bAsync);
45 
46  //Play system sound by name
47  MUTILS_API bool play_system_sound(const QString &alias, const bool &bAsync);
48 
49  //Play sound from file
50  MUTILS_API bool play_sound_file(const QString &library, const unsigned short uiSoundIdx, const bool &bAsync);
51  }
52 }
53 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d6/d83/_update_checker_8h_source.html b/docs/d6/d83/_update_checker_8h_source.html index 9b399c3..273339f 100644 --- a/docs/d6/d83/_update_checker_8h_source.html +++ b/docs/d6/d83/_update_checker_8h_source.html @@ -67,7 +67,7 @@ $(function() {
UpdateChecker.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 <QThread>
29 #include <QDate>
30 
31 class QUrl;
32 
34 
35 namespace MUtils
36 {
37  class MUTILS_API UpdateCheckerInfo
38  {
39  friend class UpdateChecker;
40 
41  public:
42  UpdateCheckerInfo(void);
43  void resetInfo(void);
44  bool isComplete(void);
45 
46  const quint32 &getBuildNo(void) const { return m_buildNo; }
47  const QDate &getBuildDate(void) const { return m_buildDate; }
48  const QString &getDownloadSite(void) const { return m_downloadSite; }
49  const QString &getDownloadAddress(void) const { return m_downloadAddress; }
50  const QString &getDownloadFilename(void) const { return m_downloadFilename; }
51  const QString &getDownloadFilecode(void) const { return m_downloadFilecode; }
52  const QString &getDownloadChecksum(void) const { return m_downloadChecksum; }
53 
54  private:
55  quint32 m_buildNo;
56  QDate m_buildDate;
57  QString m_downloadSite;
58  QString m_downloadAddress;
59  QString m_downloadFilename;
60  QString m_downloadFilecode;
61  QString m_downloadChecksum;
62  };
63 
64  // ----------------------------------------------------------------
65 
66  class MUTILS_API UpdateChecker : public QThread
67  {
68  Q_OBJECT
69 
70  public:
71  enum
72  {
73  UpdateStatus_NotStartedYet = 0,
74  UpdateStatus_CheckingConnection = 1,
75  UpdateStatus_FetchingUpdates = 2,
76  UpdateStatus_CompletedUpdateAvailable = 3,
77  UpdateStatus_CompletedNoUpdates = 4,
78  UpdateStatus_CompletedNewVersionOlder = 5,
79  UpdateStatus_ErrorNoConnection = 6,
80  UpdateStatus_ErrorConnectionTestFailed = 7,
81  UpdateStatus_ErrorFetchUpdateInfo = 8,
82  UpdateStatus_CancelledByUser = 9
83  }
84  update_status_t;
85 
86  UpdateChecker(const QString &binCurl, const QString &binGnuPG, const QString &binKeys, const QString &applicationId, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode = false);
87  ~UpdateChecker(void);
88 
89  const int getUpdateStatus(void) const { return m_status; }
90  const bool getSuccess(void) const { return m_success; };
91  const int getMaximumProgress(void) const { return m_maxProgress; };
92  const int getCurrentProgress(void) const { return m_progress; };
93  const UpdateCheckerInfo *getUpdateInfo(void) const { return m_updateInfo.data(); }
94 
95  bool cancel(void) { return m_cancelled.ref(); }
96 
97  public slots:
98  void start(Priority = InheritPriority);
99 
100  protected:
101  void run(void);
102  void checkForUpdates(void);
103  void testMirrorsList(void);
104 
105  signals:
106  void statusChanged(const int status);
107  void progressChanged(const int progress);
108  void messageLogged(const QString &text);
109 
110  private:
111  const int m_maxProgress;
112  QScopedPointer<UpdateCheckerInfo> m_updateInfo;
113 
114  const bool m_betaUpdates;
115  const bool m_testMode;
116 
117  const QString m_applicationId;
118  const quint32 m_installedBuildNo;
119 
120  const QString m_binaryCurl;
121  const QString m_binaryGnuPG;
122  const QString m_binaryKeys;
123 
124  const QScopedPointer<const QHash<QString, QString>> m_environment;
125 
126  QAtomicInt m_success;
127  QAtomicInt m_cancelled;
128 
129  int m_status;
130  int m_progress;
131 
132  inline void setStatus(const int status);
133  inline void setProgress(const int progress);
134  inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString());
135 
136  bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign);
137  bool tryContactHost(const QString &hostname, const int &timeoutMsec);
138  bool parseVersionInfo(const QString &file, UpdateCheckerInfo *const updateInfo);
139 
140  bool getFile(const QUrl &url, const QString &outFile, const unsigned int maxRedir = 8U);
141  bool checkSignature(const QString &file, const QString &signature);
142  bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url, const bool &quick);
143 
144  bool execCurl(const QStringList &args, const QString &workingDir, const int timeout);
145  int execProcess(const QString &programFile, const QStringList &args, const QString &workingDir, const int timeout);
146  };
147 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 <QThread>
29 #include <QDate>
30 
31 class QUrl;
32 
34 
35 namespace MUtils
36 {
37  class MUTILS_API UpdateCheckerInfo
38  {
39  friend class UpdateChecker;
40 
41  public:
42  UpdateCheckerInfo(void);
43  void resetInfo(void);
44  bool isComplete(void);
45 
46  const quint32 &getBuildNo(void) const { return m_buildNo; }
47  const QDate &getBuildDate(void) const { return m_buildDate; }
48  const QString &getDownloadSite(void) const { return m_downloadSite; }
49  const QString &getDownloadAddress(void) const { return m_downloadAddress; }
50  const QString &getDownloadFilename(void) const { return m_downloadFilename; }
51  const QString &getDownloadFilecode(void) const { return m_downloadFilecode; }
52  const QString &getDownloadChecksum(void) const { return m_downloadChecksum; }
53 
54  private:
55  quint32 m_buildNo;
56  QDate m_buildDate;
57  QString m_downloadSite;
58  QString m_downloadAddress;
59  QString m_downloadFilename;
60  QString m_downloadFilecode;
61  QString m_downloadChecksum;
62  };
63 
64  // ----------------------------------------------------------------
65 
66  class MUTILS_API UpdateChecker : public QThread
67  {
68  Q_OBJECT
69 
70  public:
71  enum
72  {
73  UpdateStatus_NotStartedYet = 0,
74  UpdateStatus_CheckingConnection = 1,
75  UpdateStatus_FetchingUpdates = 2,
76  UpdateStatus_CompletedUpdateAvailable = 3,
77  UpdateStatus_CompletedNoUpdates = 4,
78  UpdateStatus_CompletedNewVersionOlder = 5,
79  UpdateStatus_ErrorNoConnection = 6,
80  UpdateStatus_ErrorConnectionTestFailed = 7,
81  UpdateStatus_ErrorFetchUpdateInfo = 8,
82  UpdateStatus_CancelledByUser = 9
83  }
84  update_status_t;
85 
86  UpdateChecker(const QString &binCurl, const QString &binGnuPG, const QString &binKeys, const QString &applicationId, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode = false);
87  ~UpdateChecker(void);
88 
89  const int getUpdateStatus(void) const { return m_status; }
90  const bool getSuccess(void) const { return m_success; };
91  const int getMaximumProgress(void) const { return m_maxProgress; };
92  const int getCurrentProgress(void) const { return m_progress; };
93  const UpdateCheckerInfo *getUpdateInfo(void) const { return m_updateInfo.data(); }
94 
95  bool cancel(void) { return m_cancelled.ref(); }
96 
97  public slots:
98  void start(Priority = InheritPriority);
99 
100  protected:
101  void run(void);
102  void checkForUpdates(void);
103  void testMirrorsList(void);
104 
105  signals:
106  void statusChanged(const int status);
107  void progressChanged(const int progress);
108  void messageLogged(const QString &text);
109 
110  private:
111  const int m_maxProgress;
112  QScopedPointer<UpdateCheckerInfo> m_updateInfo;
113 
114  const bool m_betaUpdates;
115  const bool m_testMode;
116 
117  const QString m_applicationId;
118  const quint32 m_installedBuildNo;
119 
120  const QString m_binaryCurl;
121  const QString m_binaryGnuPG;
122  const QString m_binaryKeys;
123 
124  const QScopedPointer<const QHash<QString, QString>> m_environment;
125 
126  QAtomicInt m_success;
127  QAtomicInt m_cancelled;
128 
129  int m_status;
130  int m_progress;
131 
132  inline void setStatus(const int status);
133  inline void setProgress(const int progress);
134  inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString());
135 
136  bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign);
137  bool tryContactHost(const QString &hostname, const int &timeoutMsec);
138  bool parseVersionInfo(const QString &file, UpdateCheckerInfo *const updateInfo);
139 
140  bool getFile(const QUrl &url, const QString &outFile, const unsigned int maxRedir = 8U);
141  bool checkSignature(const QString &file, const QString &signature);
142  bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url, const bool &quick);
143 
144  bool execCurl(const QStringList &args, const QString &workingDir, const int timeout);
145  int execProcess(const QString &programFile, const QStringList &args, const QString &workingDir, const int timeout);
146  };
147 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: UpdateChecker.h:37
Global MUtils namespace.
Definition: CPUFeatures.h:37
Definition: UpdateChecker.h:66
diff --git a/docs/d6/ddd/_terminal_8h_source.html b/docs/d6/ddd/_terminal_8h_source.html index f505f95..4ae4c88 100644 --- a/docs/d6/ddd/_terminal_8h_source.html +++ b/docs/d6/ddd/_terminal_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Terminal.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 <QIcon>
29 
31 
32 namespace MUtils
33 {
34  namespace Terminal
35  {
36  //Setup terminal
37  MUTILS_API void setup(int &argc, char **argv, const char* const appName, const bool forceEnabled);
38 
39  //Terminal output
40  MUTILS_API void write(const int &type, const char *const message);
41 
42  //Terminal icon
43  MUTILS_API void set_icon(const QIcon &icon);
44  }
45 }
46 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 <QIcon>
29 
31 
32 namespace MUtils
33 {
34  namespace Terminal
35  {
36  //Setup terminal
37  MUTILS_API void setup(int &argc, char **argv, const char* const appName, const bool forceEnabled);
38 
39  //Terminal output
40  MUTILS_API void write(const int &type, const char *const message);
41 
42  //Terminal icon
43  MUTILS_API void set_icon(const QIcon &icon);
44  }
45 }
46 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d7/d73/_translation_8h_source.html b/docs/d7/d73/_translation_8h_source.html index d0a0817..eca8efb 100644 --- a/docs/d7/d73/_translation_8h_source.html +++ b/docs/d7/d73/_translation_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Translation.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 <QtGlobal>
29 
31 
32 namespace MUtils
33 {
34  namespace Translation
35  {
36  //Register new translation
37  MUTILS_API bool insert(const QString &langId, const QString &qmFile, const QString &langName, const quint32 &systemId, const quint32 &country);
38 
39  //Enumerate translations
40  MUTILS_API int enumerate(QStringList &list);
41 
42  //Get translation info
43  MUTILS_API QString get_name (const QString &langId);
44  MUTILS_API quint32 get_sysid (const QString &langId);
45  MUTILS_API quint32 get_country(const QString &langId);
46 
47  //Install translator
48  MUTILS_API bool install_translator(const QString &langId);
49  MUTILS_API bool install_translator_from_file(const QString &qmFile);
50 
51  //Constant
52  MUTILS_API extern const char *const DEFAULT_LANGID;
53  }
54 }
55 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 <QtGlobal>
29 
31 
32 namespace MUtils
33 {
34  namespace Translation
35  {
36  //Register new translation
37  MUTILS_API bool insert(const QString &langId, const QString &qmFile, const QString &langName, const quint32 &systemId, const quint32 &country);
38 
39  //Enumerate translations
40  MUTILS_API int enumerate(QStringList &list);
41 
42  //Get translation info
43  MUTILS_API QString get_name (const QString &langId);
44  MUTILS_API quint32 get_sysid (const QString &langId);
45  MUTILS_API quint32 get_country(const QString &langId);
46 
47  //Install translator
48  MUTILS_API bool install_translator(const QString &langId);
49  MUTILS_API bool install_translator_from_file(const QString &qmFile);
50 
51  //Constant
52  MUTILS_API extern const char *const DEFAULT_LANGID;
53  }
54 }
55 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/d8/d4d/_lazy_8h_source.html b/docs/d8/d4d/_lazy_8h_source.html index bab02d4..3848886 100644 --- a/docs/d8/d4d/_lazy_8h_source.html +++ b/docs/d8/d4d/_lazy_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Lazy.h
-Go to the documentation of this file.
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 #include <MUtils/Exception.h>
32 
33 //Qt
34 #include <QThread>
35 #include <QAtomicPointer>
36 #include <QAtomicInt>
37 
38 //CRT
39 #include <functional>
40 
41 namespace MUtils
42 {
50  template<typename T> class Lazy
51  {
52  public:
53  Lazy(std::function<T*(void)> &&initializer) : m_initializer(initializer) { }
54 
55  T& operator*(void)
56  {
57  return (*getValue());
58  }
59 
60  T* operator->(void)
61  {
62  return getValue();
63  }
64 
65  bool initialized()
66  {
67  return (m_state > 1);
68  }
69 
70  ~Lazy(void)
71  {
72  if(T *const value = m_value)
73  {
74  delete value;
75  }
76  }
77 
78  protected:
79  __forceinline T* getValue()
80  {
81  T *value;
82  while (!(value = m_value))
83  {
84  if (m_state.testAndSetOrdered(0, 1))
85  {
86  if (value = m_initializer())
87  {
88  m_value.fetchAndStoreOrdered(value);
89  m_state.fetchAndStoreOrdered(2);
90  break; /*success*/
91  }
92  m_state.fetchAndStoreOrdered(0);
93  MUTILS_THROW("Initializer returned NULL pointer!");
94  }
95  QThread::yieldCurrentThread();
96  }
97  return value;
98  }
99 
100  private:
101  QAtomicPointer<T> m_value;
102  QAtomicInt m_state;
103  const std::function<T*(void)> m_initializer;
104  };
105 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+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 #include <MUtils/Exception.h>
32 
33 //Qt
34 #include <QThread>
35 #include <QAtomicPointer>
36 #include <QAtomicInt>
37 
38 //CRT
39 #include <functional>
40 
41 namespace MUtils
42 {
50  template<typename T> class Lazy
51  {
52  public:
53  Lazy(std::function<T*(void)> &&initializer) : m_initializer(initializer) { }
54 
55  T& operator*(void)
56  {
57  return (*getValue());
58  }
59 
60  T* operator->(void)
61  {
62  return getValue();
63  }
64 
65  bool initialized()
66  {
67  return (m_state > 1);
68  }
69 
70  ~Lazy(void)
71  {
72  if(T *const value = m_value)
73  {
74  delete value;
75  }
76  }
77 
78  protected:
79  __forceinline T* getValue()
80  {
81  T *value;
82  while (!(value = m_value))
83  {
84  if (m_state.testAndSetOrdered(0, 1))
85  {
86  if (value = m_initializer())
87  {
88  m_value.fetchAndStoreOrdered(value);
89  m_state.fetchAndStoreOrdered(2);
90  break; /*success*/
91  }
92  m_state.fetchAndStoreOrdered(0);
93  MUTILS_THROW("Initializer returned NULL pointer!");
94  }
95  QThread::yieldCurrentThread();
96  }
97  return value;
98  }
99 
100  private:
101  QAtomicPointer<T> m_value;
102  QAtomicInt m_state;
103  const std::function<T*(void)> m_initializer;
104  };
105 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Lazy initialization template class.
Definition: Lazy.h:50
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/da/d5d/_g_u_i_8h_source.html b/docs/da/d5d/_g_u_i_8h_source.html index a8ddab9..b5d264f 100644 --- a/docs/da/d5d/_g_u_i_8h_source.html +++ b/docs/da/d5d/_g_u_i_8h_source.html @@ -67,7 +67,7 @@ $(function() {
GUI.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 <QColor>
29 
30 //Forward Declaration
31 class QIcon;
32 class QWidget;
33 
35 
36 namespace MUtils
37 {
38  namespace GUI
39  {
40  typedef enum
41  {
42  USER_EVENT = 1000, /*QEvent::User*/
43  USER_EVENT_QUERYENDSESSION = USER_EVENT + 666,
44  USER_EVENT_ENDSESSION = USER_EVENT + 667
45  }
46  user_events_t;
47 
48  typedef enum
49  {
50  SYSCOLOR_TEXT = 1,
51  SYSCOLOR_BACKGROUND = 2,
52  SYSCOLOR_CAPTION = 3
53  }
54  system_color_t;
55 
56  //Broadcast message
57  MUTILS_API bool broadcast(int eventType, const bool &onlyToVisible);
58 
59  //Window icon
60  MUTILS_API bool set_window_icon(QWidget *const window, const QIcon &icon, const bool bIsBigIcon);
61 
62  //Theme support
63  MUTILS_API bool themes_enabled(void);
64 
65  //DPI information
66  MUTILS_API double dpi_scale(void);
67  MUTILS_API bool scale_widget(QWidget *const widget, const bool recenter = true);
68  MUTILS_API bool center_widget(QWidget *const widget);
69 
70  //System menu
71  MUTILS_API bool sysmenu_append(const QWidget *const win, const unsigned int identifier, const QString &text);
72  MUTILS_API bool sysmenu_update(const QWidget *const win, const unsigned int identifier, const QString &text);
73  MUTILS_API bool sysmenu_check_msg(void *const message, const unsigned int &identifier);
74 
75  //Close button
76  MUTILS_API bool enable_close_button(const QWidget *const win, const bool &bEnable);
77 
78  //Bring to front
79  MUTILS_API bool bring_to_front(const QWidget *const window);
80  MUTILS_API bool bring_to_front(const unsigned long pid);
81 
82  //Sheet of glass
83  MUTILS_API bool sheet_of_glass(QWidget *const window);
84  MUTILS_API bool sheet_of_glass_update(QWidget *const window);
85 
86  //System colors
87  MUTILS_API QColor system_color(const int &color_id);
88 
89  //Blink window
90  MUTILS_API void blink_window(QWidget *const poWindow, const unsigned int &count = 10, const unsigned int &delay = 150);
91 
92  //Force quit application
93  MUTILS_API void force_quit(void);
94  }
95 }
96 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
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 <QColor>
29 
30 //Forward Declaration
31 class QIcon;
32 class QWidget;
33 
35 
36 namespace MUtils
37 {
38  namespace GUI
39  {
40  typedef enum
41  {
42  USER_EVENT = 1000, /*QEvent::User*/
43  USER_EVENT_QUERYENDSESSION = USER_EVENT + 666,
44  USER_EVENT_ENDSESSION = USER_EVENT + 667
45  }
46  user_events_t;
47 
48  typedef enum
49  {
50  SYSCOLOR_TEXT = 1,
51  SYSCOLOR_BACKGROUND = 2,
52  SYSCOLOR_CAPTION = 3
53  }
54  system_color_t;
55 
56  //Broadcast message
57  MUTILS_API bool broadcast(int eventType, const bool &onlyToVisible);
58 
59  //Window icon
60  MUTILS_API bool set_window_icon(QWidget *const window, const QIcon &icon, const bool bIsBigIcon);
61 
62  //Theme support
63  MUTILS_API bool themes_enabled(void);
64 
65  //DPI information
66  MUTILS_API double dpi_scale(void);
67  MUTILS_API bool scale_widget(QWidget *const widget, const bool recenter = true);
68  MUTILS_API bool center_widget(QWidget *const widget);
69 
70  //System menu
71  MUTILS_API bool sysmenu_append(const QWidget *const win, const unsigned int identifier, const QString &text);
72  MUTILS_API bool sysmenu_update(const QWidget *const win, const unsigned int identifier, const QString &text);
73  MUTILS_API bool sysmenu_check_msg(void *const message, const unsigned int &identifier);
74 
75  //Close button
76  MUTILS_API bool enable_close_button(const QWidget *const win, const bool &bEnable);
77 
78  //Bring to front
79  MUTILS_API bool bring_to_front(const QWidget *const window);
80  MUTILS_API bool bring_to_front(const unsigned long pid);
81 
82  //Sheet of glass
83  MUTILS_API bool sheet_of_glass(QWidget *const window);
84  MUTILS_API bool sheet_of_glass_update(QWidget *const window);
85 
86  //System colors
87  MUTILS_API QColor system_color(const int &color_id);
88 
89  //Blink window
90  MUTILS_API void blink_window(QWidget *const poWindow, const unsigned int &count = 10, const unsigned int &delay = 150);
91 
92  //Force quit application
93  MUTILS_API void force_quit(void);
94  }
95 }
96 
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Global MUtils namespace.
Definition: CPUFeatures.h:37
diff --git a/docs/df/d98/_exception_8h_source.html b/docs/df/d98/_exception_8h_source.html index 695d7fc..be48edd 100644 --- a/docs/df/d98/_exception_8h_source.html +++ b/docs/df/d98/_exception_8h_source.html @@ -67,7 +67,7 @@ $(function() {
Exception.h
-
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2018 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 #include <stdexcept>
25 
26 #define MUTILS_PRINT_ERROR(FORMAT, ...) do \
27 { \
28  fflush(stdout); \
29  fprintf(stderr, (FORMAT), __VA_ARGS__); \
30  fflush(stderr); \
31 } \
32 while(0)
33 
34 #define MUTILS_EXCEPTION_HANDLER(COMMAND) do \
35 { \
36  try \
37  { \
38  do { COMMAND; } while(0); \
39  } \
40  catch(const std::exception &error) \
41  { \
42  MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nException error:\n%s\n", error.what()); \
43  MUtils::OS::fatal_exit(L"Unhandeled C++ exception error, application will exit!"); \
44  } \
45  catch(...) \
46  { \
47  MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nUnknown exception error!\n"); \
48  MUtils::OS::fatal_exit(L"Unhandeled C++ exception error, application will exit!"); \
49  } \
50 } \
51 while(0)
52 
53 #define MUTILS_THROW(MESSAGE) do \
54 { \
55  throw std::runtime_error((MESSAGE)); \
56 } \
57 while(0)
58 
59 #define MUTILS_THROW_FMT(MESSAGE, ...) do \
60 { \
61  char _message[256]; \
62  _snprintf_s(_message, 256, _TRUNCATE, (MESSAGE), __VA_ARGS__); \
63  throw std::runtime_error(_message); \
64 } \
65 while(0)
+
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 #include <stdexcept>
25 
26 #define MUTILS_PRINT_ERROR(FORMAT, ...) do \
27 { \
28  fflush(stdout); \
29  fprintf(stderr, (FORMAT), __VA_ARGS__); \
30  fflush(stderr); \
31 } \
32 while(0)
33 
34 #define MUTILS_EXCEPTION_HANDLER(COMMAND) do \
35 { \
36  try \
37  { \
38  do { COMMAND; } while(0); \
39  } \
40  catch(const std::exception &error) \
41  { \
42  MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nException error:\n%s\n", error.what()); \
43  MUtils::OS::fatal_exit(L"Unhandeled C++ exception error, application will exit!"); \
44  } \
45  catch(...) \
46  { \
47  MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nUnknown exception error!\n"); \
48  MUtils::OS::fatal_exit(L"Unhandeled C++ exception error, application will exit!"); \
49  } \
50 } \
51 while(0)
52 
53 #define MUTILS_THROW(MESSAGE) do \
54 { \
55  throw std::runtime_error((MESSAGE)); \
56 } \
57 while(0)
58 
59 #define MUTILS_THROW_FMT(MESSAGE, ...) do \
60 { \
61  char _message[256]; \
62  _snprintf_s(_message, 256, _TRUNCATE, (MESSAGE), __VA_ARGS__); \
63  throw std::runtime_error(_message); \
64 } \
65 while(0)