summaryrefslogtreecommitdiff
path: root/utilities/vs2osisref.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:54:01 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:54:01 -0400
commit71a39f4652cd51df814c930dd268f3c9ad2aee86 (patch)
tree5994350a603908c4e4d660bc9d72c4ec43dd648e /utilities/vs2osisref.cpp
parent03134fa5f6f25d92724ce4c183f9bbe12a9e37dc (diff)
Imported Upstream version 1.6.0+dfsg
Diffstat (limited to 'utilities/vs2osisref.cpp')
-rw-r--r--utilities/vs2osisref.cpp63
1 files changed, 28 insertions, 35 deletions
diff --git a/utilities/vs2osisref.cpp b/utilities/vs2osisref.cpp
index 220e743..bdff592 100644
--- a/utilities/vs2osisref.cpp
+++ b/utilities/vs2osisref.cpp
@@ -1,25 +1,23 @@
-// Compression on variable granularity
-#include <fcntl.h>
-#include <iostream>
-#include <fstream>
-
-#ifndef __GNUC__
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
+/*
+ * Copyright 2009 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 <ztext.h>
-#include <zld.h>
-#include <zcom.h>
-#include <swmgr.h>
-#include <lzsscomprs.h>
-#include <zipcomprs.h>
+#include <iostream>
#include <versekey.h>
-#include <thmlosis.h>
-#include <stdio.h>
-#include <markupfiltmgr.h>
-#include <algorithm>
+#include <localemgr.h>
#ifndef NO_SWORD_NAMESPACE
using namespace sword;
@@ -32,25 +30,20 @@ using std::cout;
int main(int argc, char **argv)
{
if (argc < 2) {
- cerr << argv[0] << " - a tool to convert verse references from English to OSIS\n";
- cerr << "usage: "<< argv[0] << " <verse ref> [verse context]\n";
+ cerr << argv[0] << " - parse verse reference to OSISRef markup\n";
+ cerr << "usage: "<< argv[0] << " <verse ref> [verse context] [locale]\n";
cerr << "\n\n";
exit(-1);
}
- VerseKey verseKey;
- int i = strlen(argv[1]) + 1;
- char * verseString = new char[i];
- strcpy (verseString, argv[1]);
- verseString[i - 1] = 0;
-
- if (argc > 2) {
- verseKey = argv[2];
- }
- else {
- verseKey = "Gen 1:1";
- }
- std::cout << VerseKey::convertToOSIS(verseString, &verseKey) << "\n";
+
+ if (argc > 3) {
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(argv[3]);
+ }
+
+ VerseKey verseKey = (argc > 2) ? argv[2] : "Gen 1:1";
+
+ std::cout << VerseKey::convertToOSIS(argv[1], &verseKey) << "\n";
return 0;
}