Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
CipherChunk.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <Core/Core.hpp>
3 
5 
11 struct CipherChunk {
12  static constexpr const std::string_view TABLE_NAME = "CipherChunks";
13 
14  std::int64_t idc{};
15  std::int64_t ide{};
16  std::int64_t offset{};
17  std::int64_t size{};
18  std::vector<::Enigma::byte> bytes{};
20  ~CipherChunk() = default;
21 
22  public:
23  constexpr bool operator==(const CipherChunk& c) const noexcept { return idc == c.idc; }
24  friend std::ostream& operator<<(std::ostream& os, const CipherChunk& c) noexcept {
25  return os
26  << "CipherChunk(idc: " << c.idc << ','
27  << "ide: " << c.ide << ','
28  << "offset: " << c.offset << ','
29  << "size: " << c.size << ','
30  << "data: " << std::string(c.bytes.begin(), c.bytes.end()) << ')';
31  }
32  std::string toString() const noexcept {
33  std::ostringstream oss{};
34  oss << *this;
35  return oss.str();
36  }
37 };
38 
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
std::int64_t offset
Definition: CipherChunk.hpp:16
static constexpr const std::string_view TABLE_NAME
Definition: CipherChunk.hpp:12
std::int64_t size
Definition: CipherChunk.hpp:17
std::int64_t ide
Definition: CipherChunk.hpp:15
std::vector<::Enigma::byte > bytes
Definition: CipherChunk.hpp:18
friend std::ostream & operator<<(std::ostream &os, const CipherChunk &c) noexcept
Definition: CipherChunk.hpp:24
~CipherChunk()=default
std::int64_t idc
Definition: CipherChunk.hpp:14
std::string toString() const noexcept
Definition: CipherChunk.hpp:32
constexpr bool operator==(const CipherChunk &c) const noexcept
Definition: CipherChunk.hpp:23