More streamlined handling of io bases

This commit is contained in:
Leonetienne
2022-05-31 17:44:30 +02:00
parent fd75678ea3
commit 0ab87de23c
6 changed files with 59 additions and 64 deletions

View File

@@ -25,7 +25,9 @@ class Configuration {
BASE_64,
BASE_UWU,
BASE_UGH
} iobaseFormat;
}
formatIn,
formatOut;
static std::string inputFilename;
static std::string outputFilename;
@@ -44,9 +46,13 @@ class Configuration {
private:
static void DecideInputFrom();
static void DecideOutputTo();
static void DecideIOBaseFormat();
static void DecideCiphertextFormat();
static void MapCiphertextFormatToIOBases();
static void DecideModule();
// This is just an intermediary value, used between methods
static IOBASE_FORMAT ciphertextFormat;
// No instanciation! >:(
Configuration() {};
};

View File

@@ -38,9 +38,6 @@ namespace IO {
private:
static std::istream* in;
// The format to read data in
static Configuration::IOBASE_FORMAT inFormat;
// 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!

View File

@@ -34,9 +34,6 @@ namespace IO {
private:
static std::ostream* out;
// The format to write data in
static Configuration::IOBASE_FORMAT outFormat;
// 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!