[sword-svn] r2683 - in trunk/examples: classes cmdline
scribe at crosswire.org
scribe at crosswire.org
Tue Feb 21 02:09:06 MST 2012
Author: scribe
Date: 2012-02-21 02:09:05 -0700 (Tue, 21 Feb 2012)
New Revision: 2683
Modified:
trunk/examples/classes/swmgrex.cpp
trunk/examples/cmdline/listoptions.cpp
trunk/examples/cmdline/outplain.cpp
trunk/examples/cmdline/outrender.cpp
trunk/examples/cmdline/search.cpp
trunk/examples/cmdline/verserangeparse.cpp
Log:
updated headers and comments
Modified: trunk/examples/classes/swmgrex.cpp
===================================================================
--- trunk/examples/classes/swmgrex.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/classes/swmgrex.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -1,8 +1,5 @@
/******************************************************************************
* Class SWMgr manages installed modules for a frontend.
- * SWMgr reads a mods.conf file to discover its information.
- * It then instantiates the correct decendent of SWModule for each
- * module entry in mods.conf
* The developer may use this class to query what modules are installed
* and to retrieve an (SWModule *) for any one of these modules
*
Modified: trunk/examples/cmdline/listoptions.cpp
===================================================================
--- trunk/examples/cmdline/listoptions.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/cmdline/listoptions.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -1,6 +1,8 @@
/******************************************************************************
- * Simple example to show how to see which options are available from the
+ * Simple example to show how to see which 'options' are available from the
* installed set of modules and their possible settings.
+ * Options in SWORD refer to things like "Strong's Numbers", "Morphology", etc.
+ *
*
* $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $
*
Modified: trunk/examples/cmdline/outplain.cpp
===================================================================
--- trunk/examples/cmdline/outplain.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/cmdline/outplain.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -1,11 +1,15 @@
/******************************************************************************
- * This example show how to output the plain text entries from a SWORD module.
- * This is also good for speed tests
+ * This example shows how to output the plain text entries from a SWORD module.
+ * This small program outputs a SWORD module in 'imp' format, e.g.,
*
+ * $$$Gen.1.1
+ * In the beginning God created
+ * the heavens and the earth
+ *
+ * $$$Gen.1.2
+ * ...
+ *
* Class SWMgr manages installed modules for a frontend.
- * SWMgr reads a mods.conf file to discover its information.
- * It then instantiates the correct decendent of SWModule for each
- * module entry in mods.conf
* The developer may use this class to query what modules are installed
* and to retrieve an (SWModule *) for any one of these modules
*
@@ -32,21 +36,6 @@
*
*/
-/******************************************************************************
- * Class SWMgr manages installed modules for a frontend.
- * SWMgr reads a mods.conf file to discover its information.
- * It then instantiates the correct decendent of SWModule for each
- * module entry in mods.conf
- * The developer may use this class to query what modules are installed
- * and to retrieve an (SWModule *) for any one of these modules
- *
- * SWMgr makes its modules available as an STL Map.
- * The Map definition is typedef'ed as ModMap
- * ModMap consists of: FIRST : SWBuf moduleName
- * SECOND: SWModule *module
- *
- */
-
#include <iostream>
#include <swmgr.h>
Modified: trunk/examples/cmdline/outrender.cpp
===================================================================
--- trunk/examples/cmdline/outrender.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/cmdline/outrender.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -1,21 +1,11 @@
/******************************************************************************
* This example show how to choose an output render markup and render
- * entries from a SWORD module.
+ * entries from a SWORD module. The following snippet outputs a module
+ * in HTML output encoded as UTF8.
*
- * Class SWMgr manages installed modules for a frontend.
- * SWMgr reads a mods.conf file to discover its information.
- * It then instantiates the correct decendent of SWModule for each
- * module entry in mods.conf
- * The developer may use this class to query what modules are installed
- * and to retrieve an (SWModule *) for any one of these modules
*
- * SWMgr makes its modules available as an STL Map.
- * The Map definition is typedef'ed as ModMap
- * ModMap consists of: FIRST : SWBuf moduleName
- * SECOND: SWModule *module
+ * $Id: $
*
- * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $
- *
* Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
Modified: trunk/examples/cmdline/search.cpp
===================================================================
--- trunk/examples/cmdline/search.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/cmdline/search.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -1,6 +1,10 @@
/******************************************************************************
* This simple example shows how to perform a search on a SWORD module
+ * It amounts to a simple commandline search tool with a usage like:
*
+ * search KJV "swift hear slow speak"
+ *
+ *
* $Id$
*
* Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org)
@@ -31,13 +35,13 @@
using namespace sword;
#endif
- /*
- * >=0 - regex
- * -1 - phrase
- * -2 - multiword
- * -3 - entryAttrib (eg. Word//Lemma/G1234/)
- * -4 - Lucene
- */
+/*
+ * >=0 - regex
+ * -1 - phrase
+ * -2 - multiword
+ * -3 - entryAttrib (eg. Word//Lemma/G1234/)
+ * -4 - Lucene
+ */
char SEARCH_TYPE=-2;
char printed = 0;
Modified: trunk/examples/cmdline/verserangeparse.cpp
===================================================================
--- trunk/examples/cmdline/verserangeparse.cpp 2012-02-21 08:53:31 UTC (rev 2682)
+++ trunk/examples/cmdline/verserangeparse.cpp 2012-02-21 09:09:05 UTC (rev 2683)
@@ -67,20 +67,21 @@
cout << "*** " << book->getKeyText() << ": " << book->RenderText() << "\n";
}
- // since we've told our result key to persist in book, we can reuse our
+ // Since we've told our result key to persist in book, we can reuse our
// setup by simply resetting result, e.g.
//
// result = parser.ParseVerseList(someNewRange, parser, true);
//
- // now an iteration of book will give us our new range.
+ // Now an iteration of book will give us our new range.
//
- // to stop persistence of our custom key, we'll need to set our book's key
+ // To stop persistence of our custom key, we'll need to set our book's key
// to something simple:
//
// book->setKey("gen.1.1");
//
- // this allows book to create and use an instance of its preferred key type
+ // Resetting our book object's key to something not persistent will revert our book object to using its default key for positioning
//
+ //
return 0;
}
More information about the sword-cvs
mailing list