[sword-cvs] sword/utilities vs2osisref.cpp,1.2,1.3

sword@www.crosswire.org sword@www.crosswire.org
Fri, 9 May 2003 11:28:02 -0700


Update of /usr/local/cvsroot/sword/utilities
In directory www:/tmp/cvs-serv1952

Modified Files:
	vs2osisref.cpp 
Log Message:
added verse context parameter

Index: vs2osisref.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/utilities/vs2osisref.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vs2osisref.cpp	21 Dec 2002 23:30:16 -0000	1.2
--- vs2osisref.cpp	9 May 2003 18:28:00 -0000	1.3
***************
*** 1,4 ****
! // Compression on variable granularity
! 
#include <fcntl.h>
  #include <iostream>
  #include <fstream>
--- 1,4 ----
! // Compression on variable granularity
! #include <fcntl.h>
  #include <iostream>
  #include <fstream>
***************
*** 42,46 ****
  		VerseKey *element = SWDYNAMIC_CAST(VerseKey, verses.GetElement(i));
  		char buf[5120];
! 		char frag[5120];
  		if (element) {
  			memmove(frag, startFrag, ((const char *)element->userData - startFrag) + 1);
--- 42,46 ----
  		VerseKey *element = SWDYNAMIC_CAST(VerseKey, verses.GetElement(i));
  		char buf[5120];
! 		char frag[800];
  		if (element) {
  			memmove(frag, startFrag, ((const char *)element->userData - startFrag) + 1);
***************
*** 64,80 ****
          if (argc < 2) {
          	cerr << argv[0] << " - a tool to convert verse references from English to OSIS\n";
! 	        cerr << "usage: "<< argv[0] << " <verse ref>\n";
          	cerr << "\n\n";
  	        exit(-1);
          }
          VerseKey verseKey;
!         char * verseString = new char[1024];
          *verseString = 0;
!         for (int i = 1; i < argc; i++) {
!                 strcat (verseString, argv[i]);
!                 strcat (verseString, " ");
          }
!         *(verseString + strlen(verseString) - 1) = 0;
!         std::cout << convertToOSIS(verseString, &verseKey) << endl;
  
  	return 0;
--- 64,86 ----
          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 << "\n\n";
  	        exit(-1);
          }
          VerseKey verseKey;
!         int i = strlen(argv[1]) + 1;
!         char * verseString = new char[i];
          *verseString = 0;
!         strcpy (verseString, argv[1]);
!         verseString[i + 1] = 0;
!         
!         if (argc > 2) {
!                 verseKey = argv[2];
          }
!         else {
!                 verseKey = "Gen 1:1";
!         }
! 
!         std::cout << convertToOSIS(verseString, &verseKey);
  
  	return 0;