The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vs2osisref.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * vs2osisref.cpp - Utility to translate a verse reference to an osisRef
4  *
5  * $Id: vs2osisref.cpp 3063 2014-03-04 13:04:11Z chrislit $
6  *
7  * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
8  * CrossWire Bible Society
9  * P. O. Box 2528
10  * Tempe, AZ 85280-2528
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License as published by the
14  * Free Software Foundation version 2.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  */
22 
23 #ifdef _MSC_VER
24  #pragma warning( disable: 4251 )
25 #endif
26 
27 #include <iostream>
28 #include <versekey.h>
29 #include <localemgr.h>
30 
31 #ifndef NO_SWORD_NAMESPACE
32 using namespace sword;
33 #endif
34 
35 using std::endl;
36 using std::cerr;
37 using std::cout;
38 
39 
40 int main(int argc, char **argv)
41 {
42  if (argc < 2) {
43  cerr << argv[0] << " - parse verse reference to OSISRef markup\n";
44  cerr << "usage: "<< argv[0] << " <verse ref> [verse context] [locale]\n";
45  cerr << "\n\n";
46  exit(-1);
47  }
48 
49 
50  if (argc > 3) {
52  }
53 
54  VerseKey verseKey = (argc > 2) ? argv[2] : "Gen 1:1";
55 
56  std::cout << VerseKey::convertToOSIS(argv[1], &verseKey) << "\n";
57 
58  return 0;
59 }
60 
virtual void setDefaultLocaleName(const char *name)
Definition: localemgr.cpp:251
int main(int argc, char **argv)
Definition: addcomment.cpp:32
static const char * convertToOSIS(const char *inRef, const SWKey *defaultKey)
Definition: versekey.cpp:1887
static LocaleMgr * getSystemLocaleMgr()
Definition: localemgr.cpp:54