417 lines
31 KiB
HTML
417 lines
31 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.12"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>MuldeR's Utilities for Qt: include/MUtils/Global.h File Reference</title>
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../jquery.js"></script>
|
|
<script type="text/javascript" src="../../dynsections.js"></script>
|
|
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
|
<script type="text/javascript" src="../../search/search.js"></script>
|
|
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">MuldeR's Utilities for Qt
|
|
</div>
|
|
<div id="projectbrief">MUtilities</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.12 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="../../menudata.js"></script>
|
|
<script type="text/javascript" src="../../menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('../../',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<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>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#define-members">Macros</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Global.h File Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>This file contains miscellaneous functions that are generally useful for Qt-based applications.
|
|
<a href="#details">More...</a></p>
|
|
<div class="textblock"><code>#include <QString></code><br />
|
|
</div>
|
|
<p><a href="../../d5/d3b/_global_8h_source.html">Go to the source code of this file.</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
|
|
Macros</h2></td></tr>
|
|
<tr class="memitem:a761530893b34e2d324f22ddf7bc31455"><td class="memItemLeft" align="right" valign="top"><a id="a761530893b34e2d324f22ddf7bc31455"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_API</b></td></tr>
|
|
<tr class="separator:a761530893b34e2d324f22ddf7bc31455"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad5b14e1c1267ed90263a45bf6d4289ca"><td class="memItemLeft" align="right" valign="top"><a id="ad5b14e1c1267ed90263a45bf6d4289ca"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_MAKE_STRING_HELPER</b>(X)   #X</td></tr>
|
|
<tr class="separator:ad5b14e1c1267ed90263a45bf6d4289ca"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af2c5f52bf983b10e2078b03ce36efb22"><td class="memItemLeft" align="right" valign="top"><a id="af2c5f52bf983b10e2078b03ce36efb22"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_MAKE_STRING</b>(X)   MUTILS_MAKE_STRING_HELPER(X)</td></tr>
|
|
<tr class="separator:af2c5f52bf983b10e2078b03ce36efb22"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2b88ab398bf3616fb6826c806f435ddc"><td class="memItemLeft" align="right" valign="top"><a id="a2b88ab398bf3616fb6826c806f435ddc"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_COMPILER_WARNING</b>(TXT)   __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))</td></tr>
|
|
<tr class="separator:a2b88ab398bf3616fb6826c806f435ddc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a249516197568fbf9bbf980554b4d6d95"><td class="memItemLeft" align="right" valign="top"><a id="a249516197568fbf9bbf980554b4d6d95"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_DEBUG</b>   (1)</td></tr>
|
|
<tr class="separator:a249516197568fbf9bbf980554b4d6d95"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad42b1946a83df3bd76734d5ab691fd0d"><td class="memItemLeft" align="right" valign="top"><a id="ad42b1946a83df3bd76734d5ab691fd0d"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_DELETE</b>(PTR)   do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0)</td></tr>
|
|
<tr class="separator:ad42b1946a83df3bd76734d5ab691fd0d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa544a37b80f1ab9d86f439a7666e9aa8"><td class="memItemLeft" align="right" valign="top"><a id="aa544a37b80f1ab9d86f439a7666e9aa8"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_DELETE_ARRAY</b>(PTR)   do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0)</td></tr>
|
|
<tr class="separator:aa544a37b80f1ab9d86f439a7666e9aa8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1fe39de37351efa3ca46bdc8653e1f25"><td class="memItemLeft" align="right" valign="top"><a id="a1fe39de37351efa3ca46bdc8653e1f25"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_ZERO_MEMORY</b>(PTR)   memset(&(PTR), 0, sizeof((PTR)))</td></tr>
|
|
<tr class="separator:a1fe39de37351efa3ca46bdc8653e1f25"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af55d43b39d3f41cf090c138ed190ee6e"><td class="memItemLeft" align="right" valign="top"><a id="af55d43b39d3f41cf090c138ed190ee6e"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_WCHR</b>(STR)   (reinterpret_cast<const wchar_t*>((STR).utf16()))</td></tr>
|
|
<tr class="separator:af55d43b39d3f41cf090c138ed190ee6e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a88b0902153ea537b12d86267af20eb3f"><td class="memItemLeft" align="right" valign="top"><a id="a88b0902153ea537b12d86267af20eb3f"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_UTF8</b>(STR)   ((STR).toUtf8().constData())</td></tr>
|
|
<tr class="separator:a88b0902153ea537b12d86267af20eb3f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a04d63f6f60c90f8e3c4029824a7352b0"><td class="memItemLeft" align="right" valign="top"><a id="a04d63f6f60c90f8e3c4029824a7352b0"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_QSTR</b>(STR)   (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))</td></tr>
|
|
<tr class="separator:a04d63f6f60c90f8e3c4029824a7352b0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a177ecbfe7701c2ac04bb8bdeb208773a"><td class="memItemLeft" align="right" valign="top"><a id="a177ecbfe7701c2ac04bb8bdeb208773a"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MUTILS_BOOL2STR</b>(X)   ((X) ? "1" : "0")</td></tr>
|
|
<tr class="separator:a177ecbfe7701c2ac04bb8bdeb208773a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:a9ddb9a2039585b1ef3429db16ea84292"><td class="memItemLeft" align="right" valign="top">const QString & </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a9ddb9a2039585b1ef3429db16ea84292">MUtils::temp_folder</a> (void)</td></tr>
|
|
<tr class="memdesc:a9ddb9a2039585b1ef3429db16ea84292"><td class="mdescLeft"> </td><td class="mdescRight">Rerieves the full path of the application's <em>Temp</em> folder. <a href="../../d5/d3b/_global_8h.html#a9ddb9a2039585b1ef3429db16ea84292">More...</a><br /></td></tr>
|
|
<tr class="separator:a9ddb9a2039585b1ef3429db16ea84292"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5a94d9552ee93a19722fdb411e580340"><td class="memItemLeft" align="right" valign="top"><a id="a5a94d9552ee93a19722fdb411e580340"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>MUtils::init_process</b> (QProcess &process, const QString &wokringDir, const bool bReplaceTempDir=true, const QStringList *const extraPaths=NULL)</td></tr>
|
|
<tr class="separator:a5a94d9552ee93a19722fdb411e580340"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4dc7dccb81653ae28e0d37a7c2f62112"><td class="memItemLeft" align="right" valign="top">quint32 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a4dc7dccb81653ae28e0d37a7c2f62112">MUtils::next_rand_u32</a> (void)</td></tr>
|
|
<tr class="memdesc:a4dc7dccb81653ae28e0d37a7c2f62112"><td class="mdescLeft"> </td><td class="mdescRight">Generates a <em>random</em> unsigned 32-Bit value. <a href="../../d5/d3b/_global_8h.html#a4dc7dccb81653ae28e0d37a7c2f62112">More...</a><br /></td></tr>
|
|
<tr class="separator:a4dc7dccb81653ae28e0d37a7c2f62112"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a15762bf5b0239e5f67a3815d63ed441a"><td class="memItemLeft" align="right" valign="top">quint64 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a15762bf5b0239e5f67a3815d63ed441a">MUtils::next_rand_u64</a> (void)</td></tr>
|
|
<tr class="memdesc:a15762bf5b0239e5f67a3815d63ed441a"><td class="mdescLeft"> </td><td class="mdescRight">Generates a <em>random</em> unsigned 64-Bit value. <a href="../../d5/d3b/_global_8h.html#a15762bf5b0239e5f67a3815d63ed441a">More...</a><br /></td></tr>
|
|
<tr class="separator:a15762bf5b0239e5f67a3815d63ed441a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a996b60884ddf7728178e94f34ca12570"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a996b60884ddf7728178e94f34ca12570">MUtils::next_rand_str</a> (const bool &bLong=false)</td></tr>
|
|
<tr class="memdesc:a996b60884ddf7728178e94f34ca12570"><td class="mdescLeft"> </td><td class="mdescRight">Generates a <em>random</em> string. <a href="../../d5/d3b/_global_8h.html#a996b60884ddf7728178e94f34ca12570">More...</a><br /></td></tr>
|
|
<tr class="separator:a996b60884ddf7728178e94f34ca12570"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a67cb16c62b213da5135a6fa076f3f005"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a67cb16c62b213da5135a6fa076f3f005">MUtils::make_temp_file</a> (const QString &basePath, const QString &extension, const bool placeholder=false)</td></tr>
|
|
<tr class="memdesc:a67cb16c62b213da5135a6fa076f3f005"><td class="mdescLeft"> </td><td class="mdescRight">Generates a temporary file name. <a href="../../d5/d3b/_global_8h.html#a67cb16c62b213da5135a6fa076f3f005">More...</a><br /></td></tr>
|
|
<tr class="separator:a67cb16c62b213da5135a6fa076f3f005"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a390e56e35eb9329d2e67fa9741d07536"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#a390e56e35eb9329d2e67fa9741d07536">MUtils::make_unique_file</a> (const QString &basePath, const QString &baseName, const QString &extension, const bool fancy=false)</td></tr>
|
|
<tr class="memdesc:a390e56e35eb9329d2e67fa9741d07536"><td class="mdescLeft"> </td><td class="mdescRight">Generates a unique file name. <a href="../../d5/d3b/_global_8h.html#a390e56e35eb9329d2e67fa9741d07536">More...</a><br /></td></tr>
|
|
<tr class="separator:a390e56e35eb9329d2e67fa9741d07536"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad1bdb5e416839b1f85f6df68e58ae28c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d3b/_global_8h.html#ad1bdb5e416839b1f85f6df68e58ae28c">MUtils::parity</a> (quint32 value)</td></tr>
|
|
<tr class="memdesc:ad1bdb5e416839b1f85f6df68e58ae28c"><td class="mdescLeft"> </td><td class="mdescRight">Computes the <em>parity</em> of the given unsigned 32-Bit value. <a href="../../d5/d3b/_global_8h.html#ad1bdb5e416839b1f85f6df68e58ae28c">More...</a><br /></td></tr>
|
|
<tr class="separator:ad1bdb5e416839b1f85f6df68e58ae28c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a12259acdd6aff74ee83819d3aebd8ba9"><td class="memItemLeft" align="right" valign="top"><a id="a12259acdd6aff74ee83819d3aebd8ba9"></a>
|
|
bool </td><td class="memItemRight" valign="bottom"><b>MUtils::remove_file</b> (const QString &fileName)</td></tr>
|
|
<tr class="separator:a12259acdd6aff74ee83819d3aebd8ba9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac7d2c9bd5c49230b2fed72e3410c3f7d"><td class="memItemLeft" align="right" valign="top"><a id="ac7d2c9bd5c49230b2fed72e3410c3f7d"></a>
|
|
bool </td><td class="memItemRight" valign="bottom"><b>MUtils::remove_directory</b> (const QString &folderPath, const bool &recursive)</td></tr>
|
|
<tr class="separator:ac7d2c9bd5c49230b2fed72e3410c3f7d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9290a3fe637a05ad2a7515f36fad79bd"><td class="memItemLeft" align="right" valign="top"><a id="a9290a3fe637a05ad2a7515f36fad79bd"></a>
|
|
QString & </td><td class="memItemRight" valign="bottom"><b>MUtils::trim_right</b> (QString &str)</td></tr>
|
|
<tr class="separator:a9290a3fe637a05ad2a7515f36fad79bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af089c8a40b6ec2e19db3fe612aa81c8c"><td class="memItemLeft" align="right" valign="top"><a id="af089c8a40b6ec2e19db3fe612aa81c8c"></a>
|
|
QString & </td><td class="memItemRight" valign="bottom"><b>MUtils::trim_left</b> (QString &str)</td></tr>
|
|
<tr class="separator:af089c8a40b6ec2e19db3fe612aa81c8c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3eb47d6ca49b2700622e3fe99faf14d8"><td class="memItemLeft" align="right" valign="top"><a id="a3eb47d6ca49b2700622e3fe99faf14d8"></a>
|
|
QString </td><td class="memItemRight" valign="bottom"><b>MUtils::trim_right</b> (const QString &str)</td></tr>
|
|
<tr class="separator:a3eb47d6ca49b2700622e3fe99faf14d8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8680aeaeb1118353bd099e26ba7d6123"><td class="memItemLeft" align="right" valign="top"><a id="a8680aeaeb1118353bd099e26ba7d6123"></a>
|
|
QString </td><td class="memItemRight" valign="bottom"><b>MUtils::trim_left</b> (const QString &str)</td></tr>
|
|
<tr class="separator:a8680aeaeb1118353bd099e26ba7d6123"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a09e919d419ded903481cf7aba702dcba"><td class="memItemLeft" align="right" valign="top"><a id="a09e919d419ded903481cf7aba702dcba"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>MUtils::natural_string_sort</b> (QStringList &list, const bool bIgnoreCase)</td></tr>
|
|
<tr class="separator:a09e919d419ded903481cf7aba702dcba"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a895e14458df7226110ae70029c1729a9"><td class="memItemLeft" align="right" valign="top"><a id="a895e14458df7226110ae70029c1729a9"></a>
|
|
QString </td><td class="memItemRight" valign="bottom"><b>MUtils::clean_file_name</b> (const QString &name)</td></tr>
|
|
<tr class="separator:a895e14458df7226110ae70029c1729a9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac0949226be088ce65a60d5aa4194e1c0"><td class="memItemLeft" align="right" valign="top"><a id="ac0949226be088ce65a60d5aa4194e1c0"></a>
|
|
QString </td><td class="memItemRight" valign="bottom"><b>MUtils::clean_file_path</b> (const QString &path)</td></tr>
|
|
<tr class="separator:ac0949226be088ce65a60d5aa4194e1c0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a45cb0d1e6a55cf5ffda3b626c25fd957"><td class="memItemLeft" align="right" valign="top"><a id="a45cb0d1e6a55cf5ffda3b626c25fd957"></a>
|
|
bool </td><td class="memItemRight" valign="bottom"><b>MUtils::regexp_parse_uint32</b> (const QRegExp &regexp, quint32 &value)</td></tr>
|
|
<tr class="separator:a45cb0d1e6a55cf5ffda3b626c25fd957"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a367969a260da994876d19c9f7ee40606"><td class="memItemLeft" align="right" valign="top"><a id="a367969a260da994876d19c9f7ee40606"></a>
|
|
bool </td><td class="memItemRight" valign="bottom"><b>MUtils::regexp_parse_uint32</b> (const QRegExp &regexp, quint32 *values, const size_t &count)</td></tr>
|
|
<tr class="separator:a367969a260da994876d19c9f7ee40606"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4fcbdafffc1224776616fcc6aec8278b"><td class="memItemLeft" align="right" valign="top"><a id="a4fcbdafffc1224776616fcc6aec8278b"></a>
|
|
QStringList </td><td class="memItemRight" valign="bottom"><b>MUtils::available_codepages</b> (const bool &noAliases=true)</td></tr>
|
|
<tr class="separator:a4fcbdafffc1224776616fcc6aec8278b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a00af0daa1ae56f474746443002be6786"><td class="memItemLeft" align="right" valign="top"><a id="a00af0daa1ae56f474746443002be6786"></a>
|
|
int </td><td class="memItemRight" valign="bottom"><b>MUtils::Internal::selfTest</b> (const char *const buildKey, const bool debug)</td></tr>
|
|
<tr class="separator:a00af0daa1ae56f474746443002be6786"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>This file contains miscellaneous functions that are generally useful for Qt-based applications. </p>
|
|
</div><h2 class="groupheader">Function Documentation</h2>
|
|
<a id="file_a67cb16c62b213da5135a6fa076f3f005"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a67cb16c62b213da5135a6fa076f3f005">§ </a></span>make_temp_file()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QString MUtils::make_temp_file </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>basePath</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>extension</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const bool </td>
|
|
<td class="paramname"><em>placeholder</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generates a temporary file name. </p>
|
|
<p>The function generates a file name that contains a <em>random</em> component and that is guaranteed to <b>not</b> exist yet. The generated file name follows a <code>"<basedir>/<random>.<ext>"</code> pattern. This is useful (not only) for creating temporary files.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">basePath</td><td>Specifies the "base" directory where the temporary file is supposed to be created. This must be a valid <em>existing</em> directory.</td></tr>
|
|
<tr><td class="paramname">extension</td><td>Specifies the desired file extensions of the temporary file. Do <b>not</b> include a leading dot (<code>.</code>) character.</td></tr>
|
|
<tr><td class="paramname">placeholder</td><td>If set to <code>true</code>, the function creates an empty "placeholder" file under the returned file name; if set to <code>false</code>, it does <em>not</em>.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>If the function succeeds, it returns a QString holding the full path of the temporary file; otherwise it returns a default-constructed QString. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_a390e56e35eb9329d2e67fa9741d07536"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a390e56e35eb9329d2e67fa9741d07536">§ </a></span>make_unique_file()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QString MUtils::make_unique_file </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>basePath</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>baseName</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>extension</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const bool </td>
|
|
<td class="paramname"><em>fancy</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generates a unique file name. </p>
|
|
<p>The function generates a unique file name in the specified directory. The function guarantees that the return file name does <em>not</em> exist yet. If necessary, a <em>counter</em> will be included in the file name in order to ensure its uniqueness.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">basePath</td><td>Specifies the "base" directory where the unique file is supposed to be created. This must be a valid <em>existing</em> directory.</td></tr>
|
|
<tr><td class="paramname">baseName</td><td>Specifies the desired "base" file name of the unqiue file. Do <b>not</b> include a file extension.</td></tr>
|
|
<tr><td class="paramname">extension</td><td>Specifies the desired file extensions of the unqiue file. Do <b>not</b> include a leading dot (<code>.</code>) character.</td></tr>
|
|
<tr><td class="paramname">fancy</td><td>If set to <code>true</code>, the file name is generated according to the <code>"<basedir>/<basername> (N).<ext>"</code> pattern; if set to <code>false</code>, the file name is generated according to the <code>"<basedir>/<basername>.XXXX.<ext>"</code> pattern.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>If the function succeeds, it returns a QString holding the full path of the unique file; otherwise it returns a default-constructed QString. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_a996b60884ddf7728178e94f34ca12570"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a996b60884ddf7728178e94f34ca12570">§ </a></span>next_rand_str()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QString MUtils::next_rand_str </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const bool & </td>
|
|
<td class="paramname"><em>bLong</em> = <code>false</code></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generates a <em>random</em> string. </p>
|
|
<p>The random string is generated using the same PRNG as the <code><a class="el" href="../../d5/d3b/_global_8h.html#a15762bf5b0239e5f67a3815d63ed441a" title="Generates a random unsigned 64-Bit value. ">next_rand_u64()</a></code> function. The <em>random</em> bytes are converted to a hexadecimal string and, if necessary, zero-padded to a toal length of 16 or 32 characters. There is <b>no</b> <code>0x</code>-prefix included in the result.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">bLong</td><td>If set to <code>true</code>, a "long" random string (32 characters) will be generated; if set to <code>false</code>, a "short" random string (16 characters) is generated.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The function retruns a QString holding a <em>random</em> hexadecimal string </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_a4dc7dccb81653ae28e0d37a7c2f62112"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a4dc7dccb81653ae28e0d37a7c2f62112">§ </a></span>next_rand_u32()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">quint32 MUtils::next_rand_u32 </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generates a <em>random</em> unsigned 32-Bit value. </p>
|
|
<p>The <em>random</em> value is created using a "strong" PRNG of the underlying system, if possible. Otherwise a fallback PRNG is used. It is <b>not</b> required or useful to call <code>srand()</code> or <code>qsrand()</code> prior to using this function. If necessary, the seeding of the PRNG happen <em>automatically</em> on the first call.</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The function retruns a <em>random</em> unsigned 32-Bit value. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_a15762bf5b0239e5f67a3815d63ed441a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a15762bf5b0239e5f67a3815d63ed441a">§ </a></span>next_rand_u64()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">quint64 MUtils::next_rand_u64 </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generates a <em>random</em> unsigned 64-Bit value. </p>
|
|
<p>The <em>random</em> value is created using a "strong" PRNG of the underlying system, if possible. Otherwise a fallback PRNG is used. It is <b>not</b> required or useful to call <code>srand()</code> or <code>qsrand()</code> prior to using this function. If necessary, the seeding of the PRNG happen <em>automatically</em> on the first call.</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The function retruns a <em>random</em> unsigned 64-Bit value. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_ad1bdb5e416839b1f85f6df68e58ae28c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_ad1bdb5e416839b1f85f6df68e58ae28c">§ </a></span>parity()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool MUtils::parity </td>
|
|
<td>(</td>
|
|
<td class="paramtype">quint32 </td>
|
|
<td class="paramname"><em>value</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Computes the <em>parity</em> of the given unsigned 32-Bit value. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">value</td><td>The 32-Bit unsigned value from which the parity is to be computed.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the number of <b>1</b> bits in the given value is <em>odd</em>; it returns <code>false</code>, if the number of <b>1</b> bits in the given value is <em>even</em>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="file_a9ddb9a2039585b1ef3429db16ea84292"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#file_a9ddb9a2039585b1ef3429db16ea84292">§ </a></span>temp_folder()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const QString& MUtils::temp_folder </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Rerieves the full path of the application's <em>Temp</em> folder. </p>
|
|
<p>The application's <em>Temp</em> folder is a unique application-specific folder, intended to store any temporary files that the application may need. It will be created when this function is called for the first time (lazy initialization); subsequent calls are guaranteed to return the same path. Usually the application's <em>Temp</em> folder will be created as a sub-folder of the system's global <em>Temp</em> folder, as indicated by the <code>TMP</code> or <code>TEMP</code> environment variables. However, it may be created at a different place(e.g. in the users <em>Profile</em> directory), if those environment variables don't point to a usable directory. In any case, this function makes sure that the application's <em>Temp</em> folder exists for the whole lifetime of the application and that it is writable. When the application is about to terminate, the application's <em>Temp</em> folder and all files or sub-directories thereof will be <em>removed</em> automatically!</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>If the function succeeds, it returns a read-only reference to a QString holding the full path of the application's <em>Temp</em> folder; otherwise a read-only reference to a default-constructed QString is returned. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Sun Dec 18 2016 22:39:38 for MuldeR's Utilities for Qt by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.12
|
|
</small></address>
|
|
</body>
|
|
</html>
|