[sword-cvs] sword/include swbuf.h,1.28,1.29

sword@www.crosswire.org sword@www.crosswire.org
Sun, 29 Feb 2004 16:26:19 -0700


Update of /cvs/core/sword/include
In directory www:/tmp/cvs-serv31359/include

Modified Files:
	swbuf.h 
Log Message:
SWBuf::insert added, tested, works for me. Needed to make the gbfosis filter working (jansorg)

Index: swbuf.h
===================================================================
RCS file: /cvs/core/sword/include/swbuf.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- swbuf.h	5 Feb 2004 10:24:36 -0000	1.28
+++ swbuf.h	29 Feb 2004 23:26:17 -0000	1.29
@@ -179,6 +179,18 @@
  	*/
 	void appendFormatted(const char *format, ...);
 	
+	/** 
+	* SWBuf::insert - inserts the given string at position into this string
+	* @param pos The position where to insert. pos=0 inserts at the beginning, pos=1 after the first char, etc. Using pos=length() is the same as calling append(s)
+	*/
+	void insert(const unsigned long pos, const char* str, const signed long max = -1 );
+	void insert(const unsigned long pos, const SWBuf &str, const signed long max = -1 ) {
+		insert(pos, str.c_str(), max);
+	};
+	void insert(const unsigned long pos, const char c) {
+		insert(pos, SWBuf(c));
+	}
+	
 	inline char *getRawData() { return buf; }	// be careful!  Probably setSize needs to be called in conjunction before and maybe after
 
 	inline operator const char *() const { return c_str(); }