From 276788ef13a997107c6e9e9b2bca585596c40168 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Thu, 11 May 2017 20:15:40 +0200 Subject: [PATCH] Re-gen docs. --- docs/d0/d8a/class_m_utils_1_1_update_checker.html | 6 +++--- docs/d2/dad/_hash_8h_source.html | 2 +- docs/d4/d85/_job_object_8h_source.html | 2 +- docs/d5/d3b/_global_8h.html | 4 ++++ docs/d5/d3b/_global_8h_source.html | 2 +- docs/d6/d83/_update_checker_8h_source.html | 2 +- docs/globals.html | 3 +++ docs/globals_defs.html | 3 +++ docs/search/all_b.js | 1 + docs/search/defines_0.js | 1 + 10 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/d0/d8a/class_m_utils_1_1_update_checker.html b/docs/d0/d8a/class_m_utils_1_1_update_checker.html index 0153c64..138f765 100644 --- a/docs/d0/d8a/class_m_utils_1_1_update_checker.html +++ b/docs/d0/d8a/class_m_utils_1_1_update_checker.html @@ -141,9 +141,9 @@ const int getCurrentProgre const UpdateCheckerInfogetUpdateInfo (void) const   - -void cancel (void) -  + +bool cancel (void) +  diff --git a/docs/d2/dad/_hash_8h_source.html b/docs/d2/dad/_hash_8h_source.html index 5fb4967..866f5de 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:366
+
#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:370
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/d4/d85/_job_object_8h_source.html b/docs/d4/d85/_job_object_8h_source.html index 254f51e..7a57f6d 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-2017 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:366
+
#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:370
+ + + diff --git a/docs/d5/d3b/_global_8h_source.html b/docs/d5/d3b/_global_8h_source.html index 84321cf..8d4ecc8 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-2017 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 
35 
39 //MUtils API
40 #ifdef _MSC_VER
41 # ifdef MUTILS_DLL_EXPORT
42 # define MUTILS_API __declspec(dllexport)
43 # else
44 # ifndef MUTILS_STATIC_LIB
45 # define MUTILS_API __declspec(dllimport)
46 # else
47 # define MUTILS_API /*static lib*/
48 # endif
49 # endif
50 #else
51 # define MUTILS_API
52 #endif
53 
54 #define MUTILS_MAKE_STRING_HELPER(X) #X
55 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
56 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
57 
58 //Check Debug Flags
59 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
60 # define MUTILS_DEBUG (1)
61 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG))
62 # error Inconsistent DEBUG flags have been detected!
63 # endif
64 #else
65 # define MUTILS_DEBUG (0)
66 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG)
67 # error Inconsistent DEBUG flags have been detected!
68 # endif
69 #endif
70 
71 //Check CPU options
72 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP)
73  #if (_M_IX86_FP != 0)
74  #error We should not enabled SSE or SSE2 in release builds!
75  #endif
76 #endif
77 
81 
86 namespace MUtils
87 {
95  MUTILS_API const QString& temp_folder(void);
96 
110  MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL);
111 
119  MUTILS_API quint32 next_rand_u32(void);
120 
128  MUTILS_API quint64 next_rand_u64(void);
129 
139  MUTILS_API QString next_rand_str(const bool &bLong = false);
140 
154  MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false);
155 
171  MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false);
172 
180  MUTILS_API bool parity(quint32 value);
181 
191  MUTILS_API bool remove_file(const QString &fileName);
192 
204  MUTILS_API bool remove_directory(const QString &folderPath, const bool &recursive);
205 
215  MUTILS_API QString& trim_right(QString &str);
216 
226  MUTILS_API QString& trim_left(QString &str);
227 
237  MUTILS_API QString trim_right(const QString &str);
238 
248  MUTILS_API QString trim_left(const QString &str);
249 
259  MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase);
260 
272  MUTILS_API QString clean_file_name(const QString &name, const bool &pretty);
273 
285  MUTILS_API QString clean_file_path(const QString &path, const bool &pretty);
286 
298  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value);
299 
313  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &count);
314 
324  MUTILS_API QStringList available_codepages(const bool &noAliases = true);
325 
326  //Internal
327  namespace Internal
328  {
329  MUTILS_API int selfTest(const char *const buildKey, const bool debug);
330  static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
331  }
332 }
333 
335 
338 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0)
339 
342 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0)
343 
346 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR)))
347 
350 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
351 
354 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData())
355 
358 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))
359 
362 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0")
363 
366 #define MUTILS_NO_COPY(CLASS) \
367  CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \
368  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-2017 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 
35 
39 //MUtils API
40 #ifdef _MSC_VER
41 # ifdef MUTILS_DLL_EXPORT
42 # define MUTILS_API __declspec(dllexport)
43 # else
44 # ifndef MUTILS_STATIC_LIB
45 # define MUTILS_API __declspec(dllimport)
46 # else
47 # define MUTILS_API /*static lib*/
48 # endif
49 # endif
50 #else
51 # define MUTILS_API
52 #endif
53 
54 #define MUTILS_MAKE_STRING_HELPER(X) #X
55 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
56 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
57 
58 //Check Debug Flags
59 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
60 # define MUTILS_DEBUG (1)
61 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG))
62 # error Inconsistent DEBUG flags have been detected!
63 # endif
64 #else
65 # define MUTILS_DEBUG (0)
66 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG)
67 # error Inconsistent DEBUG flags have been detected!
68 # endif
69 #endif
70 
71 //Check CPU options
72 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP)
73  #if (_M_IX86_FP != 0)
74  #error We should not enabled SSE or SSE2 in release builds!
75  #endif
76 #endif
77 
81 
86 namespace MUtils
87 {
95  MUTILS_API const QString& temp_folder(void);
96 
110  MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL);
111 
119  MUTILS_API quint32 next_rand_u32(void);
120 
128  MUTILS_API quint64 next_rand_u64(void);
129 
139  MUTILS_API QString next_rand_str(const bool &bLong = false);
140 
154  MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false);
155 
171  MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false);
172 
180  MUTILS_API bool parity(quint32 value);
181 
191  MUTILS_API bool remove_file(const QString &fileName);
192 
204  MUTILS_API bool remove_directory(const QString &folderPath, const bool &recursive);
205 
215  MUTILS_API QString& trim_right(QString &str);
216 
226  MUTILS_API QString& trim_left(QString &str);
227 
237  MUTILS_API QString trim_right(const QString &str);
238 
248  MUTILS_API QString trim_left(const QString &str);
249 
259  MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase);
260 
272  MUTILS_API QString clean_file_name(const QString &name, const bool &pretty);
273 
285  MUTILS_API QString clean_file_path(const QString &path, const bool &pretty);
286 
298  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 &value);
299 
313  MUTILS_API bool regexp_parse_uint32(const QRegExp &regexp, quint32 *values, const size_t &count);
314 
324  MUTILS_API QStringList available_codepages(const bool &noAliases = true);
325 
326  //Internal
327  namespace Internal
328  {
329  MUTILS_API int selfTest(const char *const buildKey, const bool debug);
330  static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
331  }
332 }
333 
335 
338 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0)
339 
342 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0)
343 
346 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR)))
347 
350 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
351 
354 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData())
355 
358 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))
359 
362 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0")
363 
366 #define MUTILS_BOOLIFY(X) (!(!(X)))
367 
370 #define MUTILS_NO_COPY(CLASS) \
371  CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \
372  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.
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.
MUTILS_API QString clean_file_path(const QString &path, const bool &pretty)
Clean up a file path string.
diff --git a/docs/d6/d83/_update_checker_8h_source.html b/docs/d6/d83/_update_checker_8h_source.html index bea46fd..5d0462d 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-2017 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 
32 
33 namespace MUtils
34 {
35  class MUTILS_API UpdateCheckerInfo
36  {
37  friend class UpdateChecker;
38 
39  public:
40  UpdateCheckerInfo(void);
41  void resetInfo(void);
42  bool isComplete(void);
43 
44  const quint32 &getBuildNo(void) const { return m_buildNo; }
45  const QDate &getBuildDate(void) const { return m_buildDate; }
46  const QString &getDownloadSite(void) const { return m_downloadSite; }
47  const QString &getDownloadAddress(void) const { return m_downloadAddress; }
48  const QString &getDownloadFilename(void) const { return m_downloadFilename; }
49  const QString &getDownloadFilecode(void) const { return m_downloadFilecode; }
50  const QString &getDownloadChecksum(void) const { return m_downloadChecksum; }
51 
52  private:
53  quint32 m_buildNo;
54  QDate m_buildDate;
55  QString m_downloadSite;
56  QString m_downloadAddress;
57  QString m_downloadFilename;
58  QString m_downloadFilecode;
59  QString m_downloadChecksum;
60  };
61 
62  // ----------------------------------------------------------------
63 
64  class MUTILS_API UpdateChecker : public QThread
65  {
66  Q_OBJECT
67 
68  public:
69  enum
70  {
71  UpdateStatus_NotStartedYet = 0,
72  UpdateStatus_CheckingConnection = 1,
73  UpdateStatus_FetchingUpdates = 2,
74  UpdateStatus_CompletedUpdateAvailable = 3,
75  UpdateStatus_CompletedNoUpdates = 4,
76  UpdateStatus_CompletedNewVersionOlder = 5,
77  UpdateStatus_ErrorNoConnection = 6,
78  UpdateStatus_ErrorConnectionTestFailed = 7,
79  UpdateStatus_ErrorFetchUpdateInfo = 8,
80  UpdateStatus_CancelledByUser = 9
81  }
82  update_status_t;
83 
84  UpdateChecker(const QString &binWGet, const QString &binMCat, const QString &binGnuPG, const QString &binKeys, const QString &applicationId, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode = false);
85  ~UpdateChecker(void);
86 
87  const int getUpdateStatus(void) const { return m_status; }
88  const bool getSuccess(void) const { return m_success; };
89  const int getMaximumProgress(void) const { return m_maxProgress; };
90  const int getCurrentProgress(void) const { return m_progress; };
91  const UpdateCheckerInfo *getUpdateInfo(void) const { return m_updateInfo.data(); }
92 
93  void cancel(void) { m_cancelled = true; }
94 
95  public slots:
96  void start(Priority = InheritPriority);
97 
98  protected:
99  void run(void);
100  void checkForUpdates(void);
101  void testKnownHosts(void);
102 
103  signals:
104  void statusChanged(const int status);
105  void progressChanged(const int progress);
106  void messageLogged(const QString &text);
107 
108  private:
109  const int m_maxProgress;
110  QScopedPointer<UpdateCheckerInfo> m_updateInfo;
111 
112  const bool m_betaUpdates;
113  const bool m_testMode;
114 
115  const QString m_applicationId;
116  const quint32 m_installedBuildNo;
117 
118  const QString m_binaryWGet;
119  const QString m_binaryMCat;
120  const QString m_binaryGnuPG;
121  const QString m_binaryKeys;
122 
123  volatile bool m_success;
124  volatile bool m_cancelled;
125 
126  int m_status;
127  int m_progress;
128 
129  inline void setStatus(const int status);
130  inline void setProgress(const int progress);
131  inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString());
132 
133  bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign);
134  bool tryContactHost(const QString &hostname, const int &timeoutMsec);
135  bool parseVersionInfo(const QString &file, UpdateCheckerInfo *updateInfo);
136 
137  bool getFile(const QString &url, const QString &outFile, const unsigned int maxRedir = 5U);
138  bool getFile(const QString &url, const bool forceIp4, const QString &outFile, const unsigned int maxRedir = 5U);
139  bool checkSignature(const QString &file, const QString &signature);
140  bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url, const bool &quick);
141  };
142 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
+
1 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2017 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 
32 
33 namespace MUtils
34 {
35  class MUTILS_API UpdateCheckerInfo
36  {
37  friend class UpdateChecker;
38 
39  public:
40  UpdateCheckerInfo(void);
41  void resetInfo(void);
42  bool isComplete(void);
43 
44  const quint32 &getBuildNo(void) const { return m_buildNo; }
45  const QDate &getBuildDate(void) const { return m_buildDate; }
46  const QString &getDownloadSite(void) const { return m_downloadSite; }
47  const QString &getDownloadAddress(void) const { return m_downloadAddress; }
48  const QString &getDownloadFilename(void) const { return m_downloadFilename; }
49  const QString &getDownloadFilecode(void) const { return m_downloadFilecode; }
50  const QString &getDownloadChecksum(void) const { return m_downloadChecksum; }
51 
52  private:
53  quint32 m_buildNo;
54  QDate m_buildDate;
55  QString m_downloadSite;
56  QString m_downloadAddress;
57  QString m_downloadFilename;
58  QString m_downloadFilecode;
59  QString m_downloadChecksum;
60  };
61 
62  // ----------------------------------------------------------------
63 
64  class MUTILS_API UpdateChecker : public QThread
65  {
66  Q_OBJECT
67 
68  public:
69  enum
70  {
71  UpdateStatus_NotStartedYet = 0,
72  UpdateStatus_CheckingConnection = 1,
73  UpdateStatus_FetchingUpdates = 2,
74  UpdateStatus_CompletedUpdateAvailable = 3,
75  UpdateStatus_CompletedNoUpdates = 4,
76  UpdateStatus_CompletedNewVersionOlder = 5,
77  UpdateStatus_ErrorNoConnection = 6,
78  UpdateStatus_ErrorConnectionTestFailed = 7,
79  UpdateStatus_ErrorFetchUpdateInfo = 8,
80  UpdateStatus_CancelledByUser = 9
81  }
82  update_status_t;
83 
84  UpdateChecker(const QString &binWGet, const QString &binMCat, const QString &binGnuPG, const QString &binKeys, const QString &applicationId, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode = false);
85  ~UpdateChecker(void);
86 
87  const int getUpdateStatus(void) const { return m_status; }
88  const bool getSuccess(void) const { return m_success; };
89  const int getMaximumProgress(void) const { return m_maxProgress; };
90  const int getCurrentProgress(void) const { return m_progress; };
91  const UpdateCheckerInfo *getUpdateInfo(void) const { return m_updateInfo.data(); }
92 
93  bool cancel(void) { return m_cancelled.ref(); }
94 
95  public slots:
96  void start(Priority = InheritPriority);
97 
98  protected:
99  void run(void);
100  void checkForUpdates(void);
101  void testKnownHosts(void);
102 
103  signals:
104  void statusChanged(const int status);
105  void progressChanged(const int progress);
106  void messageLogged(const QString &text);
107 
108  private:
109  const int m_maxProgress;
110  QScopedPointer<UpdateCheckerInfo> m_updateInfo;
111 
112  const bool m_betaUpdates;
113  const bool m_testMode;
114 
115  const QString m_applicationId;
116  const quint32 m_installedBuildNo;
117 
118  const QString m_binaryWGet;
119  const QString m_binaryMCat;
120  const QString m_binaryGnuPG;
121  const QString m_binaryKeys;
122 
123  QAtomicInt m_success;
124  QAtomicInt m_cancelled;
125 
126  int m_status;
127  int m_progress;
128 
129  inline void setStatus(const int status);
130  inline void setProgress(const int progress);
131  inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString());
132 
133  bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign);
134  bool tryContactHost(const QString &hostname, const int &timeoutMsec);
135  bool parseVersionInfo(const QString &file, UpdateCheckerInfo *updateInfo);
136 
137  bool getFile(const QString &url, const QString &outFile, const unsigned int maxRedir = 5U);
138  bool getFile(const QString &url, const bool forceIp4, const QString &outFile, const unsigned int maxRedir = 5U);
139  bool checkSignature(const QString &file, const QString &signature);
140  bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url, const bool &quick);
141  };
142 }
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: UpdateChecker.h:35
Global MUtils namespace.
Definition: CPUFeatures.h:37
Definition: UpdateChecker.h:64
diff --git a/docs/globals.html b/docs/globals.html index e130e9b..1a8f59a 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -63,6 +63,9 @@ $(function() {
  • MUTILS_BOOL2STR : Global.h
  • +
  • MUTILS_BOOLIFY +: Global.h +
  • MUTILS_DELETE : Global.h
  • diff --git a/docs/globals_defs.html b/docs/globals_defs.html index c0c9271..bb1ecf3 100644 --- a/docs/globals_defs.html +++ b/docs/globals_defs.html @@ -63,6 +63,9 @@ $(function() {
  • MUTILS_BOOL2STR : Global.h
  • +
  • MUTILS_BOOLIFY +: Global.h +
  • MUTILS_DELETE : Global.h
  • diff --git a/docs/search/all_b.js b/docs/search/all_b.js index dbb59f2..5b1ac8c 100644 --- a/docs/search/all_b.js +++ b/docs/search/all_b.js @@ -6,6 +6,7 @@ var searchData= ['model',['model',['../dd/de2/struct_m_utils_1_1_c_p_u_fetaures_1_1__cpu__info__t.html#a7d0a012412dc4b04f2b5b37e83f5874a',1,'MUtils::CPUFetaures::_cpu_info_t']]], ['mutils',['MUtils',['../d3/da6/namespace_m_utils.html',1,'']]], ['mutils_5fbool2str',['MUTILS_BOOL2STR',['../d5/d3b/_global_8h.html#a177ecbfe7701c2ac04bb8bdeb208773a',1,'Global.h']]], + ['mutils_5fboolify',['MUTILS_BOOLIFY',['../d5/d3b/_global_8h.html#a8455a4d868742129d26356469fae26ba',1,'Global.h']]], ['mutils_5fdelete',['MUTILS_DELETE',['../d5/d3b/_global_8h.html#ad42b1946a83df3bd76734d5ab691fd0d',1,'Global.h']]], ['mutils_5fdelete_5farray',['MUTILS_DELETE_ARRAY',['../d5/d3b/_global_8h.html#aa544a37b80f1ab9d86f439a7666e9aa8',1,'Global.h']]], ['mutils_5fno_5fcopy',['MUTILS_NO_COPY',['../d5/d3b/_global_8h.html#a8e7b4857b78f9749233e5abc96534ca8',1,'Global.h']]], diff --git a/docs/search/defines_0.js b/docs/search/defines_0.js index e724674..bd24277 100644 --- a/docs/search/defines_0.js +++ b/docs/search/defines_0.js @@ -1,6 +1,7 @@ var searchData= [ ['mutils_5fbool2str',['MUTILS_BOOL2STR',['../d5/d3b/_global_8h.html#a177ecbfe7701c2ac04bb8bdeb208773a',1,'Global.h']]], + ['mutils_5fboolify',['MUTILS_BOOLIFY',['../d5/d3b/_global_8h.html#a8455a4d868742129d26356469fae26ba',1,'Global.h']]], ['mutils_5fdelete',['MUTILS_DELETE',['../d5/d3b/_global_8h.html#ad42b1946a83df3bd76734d5ab691fd0d',1,'Global.h']]], ['mutils_5fdelete_5farray',['MUTILS_DELETE_ARRAY',['../d5/d3b/_global_8h.html#aa544a37b80f1ab9d86f439a7666e9aa8',1,'Global.h']]], ['mutils_5fno_5fcopy',['MUTILS_NO_COPY',['../d5/d3b/_global_8h.html#a8e7b4857b78f9749233e5abc96534ca8',1,'Global.h']]],

    Public Attributes

    MUTILS_BOOL2STR(X)   ((X) ? "1" : "0")
     Converts a boolean expression into a string. A true boolean expression is converted to the string "1"; a false boolean expression is converted to the string "0".
     
    +#define MUTILS_BOOLIFY(X)   (!(!(X)))
     Converts a given expression into a boolean expression, by application of double negation operator.
     
    #define MUTILS_NO_COPY(CLASS)
     Disables copy constructor and assignment operator in the specified class. This macro should be used in the "private" section of the class' declaration. More...