diff options
author | Saturneric <[email protected]> | 2022-02-13 08:40:11 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-02-13 08:40:11 +0000 |
commit | 3c889bd876460b37daddb98b2816e85495ed4426 (patch) | |
tree | 24e539a14a84cfc10fa39f0aa79a56286ff64632 /src/core/function/FileOperator.h | |
parent | <fix>(ci): Minor bug in modifying OS labels in ci files (diff) | |
download | GpgFrontend-3c889bd876460b37daddb98b2816e85495ed4426.tar.gz GpgFrontend-3c889bd876460b37daddb98b2816e85495ed4426.zip |
<feat, refactor>(ui, core): Transfer file hash calculation logic to core
1. show file size
Diffstat (limited to 'src/core/function/FileOperator.h')
-rw-r--r-- | src/core/function/FileOperator.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/function/FileOperator.h b/src/core/function/FileOperator.h index de195a96..aa2c3b73 100644 --- a/src/core/function/FileOperator.h +++ b/src/core/function/FileOperator.h @@ -38,7 +38,7 @@ namespace GpgFrontend { * */ class FileOperator { -public: + public: /** * @brief read file content using std struct * @@ -79,7 +79,14 @@ public: * @return false if failed */ static bool WriteFile(const QString &file_name, const QByteArray &data); + + /** + * calculate the hash of a file + * @param file_path + * @return + */ + static std::string CalculateHash(const std::filesystem::path &file_path); }; -} // namespace GpgFrontend +} // namespace GpgFrontend -#endif // GPGFRONTEND_FILEOPERATOR_H +#endif // GPGFRONTEND_FILEOPERATOR_H |