2009-01-31 10:33:39 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2007-02-16 15:49:55 -08:00
|
|
|
#include "Ecore_Data.h"
|
2007-03-05 13:41:39 -08:00
|
|
|
|
2007-02-16 15:49:55 -08:00
|
|
|
/**
|
|
|
|
* Create a new string buffer
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_new() instead.
|
2007-02-16 15:49:55 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI Ecore_Strbuf *
|
2007-02-16 15:49:55 -08:00
|
|
|
ecore_strbuf_new(void)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
return eina_strbuf_new();
|
2007-02-16 15:49:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Free a string buffer
|
|
|
|
* @param buf the buffer to free
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_free() instead.
|
2007-02-16 15:49:55 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI void
|
2007-02-16 15:49:55 -08:00
|
|
|
ecore_strbuf_free(Ecore_Strbuf *buf)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
eina_strbuf_free(buf);
|
2007-02-16 15:49:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Append a string to a buffer, reallocating as necessary.
|
|
|
|
* @param buf the Ecore_Strbuf to append to
|
|
|
|
* @param str the string to append
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_append() instead.
|
2007-02-16 15:49:55 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI void
|
2007-02-16 15:49:55 -08:00
|
|
|
ecore_strbuf_append(Ecore_Strbuf *buf, const char *str)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
eina_strbuf_append(buf, str);
|
2007-02-16 15:49:55 -08:00
|
|
|
}
|
|
|
|
|
2007-02-20 20:31:50 -08:00
|
|
|
/**
|
|
|
|
* Insert a string to a buffer, reallocating as necessary.
|
|
|
|
* @param buf the Ecore_Strbuf to insert
|
|
|
|
* @param str the string to insert
|
|
|
|
* @param pos the position to insert the string
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_insert() instead.
|
2007-02-20 20:31:50 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI void
|
2007-02-20 20:31:50 -08:00
|
|
|
ecore_strbuf_insert(Ecore_Strbuf *buf, const char *str, size_t pos)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
eina_strbuf_insert(buf, str, pos);
|
2007-02-20 20:31:50 -08:00
|
|
|
}
|
|
|
|
|
2007-02-16 15:49:55 -08:00
|
|
|
/**
|
|
|
|
* Append a character to a string buffer, reallocating as necessary.
|
|
|
|
* @param buf the Ecore_Strbuf to append to
|
|
|
|
* @param c the char to append
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_append_char() instead.
|
2007-02-16 15:49:55 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI void
|
2007-02-16 15:49:55 -08:00
|
|
|
ecore_strbuf_append_char(Ecore_Strbuf *buf, char c)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
eina_strbuf_append_char(buf, c);
|
2007-02-16 15:49:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a pointer to the contents of a string buffer
|
|
|
|
* @param buf the buffer
|
|
|
|
*
|
|
|
|
* This pointer must not be modified, and will no longer be valid if
|
|
|
|
* the Ecore_Strbuf is modified.
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_string_get() instead.
|
2007-02-16 15:49:55 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI const char *
|
2007-02-16 15:49:55 -08:00
|
|
|
ecore_strbuf_string_get(Ecore_Strbuf *buf)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
return eina_strbuf_string_get(buf);
|
2007-02-16 15:49:55 -08:00
|
|
|
}
|
2007-02-20 20:31:50 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the length of the string buffer content
|
|
|
|
* @param buf the buffer
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_length_get() instead.
|
2007-02-20 20:31:50 -08:00
|
|
|
*/
|
2007-03-05 13:41:39 -08:00
|
|
|
EAPI size_t
|
2007-02-20 20:31:50 -08:00
|
|
|
ecore_strbuf_length_get(Ecore_Strbuf *buf)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
return eina_strbuf_length_get(buf);
|
2007-02-20 20:31:50 -08:00
|
|
|
}
|
|
|
|
|
2007-03-05 13:41:39 -08:00
|
|
|
/**
|
|
|
|
* Replace the n-th string with an other string.
|
|
|
|
* @param buf the Ecore_Strbuf to work with
|
|
|
|
* @param str the string to replace
|
|
|
|
* @param with the replaceing string
|
2008-11-29 03:23:17 -08:00
|
|
|
* @param n the number of the fitting string
|
2007-03-05 13:41:39 -08:00
|
|
|
*
|
|
|
|
* @return true on success
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_replace() instead.
|
2007-03-05 13:41:39 -08:00
|
|
|
*/
|
|
|
|
EAPI int
|
|
|
|
ecore_strbuf_replace(Ecore_Strbuf *buf, const char *str, const char *with,
|
|
|
|
unsigned int n)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
return eina_strbuf_replace(buf, str, with, n);
|
2007-03-05 13:41:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replace all strings with an other string.
|
|
|
|
* @param buf the Ecore_Strbuf to work with
|
|
|
|
* @param str the string to replace
|
|
|
|
* @param with the replaceing string
|
|
|
|
*
|
|
|
|
* @return how often the string was replaced
|
2010-02-26 16:53:58 -08:00
|
|
|
*
|
|
|
|
* @deprecated use eina_strbuf_replace_all() instead.
|
2007-03-05 13:41:39 -08:00
|
|
|
*/
|
|
|
|
EAPI int
|
|
|
|
ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|
|
|
{
|
2010-02-26 16:53:58 -08:00
|
|
|
return eina_strbuf_replace_all(buf, str, with);
|
2007-03-05 13:41:39 -08:00
|
|
|
}
|