mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Moved getCipher() to remove occasional compile error
This commit is contained in:
@@ -102,27 +102,6 @@ void setFlagStrings(){
|
||||
flagStrings[OUTPUT_FILE] = "-o";
|
||||
}
|
||||
|
||||
//Returns the correct function for the flags that are set
|
||||
Fn getCipher(const bool cipherFlags[]){
|
||||
if(cipherFlags[CAESAR]){
|
||||
return runCaesar;
|
||||
}
|
||||
else if(cipherFlags[PLAYFAIR]){
|
||||
return runPlayfair;
|
||||
}
|
||||
else if(cipherFlags[VIGENERE]){
|
||||
return runVigenere;
|
||||
}
|
||||
else if(cipherFlags[ATBASH]){
|
||||
return runAtbash;
|
||||
}
|
||||
//If it didn't trip one of the flags, there was an error before this
|
||||
else{
|
||||
std::cout << "There was an error selecting the appropriate function";
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
std::string runCaesar(std::ifstream& infile, bool encode){
|
||||
std::string inputString, cipherString;
|
||||
int offset;
|
||||
@@ -246,4 +225,25 @@ std::string runAtbash(std::ifstream& infile, bool encode){
|
||||
return cipherString;
|
||||
}
|
||||
|
||||
//Returns the correct function for the flags that are set
|
||||
Fn getCipher(const bool cipherFlags[]){
|
||||
if(cipherFlags[CAESAR]){
|
||||
return runCaesar;
|
||||
}
|
||||
else if(cipherFlags[PLAYFAIR]){
|
||||
return runPlayfair;
|
||||
}
|
||||
else if(cipherFlags[VIGENERE]){
|
||||
return runVigenere;
|
||||
}
|
||||
else if(cipherFlags[ATBASH]){
|
||||
return runAtbash;
|
||||
}
|
||||
//If it didn't trip one of the flags, there was an error before this
|
||||
else{
|
||||
std::cout << "There was an error selecting the appropriate function";
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif //HELPER_FUNCTIONS_HPP
|
||||
Reference in New Issue
Block a user