Sophisticated and bug-fixed DataOutput/InputLayer, and added ModuleDecryption

This commit is contained in:
Leonetienne
2022-05-31 21:40:13 +02:00
parent d9fb90a01e
commit a93b3b3fe5
9 changed files with 214 additions and 39 deletions

View File

@@ -38,6 +38,11 @@ namespace IO {
private:
static std::istream* in;
// Will read n bytes from the input.
// If EOF is reached, it will return a string of length <= 5
// and will set the approriate flags.
static std::string ReadBytes(const std::size_t n, std::size_t& out_bytes_read);
// We have to hold on to a reference to a filestream,
// even if we're always just reading from in.
// We still have to CLOSE the file handle afterwards!
@@ -49,6 +54,9 @@ namespace IO {
// Indicates whether this class has been initialized
static bool initialized;
// Are we reading ciphertext or regular text?
static bool isReadingCiphertext;
// All read blocks, that haven't been given out yet
static std::queue<Block> blocks;

View File

@@ -32,6 +32,10 @@ namespace IO {
static bool IsFinished();
private:
//! If we are finished, and are outputting to stdout,
//! and the user didn't specifically opt out, print a newline
static void AddTrailingLinebreakIfRequired();
static std::ostream* out;
// We have to hold on to a reference to a filestream,

View File

@@ -0,0 +1,18 @@
#ifndef GCRYPTCLI_MODULE_DECRYPTION_H
#define GCRYPTCLI_MODULE_DECRYPTION_H
namespace Module {
//! This module will decrypt supplied input
class Decryption {
public:
//! Will run the module
static void Run();
private:
// No instanciation! >:(
Decryption() {};
};
}
#endif