diff --git a/respak2.cpp b/respak2.cpp new file mode 100644 index 0000000..9e97f62 --- /dev/null +++ b/respak2.cpp @@ -0,0 +1,88 @@ +#include +#include +#include +#include + +using namespace std; +namespace fs = std::filesystem; + +void printHelp() +{ + cout << "Usage: respak2 " << endl; + cout << endl << "Valid commands:" << endl; + cout << "-p: Pack all files and folders within the 'data' folder into a file named 'data.jf2'." << endl; + cout << "-u: Unpack all files inside the file 'data.jf2' into the 'data' folder." << endl; + cout << "-l: List the contents of the 'data.jf2' file." << endl; + exit(1); +} + +void printErrorAndExit(string errorMsg) { + cout << errorMsg << endl; + exit(1); +} + +void printDirectory(string path, int tabs=0) +{ + for (const auto & entry : fs::directory_iterator(path)) + { + for(int i=0;i