EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
EAPI const char *eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI char *eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_MALLOC EINA_ARG_NONNULL(1);
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
* @return The current string in the string buffer.
*
* This function returns the string contained in @p buf. @p buf is
- * then initialized and does not own anymore the returned string. The
+ * then initialized and does not own the returned string anymore. The
* caller must release the memory of the returned string by calling
* free().
*
}
/**
+ * @brief Free the contents of a string buffer but not the buffer.
+ *
+ * @param buf The string buffer to free the string of.
+ *
+ * This function frees the string contained in @p buf without freeing
+ * @p buf.
+ */
+EAPI void
+eina_strbuf_string_free(Eina_Strbuf *buf)
+{
+ char *ret;
+
+ EINA_MAGIC_CHECK_STRBUF(buf, NULL);
+
+ free(buf->buf);
+ _eina_strbuf_init(buf);
+}
+
+/**
* @brief Retrieve the length of the string buffer content.
*
* @param buf The string buffer.