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

§ parent_path()

+ +
+
+ + + + + + + + +
MUTILS_API QString MUtils::parent_path (const QString & path)
+
+ +

Get parent path.

+

This function determines the "parent" path, by removing the last path component (file name or directory) form the given original path.

+
Parameters
+ + +
pathA read-only reference to the original path string.
+
+
+
Returns
The remaining path string (i.e. "parent" path); an empty string if the original path only consited of a single component.
+ +
+

§ parity()

diff --git a/docs/d4/d85/_job_object_8h_source.html b/docs/d4/d85/_job_object_8h_source.html index 1d9ee03..51f8464 100644 --- a/docs/d4/d85/_job_object_8h_source.html +++ b/docs/d4/d85/_job_object_8h_source.html @@ -70,7 +70,7 @@ $(function() { 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:418
+
#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:429