Updated member availability and comments

This commit is contained in:
2018-05-05 16:12:54 -04:00
parent 42382f56c0
commit 227aee31b2

View File

@@ -1,7 +1,7 @@
//Ciphers/Headers/Morse.hpp //Ciphers/Headers/Morse.hpp
//Matthew Ellison //Matthew Ellison
// Created: 5-1-18 // Created: 5-1-18
//Modified: 5-1-18 //Modified: 5-5-18
//This file contains the declaration of the Morse class //This file contains the declaration of the Morse class
//This class is designed to translate Morse Code into regular letters and numbers //This class is designed to translate Morse Code into regular letters and numbers
@@ -14,21 +14,24 @@
class Morse{ class Morse{
private: private:
static std::string code[]; //Holds the Morse representation of the alphanumeric characters
std::stringstream inputString; const std::string Morse::code[36] {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", //A-L
std::string outputString; "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--..", //M-Z
std::string encode(); "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----."}; //0-9
std::string decode(); std::stringstream inputString; //The string that needs encoded/decoded
std::string outputString; //The encoded/decoded message
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
void setDecodeInputString(std::string input); //Decodes input and returns the result
public: public:
Morse(); Morse();
~Morse(); ~Morse();
void setEncodeInputString(std::string input); std::string getInputString() const; //Returns inputString
void setDecodeInputString(std::string input); std::string getOutputString() const; //Returns outputString
std::string getInputString() const; std::string encode(std::string input); //Encodes input and returns the result
std::string getOutputString() const; std::string decode(std::string input); //Decodes input and returns the result
std::string encode(std::string input); void reset(); //Makes sure all variables are empty
std::string decode(std::string input);
void reset();
}; };
#endif //MORSE_HPP #endif //MORSE_HPP