[sword-svn] r2203 - trunk/utilities
scribe at www.crosswire.org
scribe at www.crosswire.org
Wed Sep 17 10:31:38 MST 2008
Author: scribe
Date: 2008-09-17 10:31:38 -0700 (Wed, 17 Sep 2008)
New Revision: 2203
Added:
trunk/utilities/vs2osisreftxt.cpp
Log:
oops, forgot to add the new utility file
Added: trunk/utilities/vs2osisreftxt.cpp
===================================================================
--- trunk/utilities/vs2osisreftxt.cpp (rev 0)
+++ trunk/utilities/vs2osisreftxt.cpp 2008-09-17 17:31:38 UTC (rev 2203)
@@ -0,0 +1,32 @@
+#include <iostream>
+
+#include <versekey.h>
+#include <localemgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+
+int main(int argc, char **argv) {
+ if ((argc < 2) || (argc > 4)) {
+ fprintf(stderr, "usage: %s <\"string to parse\"> [locale_name] [test-in-set-verse]\n", *argv);
+ exit(-1);
+ }
+
+ if (argc > 2)
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(argv[2]);
+
+ VerseKey DefaultVSKey;
+
+ DefaultVSKey = "jas3:1";
+
+ ListKey verses = DefaultVSKey.ParseVerseList(argv[1], DefaultVSKey, true);
+
+ std::cout << verses.getOSISRefRangeText() << "\n";
+
+ if (argc > 3) {
+ verses.setText(argv[3]);
+ std::cout << "Verse is" << ((verses.Error()) ? " NOT" : "") << " in set.\n\n";
+ }
+
+ return 0;
+}
More information about the sword-cvs
mailing list