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 
92 auto GPGFRONTEND_CORE_EXPORT WriteBufferToFile(const QString &path,
93  const QString &out_buffer)
94  -> bool;
95 
101 auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
102 
109 auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
110  -> QString;
111 
118 auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
119  -> QString;
120 
128 auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
129  -> std::tuple<bool, QString>;
130 
137 auto GPGFRONTEND_CORE_EXPORT GetFullExtension(QString path) -> QString;
138 
139 } // 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 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