1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/xhtml;charset=UTF-8"/>
5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=9"/>
6 <meta name=
"generator" content=
"Doxygen 1.8.12"/>
7 <meta name=
"viewport" content=
"width=device-width, initial-scale=1"/>
8 <title>MuldeR
's Utilities for Qt: include/MUtils/Global.h Source File
</title>
9 <link href=
"../../tabs.css" rel=
"stylesheet" type=
"text/css"/>
10 <script type=
"text/javascript" src=
"../../jquery.js"></script>
11 <script type=
"text/javascript" src=
"../../dynsections.js"></script>
12 <link href=
"../../search/search.css" rel=
"stylesheet" type=
"text/css"/>
13 <script type=
"text/javascript" src=
"../../search/searchdata.js"></script>
14 <script type=
"text/javascript" src=
"../../search/search.js"></script>
15 <link href=
"../../doxygen.css" rel=
"stylesheet" type=
"text/css" />
18 <div id=
"top"><!-- do not remove this div, it is closed by doxygen! -->
20 <table cellspacing=
"0" cellpadding=
"0">
22 <tr style=
"height: 56px;">
23 <td id=
"projectalign" style=
"padding-left: 0.5em;">
24 <div id=
"projectname">MuldeR
's Utilities for Qt
26 <div id=
"projectbrief">MUtilities
</div>
32 <!-- end header part -->
33 <!-- Generated by Doxygen 1.8.12 -->
34 <script type=
"text/javascript">
35 var searchBox
= new SearchBox("searchBox", "../../search",false,'Search');
37 <script type=
"text/javascript" src=
"../../menudata.js"></script>
38 <script type=
"text/javascript" src=
"../../menu.js"></script>
39 <script type=
"text/javascript">
41 initMenu('../../',true,false,'search.php','Search');
42 $(document
).ready(function() { init_search(); });
45 <div id=
"main-nav"></div>
46 <!-- window showing the filter options -->
47 <div id=
"MSearchSelectWindow"
48 onmouseover=
"return searchBox.OnSearchSelectShow()"
49 onmouseout=
"return searchBox.OnSearchSelectHide()"
50 onkeydown=
"return searchBox.OnSearchSelectKey(event)">
53 <!-- iframe showing the search results (closed by default) -->
54 <div id=
"MSearchResultsWindow">
55 <iframe src=
"javascript:void(0)" frameborder=
"0"
56 name=
"MSearchResults" id=
"MSearchResults">
60 <div id=
"nav-path" class=
"navpath">
62 <li class=
"navelem"><a class=
"el" href=
"../../dir_d44c64559bbebec7f509842c48db8b23.html">include
</a></li><li class=
"navelem"><a class=
"el" href=
"../../dir_b076b53667bc06ebb413a190e197fc7b.html">MUtils
</a></li> </ul>
66 <div class=
"headertitle">
67 <div class=
"title">Global.h
</div> </div>
69 <div class=
"contents">
70 <a href=
"../../d5/d3b/_global_8h.html">Go to the documentation of this file.
</a><div class=
"fragment"><div class=
"line"><a name=
"l00001"></a><span class=
"lineno"> 1</span> <span class=
"comment">// MuldeR
's Utilities for Qt
</span></div><div class=
"line"><a name=
"l00003"></a><span class=
"lineno"> 3</span> <span class=
"comment">// Copyright (C)
2004-
2016 LoRd_MuldeR
<MuldeR2@GMX.de
></span></div><div class=
"line"><a name=
"l00004"></a><span class=
"lineno"> 4</span> <span class=
"comment">//
</span></div><div class=
"line"><a name=
"l00005"></a><span class=
"lineno"> 5</span> <span class=
"comment">// This library is free software; you can redistribute it and/or
</span></div><div class=
"line"><a name=
"l00006"></a><span class=
"lineno"> 6</span> <span class=
"comment">// modify it under the terms of the GNU Lesser General Public
</span></div><div class=
"line"><a name=
"l00007"></a><span class=
"lineno"> 7</span> <span class=
"comment">// License as published by the Free Software Foundation; either
</span></div><div class=
"line"><a name=
"l00008"></a><span class=
"lineno"> 8</span> <span class=
"comment">// version
2.1 of the License, or (at your option) any later version.
</span></div><div class=
"line"><a name=
"l00009"></a><span class=
"lineno"> 9</span> <span class=
"comment">//
</span></div><div class=
"line"><a name=
"l00010"></a><span class=
"lineno"> 10</span> <span class=
"comment">// This library is distributed in the hope that it will be useful,
</span></div><div class=
"line"><a name=
"l00011"></a><span class=
"lineno"> 11</span> <span class=
"comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of
</span></div><div class=
"line"><a name=
"l00012"></a><span class=
"lineno"> 12</span> <span class=
"comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
</span></div><div class=
"line"><a name=
"l00013"></a><span class=
"lineno"> 13</span> <span class=
"comment">// Lesser General Public License for more details.
</span></div><div class=
"line"><a name=
"l00014"></a><span class=
"lineno"> 14</span> <span class=
"comment">//
</span></div><div class=
"line"><a name=
"l00015"></a><span class=
"lineno"> 15</span> <span class=
"comment">// You should have received a copy of the GNU Lesser General Public
</span></div><div class=
"line"><a name=
"l00016"></a><span class=
"lineno"> 16</span> <span class=
"comment">// License along with this library; if not, write to the Free Software
</span></div><div class=
"line"><a name=
"l00017"></a><span class=
"lineno"> 17</span> <span class=
"comment">// Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA
02110-
1301 USA
</span></div><div class=
"line"><a name=
"l00018"></a><span class=
"lineno"> 18</span> <span class=
"comment">//
</span></div><div class=
"line"><a name=
"l00019"></a><span class=
"lineno"> 19</span> <span class=
"comment">// http://www.gnu.org/licenses/lgpl-
2.1.txt
</span></div><div class=
"line"><a name=
"l00021"></a><span class=
"lineno"> 21</span> <span class=
"comment"></span></div><div class=
"line"><a name=
"l00027"></a><span class=
"lineno"> 27</span> <span class=
"preprocessor">#pragma once
</span></div><div class=
"line"><a name=
"l00028"></a><span class=
"lineno"> 28</span> </div><div class=
"line"><a name=
"l00029"></a><span class=
"lineno"> 29</span> <span class=
"preprocessor">#include
<QString
></span></div><div class=
"line"><a name=
"l00030"></a><span class=
"lineno"> 30</span> </div><div class=
"line"><a name=
"l00031"></a><span class=
"lineno"> 31</span> <span class=
"comment">//Forward Declarations
</span></div><div class=
"line"><a name=
"l00032"></a><span class=
"lineno"> 32</span> <span class=
"keyword">class
</span>QProcess;
</div><div class=
"line"><a name=
"l00033"></a><span class=
"lineno"> 33</span> </div><div class=
"line"><a name=
"l00035"></a><span class=
"lineno"> 35</span> </div><div class=
"line"><a name=
"l00036"></a><span class=
"lineno"> 36</span> <span class=
"comment">//MUtils API
</span></div><div class=
"line"><a name=
"l00037"></a><span class=
"lineno"> 37</span> <span class=
"preprocessor">#ifdef _MSC_VER
</span></div><div class=
"line"><a name=
"l00038"></a><span class=
"lineno"> 38</span> <span class=
"preprocessor"># ifdef MUTILS_DLL_EXPORT
</span></div><div class=
"line"><a name=
"l00039"></a><span class=
"lineno"> 39</span> <span class=
"preprocessor"># define MUTILS_API __declspec(dllexport)
</span></div><div class=
"line"><a name=
"l00040"></a><span class=
"lineno"> 40</span> <span class=
"preprocessor"># else
</span></div><div class=
"line"><a name=
"l00041"></a><span class=
"lineno"> 41</span> <span class=
"preprocessor"># ifndef MUTILS_STATIC_LIB
</span></div><div class=
"line"><a name=
"l00042"></a><span class=
"lineno"> 42</span> <span class=
"preprocessor"># define MUTILS_API __declspec(dllimport)
</span></div><div class=
"line"><a name=
"l00043"></a><span class=
"lineno"> 43</span> <span class=
"preprocessor"># else
</span></div><div class=
"line"><a name=
"l00044"></a><span class=
"lineno"> 44</span> <span class=
"preprocessor"># define MUTILS_API
</span><span class=
"comment">/*static lib*/
</span><span class=
"preprocessor"></span></div><div class=
"line"><a name=
"l00045"></a><span class=
"lineno"> 45</span> <span class=
"preprocessor"># endif
</span></div><div class=
"line"><a name=
"l00046"></a><span class=
"lineno"> 46</span> <span class=
"preprocessor"># endif
</span></div><div class=
"line"><a name=
"l00047"></a><span class=
"lineno"> 47</span> <span class=
"preprocessor">#else
</span></div><div class=
"line"><a name=
"l00048"></a><span class=
"lineno"> 48</span> <span class=
"preprocessor"># define MUTILS_API
</span></div><div class=
"line"><a name=
"l00049"></a><span class=
"lineno"> 49</span> <span class=
"preprocessor">#endif
</span></div><div class=
"line"><a name=
"l00050"></a><span class=
"lineno"> 50</span> </div><div class=
"line"><a name=
"l00051"></a><span class=
"lineno"> 51</span> <span class=
"comment">//Helper Macros
</span></div><div class=
"line"><a name=
"l00052"></a><span class=
"lineno"> 52</span> <span class=
"preprocessor">#define MUTILS_MAKE_STRING_HELPER(X) #X
</span></div><div class=
"line"><a name=
"l00053"></a><span class=
"lineno"> 53</span> <span class=
"preprocessor">#define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
</span></div><div class=
"line"><a name=
"l00054"></a><span class=
"lineno"> 54</span> <span class=
"preprocessor">#define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__
"(
" MUTILS_MAKE_STRING(__LINE__)
") : warning:
" TXT))
</span></div><div class=
"line"><a name=
"l00055"></a><span class=
"lineno"> 55</span> </div><div class=
"line"><a name=
"l00056"></a><span class=
"lineno"> 56</span> <span class=
"comment">//Check Debug Flags
</span></div><div class=
"line"><a name=
"l00057"></a><span class=
"lineno"> 57</span> <span class=
"preprocessor">#if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
</span></div><div class=
"line"><a name=
"l00058"></a><span class=
"lineno"> 58</span> <span class=
"preprocessor"># define MUTILS_DEBUG (
1)
</span></div><div class=
"line"><a name=
"l00059"></a><span class=
"lineno"> 59</span> <span class=
"preprocessor"># if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG))
</span></div><div class=
"line"><a name=
"l00060"></a><span class=
"lineno"> 60</span> <span class=
"preprocessor"># error Inconsistent DEBUG flags have been detected!
</span></div><div class=
"line"><a name=
"l00061"></a><span class=
"lineno"> 61</span> <span class=
"preprocessor"># endif
</span></div><div class=
"line"><a name=
"l00062"></a><span class=
"lineno"> 62</span> <span class=
"preprocessor">#else
</span></div><div class=
"line"><a name=
"l00063"></a><span class=
"lineno"> 63</span> <span class=
"preprocessor"># define MUTILS_DEBUG (
0)
</span></div><div class=
"line"><a name=
"l00064"></a><span class=
"lineno"> 64</span> <span class=
"preprocessor"># if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG)
</span></div><div class=
"line"><a name=
"l00065"></a><span class=
"lineno"> 65</span> <span class=
"preprocessor"># error Inconsistent DEBUG flags have been detected!
</span></div><div class=
"line"><a name=
"l00066"></a><span class=
"lineno"> 66</span> <span class=
"preprocessor"># endif
</span></div><div class=
"line"><a name=
"l00067"></a><span class=
"lineno"> 67</span> <span class=
"preprocessor">#endif
</span></div><div class=
"line"><a name=
"l00068"></a><span class=
"lineno"> 68</span> </div><div class=
"line"><a name=
"l00069"></a><span class=
"lineno"> 69</span> <span class=
"comment">//Check CPU options
</span></div><div class=
"line"><a name=
"l00070"></a><span class=
"lineno"> 70</span> <span class=
"preprocessor">#if defined(_MSC_VER)
&& (!defined(__INTELLISENSE__))
&& (!defined(_M_X64))
&& defined(_M_IX86_FP)
</span></div><div class=
"line"><a name=
"l00071"></a><span class=
"lineno"> 71</span> <span class=
"preprocessor"> #if (_M_IX86_FP !=
0)
</span></div><div class=
"line"><a name=
"l00072"></a><span class=
"lineno"> 72</span> <span class=
"preprocessor"> #error We should not enabled SSE or SSE2 in release builds!
</span></div><div class=
"line"><a name=
"l00073"></a><span class=
"lineno"> 73</span> <span class=
"preprocessor"> #endif
</span></div><div class=
"line"><a name=
"l00074"></a><span class=
"lineno"> 74</span> <span class=
"preprocessor">#endif
</span></div><div class=
"line"><a name=
"l00075"></a><span class=
"lineno"> 75</span> </div><div class=
"line"><a name=
"l00077"></a><span class=
"lineno"> 77</span> </div><div class=
"line"><a name=
"l00078"></a><span class=
"lineno"> 78</span> <span class=
"keyword">namespace
</span><a class=
"code" href=
"../../d3/da6/namespace_m_utils.html">MUtils
</a></div><div class=
"line"><a name=
"l00079"></a><span class=
"lineno"> 79</span> {
</div><div class=
"line"><a name=
"l00087"></a><span class=
"lineno"> 87</span>  MUTILS_API
<span class=
"keyword">const
</span> QString
& <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a9ddb9a2039585b1ef3429db16ea84292">temp_folder
</a>(
<span class=
"keywordtype">void
</span>);
</div><div class=
"line"><a name=
"l00088"></a><span class=
"lineno"> 88</span> </div><div class=
"line"><a name=
"l00089"></a><span class=
"lineno"> 89</span>  <span class=
"comment">//Process Utils
</span></div><div class=
"line"><a name=
"l00090"></a><span class=
"lineno"> 90</span>  MUTILS_API
<span class=
"keywordtype">void
</span> init_process(QProcess
&process,
<span class=
"keyword">const
</span> QString
&wokringDir,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> bReplaceTempDir =
<span class=
"keyword">true
</span>,
<span class=
"keyword">const
</span> QStringList *
<span class=
"keyword">const
</span> extraPaths = NULL);
</div><div class=
"line"><a name=
"l00091"></a><span class=
"lineno"> 91</span> </div><div class=
"line"><a name=
"l00099"></a><span class=
"lineno"> 99</span>  MUTILS_API quint32
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a4dc7dccb81653ae28e0d37a7c2f62112">next_rand_u32
</a>(
<span class=
"keywordtype">void
</span>);
</div><div class=
"line"><a name=
"l00100"></a><span class=
"lineno"> 100</span>  </div><div class=
"line"><a name=
"l00108"></a><span class=
"lineno"> 108</span>  MUTILS_API quint64
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a15762bf5b0239e5f67a3815d63ed441a">next_rand_u64
</a>(
<span class=
"keywordtype">void
</span>);
</div><div class=
"line"><a name=
"l00109"></a><span class=
"lineno"> 109</span>  </div><div class=
"line"><a name=
"l00119"></a><span class=
"lineno"> 119</span>  MUTILS_API QString
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a996b60884ddf7728178e94f34ca12570">next_rand_str
</a>(
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> &bLong =
<span class=
"keyword">false
</span>);
</div><div class=
"line"><a name=
"l00120"></a><span class=
"lineno"> 120</span> </div><div class=
"line"><a name=
"l00134"></a><span class=
"lineno"> 134</span>  MUTILS_API QString
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a67cb16c62b213da5135a6fa076f3f005">make_temp_file
</a>(
<span class=
"keyword">const
</span> QString
&basePath,
<span class=
"keyword">const
</span> QString
&extension,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> placeholder =
<span class=
"keyword">false
</span>);
</div><div class=
"line"><a name=
"l00135"></a><span class=
"lineno"> 135</span> </div><div class=
"line"><a name=
"l00151"></a><span class=
"lineno"> 151</span>  MUTILS_API QString
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a390e56e35eb9329d2e67fa9741d07536">make_unique_file
</a>(
<span class=
"keyword">const
</span> QString
&basePath,
<span class=
"keyword">const
</span> QString
&baseName,
<span class=
"keyword">const
</span> QString
&extension,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> fancy =
<span class=
"keyword">false
</span>);
</div><div class=
"line"><a name=
"l00152"></a><span class=
"lineno"> 152</span> </div><div class=
"line"><a name=
"l00160"></a><span class=
"lineno"> 160</span>  MUTILS_API
<span class=
"keywordtype">bool
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#ad1bdb5e416839b1f85f6df68e58ae28c">parity
</a>(quint32 value);
</div><div class=
"line"><a name=
"l00161"></a><span class=
"lineno"> 161</span> </div><div class=
"line"><a name=
"l00171"></a><span class=
"lineno"> 171</span>  MUTILS_API
<span class=
"keywordtype">bool
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a12259acdd6aff74ee83819d3aebd8ba9">remove_file
</a>(
<span class=
"keyword">const
</span> QString
&fileName);
</div><div class=
"line"><a name=
"l00172"></a><span class=
"lineno"> 172</span> </div><div class=
"line"><a name=
"l00184"></a><span class=
"lineno"> 184</span>  MUTILS_API
<span class=
"keywordtype">bool
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#ac7d2c9bd5c49230b2fed72e3410c3f7d">remove_directory
</a>(
<span class=
"keyword">const
</span> QString
&folderPath,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> &recursive);
</div><div class=
"line"><a name=
"l00185"></a><span class=
"lineno"> 185</span> </div><div class=
"line"><a name=
"l00195"></a><span class=
"lineno"> 195</span>  MUTILS_API QString
& <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a9290a3fe637a05ad2a7515f36fad79bd">trim_right
</a>(QString
&str);
</div><div class=
"line"><a name=
"l00196"></a><span class=
"lineno"> 196</span> </div><div class=
"line"><a name=
"l00206"></a><span class=
"lineno"> 206</span>  MUTILS_API QString
& <a class=
"code" href=
"../../d5/d3b/_global_8h.html#af089c8a40b6ec2e19db3fe612aa81c8c">trim_left
</a>(QString
&str);
</div><div class=
"line"><a name=
"l00207"></a><span class=
"lineno"> 207</span> </div><div class=
"line"><a name=
"l00217"></a><span class=
"lineno"> 217</span>  MUTILS_API QString
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a9290a3fe637a05ad2a7515f36fad79bd">trim_right
</a>(
<span class=
"keyword">const
</span> QString
&str);
</div><div class=
"line"><a name=
"l00218"></a><span class=
"lineno"> 218</span> </div><div class=
"line"><a name=
"l00228"></a><span class=
"lineno"> 228</span>  MUTILS_API QString
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#af089c8a40b6ec2e19db3fe612aa81c8c">trim_left
</a>(
<span class=
"keyword">const
</span> QString
&str);
</div><div class=
"line"><a name=
"l00229"></a><span class=
"lineno"> 229</span> </div><div class=
"line"><a name=
"l00239"></a><span class=
"lineno"> 239</span>  MUTILS_API
<span class=
"keywordtype">void
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a09e919d419ded903481cf7aba702dcba">natural_string_sort
</a>(QStringList
&list,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> bIgnoreCase);
</div><div class=
"line"><a name=
"l00240"></a><span class=
"lineno"> 240</span> </div><div class=
"line"><a name=
"l00241"></a><span class=
"lineno"> 241</span>  MUTILS_API QString clean_file_name(
<span class=
"keyword">const
</span> QString
&name);
</div><div class=
"line"><a name=
"l00242"></a><span class=
"lineno"> 242</span>  MUTILS_API QString clean_file_path(
<span class=
"keyword">const
</span> QString
&path);
</div><div class=
"line"><a name=
"l00243"></a><span class=
"lineno"> 243</span> </div><div class=
"line"><a name=
"l00255"></a><span class=
"lineno"> 255</span>  MUTILS_API
<span class=
"keywordtype">bool
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a45cb0d1e6a55cf5ffda3b626c25fd957">regexp_parse_uint32
</a>(
<span class=
"keyword">const
</span> QRegExp
&regexp, quint32
&value);
</div><div class=
"line"><a name=
"l00256"></a><span class=
"lineno"> 256</span> </div><div class=
"line"><a name=
"l00270"></a><span class=
"lineno"> 270</span>  MUTILS_API
<span class=
"keywordtype">bool
</span> <a class=
"code" href=
"../../d5/d3b/_global_8h.html#a45cb0d1e6a55cf5ffda3b626c25fd957">regexp_parse_uint32
</a>(
<span class=
"keyword">const
</span> QRegExp
&regexp, quint32 *values,
<span class=
"keyword">const
</span> <span class=
"keywordtype">size_t
</span> &count);
</div><div class=
"line"><a name=
"l00271"></a><span class=
"lineno"> 271</span> </div><div class=
"line"><a name=
"l00281"></a><span class=
"lineno"> 281</span>  MUTILS_API QStringList
<a class=
"code" href=
"../../d5/d3b/_global_8h.html#a4fcbdafffc1224776616fcc6aec8278b">available_codepages
</a>(
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> &noAliases =
<span class=
"keyword">true
</span>);
</div><div class=
"line"><a name=
"l00282"></a><span class=
"lineno"> 282</span> </div><div class=
"line"><a name=
"l00283"></a><span class=
"lineno"> 283</span>  <span class=
"comment">//Internal
</span></div><div class=
"line"><a name=
"l00284"></a><span class=
"lineno"> 284</span>  <span class=
"keyword">namespace
</span>Internal
</div><div class=
"line"><a name=
"l00285"></a><span class=
"lineno"> 285</span>  {
</div><div class=
"line"><a name=
"l00286"></a><span class=
"lineno"> 286</span>  MUTILS_API
<span class=
"keywordtype">int
</span> selfTest(
<span class=
"keyword">const
</span> <span class=
"keywordtype">char
</span> *
<span class=
"keyword">const
</span> buildKey,
<span class=
"keyword">const
</span> <span class=
"keywordtype">bool
</span> debug);
</div><div class=
"line"><a name=
"l00287"></a><span class=
"lineno"> 287</span>  <span class=
"keyword">static
</span> <span class=
"keyword">const
</span> <span class=
"keywordtype">int
</span> s_selfTest = selfTest(__DATE__
<span class=
"stringliteral">"@
"</span> __TIME__, MUTILS_DEBUG);
</div><div class=
"line"><a name=
"l00288"></a><span class=
"lineno"> 288</span>  }
</div><div class=
"line"><a name=
"l00289"></a><span class=
"lineno"> 289</span> }
</div><div class=
"line"><a name=
"l00290"></a><span class=
"lineno"> 290</span> </div><div class=
"line"><a name=
"l00292"></a><span class=
"lineno"> 292</span> </div><div class=
"line"><a name=
"l00293"></a><span class=
"lineno"> 293</span> <span class=
"comment">//Delete helper
</span></div><div class=
"line"><a name=
"l00294"></a><span class=
"lineno"> 294</span> <span class=
"preprocessor">#define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(
0)
</span></div><div class=
"line"><a name=
"l00295"></a><span class=
"lineno"> 295</span> <span class=
"preprocessor">#define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(
0)
</span></div><div class=
"line"><a name=
"l00296"></a><span class=
"lineno"> 296</span> </div><div class=
"line"><a name=
"l00297"></a><span class=
"lineno"> 297</span> <span class=
"comment">//Zero memory
</span></div><div class=
"line"><a name=
"l00298"></a><span class=
"lineno"> 298</span> <span class=
"preprocessor">#define MUTILS_ZERO_MEMORY(PTR) memset(
&(PTR),
0, sizeof((PTR)))
</span></div><div class=
"line"><a name=
"l00299"></a><span class=
"lineno"> 299</span> </div><div class=
"line"><a name=
"l00300"></a><span class=
"lineno"> 300</span> <span class=
"comment">//String conversion macros
</span></div><div class=
"line"><a name=
"l00301"></a><span class=
"lineno"> 301</span> <span class=
"preprocessor">#define MUTILS_WCHR(STR) (reinterpret_cast
<const wchar_t*
>((STR).utf16()))
</span></div><div class=
"line"><a name=
"l00302"></a><span class=
"lineno"> 302</span> <span class=
"preprocessor">#define MUTILS_UTF8(STR) ((STR).toUtf8().constData())
</span></div><div class=
"line"><a name=
"l00303"></a><span class=
"lineno"> 303</span> <span class=
"preprocessor">#define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast
<const unsigned short*
>((STR))))
</span></div><div class=
"line"><a name=
"l00304"></a><span class=
"lineno"> 304</span> </div><div class=
"line"><a name=
"l00305"></a><span class=
"lineno"> 305</span> <span class=
"comment">//Boolean helper
</span></div><div class=
"line"><a name=
"l00306"></a><span class=
"lineno"> 306</span> <span class=
"preprocessor">#define MUTILS_BOOL2STR(X) ((X) ?
"1" :
"0")
</span></div><div class=
"ttc" id=
"_global_8h_html_a12259acdd6aff74ee83819d3aebd8ba9"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a12259acdd6aff74ee83819d3aebd8ba9">MUtils::remove_file
</a></div><div class=
"ttdeci">bool remove_file(const QString
&fileName)
</div><div class=
"ttdoc">Deletes the specified file.
</div></div>
71 <div class=
"ttc" id=
"_global_8h_html_a4dc7dccb81653ae28e0d37a7c2f62112"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a4dc7dccb81653ae28e0d37a7c2f62112">MUtils::next_rand_u32
</a></div><div class=
"ttdeci">quint32 next_rand_u32(void)
</div><div class=
"ttdoc">Generates a random unsigned
32-Bit value.
</div></div>
72 <div class=
"ttc" id=
"_global_8h_html_ad1bdb5e416839b1f85f6df68e58ae28c"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#ad1bdb5e416839b1f85f6df68e58ae28c">MUtils::parity
</a></div><div class=
"ttdeci">bool parity(quint32 value)
</div><div class=
"ttdoc">Computes the parity of the given unsigned
32-Bit value.
</div></div>
73 <div class=
"ttc" id=
"_global_8h_html_a390e56e35eb9329d2e67fa9741d07536"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a390e56e35eb9329d2e67fa9741d07536">MUtils::make_unique_file
</a></div><div class=
"ttdeci">QString make_unique_file(const QString
&basePath, const QString
&baseName, const QString
&extension, const bool fancy=false)
</div><div class=
"ttdoc">Generates a unique file name.
</div></div>
74 <div class=
"ttc" id=
"_global_8h_html_a9ddb9a2039585b1ef3429db16ea84292"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a9ddb9a2039585b1ef3429db16ea84292">MUtils::temp_folder
</a></div><div class=
"ttdeci">const QString
& temp_folder(void)
</div><div class=
"ttdoc">Rerieves the full path of the application
&#
39;s Temp folder.
</div></div>
75 <div class=
"ttc" id=
"namespace_m_utils_html"><div class=
"ttname"><a href=
"../../d3/da6/namespace_m_utils.html">MUtils
</a></div><div class=
"ttdef"><b>Definition:
</b> CPUFeatures.h:
30</div></div>
76 <div class=
"ttc" id=
"_global_8h_html_a996b60884ddf7728178e94f34ca12570"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a996b60884ddf7728178e94f34ca12570">MUtils::next_rand_str
</a></div><div class=
"ttdeci">QString next_rand_str(const bool
&bLong=false)
</div><div class=
"ttdoc">Generates a random string.
</div></div>
77 <div class=
"ttc" id=
"_global_8h_html_a67cb16c62b213da5135a6fa076f3f005"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a67cb16c62b213da5135a6fa076f3f005">MUtils::make_temp_file
</a></div><div class=
"ttdeci">QString make_temp_file(const QString
&basePath, const QString
&extension, const bool placeholder=false)
</div><div class=
"ttdoc">Generates a temporary file name.
</div></div>
78 <div class=
"ttc" id=
"_global_8h_html_ac7d2c9bd5c49230b2fed72e3410c3f7d"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#ac7d2c9bd5c49230b2fed72e3410c3f7d">MUtils::remove_directory
</a></div><div class=
"ttdeci">bool remove_directory(const QString
&folderPath, const bool
&recursive)
</div><div class=
"ttdoc">Recursively deletes the specified directory.
</div></div>
79 <div class=
"ttc" id=
"_global_8h_html_a9290a3fe637a05ad2a7515f36fad79bd"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a9290a3fe637a05ad2a7515f36fad79bd">MUtils::trim_right
</a></div><div class=
"ttdeci">QString
& trim_right(QString
&str)
</div><div class=
"ttdoc">Remove trailing white-space characters.
</div></div>
80 <div class=
"ttc" id=
"_global_8h_html_a09e919d419ded903481cf7aba702dcba"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a09e919d419ded903481cf7aba702dcba">MUtils::natural_string_sort
</a></div><div class=
"ttdeci">void natural_string_sort(QStringList
&list, const bool bIgnoreCase)
</div><div class=
"ttdoc">Sort a list of strings using
"natural ordering
" algorithm.
</div></div>
81 <div class=
"ttc" id=
"_global_8h_html_a4fcbdafffc1224776616fcc6aec8278b"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a4fcbdafffc1224776616fcc6aec8278b">MUtils::available_codepages
</a></div><div class=
"ttdeci">QStringList available_codepages(const bool
&noAliases=true)
</div><div class=
"ttdoc">Retrieve a list of all available codepages.
</div></div>
82 <div class=
"ttc" id=
"_global_8h_html_af089c8a40b6ec2e19db3fe612aa81c8c"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#af089c8a40b6ec2e19db3fe612aa81c8c">MUtils::trim_left
</a></div><div class=
"ttdeci">QString
& trim_left(QString
&str)
</div><div class=
"ttdoc">Remove leading white-space characters.
</div></div>
83 <div class=
"ttc" id=
"_global_8h_html_a45cb0d1e6a55cf5ffda3b626c25fd957"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a45cb0d1e6a55cf5ffda3b626c25fd957">MUtils::regexp_parse_uint32
</a></div><div class=
"ttdeci">bool regexp_parse_uint32(const QRegExp
&regexp, quint32
&value)
</div><div class=
"ttdoc">Parse regular expression results.
</div></div>
84 <div class=
"ttc" id=
"_global_8h_html_a15762bf5b0239e5f67a3815d63ed441a"><div class=
"ttname"><a href=
"../../d5/d3b/_global_8h.html#a15762bf5b0239e5f67a3815d63ed441a">MUtils::next_rand_u64
</a></div><div class=
"ttdeci">quint64 next_rand_u64(void)
</div><div class=
"ttdoc">Generates a random unsigned
64-Bit value.
</div></div>
85 </div><!-- fragment --></div><!-- contents -->
86 <!-- start footer part -->
87 <hr class=
"footer"/><address class=
"footer"><small>
88 Generated by
 <a href=
"http://www.doxygen.org/index.html">
89 <img class=
"footer" src=
"../../doxygen.png" alt=
"doxygen"/>