38 # ifdef MUTILS_DLL_EXPORT 39 # define MUTILS_API __declspec(dllexport) 41 # ifndef MUTILS_STATIC_LIB 42 # define MUTILS_API __declspec(dllimport) 52 #define MUTILS_MAKE_STRING_HELPER(X) #X 53 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X) 54 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 57 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG)) 58 # define MUTILS_DEBUG (1) 59 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG)) 60 # error Inconsistent DEBUG flags have been detected! 63 # define MUTILS_DEBUG (0) 64 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG) 65 # error Inconsistent DEBUG flags have been detected! 70 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 72 #error We should not enabled SSE or SSE2 in release builds! 126 MUTILS_API
void init_process(QProcess &process,
const QString &wokringDir,
const bool bReplaceTempDir =
true,
const QStringList *
const extraPaths = NULL);
170 MUTILS_API QString
make_temp_file(
const QString &basePath,
const QString &extension,
const bool placeholder =
false);
187 MUTILS_API QString
make_unique_file(
const QString &basePath,
const QString &baseName,
const QString &extension,
const bool fancy =
false);
196 MUTILS_API
bool parity(quint32 value);
199 MUTILS_API
bool remove_file(
const QString &fileName);
200 MUTILS_API
bool remove_directory(
const QString &folderPath,
const bool &recursive);
203 MUTILS_API QString& trim_right(QString &str);
204 MUTILS_API QString& trim_left(QString &str);
205 MUTILS_API QString trim_right(
const QString &str);
206 MUTILS_API QString trim_left(
const QString &str);
209 MUTILS_API
void natural_string_sort(QStringList &list,
const bool bIgnoreCase);
212 MUTILS_API QString clean_file_name(
const QString &name);
213 MUTILS_API QString clean_file_path(
const QString &path);
216 MUTILS_API
bool regexp_parse_uint32(
const QRegExp ®exp, quint32 &value);
217 MUTILS_API
bool regexp_parse_uint32(
const QRegExp ®exp, quint32 *values,
const size_t &count);
220 MUTILS_API QStringList available_codepages(
const bool &noAliases =
true);
225 MUTILS_API
int selfTest(
const char *
const buildKey,
const bool debug);
226 static const int s_selfTest = selfTest(__DATE__
"@" __TIME__, MUTILS_DEBUG);
233 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0) 234 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0) 237 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR))) 240 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16())) 241 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData()) 242 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR)))) 245 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0") quint32 next_rand_u32(void)
Generates a random unsigned 32-Bit value.
bool parity(quint32 value)
Computes the parity of the given unsigned 32-Bit value.
QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy=false)
Generates a unique file name.
const QString & temp_folder(void)
Rerieves the full path of the application's Temp folder.
Definition: CPUFeatures.h:30
QString next_rand_str(const bool &bLong=false)
Generates a random string.
QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder=false)
Generates a temporary file name.
quint64 next_rand_u64(void)
Generates a random unsigned 64-Bit value.