r2835 - in trunk/libmutil: include/libmutil source

erik at minisip.org erik at minisip.org
Tue Oct 17 15:09:51 CEST 2006


Author: erik
Date: 2006-10-17 15:09:50 +0200 (Tue, 17 Oct 2006)
New Revision: 2835

Modified:
   trunk/libmutil/include/libmutil/stringutils.h
   trunk/libmutil/source/stringutils.cxx
Log:

 * Added function to check whether a character is whitespace or not to
   libmutil/stringgutils.



Modified: trunk/libmutil/include/libmutil/stringutils.h
===================================================================
--- trunk/libmutil/include/libmutil/stringutils.h	2006-10-17 10:14:37 UTC (rev 2834)
+++ trunk/libmutil/include/libmutil/stringutils.h	2006-10-17 13:09:50 UTC (rev 2835)
@@ -63,6 +63,11 @@
 LIBMUTIL_API int strNCaseCmp(const char *s1, const char* s2);
 
 /**
+ * @return true if the parameter is a white space (' ', '\n' or '\t')
+ */
+LIBMUTIL_API bool isWS(char c);
+
+/**
  * Removes whitespace from beginning and end of Strings.
  * 	@param s	String from which to remove whitespace (or rather copy and remove whitespace from)
  * 	@author Erik Eliasson

Modified: trunk/libmutil/source/stringutils.cxx
===================================================================
--- trunk/libmutil/source/stringutils.cxx	2006-10-17 10:14:37 UTC (rev 2834)
+++ trunk/libmutil/source/stringutils.cxx	2006-10-17 13:09:50 UTC (rev 2835)
@@ -104,6 +104,10 @@
 	return split(s, do_trim, '\n',false);
 }
 
+LIBMUTIL_API bool isWS(char c){
+	return (c==' ' || c=='\t' || c=='\n');
+}
+
 LIBMUTIL_API string upCase(string s){
 	size_t n=s.size();
 	string ret(n,' ');



More information about the Minisip-devel mailing list