mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Added propper error handling
This commit is contained in:
@@ -14,6 +14,23 @@
|
||||
|
||||
class Playfair{
|
||||
private:
|
||||
//Classed to help with error handling
|
||||
class letterNotFound{
|
||||
private:
|
||||
char letter;
|
||||
public:
|
||||
letterNotFound(char letter): letter(letter) {}
|
||||
char getLetter(){ return letter; }
|
||||
};
|
||||
class invalidGrid{
|
||||
private:
|
||||
std::string type;
|
||||
unsigned int size;
|
||||
public:
|
||||
invalidGrid(std::string type, unsigned int size): type(type), size(size) {}
|
||||
std::string getType(){ return type; }
|
||||
int getSize(){ return size; }
|
||||
};
|
||||
static char REPLACED; //The letter that will need to be replaced in the grid and any input string or keyword
|
||||
static char REPLACER; //The letter that replaced REPLACED in any input string or keyword
|
||||
static char DOUBLED; //The letter that will be placed between double letters in the input string if necessary or to make the string length even
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
class Vigenere{
|
||||
protected:
|
||||
class emptyKeyword{}; //A class to help with error handling
|
||||
std::string inputString; //This is the string that you want to encode or decode
|
||||
std::string outputString; //This is the string that is output from encoding or decoding
|
||||
std::string keyword; //This is the keyword that is the resposible for determining the offsets that you change each character by
|
||||
|
||||
Reference in New Issue
Block a user