Added version information for all classes

This commit is contained in:
2018-05-16 10:33:17 -04:00
parent 5cc3b935c1
commit d54b34f4c2
12 changed files with 124 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Atbash.hpp
//Matthew Ellison
// Created: 4-30-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Atbash class
//This class is used to encode and decode an Atbash cipher
@@ -15,6 +15,7 @@ class Atbash{
private:
std::string inputString; //Holds the string that needs encoded or decoded
std::string outputString; //Holds the encoded/decoded string
static const std::string version; //Holds the current version of the library
std::string decode(); //Decodes inputString and stores in outputString
std::string encode(); //Encodes inputString and stores in outputString
void setInputString(std::string input); //Removes all invalid characters and sets inputString
@@ -26,6 +27,7 @@ public:
std::string encode(std::string input);
std::string decode(std::string input);
void reset();
static std::string getVersion();
};
#endif //ATBASH_HPP

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Autokey.hpp
//Matthew Ellison
// Created: 5-2-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Autokey class
//This class will encode a message using the Autokey cipher
@@ -22,6 +22,7 @@ public:
~Autokey();
virtual std::string encode(std::string key, std::string input); //Encodes inputString using the Autokey cipher
virtual std::string decode(std::string key, std::string input); //Decodes inputString using the Autokey cipher
static std::string getVersion();
};

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Caesar.hpp
//Matthew Ellison
// Created: 4-25-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Caesar class
//This class implements the Caesar Cipher and is inteded to be turned into a library
@@ -15,6 +15,7 @@ class Caesar{
private:
std::string inputString; //The string that needs encoded/decoded
std::string outputString; //The encoded/decoded string
static const std::string version; //The current version number for the library
int shift; //The amount that you need to shift each letter
void setShift(int shiftAmount); //Sets shift and makes sure it is within the propper bounds
void setInputString(std::string inputString); //Sets the input string
@@ -29,6 +30,7 @@ public:
std::string encode(int shiftAmount, std::string input); //Sets the shift and inputString and encodes the message
std::string decode(int shiftAmount, std::string input); //Sets the shift and inputString and decodes the message
void reset(); //Makes sure all of the variables are empty
static std::string getVersion();
};

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Morse.hpp
//Matthew Ellison
// Created: 5-1-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Morse class
//This class is designed to translate Morse Code into regular letters and numbers
@@ -15,11 +15,10 @@
class Morse{
private:
//Holds the Morse representation of the alphanumeric characters
const std::string code[36] {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", //A-L
"--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--..", //M-Z
"-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----."}; //0-9
static const std::string code[];
std::stringstream inputString; //The string that needs encoded/decoded
std::string outputString; //The encoded/decoded message
static const std::string version; //The current library's version number
std::string encode(); //Encodes inputString and stores the result in outputString
std::string decode(); //Decodes inputString and stores the result in outputString
void setEncodeInputString(std::string input); //Encodes input and returns the result
@@ -32,6 +31,7 @@ public:
std::string encode(std::string input); //Encodes input and returns the result
std::string decode(std::string input); //Decodes input and returns the result
void reset(); //Makes sure all variables are empty
static std::string getVersion();
};
#endif //MORSE_HPP

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Playfair.hpp
//Matthew Ellison
// Created: 4-25-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Playfair class
//It is designed to encrypt and decrypt strings using the Playfair cipher
@@ -20,6 +20,7 @@ private:
std::string inputString; //The message that needs to be encoded/decoded
std::string outputString; //The encoded/decoded message
std::string keyword; //The keyword used to create the grid
static const std::string version; //The current library's version number
char grid[5][5]; //The grid used to encode/decode the message
void createGrid(); //Create the grid from the keyword
bool checkGrid(const char letter) const; //Returns true if the letter is found in the grid
@@ -45,6 +46,7 @@ public:
static void setReplaced(const char replaced); //Sets the character that needs replaced in messages and the grid
static void setReplacer(const char replacer); //Sets the character that replaces the character that needs replaced
static void setDoubled(const char doubled); //Sets the character that is added betwee 2 adjacent characters that are the same
static std::string getVersion();
};
#endif //PLAYFAIR_HPP

View File

@@ -1,7 +1,7 @@
//Ciphers/SourceFiles/Vigenere.hpp
//Matthew Ellison
// Created: 4-29-18
//Modified: 5-5-18
//Modified: 5-16-18
//This file contains the declaration of the Vigenere class
#ifndef VIGENERE_HPP
@@ -17,6 +17,7 @@ protected:
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
static const std::string version; //The current library's version number
std::vector<unsigned int> offset; //This holds the offsets computed from each character in the keyword
void setOffset(); //Uses keyword to calculate the offset for the Caesar cipher for each character
void setInputString(std::string input); //Sets inputString
@@ -33,6 +34,7 @@ public:
std::string encode(std::string key, std::string input); //Encodes input using key and returns the result
std::string decode(std::string key, std::string input); //Decodes input using key and returns the result
void reset(); //Makes sure all of the variables are empty
static std::string getVersion();
};
#endif //VIGENERE_HPP