utilities/emptyvss.cpp File Reference

#include <swmgr.h>
#include <swmodule.h>
#include <versekey.h>
#include <iostream>
#include <stdio.h>
Include dependency graph for emptyvss.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 37 of file emptyvss.cpp.

00037                                 {
00038     if (argc < 2) {
00039         fprintf(stderr, "usage: %s <Mod Name>\n", argv[0]);
00040         exit(-1);
00041     }
00042 
00043     SWMgr mgr;
00044 
00045     ModMap::iterator it = mgr.Modules.find(argv[1]);
00046     if (it == mgr.Modules.end()) {
00047         fprintf(stderr, "error: %s: couldn't find module: %s \n", argv[0], argv[1]);
00048         exit(-2);
00049     }
00050 
00051     SWModule *mod = it->second;
00052 
00053     SWKey *key = (*mod);
00054     VerseKey *vkey = 0;
00055     SWTRY {
00056         vkey = dynamic_cast<VerseKey *>(key);
00057     }
00058     SWCATCH (...) {}
00059 
00060     if (!vkey) {
00061         fprintf(stderr, "error: %s: %s module is not keyed to verses \n", argv[0], argv[1]);
00062         exit(-3);
00063     }
00064 
00065     vkey->setIntros(false); // turn on mod/testmnt/book/chap headings
00066 
00067     (*mod) = TOP;
00068 
00069     while (!mod->popError()) {
00070       
00071       if (vkey->getVerse())
00072         if (!strlen ((const char *)(*mod)))
00073           std::cout << *vkey << std::endl;
00074       (*mod)++;
00075     }
00076 }


Generated on 18 Mar 2013 for The SWORD Project by  doxygen 1.6.1