diff options
| author | Chanin Timbal <[email protected]> | 2024-06-01 11:49:52 -0700 |
|---|---|---|
| committer | Chanin Timbal <[email protected]> | 2024-06-01 11:49:52 -0700 |
| commit | ee299e40737932350f6b4b48a7380e2645089d45 (patch) | |
| tree | c33e828baa1951790771f05b051e912452302a5b /CST 126/Homework 2/Homework2/program.cpp | |
| parent | Merge branch 'develop' of https://github.com/OIT-WI-2024/homework-1-chaninnoh... (diff) | |
| download | homework-1-chaninnohea-ee299e40737932350f6b4b48a7380e2645089d45.tar.xz homework-1-chaninnohea-ee299e40737932350f6b4b48a7380e2645089d45.zip | |
attempting rebuild
Diffstat (limited to 'CST 126/Homework 2/Homework2/program.cpp')
| -rw-r--r-- | CST 126/Homework 2/Homework2/program.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/CST 126/Homework 2/Homework2/program.cpp b/CST 126/Homework 2/Homework2/program.cpp deleted file mode 100644 index 158a2be..0000000 --- a/CST 126/Homework 2/Homework2/program.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//Chanin Timbal -//Homework 2 -//27 April 2024 - -#include <iostream> - -#include "helpers.hpp" -#include "Base64Converter.hpp" - -constexpr short ARG_COUNT = 4; - -bool Worker(); -bool Worker(char** argv); - - - -int main(const int argc, char* argv[]) -{ - if (argc == ARG_COUNT) - { - //run the command line version - Worker(argv); - } - return Worker(); -} - -bool Worker() -{ -} - -bool Worker(char** argv) -{ - const char* arg1 = argv[1]; //-e -d - const char* arg2 = argv[2]; //source file name - const char* arg3 = argv[3]; //destination file name - - const char option = arg1[1]; //e or d - - switch (option) - { - case 'e': - //file reading binary - char* buffer = new char[1]; - - buffer = ReadFileAsBinary(arg2, buffer); - //endcoding work - - bool success = WriteTextToFile(arg3, buffer); - - delete[] buffer; - - return success; - case 'd': - //file reading text - //decoding work - //file writing binary - return true; - default: - std::cerr << "Invalid command option\n" << - "Valid commands:\n" << - "\t-e source_file.exe destination_file.exe" << - "\t\tEncodes file in source into text in destination txt file." << - "\t-d source_file.txt destination file.exe" << - "\t\tDecodes text in source file into the destination file.\n\n"; - return false; - } - - - return false; -}
\ No newline at end of file |