mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Adjusted to change testmain to regular funct to maintain single main()
This commit is contained in:
25
main.cpp
25
main.cpp
@@ -22,7 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///The header files
|
//The header files
|
||||||
#include "Headers/Caesar.hpp"
|
#include "Headers/Caesar.hpp"
|
||||||
#include "Headers/Playfair.hpp"
|
#include "Headers/Playfair.hpp"
|
||||||
#include "Headers/Vigenere.hpp"
|
#include "Headers/Vigenere.hpp"
|
||||||
@@ -31,26 +31,26 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
//If this is the test version include the appropriate functions from the file
|
||||||
///Test definitions
|
|
||||||
//#define TEST_VERSION
|
|
||||||
|
|
||||||
|
|
||||||
//Main functions
|
|
||||||
#ifdef TEST_VERSION
|
#ifdef TEST_VERSION
|
||||||
#include "testMain.hpp" //This inserts the main function with all of the test functions
|
#include "testHandler.hpp" //This inserts the main function with all of the test functions
|
||||||
#else //TEST_VERSION main function
|
#else
|
||||||
|
//We need these files for normal opperations
|
||||||
#include "helperFunctions.hpp"
|
#include "helperFunctions.hpp"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#endif //TEST_VERSION
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv){
|
int main(int argc, char** argv){
|
||||||
|
//If this is the test version of the program run the test function
|
||||||
|
#ifdef TEST_VERSION
|
||||||
|
testHandler(argc, argv);
|
||||||
|
//Otherwise handle the program normally
|
||||||
|
#else //TEST_VERSION
|
||||||
bool cipherFlags[SIZE];
|
bool cipherFlags[SIZE];
|
||||||
std::string inputFileName, outputFileName, cipherString;
|
std::string inputFileName, outputFileName, cipherString;
|
||||||
std::ifstream inputFile;
|
std::ifstream inputFile;
|
||||||
std::ofstream outputFile;
|
std::ofstream outputFile;
|
||||||
setFlagStrings();
|
|
||||||
|
|
||||||
//Make sure the flags are all false by default
|
//Make sure the flags are all false by default
|
||||||
for(int cnt = 0;cnt < SIZE;++cnt){
|
for(int cnt = 0;cnt < SIZE;++cnt){
|
||||||
@@ -101,7 +101,6 @@ int main(int argc, char** argv){
|
|||||||
|
|
||||||
inputFile.close();
|
inputFile.close();
|
||||||
outputFile.close();
|
outputFile.close();
|
||||||
|
#endif //TEST_VERSION
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //TEST_VERSION
|
|
||||||
|
|||||||
Reference in New Issue
Block a user