Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/include/svn_string.h view on Meta::CPAN
apr_size_t new_count);
/** Return a duplicate of @a original_string. */
svn_stringbuf_t *
svn_stringbuf_dup(const svn_stringbuf_t *original_string, apr_pool_t *pool);
/** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */
svn_boolean_t
svn_stringbuf_compare(const svn_stringbuf_t *str1,
const svn_stringbuf_t *str2);
/** Return offset of first non-whitespace character in @a str, or return
* @a str->len if none.
*/
apr_size_t
svn_stringbuf_first_non_whitespace(const svn_stringbuf_t *str);
/** Strip whitespace from both sides of @a str (modified in place). */
void
svn_stringbuf_strip_whitespace(svn_stringbuf_t *str);
/** Return position of last occurrence of @a ch in @a str, or return
* @a str->len if no occurrence.
*/
apr_size_t
svn_stringbuf_find_char_backward(const svn_stringbuf_t *str, char ch);
/** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */
svn_boolean_t
svn_string_compare_stringbuf(const svn_string_t *str1,
const svn_stringbuf_t *str2);
/** @} */
/**
* @defgroup svn_string_cstrings C string functions
* @{
*/
/** Divide @a input into substrings along @a sep_chars boundaries, return an
* array of copies of those substrings (plain const char*), allocating both
* the array and the copies in @a pool.
*
* None of the elements added to the array contain any of the
* characters in @a sep_chars, and none of the new elements are empty
* (thus, it is possible that the returned array will have length
* zero).
*
* If @a chop_whitespace is TRUE, then remove leading and trailing
* whitespace from the returned strings.
*/
apr_array_header_t *
svn_cstring_split(const char *input,
const char *sep_chars,
svn_boolean_t chop_whitespace,
apr_pool_t *pool);
/** Like svn_cstring_split(), but append to existing @a array instead of
* creating a new one. Allocate the copied substrings in @a pool
* (i.e., caller decides whether or not to pass @a array->pool as @a pool).
*/
void
svn_cstring_split_append(apr_array_header_t *array,
const char *input,
const char *sep_chars,
svn_boolean_t chop_whitespace,
apr_pool_t *pool);
/** Return @c TRUE iff @a str matches any of the elements of @a list, a list
* of zero or more glob patterns.
*/
svn_boolean_t
svn_cstring_match_glob_list(const char *str, const apr_array_header_t *list);
/** Return @c TRUE iff @a str exactly matches any of the elements of @a list.
*
* @since new in 1.7
*/
svn_boolean_t
svn_cstring_match_list(const char *str, const apr_array_header_t *list);
/**
* Get the next token from @a *str interpreting any char from @a sep as a
* token separator. Separators at the beginning of @a str will be skipped.
* Returns a pointer to the beginning of the first token in @a *str or NULL
* if no token is left. Modifies @a str such that the next call will return
* the next token.
*
* @note The content of @a *str may be modified by this function.
*
* @since New in 1.8.
*/
char *
svn_cstring_tokenize(const char *sep, char **str);
/**
* Return the number of line breaks in @a msg, allowing any kind of newline
* termination (CR, LF, CRLF, or LFCR), even inconsistent.
*
* @since New in 1.2.
*/
int
svn_cstring_count_newlines(const char *msg);
/**
* Return a cstring which is the concatenation of @a strings (an array
* of char *) each followed by @a separator (that is, @a separator
* will also end the resulting string). Allocate the result in @a pool.
* If @a strings is empty, then return the empty string.
*
* @since New in 1.2.
*/
char *
svn_cstring_join(const apr_array_header_t *strings,
const char *separator,
apr_pool_t *pool);
/**
* Compare two strings @a atr1 and @a atr2, treating case-equivalent
( run in 1.450 second using v1.01-cache-2.11-cpan-d7f47b0818f )