The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 42 of file emptyvss.cpp.

42  {
43  if (argc < 2) {
44  fprintf(stderr, "usage: %s <Mod Name>\n", argv[0]);
45  exit(-1);
46  }
47 
48  SWMgr mgr;
49 
50  ModMap::iterator it = mgr.Modules.find(argv[1]);
51  if (it == mgr.Modules.end()) {
52  fprintf(stderr, "error: %s: couldn't find module: %s \n", argv[0], argv[1]);
53  exit(-2);
54  }
55 
56  SWModule *mod = it->second;
57 
58  SWKey *key = (*mod);
59  VerseKey *vkey = 0;
60  SWTRY {
61  vkey = dynamic_cast<VerseKey *>(key);
62  }
63  SWCATCH (...) {}
64 
65  if (!vkey) {
66  fprintf(stderr, "error: %s: %s module is not keyed to verses \n", argv[0], argv[1]);
67  exit(-3);
68  }
69 
70  vkey->setIntros(false); // turn on mod/testmnt/book/chap headings
71 
72  (*mod) = TOP;
73 
74  while (!mod->popError()) {
75 
76  if (vkey->getVerse()) {
77  if (!mod->renderText().length()) {
78  std::cout << *vkey << std::endl;
79  }
80  (*mod)++;
81  }
82  }
83 }
#define TOP
Definition: swkey.h:68
Definition: swmgr.h:93
unsigned long length() const
Definition: swbuf.h:197
ModMap Modules
Definition: swmgr.h:322
#define SWTRY
Definition: defs.h:57
SWBuf renderText(const char *buf, int len=-1, bool render=true) const
Definition: swmodule.cpp:1038
virtual void setIntros(bool val)
Definition: versekey.cpp:1663
#define SWCATCH(x)
Definition: defs.h:58
virtual int getVerse() const
Definition: versekey.cpp:1534
virtual char popError()
Definition: swmodule.cpp:185
Definition: swkey.h:77
SWMgr * mgr
Definition: installmgr.cpp:46