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() {
-
38 MUTILS_API
static const quint32 &lib_version_major(
void);
39 MUTILS_API
static const quint32 &lib_version_minor(
void);
42 MUTILS_API
static const QDate lib_build_date(
void);
43 MUTILS_API
static const QTime lib_build_time(
void);
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());
50 static const char *
const compiler_version(
void)
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) 64 #elif (__INTEL_COMPILER >= 1000) 67 #error Compiler is not supported! 69 #elif defined(_MSC_VER) 70 #if (_MSC_VER == 1922) 71 #if((_MSC_FULL_VER >= 192227905) && (_MSC_FULL_VER <= 192227905)) 74 #error Compiler version is not supported yet! 76 #elif (_MSC_VER == 1921) 77 #if((_MSC_FULL_VER >= 192127702) && (_MSC_FULL_VER <= 192127702)) 80 #error Compiler version is not supported yet! 82 #elif (_MSC_VER == 1920) 83 #if((_MSC_FULL_VER >= 192027508) && (_MSC_FULL_VER <= 192027508)) 86 #error Compiler version is not supported yet! 88 #elif (_MSC_VER == 1916) 89 #if((_MSC_FULL_VER >= 191627024) && (_MSC_FULL_VER <= 191627032)) 92 #error Compiler version is not supported yet! 94 #elif (_MSC_VER == 1915) 95 #if((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732)) 98 #error Compiler version is not supported yet! 100 #elif (_MSC_VER == 1914) 101 #if((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433)) 104 #error Compiler version is not supported yet! 106 #elif (_MSC_VER == 1913) 107 #if((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132)) 110 #error Compiler version is not supported yet! 112 #elif (_MSC_VER == 1912) 113 #if((_MSC_FULL_VER >= 191225830) && (_MSC_FULL_VER <= 191225835)) 116 #error Compiler version is not supported yet! 118 #elif (_MSC_VER == 1911) 119 #if((_MSC_FULL_VER >= 191125542) && (_MSC_FULL_VER <= 191125547)) 121 #elif((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508)) 124 #error Compiler version is not supported yet! 126 #elif (_MSC_VER == 1910) 127 #if ((_MSC_FULL_VER >= 191025017) && (_MSC_FULL_VER <= 191025019)) 130 #error Compiler version is not supported yet! 132 #elif (_MSC_VER == 1900) 133 #if (_MSC_FULL_VER == 190023026) 135 #elif (_MSC_FULL_VER == 190023506) 137 #elif (_MSC_FULL_VER == 190023918) 139 #elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215) 142 #error Compiler version is not supported yet! 144 #elif (_MSC_VER == 1800) 145 #if (_MSC_FULL_VER == 180021005) 147 #elif (_MSC_FULL_VER == 180030501) 149 #elif (_MSC_FULL_VER == 180030723) 151 #elif (_MSC_FULL_VER == 180031101) 153 #elif (_MSC_FULL_VER == 180040629) 156 #error Compiler version is not supported yet! 158 #elif (_MSC_VER == 1700) 159 #if (_MSC_FULL_VER == 170050727) 161 #elif (_MSC_FULL_VER == 170051106) 163 #elif (_MSC_FULL_VER == 170060315) 165 #elif (_MSC_FULL_VER == 170060610) 167 #elif (_MSC_FULL_VER == 170061030) 170 #error Compiler version is not supported yet! 172 #elif (_MSC_VER == 1600) 173 #if (_MSC_FULL_VER >= 160040219) 179 #error Compiler is not supported! 182 #error Compiler is not supported! 184 return COMPILER_VERS;
188 static const char *
const compiler_arch(
void)
190 static const char *
const COMPILER_ARCH =
193 #elif defined(_M_IX86) 196 #error Architecture is not supported! 198 return COMPILER_ARCH;
203 static const char *
const build_date_raw(
void)
205 static const char *
const RAW_BUILD_DATE = __DATE__;
206 return RAW_BUILD_DATE;
210 static const char *
const build_time_raw(
void)
212 static const char *
const RAW_BUILD_TIME = __TIME__;
213 return RAW_BUILD_TIME;
+
38 MUTILS_API
static const quint32 &lib_version_major(
void);
39 MUTILS_API
static const quint32 &lib_version_minor(
void);
42 MUTILS_API
static const QDate lib_build_date(
void);
43 MUTILS_API
static const QTime lib_build_time(
void);
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());
50 static const char *
const compiler_version(
void)
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) 64 #elif (__INTEL_COMPILER >= 1000) 67 #error Compiler is not supported! 69 #elif defined(_MSC_VER) 70 #if (_MSC_VER == 1923) 71 #if((_MSC_FULL_VER >= 192328105) && (_MSC_FULL_VER <= 192328105)) 74 #error Compiler version is not supported yet! 76 #elif (_MSC_VER == 1922) 77 #if((_MSC_FULL_VER >= 192227905) && (_MSC_FULL_VER <= 192227905)) 80 #error Compiler version is not supported yet! 82 #elif (_MSC_VER == 1921) 83 #if((_MSC_FULL_VER >= 192127702) && (_MSC_FULL_VER <= 192127702)) 86 #error Compiler version is not supported yet! 88 #elif (_MSC_VER == 1920) 89 #if((_MSC_FULL_VER >= 192027508) && (_MSC_FULL_VER <= 192027508)) 92 #error Compiler version is not supported yet! 94 #elif (_MSC_VER == 1916) 95 #if((_MSC_FULL_VER >= 191627024) && (_MSC_FULL_VER <= 191627034)) 98 #error Compiler version is not supported yet! 100 #elif (_MSC_VER == 1915) 101 #if((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732)) 104 #error Compiler version is not supported yet! 106 #elif (_MSC_VER == 1914) 107 #if((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433)) 110 #error Compiler version is not supported yet! 112 #elif (_MSC_VER == 1913) 113 #if((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132)) 116 #error Compiler version is not supported yet! 118 #elif (_MSC_VER == 1912) 119 #if((_MSC_FULL_VER >= 191225830) && (_MSC_FULL_VER <= 191225835)) 122 #error Compiler version is not supported yet! 124 #elif (_MSC_VER == 1911) 125 #if((_MSC_FULL_VER >= 191125542) && (_MSC_FULL_VER <= 191125547)) 127 #elif((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508)) 130 #error Compiler version is not supported yet! 132 #elif (_MSC_VER == 1910) 133 #if ((_MSC_FULL_VER >= 191025017) && (_MSC_FULL_VER <= 191025019)) 136 #error Compiler version is not supported yet! 138 #elif (_MSC_VER == 1900) 139 #if (_MSC_FULL_VER == 190023026) 141 #elif (_MSC_FULL_VER == 190023506) 143 #elif (_MSC_FULL_VER == 190023918) 145 #elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215) 148 #error Compiler version is not supported yet! 150 #elif (_MSC_VER == 1800) 151 #if (_MSC_FULL_VER == 180021005) 153 #elif (_MSC_FULL_VER == 180030501) 155 #elif (_MSC_FULL_VER == 180030723) 157 #elif (_MSC_FULL_VER == 180031101) 159 #elif (_MSC_FULL_VER == 180040629) 162 #error Compiler version is not supported yet! 164 #elif (_MSC_VER == 1700) 165 #if (_MSC_FULL_VER == 170050727) 167 #elif (_MSC_FULL_VER == 170051106) 169 #elif (_MSC_FULL_VER == 170060315) 171 #elif (_MSC_FULL_VER == 170060610) 173 #elif (_MSC_FULL_VER == 170061030) 176 #error Compiler version is not supported yet! 178 #elif (_MSC_VER == 1600) 179 #if (_MSC_FULL_VER >= 160040219) 185 #error Compiler is not supported! 188 #error Compiler is not supported! 190 return COMPILER_VERS;
194 static const char *
const compiler_arch(
void)
196 static const char *
const COMPILER_ARCH =
199 #elif defined(_M_IX86) 202 #error Architecture is not supported! 204 return COMPILER_ARCH;
209 static const char *
const build_date_raw(
void)
211 static const char *
const RAW_BUILD_DATE = __DATE__;
212 return RAW_BUILD_DATE;
216 static const char *
const build_time_raw(
void)
218 static const char *
const RAW_BUILD_TIME = __TIME__;
219 return RAW_BUILD_TIME;
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 ®exp, 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 ®exp, quint32 *values, const size_t &count) |
| Parse regular expression results. More...
|
|
@@ -622,6 +625,34 @@ class MUTILS_API | Taskbar7_
The random value is created using a "strong" PRNG of the underlying system, if possible. Otherwise a fallback PRNG is used. It is not required or useful to call srand() or qsrand() prior to using this function. If necessary, the seeding of the PRNG happen automatically on the first call.
- Returns
- The function returns a random unsigned 64-Bit value.
+
+
+
+§ 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
-
+
+ path | A 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.
+
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. 70 bool isObjectCreated( void); 81 bool addProcessToJob( const QProcess * const process); 92 bool terminateJob( const quint32 &exitCode); 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
| MUtils::re
MUTILS_API bool | MUtils::regexp_parse_int32 (const QRegExp ®exp, qint32 &value, const size_t &offset) |
|
+MUTILS_API QString | MUtils::parent_path (const QString &path) |
+ | Get parent path. More...
|
+ |
MUTILS_API bool | MUtils::regexp_parse_uint32 (const QRegExp ®exp, quint32 *values, const size_t &count) |
| Parse regular expression results. More...
|
|
diff --git a/docs/d5/d3b/_global_8h_source.html b/docs/d5/d3b/_global_8h_source.html
index 7234764..941d743 100644
--- a/docs/d5/d3b/_global_8h_source.html
+++ b/docs/d5/d3b/_global_8h_source.html
@@ -67,12 +67,13 @@ $(function() {
Global.h
- Go to the documentation of this file. 34 template< typename K, typename V> class QHash; 42 #define MUTILS_INTERFACE 3 46 # ifdef MUTILS_DLL_EXPORT 47 # define MUTILS_API __declspec(dllexport) 49 # ifndef MUTILS_STATIC_LIB 50 # define MUTILS_API __declspec(dllimport) 60 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG)) 61 # define MUTILS_DEBUG (1) 62 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG)) 63 # error Inconsistent DEBUG flags have been detected! 66 # define MUTILS_DEBUG (0) 67 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG) 68 # error Inconsistent DEBUG flags have been detected! 73 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 75 #error We should not enabled SSE or SSE2 in release builds! 80 #define MUTILS_GLUE_NAME_HELPER(X,Y) X##Y 81 #define MUTILS_GLUE_NAME(X,Y) MUTILS_GLUE_NAME_HELPER(X,Y) 83 #define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_d, MUTILS_INTERFACE) 85 #define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_r, MUTILS_INTERFACE) 89 #define MUTILS_MAKE_STRING_HELPER(X) #X 90 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X) 91 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 130 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); 175 MUTILS_API QString make_temp_file( const QString &basePath, const QString &extension, const bool placeholder = false); 176 MUTILS_API QString make_temp_file( const QDir &basePath, const QString &extension, const bool placeholder = false); 193 MUTILS_API QString make_unique_file( const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 194 MUTILS_API QString make_unique_file( const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 203 MUTILS_API bool parity(quint32 value); 214 MUTILS_API bool remove_file( const QString &fileName); 227 MUTILS_API bool remove_directory( const QString &folderPath, const bool &recursive); 249 MUTILS_API QString& trim_left(QString &str); 260 MUTILS_API QString trim_right( const QString &str); 271 MUTILS_API QString trim_left( const QString &str); 295 MUTILS_API QString clean_file_name( const QString &name, const bool &pretty); 308 MUTILS_API QString clean_file_path( const QString &path, const bool &pretty); 322 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value); 323 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 &value, const size_t &offset); 324 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value, const size_t &offset); 339 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &count); 340 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &count); 341 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 342 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); 369 MUTILS_API unsigned int MUTILS_INITIALIZER( const unsigned int interfaceId); 370 static const unsigned int init_flag = MUTILS_INITIALIZER(MUTILS_INTERFACE); 378 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0) 382 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0) 386 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR))) 390 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16())) 394 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData()) 398 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData()) 402 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR)))) 406 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0") 410 #define MUTILS_BOOLIFY(X) (!(!(X))) 414 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0])) 418 #define MUTILS_NO_COPY(CLASS) \ 419 CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \ 420 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. 34 template< typename K, typename V> class QHash; 42 #define MUTILS_INTERFACE 3 46 # ifdef MUTILS_DLL_EXPORT 47 # define MUTILS_API __declspec(dllexport) 49 # ifndef MUTILS_STATIC_LIB 50 # define MUTILS_API __declspec(dllimport) 60 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG)) 61 # define MUTILS_DEBUG (1) 62 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG)) 63 # error Inconsistent DEBUG flags have been detected! 66 # define MUTILS_DEBUG (0) 67 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG) 68 # error Inconsistent DEBUG flags have been detected! 73 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 75 #error We should not enabled SSE or SSE2 in release builds! 80 #define MUTILS_GLUE_NAME_HELPER(X,Y) X##Y 81 #define MUTILS_GLUE_NAME(X,Y) MUTILS_GLUE_NAME_HELPER(X,Y) 83 #define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_d, MUTILS_INTERFACE) 85 #define MUTILS_INITIALIZER MUTILS_GLUE_NAME(initialize_r, MUTILS_INTERFACE) 89 #define MUTILS_MAKE_STRING_HELPER(X) #X 90 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X) 91 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 130 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); 175 MUTILS_API QString make_temp_file( const QString &basePath, const QString &extension, const bool placeholder = false); 176 MUTILS_API QString make_temp_file( const QDir &basePath, const QString &extension, const bool placeholder = false); 193 MUTILS_API QString make_unique_file( const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 194 MUTILS_API QString make_unique_file( const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 203 MUTILS_API bool parity(quint32 value); 214 MUTILS_API bool remove_file( const QString &fileName); 227 MUTILS_API bool remove_directory( const QString &folderPath, const bool &recursive); 249 MUTILS_API QString& trim_left(QString &str); 260 MUTILS_API QString trim_right( const QString &str); 271 MUTILS_API QString trim_left( const QString &str); 295 MUTILS_API QString clean_file_name( const QString &name, const bool &pretty); 308 MUTILS_API QString clean_file_path( const QString &path, const bool &pretty); 322 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value); 323 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 &value, const size_t &offset); 324 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value, const size_t &offset); 335 MUTILS_API QString parent_path( const QString &path); 350 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &count); 351 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &count); 352 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 353 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); 380 MUTILS_API unsigned int MUTILS_INITIALIZER( const unsigned int interfaceId); 381 static const unsigned int init_flag = MUTILS_INITIALIZER(MUTILS_INTERFACE); 389 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0) 393 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0) 397 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR))) 401 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16())) 405 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData()) 409 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData()) 413 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR)))) 417 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0") 421 #define MUTILS_BOOLIFY(X) (!(!(X))) 425 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0])) 429 #define MUTILS_NO_COPY(CLASS) \ 430 CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \ 431 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.
MUTILS_API QString clean_file_path(const QString &path, const bool &pretty) Clean up a file path string.
This struct containes the parts (integral and fractional part) of a floating-point number... Definition: Global.h:106
+ MUTILS_API QString parent_path(const QString &path) Get parent path.
MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase) Sort a list of strings using "natural ordering" algorithm.
MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value) Parse regular expression results.
MUTILS_API bool parity(quint32 value) Computes the parity of the given unsigned 32-Bit value.
diff --git a/docs/namespacemembers.html b/docs/namespacemembers.html
index 4cdc487..414c5fb 100644
--- a/docs/namespacemembers.html
+++ b/docs/namespacemembers.html
@@ -307,6 +307,9 @@ $(function() {
- p -
+- parent_path()
+: MUtils
+
- parity()
: MUtils
diff --git a/docs/namespacemembers_func.html b/docs/namespacemembers_func.html
index b1d4f40..c9b9ccd 100644
--- a/docs/namespacemembers_func.html
+++ b/docs/namespacemembers_func.html
@@ -102,6 +102,9 @@ $(function() {
- next_rand_u64()
: MUtils
+- parent_path()
+: MUtils
+
- parity()
: MUtils
diff --git a/docs/search/all_f.js b/docs/search/all_f.js
index f923f06..1afe4d7 100644
--- a/docs/search/all_f.js
+++ b/docs/search/all_f.js
@@ -1,4 +1,5 @@
var searchData=
[
+ ['parent_5fpath',['parent_path',['../d3/da6/namespace_m_utils.html#a9916e02e90bdb987b95b3cc9d463f949',1,'MUtils']]],
['parity',['parity',['../d3/da6/namespace_m_utils.html#aea4a212153b09b24b04f30ef5159f29b',1,'MUtils']]]
];
diff --git a/docs/search/functions_9.js b/docs/search/functions_9.js
index f923f06..1afe4d7 100644
--- a/docs/search/functions_9.js
+++ b/docs/search/functions_9.js
@@ -1,4 +1,5 @@
var searchData=
[
+ ['parent_5fpath',['parent_path',['../d3/da6/namespace_m_utils.html#a9916e02e90bdb987b95b3cc9d463f949',1,'MUtils']]],
['parity',['parity',['../d3/da6/namespace_m_utils.html#aea4a212153b09b24b04f30ef5159f29b',1,'MUtils']]]
];
diff --git a/include/MUtils/Global.h b/include/MUtils/Global.h
index ca7fe75..90266a3 100644
--- a/include/MUtils/Global.h
+++ b/include/MUtils/Global.h
@@ -39,7 +39,7 @@ template class QHash;
*/
//Interface version
-#define MUTILS_INTERFACE 3
+#define MUTILS_INTERFACE 4
//MUtils API
#ifdef _MSC_VER
@@ -323,6 +323,17 @@ namespace MUtils
MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value, const size_t &offset);
MUTILS_API bool regexp_parse_int32(const QRegExp ®exp, qint32 &value, const size_t &offset);
+ /**
+ * \brief Get parent path
+ *
+ * This function determines the "parent" path, by removing the *last* path component (file name or directory) form the given original path.
+ *
+ * \param path A read-only reference to the original path string.
+ *
+ * \return The remaining path string (i.e. "parent" path); an empty string if the original path only consited of a single component.
+ */
+ MUTILS_API QString parent_path(const QString &path);
+
/**
* \brief Parse regular expression results
*
diff --git a/src/Config.h b/src/Config.h
index dd10622..6884451 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -31,7 +31,7 @@
#define VER_MUTILS_MAJOR 1
#define VER_MUTILS_MINOR_HI 1
-#define VER_MUTILS_MINOR_LO 3
+#define VER_MUTILS_MINOR_LO 4
#define VER_MUTILS_PATCH 0
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/Global.cpp b/src/Global.cpp
index 845fd3f..d743248 100644
--- a/src/Global.cpp
+++ b/src/Global.cpp
@@ -772,6 +772,40 @@ QString MUtils::clean_file_path(const QString &path, const bool &pretty)
return prefix.first.isEmpty() ? cleanPath : prefix.first + cleanPath;
}
+///////////////////////////////////////////////////////////////////////////////
+// PARENT PATH
+///////////////////////////////////////////////////////////////////////////////
+
+static void remove_trailing_separators(QString &pathStr)
+{
+ while (pathStr.endsWith('/'))
+ {
+ pathStr.chop(1);
+ }
+}
+
+MUTILS_API QString MUtils::parent_path(const QString &path)
+{
+ QString parentPath(QDir::fromNativeSeparators(path));
+ remove_trailing_separators(parentPath);
+ const int pos = parentPath.lastIndexOf(QLatin1Char('/'));
+ if (pos >= 0)
+ {
+ parentPath.truncate(pos);
+ remove_trailing_separators(parentPath);
+ if (parentPath.isEmpty())
+ {
+ return QLatin1String("/");
+ }
+ if ((parentPath.length() == 2) && parentPath.at(0).isLetter() && (parentPath.at(1) == QLatin1Char(':')))
+ {
+ parentPath += QLatin1Char('/');
+ }
+ return parentPath;
+ }
+ return QString();
+}
+
///////////////////////////////////////////////////////////////////////////////
// REGULAR EXPESSION HELPER
///////////////////////////////////////////////////////////////////////////////
|