summaryrefslogtreecommitdiff
path: root/examples/cmdline/lookup.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /examples/cmdline/lookup.cpp
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'examples/cmdline/lookup.cpp')
-rw-r--r--examples/cmdline/lookup.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp
index 5fecafb..505b5e1 100644
--- a/examples/cmdline/lookup.cpp
+++ b/examples/cmdline/lookup.cpp
@@ -1,9 +1,11 @@
/******************************************************************************
- * Simple example of how to retrieve an entry from a SWORD module
*
- * $Id: lookup.cpp 2546 2010-09-08 14:14:37Z scribe $
+ * lookup.cpp - Simple example of how to retrieve an entry from a
+ * SWORD module
*
- * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org)
+ * $Id: lookup.cpp 2980 2013-09-14 21:51:47Z scribe $
+ *
+ * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -24,9 +26,11 @@
#include <stdlib.h>
#include <swmgr.h>
#include <swmodule.h>
+#include <swfilter.h>
#include <markupfiltmgr.h>
#include <versekey.h>
+
using sword::SWMgr;
using sword::MarkupFilterMgr;
using sword::SWModule;
@@ -38,6 +42,8 @@ using sword::AttributeTypeList;
using sword::AttributeList;
using sword::AttributeValue;
using sword::VerseKey;
+using sword::FilterList;
+
int main(int argc, char **argv)
{
@@ -57,8 +63,8 @@ int main(int argc, char **argv)
if (!target) {
fprintf(stderr, "Could not find module [%s]. Available modules:\n", argv[1]);
ModMap::iterator it;
- for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) {
- fprintf(stderr, "[%s]\t - %s\n", (*it).second->Name(), (*it).second->Description());
+ for (it = manager.Modules.begin(); it != manager.Modules.end(); ++it) {
+ fprintf(stderr, "[%s]\t - %s\n", (*it).second->getName(), (*it).second->getDescription());
}
exit(-1);
}
@@ -73,36 +79,40 @@ int main(int argc, char **argv)
if (vk) {
// vk->AutoNormalize(false);
- vk->Headings(true);
+ vk->setIntros(true);
vk->setText(argv[2]);
}
else {
target->setKey(argv[2]);
}
- target->RenderText(); // force an entry lookup to resolve key to something in the index
+ target->renderText(); // force an entry lookup to resolve key to something in the index
std::cout << "==Raw=Entry===============\n";
std::cout << target->getKeyText() << ":\n";
std::cout << target->getRawEntry();
std::cout << "\n";
std::cout << "==Render=Entry============\n";
- std::cout << target->RenderText();
+ std::cout << target->getRenderHeader();
+ std::cout << "\n";
+ std::cout << target->renderText();
std::cout << "\n";
std::cout << "==========================\n";
std::cout << "Entry Attributes:\n\n";
AttributeTypeList::iterator i1;
AttributeList::iterator i2;
AttributeValue::iterator i3;
- for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); i1++) {
+ for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); ++i1) {
std::cout << "[ " << i1->first << " ]\n";
- for (i2 = i1->second.begin(); i2 != i1->second.end(); i2++) {
+ for (i2 = i1->second.begin(); i2 != i1->second.end(); ++i2) {
std::cout << "\t[ " << i2->first << " ]\n";
- for (i3 = i2->second.begin(); i3 != i2->second.end(); i3++) {
+ for (i3 = i2->second.begin(); i3 != i2->second.end(); ++i3) {
std::cout << "\t\t" << i3->first << " = " << i3->second << "\n";
}
}
}
std::cout << std::endl;
+
return 0;
}
+