diff options
Diffstat (limited to 'utilities/mod2zmod.cpp')
-rw-r--r-- | utilities/mod2zmod.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/utilities/mod2zmod.cpp b/utilities/mod2zmod.cpp index 7d64b54..de7a3e3 100644 --- a/utilities/mod2zmod.cpp +++ b/utilities/mod2zmod.cpp @@ -19,11 +19,12 @@ #include <zipcomprs.h> #include <versekey.h> #include <stdio.h> +#include <cipherfil.h> void errorOutHelp(char *appName) { cerr << appName << " - a tool to create compressed Sword modules\n"; cerr << "version 0.1\n\n"; - cerr << "usage: "<< appName << " <modname> <datapath> [blockType [compressType]]\n\n"; + cerr << "usage: "<< appName << " <modname> <datapath> [blockType [compressType [cipherKey]]]\n\n"; cerr << "datapath: the directory in which to write the zModule\n"; cerr << "blockType : (default 4)\n\t2 - verses\n\t3 - chapters\n\t4 - books\n"; cerr << "compressType: (default 1):\n\t1 - LZSS\n\t2 - Zip\n"; @@ -36,12 +37,13 @@ int main(int argc, char **argv) { int iType = 4; int compType = 1; + string cipherKey = ""; SWCompress *compressor = 0; SWModule *inModule = 0; SWModule *outModule = 0; - if ((argc < 3) || (argc > 5)) { + if ((argc < 3) || (argc > 6)) { errorOutHelp(argv[0]); } @@ -49,6 +51,9 @@ int main(int argc, char **argv) iType = atoi(argv[3]); if (argc > 4) { compType = atoi(argv[4]); + if (argc > 5) { + cipherKey = argv[5]; + } } } @@ -115,6 +120,11 @@ int main(int argc, char **argv) break; } + if (!cipherKey.empty()) { + SWFilter *cipherFilter = new CipherFilter(cipherKey.c_str()); + outModule->AddRawFilter(cipherFilter); + } + string lastBuffer = "Something that would never be first module entry"; SWKey bufferKey; SWKey lastBufferKey; @@ -153,7 +163,7 @@ int main(int argc, char **argv) } (*inModule)++; } - delete outModuleKey; delete outModule; + delete outModuleKey; } |