From: Andrew C. <ac...@us...> - 2002-03-14 07:05:58
|
Update of /cvsroot/planeshift/planeshift/src/common/util In directory usw-pr-cvs1:/tmp/cvs-serv8838/src/common/util Modified Files: psxmlparser.cpp xmlstring.cpp xmlstring.h Log Message: xmlparser fixes Index: psxmlparser.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/psxmlparser.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** psxmlparser.cpp 14 Mar 2002 01:35:46 -0000 1.4 --- psxmlparser.cpp 14 Mar 2002 07:05:53 -0000 1.5 *************** *** 122,128 **** { xmlString param(parm); - int start = FindSubString(param, 0, true); ! while ( start != -1 ) { --- 122,128 ---- { xmlString param(parm); int start = FindSubString(param, 0, true); ! xmlString tempStr; ! while ( start != -1 ) { *************** *** 152,156 **** end++; ! GetSubString(value, start+(chr!=' '), end); } } --- 152,163 ---- end++; ! GetSubString(tempStr, start+(chr!=' '), end); ! ! // Replace any xml code with the correct '&' ! csString what = "&"; ! csString with = "&"; ! tempStr.ReplaceSubString(what,with); ! ! value = tempStr; } } Index: xmlstring.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/xmlstring.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlstring.cpp 14 Mar 2002 01:35:46 -0000 1.2 --- xmlstring.cpp 14 Mar 2002 07:05:54 -0000 1.3 *************** *** 91,105 **** } void xmlString::RemoveSubString(size_t from, size_t to) { if (from >= Size || from>to) return; ! size_t len = to-from; ! size_t x; ! for (x=to; x<=Size; x++) ! Data[x-len] = Data[x]; ! Data[x] = '\0'; ! Size -= len; } --- 91,119 ---- } + void xmlString::RemoveSubString(size_t from, size_t to) { if (from >= Size || from>to) return; + DeleteAt(from, to-from); + } ! ! //--------------------------------------------------------------------------- ! bool xmlString::ReplaceSubString(csString& what, csString& with) ! { ! int where; ! ! if ( (where = FindSubString(what)) > -1 ) ! { ! size_t pos = where; ! DeleteAt(where, what.Length()); ! Insert(pos, with); ! return true; ! } ! else ! return false; } + + Index: xmlstring.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/xmlstring.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlstring.h 14 Mar 2002 01:35:46 -0000 1.2 --- xmlstring.h 14 Mar 2002 07:05:55 -0000 1.3 *************** *** 39,42 **** --- 39,43 ---- void RemoveSubString(size_t from, size_t to); + bool ReplaceSubString(csString& what, csString& with); }; |