[sword-svn] r3030 - trunk/examples/classes

scribe at crosswire.org scribe at crosswire.org
Thu Feb 27 19:14:45 MST 2014


Author: scribe
Date: 2014-02-27 19:14:44 -0700 (Thu, 27 Feb 2014)
New Revision: 3030

Added:
   trunk/examples/classes/simplechapter.cpp
Removed:
   trunk/examples/classes/showchapter.cpp
Modified:
   trunk/examples/classes/Makefile
Log:
renamed showchapter to simplechapter in anticipation of adding a full chapter display example.
added recognition of 2 simple commandline parameters <modname> <key>


Modified: trunk/examples/classes/Makefile
===================================================================
--- trunk/examples/classes/Makefile	2014-02-25 13:00:49 UTC (rev 3029)
+++ trunk/examples/classes/Makefile	2014-02-28 02:14:44 UTC (rev 3030)
@@ -1,4 +1,4 @@
-TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition showchapter
+TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup
 all: $(TARGETS)
 
 clean:
@@ -6,5 +6,7 @@
 
 .cpp:
 	g++ -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
+.c:
+	gcc -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword` -lstdc++
 
 

Deleted: trunk/examples/classes/showchapter.cpp
===================================================================
--- trunk/examples/classes/showchapter.cpp	2014-02-25 13:00:49 UTC (rev 3029)
+++ trunk/examples/classes/showchapter.cpp	2014-02-28 02:14:44 UTC (rev 3030)
@@ -1,57 +0,0 @@
-/******************************************************************************
- *
- *  showchapter.cpp -	
- *
- * $Id$
- *
- * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
- *	CrossWire Bible Society
- *	P. O. Box 2528
- *	Tempe, AZ  85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- */
-
-#include <swmgr.h>
-#include <swmodule.h>
-#include <versekey.h>
-#include <iostream>
-
-
-using namespace sword;
-using namespace std;
-
-
-int main(int argc, char **argv) {
-
-	SWMgr library;
-	SWModule *kjv = library.getModule("KJV");
-
-	kjv->setKey(argc > 1 ? argv[1] : "Jn.3.16");
-
-	VerseKey *key = (VerseKey *)kjv->getKey();
-
-	int curVerse = key->getVerse();
-	int curChapter = key->getChapter();
-	int curBook = key->getBook();
-
-	for (key->setVerse(1);
-				(key->getBook()    == curBook)    &&
-				(key->getChapter() == curChapter) &&
-				!kjv->popError();
-				(*kjv)++) {
-		if (key->getVerse() == curVerse) cout << "* ";
-		cout << key->getVerse() << " " << kjv->stripText() << "\n";
-	}
-
-	return 0;
-}
-

Copied: trunk/examples/classes/simplechapter.cpp (from rev 3028, trunk/examples/classes/showchapter.cpp)
===================================================================
--- trunk/examples/classes/simplechapter.cpp	                        (rev 0)
+++ trunk/examples/classes/simplechapter.cpp	2014-02-28 02:14:44 UTC (rev 3030)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ *  showchapter.cpp -	
+ *
+ * $Id$
+ *
+ * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
+ *	CrossWire Bible Society
+ *	P. O. Box 2528
+ *	Tempe, AZ  85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <swmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+#include <iostream>
+
+
+using namespace sword;
+using namespace std;
+
+
+int main(int argc, char **argv) {
+
+	SWMgr library;
+	SWModule *kjv = library.getModule((argc > 1)?argv[1]:"KJV");
+
+	kjv->setKey(argc > 2 ? argv[2] : "Jn.3.16");
+
+	VerseKey *key = (VerseKey *)kjv->getKey();
+
+	int curVerse = key->getVerse();
+	int curChapter = key->getChapter();
+	int curBook = key->getBook();
+
+	for (key->setVerse(1);
+				(key->getBook()    == curBook)    &&
+				(key->getChapter() == curChapter) &&
+				!kjv->popError();
+				(*kjv)++) {
+		if (key->getVerse() == curVerse) cout << "* ";
+		cout << key->getVerse() << " " << kjv->stripText() << "\n";
+	}
+
+	return 0;
+}
+




More information about the sword-cvs mailing list