79 #include <apr_pools.h>
80 #include <apr_tables.h>
156 svn_string_createf(apr_pool_t *pool,
const char *fmt, ...)
157 __attribute__((format(printf, 2, 3)));
164 svn_string_createv(apr_pool_t *pool, const
char *fmt, va_list ap)
165 __attribute__((format(printf, 2, 0)));
239 svn_stringbuf_createf(apr_pool_t *pool, const
char *fmt, ...)
240 __attribute__((format(printf, 2, 3)));
247 svn_stringbuf_createv(apr_pool_t *pool, const
char *fmt, va_list ap)
248 __attribute__((format(printf, 2, 0)));
368 apr_size_t old_count,
370 apr_size_t new_count);
424 const
char *sep_chars,
435 const
char *sep_chars,
486 const
char *separator,
512 apr_int64_t minval, apr_int64_t maxval,
545 apr_uint64_t minval, apr_uint64_t maxval,
apr_size_t svn_string_first_non_whitespace(const svn_string_t *str)
Return offset of first non-whitespace character in str, or return str->len if none.
svn_boolean_t svn_stringbuf_compare(const svn_stringbuf_t *str1, const svn_stringbuf_t *str2)
Return TRUE iff str1 and str2 have identical length and data.
char * svn_cstring_join(const apr_array_header_t *strings, const char *separator, apr_pool_t *pool)
Return a cstring which is the concatenation of strings (an array of char *) each followed by separato...
apr_array_header_t * svn_cstring_split(const char *input, const char *sep_chars, svn_boolean_t chop_whitespace, apr_pool_t *pool)
Divide input into substrings along sep_chars boundaries, return an array of copies of those substring...
apr_size_t svn_stringbuf_find_char_backward(const svn_stringbuf_t *str, char ch)
Return position of last occurrence of ch in str, or return str->len if no occurrence.
svn_stringbuf_t * svn_stringbuf_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool)
Create a new stringbuf copied from the generic string of bytes, bytes, of length size bytes...
apr_size_t blocksize
total size of buffer allocated
svn_boolean_t svn_cstring_match_glob_list(const char *str, const apr_array_header_t *list)
Return TRUE iff str matches any of the elements of list, a list of zero or more glob patterns...
void svn_stringbuf_strip_whitespace(svn_stringbuf_t *str)
Strip whitespace from both sides of str (modified in place).
svn_string_t * svn_string_create_empty(apr_pool_t *pool)
Create a new, empty string.
svn_stringbuf_t * svn_stringbuf_create(const char *cstring, apr_pool_t *pool)
Create a new stringbuf copied from the null-terminated C string cstring.
apr_size_t len
length of bytestring
svn_boolean_t svn_string_compare_stringbuf(const svn_string_t *str1, const svn_stringbuf_t *str2)
Return TRUE iff str1 and str2 have identical length and data.
svn_string_t * svn_string_create(const char *cstring, apr_pool_t *pool)
Create a new string copied from the null-terminated C string cstring.
void svn_stringbuf_set(svn_stringbuf_t *str, const char *value)
Set str to a copy of the null-terminated C string value.
svn_stringbuf_t * svn_stringbuf_create_empty(apr_pool_t *pool)
Create a new, empty stringbuf.
char * data
pointer to the bytestring
svn_error_t * svn_cstring_atoui(unsigned int *n, const char *str)
Parse the C string str into an unsigned 32 bit number, and return it in *n.
apr_size_t len
length of bytestring
svn_boolean_t svn_cstring_match_list(const char *str, const apr_array_header_t *list)
Return TRUE iff str exactly matches any of the elements of list.
void svn_stringbuf_setempty(svn_stringbuf_t *str)
Set str to empty (zero length).
struct svn_string_t svn_string_t
A simple counted string.
svn_stringbuf_t * svn_stringbuf_dup(const svn_stringbuf_t *original_string, apr_pool_t *pool)
Return a duplicate of original_string.
int svn_cstring_casecmp(const char *str1, const char *str2)
Compare two strings atr1 and atr2, treating case-equivalent unaccented Latin (ASCII subset) letters a...
char * svn_cstring_tokenize(const char *sep, char **str)
Get the next token from *str interpreting any char from sep as a token separator. ...
svn_error_t * svn_cstring_atoi64(apr_int64_t *n, const char *str)
Parse the C string str into a 64 bit number, and return it in *n.
void svn_stringbuf_appendbytes(svn_stringbuf_t *targetstr, const char *bytes, apr_size_t count)
Append an array of bytes onto targetstr.
void svn_stringbuf_fillchar(svn_stringbuf_t *str, unsigned char c)
Fill str with character c.
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)
Like svn_cstring_split(), but append to existing array instead of creating a new one.
svn_string_t *svn_string_t *svn_boolean_t svn_string_isempty(const svn_string_t *str)
Create a new string by printf-style formatting using fmt and the variable arguments, which are as appropriate for apr_psprintf().
void svn_stringbuf_chop(svn_stringbuf_t *str, apr_size_t nbytes)
Chop nbytes bytes off end of str, but not more than str->len.
svn_stringbuf_t * svn_stringbuf_create_from_string(const svn_string_t *str, apr_pool_t *pool)
Create a new stringbuf copied from the string str.
void svn_stringbuf_appendbyte(svn_stringbuf_t *targetstr, char byte)
Append the single character byte onto targetstr.
void svn_stringbuf_replace(svn_stringbuf_t *str, apr_size_t pos, apr_size_t old_count, const char *bytes, apr_size_t new_count)
Replace in str the substring which starts at pos and is old_count bytes long with a new substring byt...
void svn_stringbuf_insert(svn_stringbuf_t *str, apr_size_t pos, const char *bytes, apr_size_t count)
Read count bytes from bytes and insert them into str at position pos and following.
svn_stringbuf_t *svn_stringbuf_t *void svn_stringbuf_ensure(svn_stringbuf_t *str, apr_size_t minimum_size)
Create a new stringbuf by printf-style formatting using fmt and the variable arguments, which are as appropriate for apr_psprintf().
svn_string_t * svn_string_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool)
Create a new string copied from a generic string of bytes, bytes, of length size bytes.
Subversion's data types.
int svn_cstring_count_newlines(const char *msg)
Return the number of line breaks in msg, allowing any kind of newline termination (CR...
svn_error_t * svn_cstring_atoui64(apr_uint64_t *n, const char *str)
Parse the C string str into an unsigned 64 bit number, and return it in *n.
struct svn_stringbuf_t svn_stringbuf_t
A buffered string, capable of appending without an allocation and copy for each append.
svn_string_t * svn_string_create_from_buf(const svn_stringbuf_t *strbuf, apr_pool_t *pool)
Create a new string copied from the stringbuf strbuf.
svn_error_t * svn_cstring_strtoui64(apr_uint64_t *n, const char *str, apr_uint64_t minval, apr_uint64_t maxval, int base)
Parse the C string str into an unsigned 64 bit number, and return it in *n.
void svn_stringbuf_appendstr(svn_stringbuf_t *targetstr, const svn_stringbuf_t *appendstr)
Append the stringbuf appendstr onto targetstr.
void svn_stringbuf_appendcstr(svn_stringbuf_t *targetstr, const char *cstr)
Append the C string cstr onto targetstr.
apr_pool_t * pool
a pool from which this string was originally allocated, and is not necessarily specific to this strin...
svn_boolean_t svn_stringbuf_isempty(const svn_stringbuf_t *str)
Return TRUE if str is empty (has length zero).
svn_string_t * svn_string_dup(const svn_string_t *original_string, apr_pool_t *pool)
Return a duplicate of original_string.
svn_boolean_t svn_string_compare(const svn_string_t *str1, const svn_string_t *str2)
Return TRUE iff str1 and str2 have identical length and data.
int svn_boolean_t
YABT: Yet Another Boolean Type.
svn_error_t * svn_cstring_atoi(int *n, const char *str)
Parse the C string str into a 32 bit number, and return it in *n.
svn_stringbuf_t * svn_stringbuf_create_ensure(apr_size_t minimum_size, apr_pool_t *pool)
Create a new, empty stringbuf with at least minimum_size bytes of space available in the memory block...
svn_error_t * svn_cstring_strtoi64(apr_int64_t *n, const char *str, apr_int64_t minval, apr_int64_t maxval, int base)
Parse the C string str into a 64 bit number, and return it in *n.
void svn_stringbuf_remove(svn_stringbuf_t *str, apr_size_t pos, apr_size_t count)
Removes count bytes from str, starting at position pos.
apr_size_t svn_string_find_char_backward(const svn_string_t *str, char ch)
Return position of last occurrence of ch in str, or return str->len if no occurrence.
A buffered string, capable of appending without an allocation and copy for each append.
const char * data
pointer to the bytestring
apr_size_t svn_stringbuf_first_non_whitespace(const svn_stringbuf_t *str)
Return offset of first non-whitespace character in str, or return str->len if none.