Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
Encryption.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CipherChunk.hpp"
4 #include <Core/Core.hpp>
6 
7 #include <sstream> // std::ostringstream
8 
10 
14 struct Encryption {
15  static constexpr const std::string_view TABLE_NAME = "Encryptions";
16 
17  std::int64_t ide{};
19  std::string title{};
20  std::string date_time{};
21  std::int64_t size{};
22  bool is_file{};
23  std::string file_ext{};
25  ~Encryption() noexcept = default;
26 
27  public:
28  constexpr bool operator==(const Encryption& e) const noexcept { return ide == e.ide; }
29  friend std::ostream& operator<<(std::ostream& os, const Encryption& e) noexcept {
30  return os
31  << "Encryptions(ide: " << e.ide << ','
32  << "algo: " << int(e.algo) << ','
33  << "title: " << e.title << ','
34  << "date_time: " << e.date_time << ','
35  << "is_file: " << std::boolalpha << e.is_file << ','
36  << "file_ext:" << e.file_ext << ')';
37  }
38  std::string toString() noexcept {
39  std::ostringstream oss{};
40  oss << *this;
41  return oss.str();
42  }
43 };
44 
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
std::string date_time
Definition: Encryption.hpp:20
bool is_file
Definition: Encryption.hpp:22
friend std::ostream & operator<<(std::ostream &os, const Encryption &e) noexcept
Definition: Encryption.hpp:29
std::string toString() noexcept
Definition: Encryption.hpp:38
std::int64_t size
Definition: Encryption.hpp:21
~Encryption() noexcept=default
static constexpr const std::string_view TABLE_NAME
Definition: Encryption.hpp:15
std::int64_t ide
Definition: Encryption.hpp:17
std::string file_ext
Definition: Encryption.hpp:23
std::string title
Definition: Encryption.hpp:19
Algorithm::Type algo
Definition: Encryption.hpp:18