summaryrefslogtreecommitdiff
path: root/utilities/mod2zmod.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/mod2zmod.cpp')
-rw-r--r--utilities/mod2zmod.cpp49
1 files changed, 31 insertions, 18 deletions
diff --git a/utilities/mod2zmod.cpp b/utilities/mod2zmod.cpp
index 4e91ea3..2e5be31 100644
--- a/utilities/mod2zmod.cpp
+++ b/utilities/mod2zmod.cpp
@@ -1,5 +1,22 @@
// Compression on variable granularity
+/*
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
#include <fcntl.h>
#include <iostream>
#include <fstream>
@@ -14,6 +31,7 @@
#include <ztext.h>
#include <zld.h>
#include <zcom.h>
+#include <swtext.h>
#include <swmgr.h>
#include <lzsscomprs.h>
#include <zipcomprs.h>
@@ -23,20 +41,7 @@
#ifndef NO_SWORD_NAMESPACE
-using sword::SWCompress;
-using sword::CipherFilter;
-using sword::SWModule;
-using sword::SWMgr;
-using sword::ModMap;
-using sword::zText;
-using sword::zLD;
-using sword::zCom;
-using sword::SWFilter;
-using sword::VerseKey;
-using sword::SWKey;
-using sword::SW_POSITION;
-using sword::ZipCompress;
-using sword::LZSSCompress;
+using namespace sword;
#endif
using std::cerr;
@@ -113,9 +118,12 @@ int main(int argc, char **argv)
int result = 0;
switch (modType) {
case BIBLE:
- case COM:
- result = zText::createModule(argv[2], iType);
+ case COM: {
+ SWKey *k = inModule->getKey();
+ VerseKey *vk = SWDYNAMIC_CAST(VerseKey, k);
+ result = zText::createModule(argv[2], iType, vk->getVersificationSystem());
break;
+ }
case LEX:
result = zLD::createModule(argv[2]);
break;
@@ -128,10 +136,15 @@ int main(int argc, char **argv)
switch (modType) {
case BIBLE:
- case COM:
- outModule = new zText(argv[2], 0, 0, iType, compressor); // open our datapath with our RawText driver.
+ case COM: {
+ SWKey *k = inModule->getKey();
+ VerseKey *vk = SWDYNAMIC_CAST(VerseKey, k);
+ outModule = new zText(argv[2], 0, 0, iType, compressor,
+ 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0,
+ vk->getVersificationSystem()); // open our datapath with our RawText driver.
((VerseKey *)(SWKey *)(*inModule))->Headings(1);
break;
+ }
case LEX:
outModule = new zLD(argv[2], 0, 0, iType, compressor); // open our datapath with our RawText driver.
break;