GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
IOUtils.h
1 
29 #pragma once
30 
31 #include "core/model/GFBuffer.h"
32 
33 namespace GpgFrontend {
34 
41 auto GPGFRONTEND_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
42  -> std::tuple<bool, GFBuffer>;
43 
52 auto GPGFRONTEND_CORE_EXPORT WriteFileGFBuffer(const QString &file_name,
53  GFBuffer data) -> bool;
54 
63 auto GPGFRONTEND_CORE_EXPORT ReadFile(const QString &file_name,
64  QByteArray &data) -> bool;
65 
74 auto GPGFRONTEND_CORE_EXPORT WriteFile(const QString &file_name,
75  const QByteArray &data) -> bool;
76 
82 auto GPGFRONTEND_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
83 
90 auto GPGFRONTEND_CORE_EXPORT CalculateBinaryChacksum(const QString &path)
91  -> QString;
92 
101 auto GPGFRONTEND_CORE_EXPORT WriteBufferToFile(const QString &path,
102  const QString &out_buffer)
103  -> bool;
104 
110 auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
111 
118 auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
119  -> QString;
120 
127 auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
128  -> QString;
129 
137 auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
138  -> std::tuple<bool, QString>;
139 
146 auto GPGFRONTEND_CORE_EXPORT GetFullExtension(QString path) -> QString;
147 
148 } // namespace GpgFrontend
Definition: GFBuffer.h:36
Definition: app.cpp:39
auto ReadFile(const QString &file_name, QByteArray &data) -> bool
read file content
Definition: IOUtils.cpp:49
auto ReadFileGFBuffer(const QString &file_name) -> std::tuple< bool, GFBuffer >
Definition: IOUtils.cpp:71
auto GetTempFilePath() -> QString
Definition: IOUtils.cpp:132
auto WriteFileGFBuffer(const QString &file_name, GFBuffer data) -> bool
Definition: IOUtils.cpp:78
auto GPGFRONTEND_CORE_EXPORT WriteBufferToFile(const QString &path, const QString &out_buffer) -> bool
auto TargetFilePreCheck(const QString &path, bool read) -> std::tuple< bool, QString >
Definition: IOUtils.cpp:150
auto CalculateBinaryChacksum(const QString &path) -> QString
Definition: IOUtils.cpp:183
auto CreateTempFileAndWriteData(const QString &data) -> QString
Definition: IOUtils.cpp:138
auto WriteFile(const QString &file_name, const QByteArray &data) -> bool
write file content
Definition: IOUtils.cpp:60
auto CalculateHash(const QString &file_path) -> QString
Definition: IOUtils.cpp:82