~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to tests/mgrtest.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <swmgr.h>
 
2
#include <iostream>
 
3
#include <versekey.h>
 
4
#ifndef NO_SWORD_NAMESPACE
 
5
using namespace sword;
 
6
#endif
 
7
 
 
8
int main(int argc, char **argv) {
 
9
        SWMgr::debug = true;
 
10
        SWMgr mymgr;
 
11
        char keypress[2];
 
12
        std::cerr << "\n\nprefixPath: " << mymgr.prefixPath;
 
13
        std::cerr << "\nconfigPath: " << mymgr.configPath << "\n\n";
 
14
 
 
15
 
 
16
        ModMap::iterator it;
 
17
 
 
18
        for (it = mymgr.Modules.begin(); it != mymgr.Modules.end(); it++) {
 
19
                std::cout << "[" << (*it).second->Name() << "] (Writable: " << (it->second->isWritable()?"Yes":"No") << ") [" << (*it).second->Description() << "]\n";
 
20
                std::cout << "AbsoluteDataPath = " << it->second->getConfigEntry("AbsoluteDataPath") << "\n";
 
21
                std::cout << "Has Feature HebrewDef = " << it->second->getConfig().has("Feature", "HebrewDef") << "\n";
 
22
                if ((!strcmp((*it).second->Type(), "Biblical Texts")) || (!strcmp((*it).second->Type(), "Commentaries"))) {
 
23
                        it->second->setKey("James 1:19");
 
24
                        std::cout << (const char *) *(*it).second << "\n\n";
 
25
                }
 
26
        }
 
27
        SWModule *mhc = mymgr.Modules["MHC"];
 
28
        if (mhc) {
 
29
                for (mhc->Key("Gen 1:1"); mhc->Key() < (VerseKey) "Gen 1:10"; (*mhc)++)
 
30
                        std::cout << (const char *) *mhc << "\n";
 
31
        }
 
32
        return 0;
 
33
}