[sword-cvs] sword/utilities osis2mod.cpp,1.1,1.2

sword@www.crosswire.org sword@www.crosswire.org
Tue, 27 May 2003 18:53:02 -0700


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

Modified Files:
	osis2mod.cpp 
Log Message:


Index: osis2mod.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/utilities/osis2mod.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** osis2mod.cpp	26 May 2003 18:57:28 -0000	1.1
--- osis2mod.cpp	28 May 2003 01:53:00 -0000	1.2
***************
*** 27,30 ****
--- 27,33 ----
  using namespace std;
  
+ RawText *module;
+ VerseKey currentVerse;
+ 
  char readline(int fd, char **buf) {
  	char ch;
***************
*** 91,99 ****
  	cout << "Verse: " << key << "\n";
  	cout << "TEXT: " << text << "\n\n";
  }
  
  
  bool handleToken(SWBuf &text, XMLTag token) {
- 	static VerseKey currentVerse;
  	static bool inHeader = false;
  	static SWBuf headerType = "";
--- 94,105 ----
  	cout << "Verse: " << key << "\n";
  	cout << "TEXT: " << text << "\n\n";
+ 	SWBuf currentText = module->getRawEntry();
+ 	if (currentText.length())
+ 		text = currentText + " " + text;
+ 	module->setEntry(text);
  }
  
  
  bool handleToken(SWBuf &text, XMLTag token) {
  	static bool inHeader = false;
  	static SWBuf headerType = "";
***************
*** 102,108 ****
  	static int titleOffset = -1;
  
- 	currentVerse.Headings(0);
- 	currentVerse.AutoNormalize(0);
- 
  	if ((!strcmp(token.getName(), "title")) && (!token.isEndTag())) {
  		titleOffset = text.length();
--- 108,111 ----
***************
*** 185,189 ****
  
  
! 	if ((argc>3)&&(strcmp(argv[3], "1"))) {	// != 1 then create module
  	// Try to initialize a default set of datafiles and indicies at our
  	// datapath location passed to us from the user.
--- 188,192 ----
  
  
! 	if ((argc<4)||(strcmp(argv[3], "0"))) {	// != 1 then create module
  	// Try to initialize a default set of datafiles and indicies at our
  	// datapath location passed to us from the user.
***************
*** 192,196 ****
  			exit(-3);
  		}
- 		exit(0);
  	}
  
--- 195,198 ----
***************
*** 204,216 ****
  	// Do some initialization stuff
  	char *buffer = 0;
! 	RawText mod(argv[1]);	// open our datapath with our RawText driver.
! 	VerseKey vk;
! 	vk.AutoNormalize(0);
! 	vk.Headings(1);	// turn on mod/testmnt/book/chap headings
! 	vk.Persist(1);
  
! 	mod.setKey(vk);
  
! 	mod = TOP;
  	  
  	int successive = 0;  //part of hack below
--- 206,217 ----
  	// Do some initialization stuff
  	char *buffer = 0;
! 	module = new RawText(argv[1]);	// open our datapath with our RawText driver.
! 	currentVerse.AutoNormalize(0);
! 	currentVerse.Headings(1);	// turn on mod/testmnt/book/chap headings
! 	currentVerse.Persist(1);
  
! 	module->setKey(currentVerse);
  
! 	(*module) = TOP;
  	  
  	int successive = 0;  //part of hack below