[sword-svn] r1702 - in trunk: include src/mgr src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Fri Jan 28 17:54:53 MST 2005
Author: scribe
Date: 2005-01-28 17:54:52 -0700 (Fri, 28 Jan 2005)
New Revision: 1702
Modified:
trunk/include/swbasicfilter.h
trunk/src/mgr/curlftpt.cpp
trunk/src/modules/filters/swbasicfilter.cpp
Log:
A rename from delete* to remove*, and some other cleanups
Modified: trunk/include/swbasicfilter.h
===================================================================
--- trunk/include/swbasicfilter.h 2005-01-28 22:42:59 UTC (rev 1701)
+++ trunk/include/swbasicfilter.h 2005-01-29 00:54:52 UTC (rev 1702)
@@ -105,53 +105,69 @@
/** Sets the end of token start sequence (by default ">").*/
void setTokenEnd(const char *tokenEnd);
- /** Sets whether pass thru unknown tokens unchanged or just ignore (remove) them.
+ /** Sets whether to pass thru an unknown token unchanged
+ * or just remove it.
* Default is false.*/
void setPassThruUnknownToken(bool val);
- /** Sets whether pass thru unknown escape sequences unchanged or just ignore (remove) them.
- * Default is false.*/
+ /** Sets whether to pass thru an unknown escape sequence unchanged
+ * or just remove it.
+ * Default is false.
+ */
void setPassThruUnknownEscapeString(bool val);
/** Are escapeStrings case sensitive or not? Call this
- function before addEscapeStingSubstitute()*/
+ * function before addEscapeStingSubstitute()
+ */
void setEscapeStringCaseSensitive(bool val);
- /** Use this to add your own escapeString substitutes. It will replace them
- if they already exist.*/
+
+ /** Registers an esc control sequence
+ */
void addEscapeStringSubstitute(const char *findString, const char *replaceString);
- /** Remove excapeStringSubstitutes from the list */
- void deleteEscapeStringSubstitute(const char *findString);
+ /** Unregisters an esc control sequence
+ */
+ void removeEscapeStringSubstitute(const char *findString);
+
/** This function performs the substitution of escapeStrings */
bool substituteEscapeString(SWBuf &buf, const char *escString);
- /** Are tokens case sensitive (like in OSIS) or not? Call this
- function before addTokenSubstitute()*/
+ /** Are tokens case sensitive (like in GBF) or not? Call this
+ * function before addTokenSubstitute()
+ */
void setTokenCaseSensitive(bool val);
- /** Use this to add your own token substitutes. It will replace them
- if they already exist.*/
+
+ /** Registers a simple token substitutions. Usually called from the
+ * c-tor of a subclass
+ */
void addTokenSubstitute(const char *findString, const char *replaceString);
- /** Remove tokenSubstitutes from the list */
- void deleteTokenSubstitute(const char *findString);
+
+ /** Unregisters a simple token substitute
+ */
+ void removeTokenSubstitute(const char *findString);
+
/** This function performs the substitution of tokens */
bool substituteToken(SWBuf &buf, const char *token);
/** This function is called for every token encountered in the input text.
- * @param buf the output buffer (FIXME: what is its size?)
- * @param token the token (e.g. <code>"p align='left'"</code>
- * @param userData FIXME: document this
- * @return <code>false</code> if was not handled and should be handled in
- * the default way (by just substituting).*/
+ * @param buf the output buffer
+ * @param token the token (e.g. <code>"p align='left'"</code>
+ * @param userData user storage space for data transient to 1 full buffer parse
+ * @return subclasses should return true if they handled the token, or false if they did not.
+ */
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+
virtual bool processStage(char stage, SWBuf &text, char *&from, BasicFilterUserData *userData) { return false; }
virtual void setStageProcessing(char stages) { processStages = stages; } // see STATICs up above
/** This function is called for every escape sequence encountered in the input text.
- * @param buf the output buffer (FIXME: what is its size?)
- * @param escString the escape sequence (e.g. <code>"amp"</code> for &amp;)
- * @param userData FIXME: document this
- * @return <code>false</code> if was not handled and should be handled in
- * the default way (by just substituting).*/
+ * @param buf the output buffer
+ * @param escString the escape sequence (e.g. <code>"amp"</code> for &amp;)
+ * @param userData user storage space for data transient to 1 full buffer parse
+ * @return <code>false</code> if was not handled and should be handled in
+ * @return subclasses should return true if they handled the esc seq, or false if they did not.
+ */
virtual bool handleEscapeString(SWBuf &buf, const char *escString, BasicFilterUserData *userData);
+
};
SWORD_NAMESPACE_END
Modified: trunk/src/mgr/curlftpt.cpp
===================================================================
--- trunk/src/mgr/curlftpt.cpp 2005-01-28 22:42:59 UTC (rev 1701)
+++ trunk/src/mgr/curlftpt.cpp 2005-01-29 00:54:52 UTC (rev 1702)
@@ -96,12 +96,12 @@
curl_easy_setopt(session, CURLOPT_VERBOSE, true);
/* FTP connection settings */
-#if LIBCURL_VERSION_MAJOR >= 7
-#define EPRT_AVAILABLE 1
-#if (LIBCURL_VERSION_MINOR<=10) || (LIBCURL_VERSION_MINOR==10 && LIBCURL_VERSION_PATCH<=6)
-#undef EPRT_AVAILABLE
+
+#if (LIBCURL_VERSION_MAJOR > 7) || \
+ ((LIBCURL_VERSION_MAJOR == 7) && (LIBCURL_VERSION_MINOR > 10)) || \
+ ((LIBCURL_VERSION_MAJOR == 7) && (LIBCURL_VERSION_MINOR == 10) && (LIBCURL_VERSION_PATCH >= 6))
+# define EPRT_AVAILABLE 1
#endif
-#endif
#ifdef EPRT_AVAILABLE
curl_easy_setopt(session, CURLOPT_FTP_USE_EPRT, 0);
Modified: trunk/src/modules/filters/swbasicfilter.cpp
===================================================================
--- trunk/src/modules/filters/swbasicfilter.cpp 2005-01-28 22:42:59 UTC (rev 1701)
+++ trunk/src/modules/filters/swbasicfilter.cpp 2005-01-29 00:54:52 UTC (rev 1702)
@@ -101,7 +101,7 @@
}
-void SWBasicFilter::deleteTokenSubstitute(const char *findString) {
+void SWBasicFilter::removeTokenSubstitute(const char *findString) {
if (tokenSubMap.find(findString) != tokenSubMap.end()) {
tokenSubMap.erase( tokenSubMap.find(findString) );
}
@@ -119,7 +119,7 @@
else escSubMap.insert(DualStringMap::value_type(findString, replaceString));
}
-void SWBasicFilter::deleteEscapeStringSubstitute(const char *findString) {
+void SWBasicFilter::removeEscapeStringSubstitute(const char *findString) {
if (escSubMap.find(findString) != escSubMap.end()) {
escSubMap.erase( escSubMap.find(findString) );
}
More information about the sword-cvs
mailing list