[sword-svn] r2596 - trunk/examples/classes
scribe at crosswire.org
scribe at crosswire.org
Mon Jan 31 19:37:44 MST 2011
Author: scribe
Date: 2011-01-31 19:37:44 -0700 (Mon, 31 Jan 2011)
New Revision: 2596
Modified:
trunk/examples/classes/verseranges.cpp
Log:
Added shorter syntax examples
Modified: trunk/examples/classes/verseranges.cpp
===================================================================
--- trunk/examples/classes/verseranges.cpp 2011-02-01 01:50:25 UTC (rev 2595)
+++ trunk/examples/classes/verseranges.cpp 2011-02-01 02:37:44 UTC (rev 2596)
@@ -68,6 +68,28 @@
cout << vk->getRangeText() << "\n";
+ // Shorter syntax using the parser and based on book names
+ const VerseMgr::System *refSys = VerseMgr::getSystemVerseMgr()->getVersificationSystem(vk->getVersificationSystem());
+
+
+ // whole Bible
+ VerseKey vkBible(refSys->getBook(0)->getOSISName(), refSys->getBook(refSys->getBookCount()-1)->getOSISName(), refSys->getName());
+ cout << vkBible.getRangeText() << "\n";
+
+ // OT
+ VerseKey vkOT(refSys->getBook(0)->getOSISName(), refSys->getBook(refSys->getBMAX()[0]-1)->getOSISName(), refSys->getName());
+ cout << vkOT.getRangeText() << "\n";
+
+ // OT
+ VerseKey vkNT(refSys->getBook(refSys->getBMAX()[0])->getOSISName(), refSys->getBook(refSys->getBookCount()-1)->getOSISName(), refSys->getName());
+ cout << vkNT.getRangeText() << "\n";
+
+ // Current Book
+ vk->setText("John 3:16");
+ VerseKey vkCurrentBook(vk->getBookName(), vk->getBookName(), refSys->getName());
+ cout << vkCurrentBook.getRangeText() << "\n";
+
+
delete vk;
cout << endl;
More information about the sword-cvs
mailing list