GpgFrontend-Doxygen/docs/html/classGpgFrontend_1_1FileOperator.html

376 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GpgFrontend Project: GpgFrontend::FileOperator Class 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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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">GpgFrontend Project
</div>
<div id="projectbrief">A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classGpgFrontend_1_1FileOperator.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classGpgFrontend_1_1FileOperator-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">GpgFrontend::FileOperator Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>provides file operations
<a href="classGpgFrontend_1_1FileOperator.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="FileOperator_8h_source.html">FileOperator.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for GpgFrontend::FileOperator:</div>
<div class="dyncontent">
<div class="center"><img src="classGpgFrontend_1_1FileOperator__coll__graph.png" border="0" usemap="#aGpgFrontend_1_1FileOperator_coll__map" alt="Collaboration graph"/></div>
<map name="aGpgFrontend_1_1FileOperator_coll__map" id="aGpgFrontend_1_1FileOperator_coll__map">
<area shape="rect" title="provides file operations" alt="" coords="5,5,199,141"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ad4424bce4f22ae75a16c542dfb4ddf0a"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGpgFrontend_1_1FileOperator.html#ad4424bce4f22ae75a16c542dfb4ddf0a">ReadFileStd</a> (const std::filesystem::path &amp;file_name, std::string &amp;data)</td></tr>
<tr class="memdesc:ad4424bce4f22ae75a16c542dfb4ddf0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">read file content using std struct <a href="classGpgFrontend_1_1FileOperator.html#ad4424bce4f22ae75a16c542dfb4ddf0a">More...</a><br /></td></tr>
<tr class="separator:ad4424bce4f22ae75a16c542dfb4ddf0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51121c94dc32a83d7073fbe7138b603b"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGpgFrontend_1_1FileOperator.html#a51121c94dc32a83d7073fbe7138b603b">WriteFileStd</a> (const std::filesystem::path &amp;file_name, const std::string &amp;data)</td></tr>
<tr class="memdesc:a51121c94dc32a83d7073fbe7138b603b"><td class="mdescLeft">&#160;</td><td class="mdescRight">write file content using std struct <a href="classGpgFrontend_1_1FileOperator.html#a51121c94dc32a83d7073fbe7138b603b">More...</a><br /></td></tr>
<tr class="separator:a51121c94dc32a83d7073fbe7138b603b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28a3572dc01192b6a4d50b544181084c"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGpgFrontend_1_1FileOperator.html#a28a3572dc01192b6a4d50b544181084c">ReadFile</a> (const QString &amp;file_name, QByteArray &amp;data)</td></tr>
<tr class="memdesc:a28a3572dc01192b6a4d50b544181084c"><td class="mdescLeft">&#160;</td><td class="mdescRight">read file content <a href="classGpgFrontend_1_1FileOperator.html#a28a3572dc01192b6a4d50b544181084c">More...</a><br /></td></tr>
<tr class="separator:a28a3572dc01192b6a4d50b544181084c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f21ef4a88448b1eddf756302913d338"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGpgFrontend_1_1FileOperator.html#a2f21ef4a88448b1eddf756302913d338">WriteFile</a> (const QString &amp;file_name, const QByteArray &amp;data)</td></tr>
<tr class="memdesc:a2f21ef4a88448b1eddf756302913d338"><td class="mdescLeft">&#160;</td><td class="mdescRight">write file content <a href="classGpgFrontend_1_1FileOperator.html#a2f21ef4a88448b1eddf756302913d338">More...</a><br /></td></tr>
<tr class="separator:a2f21ef4a88448b1eddf756302913d338"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08baef750a723ee709804120a34d19c9"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGpgFrontend_1_1FileOperator.html#a08baef750a723ee709804120a34d19c9">CalculateHash</a> (const std::filesystem::path &amp;file_path)</td></tr>
<tr class="separator:a08baef750a723ee709804120a34d19c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>provides file operations </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a08baef750a723ee709804120a34d19c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08baef750a723ee709804120a34d19c9">&#9670;&nbsp;</a></span>CalculateHash()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::string GpgFrontend::FileOperator::CalculateHash </td>
<td>(</td>
<td class="paramtype">const std::filesystem::path &amp;&#160;</td>
<td class="paramname"><em>file_path</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>calculate the hash of a file </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_path</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>
</div>
</div>
<a id="a28a3572dc01192b6a4d50b544181084c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28a3572dc01192b6a4d50b544181084c">&#9670;&nbsp;</a></span>ReadFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool GpgFrontend::FileOperator::ReadFile </td>
<td>(</td>
<td class="paramtype">const QString &amp;&#160;</td>
<td class="paramname"><em>file_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">QByteArray &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>read file content </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_name</td><td>file name </td></tr>
<tr><td class="paramname">data</td><td>data read from file </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if success </dd>
<dd>
false if failed</dd></dl>
<p>Copyright (C) 2021 Saturneric</p>
<p>This file is part of <a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a>.</p>
<p><a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a> is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p><a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a> is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with <a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a>. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</p>
<p>The initial version of the source code is inherited from the gpg4usb project, which is under GPL-3.0-or-later.</p>
<p>All the source code of <a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a> was modified and released by Saturneric<a href="#" onclick="location.href='mai'+'lto:'+'eri'+'c@'+'bkt'+'us'+'.co'+'m'; return false;">eric@<span style="display: none;">.nosp@m.</span>bktu<span style="display: none;">.nosp@m.</span>s.com</a> starting on May 12, 2021.</p>
<p>SPDX-License-Identifier: GPL-3.0-or-later </p>
<p class="reference">Referenced by <a class="el" href="classGpgFrontend_1_1UI_1_1CommonUtils.html#a057526790f6b2f6288c3a35322c34d8d">GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile()</a>.</p>
</div>
</div>
<a id="ad4424bce4f22ae75a16c542dfb4ddf0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4424bce4f22ae75a16c542dfb4ddf0a">&#9670;&nbsp;</a></span>ReadFileStd()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool GpgFrontend::FileOperator::ReadFileStd </td>
<td>(</td>
<td class="paramtype">const std::filesystem::path &amp;&#160;</td>
<td class="paramname"><em>file_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>read file content using std struct </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_name</td><td>file name </td></tr>
<tr><td class="paramname">data</td><td>data read from file </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>
<p class="reference">Referenced by <a class="el" href="classGpgFrontend_1_1DataObjectOperator.html#a3a8ae5c36fec01d0d5c3e5f9aed457a6">GpgFrontend::DataObjectOperator::DataObjectOperator()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a74eb3ba532a236d8ad284b41265b0ccd">GpgFrontend::GpgFileOpera::DecryptFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a90949b4e9e6116784260cd0e416551db">GpgFrontend::GpgFileOpera::DecryptVerifyFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a234d939ae0b2c3f799dd01130fad9379">GpgFrontend::GpgFileOpera::EncryptFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a826efca057afb07157453b3b9e267b0f">GpgFrontend::GpgFileOpera::EncryptFileSymmetric()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a6353e1688b113e5746aced6aa7f3876e">GpgFrontend::GpgFileOpera::EncryptSignFile()</a>, <a class="el" href="classGpgFrontend_1_1KeyPackageOperator.html#a89538b180a42eb7d6ae53583fe10ee07">GpgFrontend::KeyPackageOperator::ImportKeyPackage()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a350df1c07c054625c4755a78e6ca5ca8">GpgFrontend::GpgFileOpera::SignFile()</a>, and <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a14cddfe822c9410cd9c301d08963b7e7">GpgFrontend::GpgFileOpera::VerifyFile()</a>.</p>
</div>
</div>
<a id="a2f21ef4a88448b1eddf756302913d338"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f21ef4a88448b1eddf756302913d338">&#9670;&nbsp;</a></span>WriteFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool GpgFrontend::FileOperator::WriteFile </td>
<td>(</td>
<td class="paramtype">const QString &amp;&#160;</td>
<td class="paramname"><em>file_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QByteArray &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>write file content </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_name</td><td>file name </td></tr>
<tr><td class="paramname">data</td><td>data to write to file </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if success </dd>
<dd>
false if failed </dd></dl>
</div>
</div>
<a id="a51121c94dc32a83d7073fbe7138b603b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51121c94dc32a83d7073fbe7138b603b">&#9670;&nbsp;</a></span>WriteFileStd()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool GpgFrontend::FileOperator::WriteFileStd </td>
<td>(</td>
<td class="paramtype">const std::filesystem::path &amp;&#160;</td>
<td class="paramname"><em>file_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>write file content using std struct </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_name</td><td>file name </td></tr>
<tr><td class="paramname">data</td><td>data to write to file </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>
<p class="reference">Referenced by <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a74eb3ba532a236d8ad284b41265b0ccd">GpgFrontend::GpgFileOpera::DecryptFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a90949b4e9e6116784260cd0e416551db">GpgFrontend::GpgFileOpera::DecryptVerifyFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a234d939ae0b2c3f799dd01130fad9379">GpgFrontend::GpgFileOpera::EncryptFile()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a826efca057afb07157453b3b9e267b0f">GpgFrontend::GpgFileOpera::EncryptFileSymmetric()</a>, <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a6353e1688b113e5746aced6aa7f3876e">GpgFrontend::GpgFileOpera::EncryptSignFile()</a>, <a class="el" href="classGpgFrontend_1_1KeyPackageOperator.html#ade02f022e405e98377343c4667c206e9">GpgFrontend::KeyPackageOperator::GenerateKeyPackage()</a>, <a class="el" href="classGpgFrontend_1_1KeyPackageOperator.html#a6d9cf022a1e0cf54c061495f59c1b4b9">GpgFrontend::KeyPackageOperator::GeneratePassphrase()</a>, <a class="el" href="classGpgFrontend_1_1DataObjectOperator.html#a6b357780482f0e0c021ad55a81eb37cf">GpgFrontend::DataObjectOperator::init_app_secure_key()</a>, and <a class="el" href="classGpgFrontend_1_1GpgFileOpera.html#a350df1c07c054625c4755a78e6ca5ca8">GpgFrontend::GpgFileOpera::SignFile()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/core/function/<a class="el" href="FileOperator_8h_source.html">FileOperator.h</a></li>
<li>src/core/function/FileOperator.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespaceGpgFrontend.html">GpgFrontend</a></li><li class="navelem"><a class="el" href="classGpgFrontend_1_1FileOperator.html">FileOperator</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>