Sophisticated and bug-fixed DataOutput/InputLayer, and added ModuleDecryption
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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,
|
||||
|
18
GCryptCLI/include/ModuleDecryption.h
Normal file
18
GCryptCLI/include/ModuleDecryption.h
Normal 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
|
||||
|
Reference in New Issue
Block a user