eina: add API for converting strbuf to lowercase.
authorSrivardhan Hebbar <sri.hebbar@samsung.com>
Wed, 21 Oct 2015 21:04:43 +0000 (14:04 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 9 Nov 2015 18:42:35 +0000 (10:42 -0800)
Summary:
This API would be used in efl_network_websocket.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3200

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/eina/eina_strbuf.c
src/lib/eina/eina_strbuf.h

index 828d842..ff461a7 100644 (file)
@@ -197,6 +197,14 @@ eina_strbuf_rtrim(Eina_Strbuf *buf)
    ((unsigned char *)buf->buf)[buf->len] = '\0';
 }
 
+EAPI void
+eina_strbuf_tolower(Eina_Strbuf *buf)
+{
+   if (!buf || !(buf->buf)) return;
+
+   eina_str_tolower((char **)&(buf->buf));
+}
+
 /* Unicode */
 
 #include "eina_strbuf_template_c.x"
index 1a628b9..3799a3d 100644 (file)
@@ -642,6 +642,15 @@ EAPI void eina_strbuf_ltrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
 EAPI void eina_strbuf_rtrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
 
 /**
+ * @brief Convert the string to lower case.
+ *
+ * @param buf the string buffer to work with.
+ *
+ * This function converts all the characters in the strbuf to lower case.
+ */
+EAPI void eina_strbuf_tolower(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
+
+/**
  * @}
  */