diff options
Diffstat (limited to 'examples/cmdline/lookup.cpp')
-rw-r--r-- | examples/cmdline/lookup.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp index 505b5e1..2ff80c8 100644 --- a/examples/cmdline/lookup.cpp +++ b/examples/cmdline/lookup.cpp @@ -3,7 +3,7 @@ * lookup.cpp - Simple example of how to retrieve an entry from a * SWORD module * - * $Id: lookup.cpp 2980 2013-09-14 21:51:47Z scribe $ + * $Id: lookup.cpp 3187 2014-04-17 04:34:03Z greg.hellings $ * * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -102,12 +102,19 @@ int main(int argc, char **argv) AttributeTypeList::iterator i1; AttributeList::iterator i2; AttributeValue::iterator i3; + bool heading = false; + bool preverse = false; for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); ++i1) { std::cout << "[ " << i1->first << " ]\n"; + heading = (i1->first == "Heading"); for (i2 = i1->second.begin(); i2 != i1->second.end(); ++i2) { std::cout << "\t[ " << i2->first << " ]\n"; + preverse = (heading && i2->first == "Preverse"); for (i3 = i2->second.begin(); i3 != i2->second.end(); ++i3) { std::cout << "\t\t" << i3->first << " = " << i3->second << "\n"; + if (preverse) { + std::cout << "\t\tmodule->renderText(heading[" << i3->first << "]) = " << target->renderText(i3->second) << "\n"; + } } } } |