[sword-svn] r2685 - trunk/examples/classes
scribe at crosswire.org
scribe at crosswire.org
Tue Feb 28 09:18:40 MST 2012
Author: scribe
Date: 2012-02-28 09:18:40 -0700 (Tue, 28 Feb 2012)
New Revision: 2685
Added:
trunk/examples/classes/verseposition.cpp
Log:
added example to show positioning a verse
Added: trunk/examples/classes/verseposition.cpp
===================================================================
--- trunk/examples/classes/verseposition.cpp (rev 0)
+++ trunk/examples/classes/verseposition.cpp 2012-02-28 16:18:40 UTC (rev 2685)
@@ -0,0 +1,39 @@
+
+#include <iostream>
+
+#include <swmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+
+using namespace sword;
+using namespace std;
+
+int main(int argc, char **argv) {
+
+ const char *modName = "HunKar";
+
+ SWMgr library;
+
+ SWModule *book = library.getModule("HunKar");
+
+ if (!book) {
+ cerr << "Can't find module: " << modName << endl;
+ return -1;
+ }
+
+ VerseKey *key = (VerseKey *)book->CreateKey();
+
+ key->setPosition(TOP);
+
+ cout << *key << endl;
+
+ key->Headings(true);
+
+ key->setPosition(TOP);
+
+ cout << *key << endl;
+
+ delete key;
+
+ return 0;
+}
More information about the sword-cvs
mailing list