<trclass="memdesc:d3/d02/namespace_m_utils_1_1_c_p_u_fetaures"><tdclass="mdescLeft"> </td><tdclass="mdescRight">This namespace contains functions and constants for detecting CPU information. <br/></td></tr>
<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">This class represents a job object. <ahref="../../dc/dd3/class_m_utils_1_1_job_object.html#details">More...</a><br/></td></tr>
<trclass="memdesc:a3f198156e8be91f3e74dd9ed69ffaa34"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Rerieves the full path of the application's <em>Temp</em> folder. <ahref="#a3f198156e8be91f3e74dd9ed69ffaa34">More...</a><br/></td></tr>
<trclass="memdesc:a0ecb5d72f33a7b6feadd7deb8ed46cc3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Initialize a given <ahref="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object. <ahref="#a0ecb5d72f33a7b6feadd7deb8ed46cc3">More...</a><br/></td></tr>
<trclass="memdesc:ac583617546d5ae100ce7436546d9662c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generates a <em>random</em> string. <ahref="#ac583617546d5ae100ce7436546d9662c">More...</a><br/></td></tr>
<trclass="memdesc:aea4a212153b09b24b04f30ef5159f29b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Computes the <em>parity</em> of the given unsigned 32-Bit value. <ahref="#aea4a212153b09b24b04f30ef5159f29b">More...</a><br/></td></tr>
<trclass="memdesc:a5a14e75627eebd09efc37898d74c5ac6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deletes the specified file. <ahref="#a5a14e75627eebd09efc37898d74c5ac6">More...</a><br/></td></tr>
<trclass="memdesc:a4d4c545ea06892f6487f15a48808564f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sort a list of strings using "natural ordering" algorithm. <ahref="#a4d4c545ea06892f6487f15a48808564f">More...</a><br/></td></tr>
<trclass="memdesc:afd8eb699de88edd73e47fe2e41873385"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clean up a file name string. <ahref="#afd8eb699de88edd73e47fe2e41873385">More...</a><br/></td></tr>
<trclass="memdesc:ad801fab93087c31d764ad15295fe3a88"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clean up a file path string. <ahref="#ad801fab93087c31d764ad15295fe3a88">More...</a><br/></td></tr>
<trclass="memdesc:a2275e64c3c74dea855c39b66be67f705"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Retrieve a list of all available codepages. <ahref="#a2275e64c3c74dea855c39b66be67f705">More...</a><br/></td></tr>
<p>Retrieve a list of all available codepages. </p>
<p>The function generates a list of all codepages that are available on the system. Each codepage name returned by this function may be passed to the <code>QTextCodec::codecForName()</code> function in order to obtain a corresponding <ahref="http://doc.qt.io/qt-4.8/qtextcodec.html">QTextCodec</a> object.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">noAliases</td><td>If set to <code>true</code>, only distinct codepages are returned, i.e. any codepage aliases are discarded from the list; if set to <code>false</code>, the returned list may (and usually will) also contain codepage aliases.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>If the function succeeds, it returns a QStringList holding the names of all codepages available on the system; otherwise it returns a default-constructed QStringList. </dd></dl>
<p>This function ensures that the given string is a valid file (or directory) name. It does so by replacing any illegal characters, i.e. any characters <em>not</em> allowed in file names (which explicitly <em>includes</em> directory separators). Furthermore, the function will trim/remove specific characters that are <em>not</em> allowed directly at the beginning or end of a file name. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file name.</p>
<tr><tdclass="paramname">list</td><td>A read-only reference to the QString holding the original, potentially invalid file name.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns a QString holding a valid file name. If, however, the input string was empty or contained only white-space characters, the returned sting can be empty. </dd></dl>
<p>This function ensures that the given string is a valid file (or directory) path. It does so by replacing any illegal characters, i.e. any characters <em>not</em> allowed in file paths. Directory separators are preserved, but they will be "canonicalized". Furthermore, in each path component, the function will trim/remove specific characters that are <em>not</em> allowed directly at the beginning or end of a path component. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file path.</p>
<tr><tdclass="paramname">list</td><td>A read-only reference to the QString holding the original, potentially invalid file path.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns a QString holding a valid file path. If, however, the input string was empty or contained only white-space characters, the returned sting can be empty. </dd></dl>
<p>Initialize a given <ahref="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object. </p>
<p>This function prepares a given <ahref="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object for sub-process creation. It does so by setting up combined <em>stdout</em> and <em>stderr</em> redirection for the sub-process, cleaning up the sub-process' environment variables, as well as setting up the sub-process' working directory. Optionally, the <em>Temp</em> directory for the sub-process can be set to the application-specific <em>Temp</em> directory, which is achieved by overwriting the corresponding environment variables (e.g. <code>TMP</code> and <code>TEMP</code>). Furthermore, additional paths can be added to the <code>PATH</code> environment variable of the sub-process.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">process</td><td>A reference to the <ahref="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object to be initialized. The <ahref="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object must be initialized <em>before</em> calling the <code>QProcess::start()</code> method.</td></tr>
<tr><tdclass="paramname">process</td><td>A read-only reference to a QString holding the path of the working directory for the sub-process.</td></tr>
<tr><tdclass="paramname">bReplaceTempDir</td><td>If set to <code>true</code>, the <em>Temp</em> directory for the sub-process is set to the application-specific <em>Temp</em> directory; if set to <code>false</code>, the default <em>Temp</em> directory is retained.</td></tr>
<tr><tdclass="paramname">extraPaths</td><td>A read-only pointer to a QStringList object containing additional paths that will be added (prepended) to the sub-process' <code>PATH</code> environment variable. This parameter can be <code>NULL</code>, in which case <em>no</em> additional paths are added. </td></tr>
<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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="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><tdclass="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><tdclass="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>
<dlclass="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>
<p>The function generates a unique file name in the specified directory. The function guarantees that the returned 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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="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><tdclass="paramname">baseName</td><td>Specifies the desired "base" file name of the unique file. Do <b>not</b> include a file extension.</td></tr>
<tr><tdclass="paramname">extension</td><td>Specifies the desired file extensions of the unique file. Do <b>not</b> include a leading dot (<code>.</code>) character.</td></tr>
<tr><tdclass="paramname">fancy</td><td>If set to <code>true</code>, the unique file name is generated according to the <code>"<basedir>/<basename> (N).<ext>"</code> pattern; if set to <code>false</code>, it is generated according to the <code>"<basedir>/<basename>.XXXX.<ext>"</code> pattern. Also, if set to <code>true</code>, a counter is only included in the file name, if the file name <em>without</em> counter already exists; if set to <code>false</code>, a counter is always included. Finally, if set to <code>true</code>, the counter starts at <b>2</b> and is printed in decimal format; if set to <code>false</code>, the counter starts at <b>0</b> and is printed in zero-padded hexadecimal format.</td></tr>
</table>
</dd>
</dl>
<dlclass="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>
<p>Sort a list of strings using "natural ordering" algorithm. </p>
<p>This function implements a sort algorithm that orders alphanumeric strings in the way a human being would. See <ahref="http://sourcefrog.net/projects/natsort/"><em>Natural Order String Comparison</em></a> for details!</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">list</td><td>A reference to the QStringList object to be sorted. The list will be sorted "in place".</td></tr>
<tr><tdclass="paramname">bIgnoreCase</td><td>If set to <code>true</code>, the list will be sorted disregarding the character case, i.e. upper-case and lower-case characters (of the same letter) are treated the same; if set to <code>false</code>, the character case <em>is</em> taken into account. </td></tr>
<p>The random string is generated using the same PRNG as the <code><aclass="el"href="../../d3/da6/namespace_m_utils.html#ad7edd4aece64faf3aa16c9509243608c"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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="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>
<dlclass="section return"><dt>Returns</dt><dd>The function returns a QString holding a <em>random</em> hexadecimal string </dd></dl>
<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>
<dlclass="section return"><dt>Returns</dt><dd>The function returns a <em>random</em> unsigned 32-Bit value. </dd></dl>
<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>
<dlclass="section return"><dt>Returns</dt><dd>The function returns a <em>random</em> unsigned 64-Bit value. </dd></dl>
<p>Computes the <em>parity</em> of the given unsigned 32-Bit value. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">value</td><td>The 32-Bit unsigned value from which the parity is to be computed.</td></tr>
</table>
</dd>
</dl>
<dlclass="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>
<p>This function tries to parses the result (capture) of a regular expression as an unsigned 32-Bit value. The given regular expression must contain at least <em>one</em> capture. Only the <em>first</em> capture is considered, additional captures are ignored.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">regexp</td><td>A read-only reference to the <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> object whose result (capture) will be parsed. This <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> must already have been <em>successfully</em> matched against the respective input string, e.g. via <code>QRegExp::indexIn()</code>, prior to calling this function.</td></tr>
<tr><tdclass="paramname">value</td><td>A reference to a variable of type <code>quint32</code>, where the unsigned 32-Bit representation of the result will be stored. The contents of this variable are <em>undefined</em>, if the function failed.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the regular expression's capture could be parsed successfully; it returns <code>false</code>, if the capture contains an invalid string or if there are insufficient captures in given the <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> object. </dd></dl>
<p>This function tries to parses the results (captures) of a regular expression as unsigned 32-Bit values. The given regular expression must contain at least <code>count</code> captures. Only the <em>first</em><code>count</code> captures are considered, additional captures are ignored.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">regexp</td><td>A read-only reference to the <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> object whose results (captures) will be parsed. This <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> must already have been <em>successfully</em> matched against the respective input string, e.g. via <code>QRegExp::indexIn()</code>, prior to calling this function.</td></tr>
<tr><tdclass="paramname">value</td><td>A pointer to an array of type <code>quint32</code>, where the unsigned 32-Bit representations of the results will be stored (the <code>n</code>-th result is stored at <code>value[n-1]</code>). The array must be at least <code>count</code> elements in length. The contents of this array are <em>undefined</em>, if the function failed.</td></tr>
<tr><tdclass="paramname">count</td><td>Specifies the number of results (captures) in the given <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> object. The function tries to parse the first <code>count</code> captures and ignores any additional captures that may exist. This parameter also determines the required (minimum) length of the <code>value</code> array.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if all of the regular expression's captures could be parsed successfully; it returns <code>false</code>, if any of the captures contain an invalid string or if there are insufficient captures in given the <ahref="http://doc.qt.io/qt-4.8/qregexp.html">QRegExp</a> object. </dd></dl>
<p>Recursively deletes the specified directory. </p>
<p>The function deletes the specified directory. In <em>recursive</em> mode, the directory will be removed including all of its files and sub-directories. Files are deleted using the <code><aclass="el"href="../../d3/da6/namespace_m_utils.html#a5a14e75627eebd09efc37898d74c5ac6"title="Deletes the specified file. ">remove_file()</a></code> function.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">folderPath</td><td>The path to the directory to be deleted. This should be a full path.</td></tr>
<tr><tdclass="paramname">recursive</td><td>If set to <code>true</code> the function removes all files and sub-directories in the specified directory; if set to <code>false</code>, the function will <em>not</em> try to delete any files or sub-directories, which means that it will fail on non-empty directories.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the directory was deleted successfully or if the directory doesn't exist; it returns <code>false</code>, if the directory could <em>not</em> be deleted. </dd></dl>
<p>The function deletes the specified file, even if it has the "read only" flag set. If the file is currently locked (e.g. by another process), the function retries multiple times to delete the file before it fails.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">fileName</td><td>The path to the file to be deleted. This should be a full path.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the file was deleted successfully or if the file doesn't exist; it returns <code>false</code>, if the file could <em>not</em> be deleted. </dd></dl>
<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 terminates normally, the application's <em>Temp</em> folder and all files or sub-directories thereof will be <em>removed</em> automatically!</p>
<dlclass="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>
<p>The function removes all <em>leading</em> white-space characters from the specified string. Trailing white-space characters are <em>not</em> removed. White-space characters are defined by the <code>\s</code> character class.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">str</td><td>A reference to the QString object to be trimmed. This QString object will be modified directly.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A reference to the trimmed QString object. This is the same QString object that was specified in the <code>str</code> parameter. </dd></dl>
<p>The function removes all <em>leading</em> white-space characters from the specified string. Trailing white-space characters are <em>not</em> removed. White-space characters are defined by the <code>\s</code> character class.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">str</td><td>A read-only reference to the QString object to be trimmed. The original QString object is <em>not</em> modified.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A new QString object that equals the original QString object, except that it has all <em>leading</em> white-space characters removed. </dd></dl>
<p>The function removes all <em>trailing</em> white-space characters from the specified string. Leading white-space characters are <em>not</em> removed. White-space characters are defined by the <code>\s</code> character class.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">str</td><td>A reference to the QString object to be trimmed. This QString object will be modified directly.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A reference to the trimmed QString object. This is the same QString object that was specified in the <code>str</code> parameter. </dd></dl>
<p>The function removes all <em>trailing</em> white-space characters from the specified string. Leading white-space characters are <em>not</em> removed. White-space characters are defined by the <code>\s</code> character class.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">str</td><td>A read-only reference to the QString object to be trimmed. The original QString object is <em>not</em> modified.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A new QString object that equals the original QString object, except that it has all <em>trailing</em> white-space characters removed. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hrclass="footer"/><addressclass="footer"><small>
Generated by  <ahref="http://www.doxygen.org/index.html">