[sword-svn] r2198 - in trunk: include src/utilfuns

scribe at www.crosswire.org scribe at www.crosswire.org
Thu Sep 11 13:59:30 MST 2008


Author: scribe
Date: 2008-09-11 13:59:30 -0700 (Thu, 11 Sep 2008)
New Revision: 2198

Modified:
   trunk/include/swbuf.h
   trunk/src/utilfuns/swbuf.cpp
Log:
added a return *this to setFormatted


Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2008-09-11 19:13:14 UTC (rev 2197)
+++ trunk/include/swbuf.h	2008-09-11 20:59:30 UTC (rev 2198)
@@ -213,7 +213,7 @@
 	* @param format The format string. Same syntax as printf, for example.
 	* @param ... Add all arguments here.
 	*/
-	void setFormatted(const char *format, ...);
+	SWBuf &setFormatted(const char *format, ...);
 
 	/**
 	* SWBuf::setSize - Size this buffer to a specific length.

Modified: trunk/src/utilfuns/swbuf.cpp
===================================================================
--- trunk/src/utilfuns/swbuf.cpp	2008-09-11 19:13:14 UTC (rev 2197)
+++ trunk/src/utilfuns/swbuf.cpp	2008-09-11 20:59:30 UTC (rev 2198)
@@ -76,7 +76,7 @@
 * WARNING: This function can only write at most
 * JUNKBUFSIZE to the string per call.
 */
-void SWBuf::setFormatted(const char *format, ...) {
+SWBuf &SWBuf::setFormatted(const char *format, ...) {
 	va_list argptr;
 
 	va_start(argptr, format);
@@ -90,6 +90,7 @@
 	va_start(argptr, format);
 	end = vsprintf(buf, format, argptr) + buf;
 	va_end(argptr);
+	return *this;
 }
 
 /******************************************************************************




More information about the sword-cvs mailing list