[sword-cvs] sword/src/modules/filters swbasicfilter.cpp,1.23,1.24
sword@www.crosswire.org
sword@www.crosswire.org
Sat, 12 Jul 2003 15:58:50 -0700
Update of /usr/local/cvsroot/sword/src/modules/filters
In directory www:/tmp/cvs-serv15306/src/modules/filters
Modified Files:
swbasicfilter.cpp
Log Message:
added helper functions replaceEscapeString and replacTokenSubstitute to SWBasicFilter
Index: swbasicfilter.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/swbasicfilter.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- swbasicfilter.cpp 27 Jun 2003 01:41:07 -0000 1.23
+++ swbasicfilter.cpp 12 Jul 2003 22:58:48 -0000 1.24
@@ -95,6 +95,14 @@
}
+void SWBasicFilter::replaceTokenSubstitute(const char *findString, const char *replaceString) {
+ if (tokenSubMap.find(findString) != tokenSubMap.end()) {
+ tokenSubMap.erase( tokenSubMap.find(findString) ); //erase entry
+ }
+ addTokenSubstitute(findString, replaceString);
+}
+
+
void SWBasicFilter::addEscapeStringSubstitute(const char *findString, const char *replaceString) {
char *buf = 0;
@@ -105,6 +113,13 @@
delete [] buf;
}
else escSubMap.insert(DualStringMap::value_type(findString, replaceString));
+}
+
+void SWBasicFilter::replaceEscapeStringSubstitute(const char *findString, const char *replaceString) {
+ if (escSubMap.find(findString) != escSubMap.end()) {
+ escSubMap.erase( escSubMap.find(findString) ); //erase entry
+ }
+ addEscapeStringSubstitute(findString, replaceString);
}