diff options
Diffstat (limited to 'utilities/addvs.cpp')
-rw-r--r-- | utilities/addvs.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/utilities/addvs.cpp b/utilities/addvs.cpp index b8c8cc2..b736c00 100644 --- a/utilities/addvs.cpp +++ b/utilities/addvs.cpp @@ -12,8 +12,16 @@ #include <swmgr.h> #include <rawtext.h> -#include <iostream.h> +#include <iostream> +#ifndef NO_SWORD_NAMESPACE +using sword::SWMgr; +using sword::RawText; +using sword::SWKey; +using sword::VerseKey; +using sword::ListKey; +using sword::SWModule; +#endif #ifndef O_BINARY #define O_BINARY 0 @@ -39,7 +47,7 @@ int main(int argc, char **argv) { vkey->Persist(1); // the magical setting *vkey = argv[3]; // Set our VerseKey - mod->SetKey(*vkey); + mod->setKey(*vkey); if (!vkey->Chapter()) { // bad hack >> // 0:0 is Book intro @@ -61,7 +69,7 @@ int main(int argc, char **argv) { entrysize = fread(buffer, sizeof(char), sizeof(buffer), infile); - mod->setentry(buffer, entrysize); // save text to module at current position + mod->setEntry(buffer, entrysize); // save text to module at current position } else { ListKey listkey = vkey->ParseVerseList(argv[3], "Gen1:1", true); @@ -73,7 +81,7 @@ int main(int argc, char **argv) { if (element) { mod->Key(element->LowerBound()); VerseKey finalkey = element->UpperBound(); - cout << (const char*)mod->Key() << "-" << (const char*)finalkey << endl; + std::cout << (const char*)mod->Key() << "-" << (const char*)finalkey << std::endl; if (!havefirst) { havefirst = true; firstverse = mod->Key(); @@ -86,12 +94,12 @@ int main(int argc, char **argv) { entrysize = fread(buffer, sizeof(char), sizeof(buffer), infile); - ((SWModule*)mod)->setentry(buffer, entrysize); // save text to module at current position - cout << "f" << (const char*)firstverse << endl; + mod->setEntry(buffer, entrysize); // save text to module at current position + std::cout << "f" << (const char*)firstverse << std::endl; (*mod)++; } while (mod->Key() <= finalkey) { - cout << (const char*)mod->Key() << endl; + std::cout << (const char*)mod->Key() << std::endl; *(SWModule*)mod << &firstverse; (*mod)++; } @@ -100,7 +108,7 @@ int main(int argc, char **argv) { if (havefirst) { mod->Key(*listkey.GetElement(i)); *(SWModule*)mod << &firstverse; - cout << (const char*)mod->Key() << endl; + std::cout << (const char*)mod->Key() << std::endl; } else { mod->Key(*listkey.GetElement(i)); @@ -115,8 +123,8 @@ int main(int argc, char **argv) { entrysize = fread(buffer, sizeof(char), sizeof(buffer), infile); - ((SWModule*)mod)->setentry(buffer, entrysize); // save text to module at current position - cout << "f" << (const char*)firstverse << endl; + mod->setEntry(buffer, entrysize); // save text to module at current position + std::cout << "f" << (const char*)firstverse << std::endl; } } } @@ -128,7 +136,7 @@ int main(int argc, char **argv) { // Do some initialization stuff RawText *mod = new RawText(argv[2]); // open our datapath with our RawText driver. - mod->SetKey(argv[4]); // set key from argument + mod->setKey(argv[4]); // set key from argument SWKey tmpkey = (SWKey) argv[3]; *(SWModule*)mod << &(tmpkey); delete mod; @@ -142,7 +150,7 @@ int main(int argc, char **argv) { vkey->Persist(1); // the magical setting // Set our VerseKey - mod.SetKey(*vkey); + mod.setKey(*vkey); *vkey = argv[3]; if (!vkey->Chapter()) |