1 ///////////////////////////////////////////////////////////////////////////////
2 // MuldeR's Utilities for Qt
3 // Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
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.
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.
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
19 // http://www.gnu.org/licenses/lgpl-2.1.txt
20 //////////////////////////////////////////////////////////////////////////////////
26 //Forward Declarations
29 ///////////////////////////////////////////////////////////////////////////////
33 # ifdef MUTILS_DLL_EXPORT
34 # define MUTILS_API __declspec(dllexport)
36 # define MUTILS_API __declspec(dllimport)
43 #define MUTILS_MAKE_STRING_HELPER(X) #X
44 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
45 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
47 ///////////////////////////////////////////////////////////////////////////////
52 MUTILS_API const QString& temp_folder(void);
55 MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true);
58 MUTILS_API void seed_rand(void);
59 MUTILS_API QString rand_str(const bool &bLong = false);
60 MUTILS_API quint32 next_rand32(void);
61 MUTILS_API quint64 next_rand64(void);
64 MUTILS_API const char* buildDate(void);
67 ///////////////////////////////////////////////////////////////////////////////
69 #define MUTILS_DELETE(PTR) do \
79 #define MUTILS_DELETE_ARRAY(PTR) do \
89 #define MUTILS_QUTF8(STR) ((STR).toUtf8().constData())
90 #define MUTILS_QSTR2WCHAR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
91 #define MUTILS_WCHAR2QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))