GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GFBuffer.h
1 
29 #pragma once
30 
31 #include "core/GpgFrontendCoreExport.h"
32 #include "core/utils/MemoryUtils.h"
33 
34 namespace GpgFrontend {
35 
36 class GPGFRONTEND_CORE_EXPORT GFBuffer {
37  public:
38  GFBuffer();
39 
40  explicit GFBuffer(QByteArray buffer);
41 
42  explicit GFBuffer(const QString& str);
43 
44  auto operator==(const GFBuffer& o) const -> bool;
45 
46  [[nodiscard]] auto Data() const -> const char*;
47 
48  void Resize(ssize_t size);
49 
50  [[nodiscard]] auto Size() const -> size_t;
51 
52  [[nodiscard]] auto Empty() const -> bool;
53 
54  void Append(const GFBuffer&);
55 
56  void Append(const char*, ssize_t);
57 
58  [[nodiscard]] auto ConvertToQByteArray() const -> QByteArray;
59 
60  private:
61  QByteArray buffer_;
62 };
63 
64 } // namespace GpgFrontend
Definition: GFBuffer.h:36
Definition: app.cpp:39