[sword-cvs] sword/src/modules/filters osisplain.cpp,1.1,1.2 osisrtf.cpp,1.1,1.2

sword@www.crosswire.org sword@www.crosswire.org
Wed, 26 Feb 2003 12:32:32 -0700


Update of /usr/local/cvsroot/sword/src/modules/filters
In directory www:/tmp/cvs-serv14688

Modified Files:
	osisplain.cpp osisrtf.cpp 
Log Message:
changed to swbuf. please review.


Index: osisplain.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisplain.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** osisplain.cpp	16 Feb 2003 06:54:52 -0000	1.1
--- osisplain.cpp	26 Feb 2003 19:32:30 -0000	1.2
***************
*** 40,44 ****
  }
  
! bool OSISPlain::handleToken(char **buf, const char *token, DualStringMap &userData) {
    // manually process if it wasn't a simple substitution
    if (!substituteToken(buf, token)) {
--- 40,44 ----
  }
  
! bool OSISPlain::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
    // manually process if it wasn't a simple substitution
    if (!substituteToken(buf, token)) {
***************
*** 53,57 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " <%s>", tagData.c_str());
        }
        pos1 = userData["w"].find("gloss=\"", 0);
--- 53,57 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	buf.appendFormatted(" <%s>", tagData.c_str() );
        }
        pos1 = userData["w"].find("gloss=\"", 0);
***************
*** 60,64 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " <%s>", tagData.c_str());
        }
        pos1 = userData["w"].find("lemma=\"", 0);
--- 60,64 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	buf.appendFormatted(" <%s>", tagData.c_str() );
        }
        pos1 = userData["w"].find("lemma=\"", 0);
***************
*** 67,71 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " <%s>", tagData.c_str());
        }
        pos1 = userData["w"].find("morph=\"", 0);
--- 67,71 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	buf.appendFormatted(" <%s>", tagData.c_str() );
        }
        pos1 = userData["w"].find("morph=\"", 0);
***************
*** 74,78 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " <%s>", tagData.c_str());
        }
        pos1 = userData["w"].find("POS=\"", 0);
--- 74,78 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	buf.appendFormatted(" <%s>", tagData.c_str() );
        }
        pos1 = userData["w"].find("POS=\"", 0);
***************
*** 81,85 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " <%s>", tagData.c_str());
        }      
      }
--- 81,85 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	buf.appendFormatted(" <%s>", tagData.c_str() );
        }      
      }
***************
*** 87,109 ****
      //p
      else if (!strncmp(token, "p", 1)) {
!       pushString(buf, "\n\n");
      }
  
      //line
      else if (!strncmp(token, "line", 4)) {
!       pushString(buf, "\n");
      }
  
      //note
      else if (!strncmp(token, "note", 4)) {
!       pushString(buf, " (");
      }
      else if (!strncmp(token, "/note", 5)) {
!       pushString(buf, ")");
      }
      
      //title
      else if (!strncmp(token, "/title", 6)) {
!       pushString(buf, "\n");
      }
  
--- 87,109 ----
      //p
      else if (!strncmp(token, "p", 1)) {
!       buf += "\n\n";
      }
  
      //line
      else if (!strncmp(token, "line", 4)) {
!       buf += "\n";
      }
  
      //note
      else if (!strncmp(token, "note", 4)) {
!       buf += " (";
      }
      else if (!strncmp(token, "/note", 5)) {
!       buf += ")";
      }
      
      //title
      else if (!strncmp(token, "/title", 6)) {
!       buf += "\n";
      }
  

Index: osisrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisrtf.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** osisrtf.cpp	16 Feb 2003 06:54:52 -0000	1.1
--- osisrtf.cpp	26 Feb 2003 19:32:30 -0000	1.2
***************
*** 40,49 ****
  }
  
! bool OSISRTF::handleToken(char **buf, const char *token, DualStringMap &userData) {
    // manually process if it wasn't a simple substitution
    if (!substituteToken(buf, token)) {
      //w
      if (!strncmp(token, "w", 1)) {
!       pushString(buf, "{");
        userData["w"] == token;
      }
--- 40,49 ----
  }
  
! bool OSISRTF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
    // manually process if it wasn't a simple substitution
    if (!substituteToken(buf, token)) {
      //w
      if (!strncmp(token, "w", 1)) {
!       buf += "{";
        userData["w"] == token;
      }
***************
*** 55,59 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " {\\fs15 <%s>}", tagData.c_str());
        }
        pos1 = userData["w"].find("gloss=\"", 0);
--- 55,59 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
!   buf.appendFormatted(" {\\fs15 <%s>}", tagData.c_str() );
        }
        pos1 = userData["w"].find("gloss=\"", 0);
***************
*** 62,66 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " {\\fs15 <%s>}", tagData.c_str());
        }
        pos1 = userData["w"].find("lemma=\"", 0);
--- 62,66 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
!   buf.appendFormatted(" {\\fs15 <%s>}", tagData.c_str() );
        }
        pos1 = userData["w"].find("lemma=\"", 0);
***************
*** 69,73 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " {\\fs15 <%s>}", tagData.c_str());
        }
        pos1 = userData["w"].find("morph=\"", 0);
--- 69,73 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
!   buf.appendFormatted(" {\\fs15 <%s>}", tagData.c_str() );
        }
        pos1 = userData["w"].find("morph=\"", 0);
***************
*** 76,80 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " {\\fs15 <%s>}", tagData.c_str());
        }
        pos1 = userData["w"].find("POS=\"", 0);
--- 76,80 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
!   buf.appendFormatted(" {\\fs15 <%s>}", tagData.c_str() );
        }
        pos1 = userData["w"].find("POS=\"", 0);
***************
*** 83,130 ****
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
! 	pushString(buf, " {\\fs15 <%s>}", tagData.c_str());
        }
        
!       pushString(buf, "}");
      }
      
      //p
      else if (!strncmp(token, "p", 1)) {
!       pushString(buf, "{\\par\\par ");
      }
      else if (!strncmp(token, "/p", 2)) {
!       pushString(buf, "}");
      }
      
      //reference
      else if (!strncmp(token, "reference", 8)) {
!       pushString(buf, "{<a href=\"\">");
      }
      else if (!strncmp(token, "/reference", 9)) {
!       pushString(buf, "</a>}");
      }
      
      //line
      else if (!strncmp(token, "line", 4)) {
!       pushString(buf, "{\\par ");
      }
      else if (!strncmp(token, "/line", 5)) {
!       pushString(buf, "}");
      }
  
      //note
      else if (!strncmp(token, "note", 4)) {
!       pushString(buf, " {\\i1\\fs15 (");
      }
      else if (!strncmp(token, "/note", 5)) {
!       pushString(buf, " ) }");
      }
      
      //title
      else if (!strncmp(token, "title", 5)) {
!       pushString(buf, "{\\i1\\b1 ");
      }
      else if (!strncmp(token, "/title", 6)) {
!       pushString(buf, "\\par}");
      }
  
--- 83,130 ----
  	pos2 = userData["w"].find("\"", pos1) - 1;
  	tagData = userData["w"].substr(pos1, pos2-pos1);
!   buf.appendFormatted(" {\\fs15 <%s>}", tagData.c_str() );
        }
        
!       buf += "}";
      }
      
      //p
      else if (!strncmp(token, "p", 1)) {
!       buf += "{\\par\\par ";
      }
      else if (!strncmp(token, "/p", 2)) {
!       buf += "}";
      }
      
      //reference
      else if (!strncmp(token, "reference", 8)) {
!       buf += "{<a href=\"\">";
      }
      else if (!strncmp(token, "/reference", 9)) {
!       buf += "</a>}";
      }
      
      //line
      else if (!strncmp(token, "line", 4)) {
!       buf += "{\\par ";
      }
      else if (!strncmp(token, "/line", 5)) {
!       buf += "}";
      }
  
      //note
      else if (!strncmp(token, "note", 4)) {
!       buf += " {\\i1\\fs15 (";
      }
      else if (!strncmp(token, "/note", 5)) {
!       buf += " ) }";
      }
      
      //title
      else if (!strncmp(token, "title", 5)) {
!       buf += "{\\i1\\b1 ";
      }
      else if (!strncmp(token, "/title", 6)) {
!       buf += "\\par}";
      }
  
***************
*** 134,150 ****
        pos1 = tagData.find("type=\"b", 0);
        if (pos1 != string::npos) {
! 	pushString(buf, "{\\b1 ");
        }
        else {
! 	pushString(buf, "{\\i1 ");
        }
      }
      else if (!strncmp(token, "/hi", 3)) {
!       pushString(buf, "}");
      }
  
      //q
      else if (!strncmp(token, "q", 1)) {
!       pushString(buf, "{");
        tagData=token;
        pos1 = tagData.find("who=\"", 0);
--- 134,150 ----
        pos1 = tagData.find("type=\"b", 0);
        if (pos1 != string::npos) {
! 	buf += "{\\b1 ";
        }
        else {
! 	buf += "{\\i1 ";
        }
      }
      else if (!strncmp(token, "/hi", 3)) {
!       buf += "}";
      }
  
      //q
      else if (!strncmp(token, "q", 1)) {
!       buf += "{";
        tagData=token;
        pos1 = tagData.find("who=\"", 0);
***************
*** 152,169 ****
  	pos2 = tagData.find("\"", pos1);
  	if (tagData.substr(pos1, pos2).find("Jesus", 0) != string::npos) {
! 	  pushString(buf, "\\cf6 ");
  	}
        }
      }
      else if (!strncmp(token, "/q", 2)) {
!       pushString(buf, "}");
      }
  
      //transChange
      else if (!strncmp(token, "transChange", 11)) {
!       pushString(buf, "{\\i1 ");
      }
      else if (!strncmp(token, "/transChange", 12)) {
!       pushString(buf, "}");
      }
  
--- 152,169 ----
  	pos2 = tagData.find("\"", pos1);
  	if (tagData.substr(pos1, pos2).find("Jesus", 0) != string::npos) {
! 	  buf += "\\cf6 ";
  	}
        }
      }
      else if (!strncmp(token, "/q", 2)) {
!       buf += "}";
      }
  
      //transChange
      else if (!strncmp(token, "transChange", 11)) {
!       buf += "{\\i1 ";
      }
      else if (!strncmp(token, "/transChange", 12)) {
!       buf += "}";
      }