[sword-svn] r280 - trunk/modules/nasb/cutil

scribe at crosswire.org scribe at crosswire.org
Fri Jun 4 01:51:42 MST 2010


Author: scribe
Date: 2010-06-04 01:51:42 -0700 (Fri, 04 Jun 2010)
New Revision: 280

Modified:
   trunk/modules/nasb/cutil/nasbosis.cpp
Log:
fixed headings


Modified: trunk/modules/nasb/cutil/nasbosis.cpp
===================================================================
--- trunk/modules/nasb/cutil/nasbosis.cpp	2010-06-03 19:02:27 UTC (rev 279)
+++ trunk/modules/nasb/cutil/nasbosis.cpp	2010-06-04 08:51:42 UTC (rev 280)
@@ -159,6 +159,8 @@
 	string outstring;
 	result = readline(fd, &buffer);
 	string lookahead = buffer;
+	unicodeTicks(lookahead);
+	prepLine(lookahead, currentTestament, false);
 	do {
 		int i, j;
 		result = readline(fd, &buffer);
@@ -169,12 +171,18 @@
 			buffer = new char [ lookahead.length() + 1];
 			strcpy(buffer, lookahead.c_str());
 			lookahead = savebuf;
+			unicodeTicks(lookahead);
+			prepLine(lookahead, currentTestament, false);
 			result = 0;
 		}
 		else if (!result) {
 			string savebuf = buffer;
 			result = readline(fd, &buffer);
 			lookahead = buffer;
+			unicodeTicks(lookahead);
+			prepLine(lookahead, currentTestament, false);
+
+
 			if (buffer)
 				delete [] buffer;
 			buffer = new char [ savebuf.length() + 1];
@@ -185,10 +193,7 @@
 		outstring = buffer;
 
 
-		unicodeTicks(outstring);
-		prepLine(outstring, currentTestament, false);
 
-
 		// BOOK NAMES  <BN>
 		if (!strncmp(outstring.c_str(), "<BN>", 4)) {
 			string book = outstring.c_str()+4;
@@ -249,6 +254,22 @@
 			inChapter = true;
 		}
 		
+		//<SF>
+		if (!strncmp(outstring.c_str(), "<SF>", 4)) {
+			outstring = "";
+			string heading = outstring.c_str()+4;
+			heading = heading.substr(0, heading.find("</SF>"));
+				
+			if (!strncmp(lookahead.c_str(), "<PM>", 4)) {
+				lookahead.erase(0, 4);
+				outstring += "<milestone type=\"line\" subType=\"x-PM\"/>";
+			}
+			if (inVerse) {
+				outstring += "</verse>\n";
+				inVerse = false;
+			}
+			outstring += (string)"<title type=\"acrostic\" canonical=\"true\" subType=\"x-preverse\">" + heading + (string)"</title>";
+		}
 
 		//<SH>
 		if (!strncmp(outstring.c_str(), "<SH>", 4)) {
@@ -264,17 +285,17 @@
 				outstring += "</verse>\n";
 				inVerse = false;
 			}
-			outstring += (string)"<title type=\"sub\" subType=\"x-Section\">" + heading + (string)"</title>";
+			outstring += (string)"<title type=\"section\" subType=\"x-preverse\">" + heading + (string)"</title>";
 		}
 		if (!strncmp(outstring.c_str(), "<SS>", 4)) {
 			string heading = (outstring.c_str()+4);
 			heading = heading.substr(0, heading.find("</SS>"));
-			outstring = (string)"<title type=\"sub\" subType=\"x-SS\">" + heading + (string)"</title>";
+			outstring = (string)"<title type=\"psalm\" canonical=\"true\" subType=\"x-preverse\">" + heading + (string)"</title>";
 		}
 		if (!strncmp(outstring.c_str(), "<SB>", 4)) {
 			string heading = (outstring.c_str()+4);
 			heading = heading.substr(0, heading.find("</SB>"));
-			outstring = (string)"<title type=\"sub\" subType=\"x-SB\">" + heading + (string)"</title>";
+			outstring = (string)"<title type=\"scope\" subType=\"x-preverse\">" + heading + (string)"</title>";
 		}
 
 
@@ -345,29 +366,8 @@
 				}
 			}
 
-			//  <SF>
-			outstr = outstring.c_str();
-			found = strstr(outstr, "<SF>");
-			start = (found) ? (found - outstr) : -1;
 
-			if (start > -1) {
-				outstring.replace(start, 4, (string)"<seg type=\"x-SF\">");
-				continue;
-				
-			}
 
-			//  <SF>
-			outstr = outstring.c_str();
-			found = strstr(outstr, "</SF>");
-			start = (found) ? (found - outstr) : -1;
-
-			if (start > -1) {
-				outstring.replace(start, 5, (string)"</seg>");
-				continue;
-				
-			}
-
-
 			//  <RS>
 			outstr = outstring.c_str();
 			found = strstr(outstr, "<RS>");
@@ -797,8 +797,8 @@
 }
 
 void prepLine(string &outstring, int currentTestament, bool note) {
-		int end = 0;
-		while (1) {
+	int end = 0;
+	while (1) {
 // ------------------------------------------
 // redundant markers
 			size_t s;




More information about the sword-cvs mailing list