DragonNest/Common/SVNLib/doc/svn__string_8h-source.html
2024-12-19 09:48:26 +08:00

397 lines
47 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Subversion: svn_string.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
<h1>svn_string.h</h1><a href="svn__string_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**</span>
<a name="l00002"></a>00002 <span class="comment"> * @copyright</span>
<a name="l00003"></a>00003 <span class="comment"> * ====================================================================</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2000-2006 CollabNet. All rights reserved.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * This software is licensed as described in the file COPYING, which</span>
<a name="l00007"></a>00007 <span class="comment"> * you should have received as part of this distribution. The terms</span>
<a name="l00008"></a>00008 <span class="comment"> * are also available at http://subversion.tigris.org/license-1.html.</span>
<a name="l00009"></a>00009 <span class="comment"> * If newer versions of this license are posted there, you may use a</span>
<a name="l00010"></a>00010 <span class="comment"> * newer version instead, at your option.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This software consists of voluntary contributions made by many</span>
<a name="l00013"></a>00013 <span class="comment"> * individuals. For exact contribution history, see the revision</span>
<a name="l00014"></a>00014 <span class="comment"> * history and logs, available at http://subversion.tigris.org/.</span>
<a name="l00015"></a>00015 <span class="comment"> * ====================================================================</span>
<a name="l00016"></a>00016 <span class="comment"> * @endcopyright</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * @file svn_string.h</span>
<a name="l00019"></a>00019 <span class="comment"> * @brief Counted-length strings for Subversion, plus some C string goodies.</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> * There are two string datatypes: @c svn_string_t and @c svn_stringbuf_t.</span>
<a name="l00022"></a>00022 <span class="comment"> * The former is a simple pointer/length pair useful for passing around</span>
<a name="l00023"></a>00023 <span class="comment"> * strings (or arbitrary bytes) with a counted length. @c svn_stringbuf_t is</span>
<a name="l00024"></a>00024 <span class="comment"> * buffered to enable efficient appending of strings without an allocation</span>
<a name="l00025"></a>00025 <span class="comment"> * and copy for each append operation.</span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> * @c svn_string_t contains a &lt;tt&gt;const char *&lt;/tt&gt; for its data, so it is</span>
<a name="l00028"></a>00028 <span class="comment"> * most appropriate for constant data and for functions which expect constant,</span>
<a name="l00029"></a>00029 <span class="comment"> * counted data. Functions should generally use &lt;tt&gt;const @c svn_string_t</span>
<a name="l00030"></a>00030 <span class="comment"> * *&lt;/tt&gt; as their parameter to indicate they are expecting a constant,</span>
<a name="l00031"></a>00031 <span class="comment"> * counted string.</span>
<a name="l00032"></a>00032 <span class="comment"> *</span>
<a name="l00033"></a>00033 <span class="comment"> * @c svn_stringbuf_t uses a plain &lt;tt&gt;char *&lt;/tt&gt; for its data, so it is</span>
<a name="l00034"></a>00034 <span class="comment"> * most appropriate for modifiable data.</span>
<a name="l00035"></a>00035 <span class="comment"> *</span>
<a name="l00036"></a>00036 <span class="comment"> * &lt;h3&gt;Invariants&lt;/h3&gt;</span>
<a name="l00037"></a>00037 <span class="comment"> *</span>
<a name="l00038"></a>00038 <span class="comment"> * 1. Null termination:</span>
<a name="l00039"></a>00039 <span class="comment"> *</span>
<a name="l00040"></a>00040 <span class="comment"> * Both structures maintain a significant invariant:</span>
<a name="l00041"></a>00041 <span class="comment"> *</span>
<a name="l00042"></a>00042 <span class="comment"> * &lt;tt&gt;s-&gt;data[s-&gt;len] == '\\0'&lt;/tt&gt;</span>
<a name="l00043"></a>00043 <span class="comment"> *</span>
<a name="l00044"></a>00044 <span class="comment"> * The functions defined within this header file will maintain</span>
<a name="l00045"></a>00045 <span class="comment"> * the invariant (which does imply that memory is</span>
<a name="l00046"></a>00046 <span class="comment"> * allocated/defined as @c len+1 bytes). If code outside of the</span>
<a name="l00047"></a>00047 <span class="comment"> * @c svn_string.h functions manually builds these structures,</span>
<a name="l00048"></a>00048 <span class="comment"> * then they must enforce this invariant.</span>
<a name="l00049"></a>00049 <span class="comment"> *</span>
<a name="l00050"></a>00050 <span class="comment"> * Note that an @c svn_string(buf)_t may contain binary data,</span>
<a name="l00051"></a>00051 <span class="comment"> * which means that strlen(s-&gt;data) does not have to equal @c</span>
<a name="l00052"></a>00052 <span class="comment"> * s-&gt;len. The NULL terminator is provided to make it easier to</span>
<a name="l00053"></a>00053 <span class="comment"> * pass @c s-&gt;data to C string interfaces.</span>
<a name="l00054"></a>00054 <span class="comment"> *</span>
<a name="l00055"></a>00055 <span class="comment"> *</span>
<a name="l00056"></a>00056 <span class="comment"> * 2. Non-NULL input:</span>
<a name="l00057"></a>00057 <span class="comment"> *</span>
<a name="l00058"></a>00058 <span class="comment"> * All the functions assume their input data is non-NULL,</span>
<a name="l00059"></a>00059 <span class="comment"> * unless otherwise documented, and may seg fault if passed</span>
<a name="l00060"></a>00060 <span class="comment"> * NULL. The input data may *contain* null bytes, of course, just</span>
<a name="l00061"></a>00061 <span class="comment"> * the data pointer itself must not be NULL.</span>
<a name="l00062"></a>00062 <span class="comment"> */</span>
<a name="l00063"></a>00063
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="preprocessor">#ifndef SVN_STRING_H</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define SVN_STRING_H</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00068"></a>00068 <span class="preprocessor">#include &lt;apr.h&gt;</span>
<a name="l00069"></a>00069 <span class="preprocessor">#include &lt;apr_tables.h&gt;</span>
<a name="l00070"></a>00070 <span class="preprocessor">#include &lt;apr_pools.h&gt;</span> <span class="comment">/* APR memory pools for everyone. */</span>
<a name="l00071"></a>00071 <span class="preprocessor">#include &lt;apr_strings.h&gt;</span>
<a name="l00072"></a>00072
<a name="l00073"></a>00073 <span class="preprocessor">#include "<a class="code" href="svn__types_8h.html" title="Subversion&amp;#39;s data types.">svn_types.h</a>"</span>
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00077"></a>00077 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00078"></a>00078 <span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">/**</span>
<a name="l00080"></a>00080 <span class="comment"> * @defgroup svn_string String handling</span>
<a name="l00081"></a>00081 <span class="comment"> * @{</span>
<a name="l00082"></a>00082 <span class="comment"> */</span>
<a name="l00083"></a>00083
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="comment"></span>
<a name="l00086"></a>00086 <span class="comment">/** A simple counted string. */</span>
<a name="l00087"></a><a class="code" href="structsvn__string__t.html">00087</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a>
<a name="l00088"></a>00088 {
<a name="l00089"></a><a class="code" href="structsvn__string__t.html#2da127c85624dda1e0066f9733e350f4">00089</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structsvn__string__t.html#2da127c85624dda1e0066f9733e350f4" title="pointer to the bytestring">data</a>; <span class="comment">/**&lt; pointer to the bytestring */</span>
<a name="l00090"></a><a class="code" href="structsvn__string__t.html#fe62b0f358b9d69bca7d42228b386c8f">00090</a> apr_size_t <a class="code" href="structsvn__string__t.html#fe62b0f358b9d69bca7d42228b386c8f" title="length of bytestring">len</a>; <span class="comment">/**&lt; length of bytestring */</span>
<a name="l00091"></a>00091 } <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a>;
<a name="l00092"></a>00092 <span class="comment"></span>
<a name="l00093"></a>00093 <span class="comment">/** A buffered string, capable of appending without an allocation and copy</span>
<a name="l00094"></a>00094 <span class="comment"> * for each append. */</span>
<a name="l00095"></a><a class="code" href="structsvn__stringbuf__t.html">00095</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a>
<a name="l00096"></a>00096 {<span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment"> /** a pool from which this string was originally allocated, and is not</span>
<a name="l00098"></a>00098 <span class="comment"> * necessarily specific to this string. This is used only for allocating</span>
<a name="l00099"></a>00099 <span class="comment"> * more memory from when the string needs to grow.</span>
<a name="l00100"></a>00100 <span class="comment"> */</span>
<a name="l00101"></a><a class="code" href="structsvn__stringbuf__t.html#4bff8435f22663e587f6ad59807d6cbe">00101</a> apr_pool_t *<a class="code" href="structsvn__stringbuf__t.html#4bff8435f22663e587f6ad59807d6cbe" title="a pool from which this string was originally allocated, and is not necessarily specific...">pool</a>;
<a name="l00102"></a>00102 <span class="comment"></span>
<a name="l00103"></a>00103 <span class="comment"> /** pointer to the bytestring */</span>
<a name="l00104"></a><a class="code" href="structsvn__stringbuf__t.html#e5566e405d9720465940d3fdf87c3f45">00104</a> <span class="keywordtype">char</span> *<a class="code" href="structsvn__stringbuf__t.html#e5566e405d9720465940d3fdf87c3f45" title="pointer to the bytestring">data</a>;
<a name="l00105"></a>00105 <span class="comment"></span>
<a name="l00106"></a>00106 <span class="comment"> /** length of bytestring */</span>
<a name="l00107"></a><a class="code" href="structsvn__stringbuf__t.html#58c2c785bfb601822265b1f75258380c">00107</a> apr_size_t <a class="code" href="structsvn__stringbuf__t.html#58c2c785bfb601822265b1f75258380c" title="length of bytestring">len</a>;
<a name="l00108"></a>00108 <span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment"> /** total size of buffer allocated */</span>
<a name="l00110"></a><a class="code" href="structsvn__stringbuf__t.html#81d1126b261bc2fa0147edaaa1a5ed30">00110</a> apr_size_t <a class="code" href="structsvn__stringbuf__t.html#81d1126b261bc2fa0147edaaa1a5ed30" title="total size of buffer allocated">blocksize</a>;
<a name="l00111"></a>00111 } <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a>;
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">/** svn_string_t functions.</span>
<a name="l00115"></a>00115 <span class="comment"> *</span>
<a name="l00116"></a>00116 <span class="comment"> * @defgroup svn_string_svn_string_t svn_string_t functions</span>
<a name="l00117"></a>00117 <span class="comment"> * @{</span>
<a name="l00118"></a>00118 <span class="comment"> */</span>
<a name="l00119"></a>00119 <span class="comment"></span>
<a name="l00120"></a>00120 <span class="comment">/** Create a new bytestring containing a C string (NULL-terminated). */</span>
<a name="l00121"></a>00121 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#gd95dc9d38e6bdc84747f3ef9d3e35fe0" title="Create a new bytestring containing a C string (NULL-terminated).">svn_string_create</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *cstring,
<a name="l00122"></a>00122 apr_pool_t *pool);
<a name="l00123"></a>00123 <span class="comment"></span>
<a name="l00124"></a>00124 <span class="comment">/** Create a new bytestring containing a generic string of bytes</span>
<a name="l00125"></a>00125 <span class="comment"> * (NOT NULL-terminated) */</span>
<a name="l00126"></a>00126 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#gc3d86b18881673a058d2436abc4f3b3d" title="Create a new bytestring containing a generic string of bytes (NOT NULL-terminated)...">svn_string_ncreate</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *bytes,
<a name="l00127"></a>00127 apr_size_t size,
<a name="l00128"></a>00128 apr_pool_t *pool);
<a name="l00129"></a>00129 <span class="comment"></span>
<a name="l00130"></a>00130 <span class="comment">/** Create a new string with the contents of the given stringbuf */</span>
<a name="l00131"></a>00131 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#ge371a744fa00e25cb91e326b628c0d58" title="Create a new string with the contents of the given stringbuf.">svn_string_create_from_buf</a>(<span class="keyword">const</span> <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *strbuf,
<a name="l00132"></a>00132 apr_pool_t *pool);
<a name="l00133"></a>00133 <span class="comment"></span>
<a name="l00134"></a>00134 <span class="comment">/** Create a new bytestring by formatting @a cstring (NULL-terminated)</span>
<a name="l00135"></a>00135 <span class="comment"> * from varargs, which are as appropriate for apr_psprintf().</span>
<a name="l00136"></a>00136 <span class="comment"> */</span>
<a name="l00137"></a>00137 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#g5b482947bdf2b1a1cbb3a1a9aaf011e5" title="Create a new bytestring by formatting cstring (NULL-terminated) from varargs, which...">svn_string_createf</a>(apr_pool_t *pool,
<a name="l00138"></a>00138 <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt,
<a name="l00139"></a>00139 ...)
<a name="l00140"></a>00140 __attribute__((format(printf, 2, 3)));
<a name="l00141"></a>00141 <span class="comment"></span>
<a name="l00142"></a>00142 <span class="comment">/** Create a new bytestring by formatting @a cstring (NULL-terminated)</span>
<a name="l00143"></a>00143 <span class="comment"> * from a @c va_list (see svn_stringbuf_createf()).</span>
<a name="l00144"></a>00144 <span class="comment"> */</span>
<a name="l00145"></a>00145 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#g4f022a5854556fd0295c48e8fa981bf2" title="Create a new bytestring by formatting cstring (NULL-terminated) from a va_list (see...">svn_string_createv</a>(apr_pool_t *pool,
<a name="l00146"></a>00146 const <span class="keywordtype">char</span> *fmt,
<a name="l00147"></a>00147 va_list ap)
<a name="l00148"></a>00148 __attribute__((format(printf, 2, 0)));
<a name="l00149"></a>00149 <span class="comment"></span>
<a name="l00150"></a>00150 <span class="comment">/** Return TRUE if a bytestring is empty (has length zero). */</span>
<a name="l00151"></a>00151 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__svn__string__t.html#g2891cd984b7ae945c9a91ba79d1d378a" title="Return TRUE if a bytestring is empty (has length zero).">svn_string_isempty</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str);
<a name="l00152"></a>00152 <span class="comment"></span>
<a name="l00153"></a>00153 <span class="comment">/** Return a duplicate of @a original_string. */</span>
<a name="l00154"></a>00154 <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *<a class="code" href="group__svn__string__svn__string__t.html#gfbbbff4a252b2cc528f17d908a05f63e" title="Return a duplicate of original_string.">svn_string_dup</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *original_string,
<a name="l00155"></a>00155 apr_pool_t *pool);
<a name="l00156"></a>00156 <span class="comment"></span>
<a name="l00157"></a>00157 <span class="comment">/** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */</span>
<a name="l00158"></a>00158 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__svn__string__t.html#gdb0c115b0e43071290450146585701d4" title="Return TRUE iff str1 and str2 have identical length and data.">svn_string_compare</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str1,
<a name="l00159"></a>00159 const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str2);
<a name="l00160"></a>00160 <span class="comment"></span>
<a name="l00161"></a>00161 <span class="comment">/** Return offset of first non-whitespace character in @a str, or return</span>
<a name="l00162"></a>00162 <span class="comment"> * @a str-&gt;len if none.</span>
<a name="l00163"></a>00163 <span class="comment"> */</span>
<a name="l00164"></a>00164 apr_size_t <a class="code" href="group__svn__string__svn__string__t.html#gef03ff9a4a6164c224ab26cb89088f98" title="Return offset of first non-whitespace character in str, or return str-&amp;gt;len if...">svn_string_first_non_whitespace</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str);
<a name="l00165"></a>00165 <span class="comment"></span>
<a name="l00166"></a>00166 <span class="comment">/** Return position of last occurrence of @a ch in @a str, or return</span>
<a name="l00167"></a>00167 <span class="comment"> * @a str-&gt;len if no occurrence.</span>
<a name="l00168"></a>00168 <span class="comment"> */</span>
<a name="l00169"></a>00169 apr_size_t <a class="code" href="group__svn__string__svn__string__t.html#g60d959ad747d999baf4cc0582f1ecfa0" title="Return position of last occurrence of ch in str, or return str-&amp;gt;len if no occurrence...">svn_string_find_char_backward</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str, <span class="keywordtype">char</span> ch);
<a name="l00170"></a>00170 <span class="comment"></span>
<a name="l00171"></a>00171 <span class="comment">/** @} */</span>
<a name="l00172"></a>00172
<a name="l00173"></a>00173 <span class="comment"></span>
<a name="l00174"></a>00174 <span class="comment">/** svn_stringbuf_t functions.</span>
<a name="l00175"></a>00175 <span class="comment"> *</span>
<a name="l00176"></a>00176 <span class="comment"> * @defgroup svn_string_svn_stringbuf_t svn_stringbuf_t functions</span>
<a name="l00177"></a>00177 <span class="comment"> * @{</span>
<a name="l00178"></a>00178 <span class="comment"> */</span>
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">/** Create a new bytestring containing a C string (NULL-terminated). */</span>
<a name="l00181"></a>00181 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#g8601f093a616a8e02037dc8e8a90f91a" title="Create a new bytestring containing a C string (NULL-terminated).">svn_stringbuf_create</a>(const <span class="keywordtype">char</span> *cstring,
<a name="l00182"></a>00182 apr_pool_t *pool);<span class="comment"></span>
<a name="l00183"></a>00183 <span class="comment">/** Create a new bytestring containing a generic string of bytes</span>
<a name="l00184"></a>00184 <span class="comment"> * (NON-NULL-terminated)</span>
<a name="l00185"></a>00185 <span class="comment"> */</span>
<a name="l00186"></a>00186 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#g52aff4fcf51690403e493bb35ac87991" title="Create a new bytestring containing a generic string of bytes (NON-NULL-terminated)...">svn_stringbuf_ncreate</a>(const <span class="keywordtype">char</span> *bytes,
<a name="l00187"></a>00187 apr_size_t size,
<a name="l00188"></a>00188 apr_pool_t *pool);
<a name="l00189"></a>00189 <span class="comment"></span>
<a name="l00190"></a>00190 <span class="comment">/** Create a new stringbuf with the contents of the given string */</span>
<a name="l00191"></a>00191 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#ga7d76a0ae1245b7695b290b91cda4947" title="Create a new stringbuf with the contents of the given string.">svn_stringbuf_create_from_string</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str,
<a name="l00192"></a>00192 apr_pool_t *pool);
<a name="l00193"></a>00193 <span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment">/** Create a new bytestring by formatting @a cstring (NULL-terminated)</span>
<a name="l00195"></a>00195 <span class="comment"> * from varargs, which are as appropriate for apr_psprintf().</span>
<a name="l00196"></a>00196 <span class="comment"> */</span>
<a name="l00197"></a>00197 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#g0b1ed3183852be19b758ff0dbd743ef2" title="Create a new bytestring by formatting cstring (NULL-terminated) from varargs, which...">svn_stringbuf_createf</a>(apr_pool_t *pool,
<a name="l00198"></a>00198 const <span class="keywordtype">char</span> *fmt,
<a name="l00199"></a>00199 ...)
<a name="l00200"></a>00200 __attribute__((format(printf, 2, 3)));
<a name="l00201"></a>00201 <span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">/** Create a new bytestring by formatting @a cstring (NULL-terminated)</span>
<a name="l00203"></a>00203 <span class="comment"> * from a @c va_list (see svn_stringbuf_createf()).</span>
<a name="l00204"></a>00204 <span class="comment"> */</span>
<a name="l00205"></a>00205 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#gc220c36f36b2aff8ec230e947a343a0c" title="Create a new bytestring by formatting cstring (NULL-terminated) from a va_list (see...">svn_stringbuf_createv</a>(apr_pool_t *pool,
<a name="l00206"></a>00206 const <span class="keywordtype">char</span> *fmt,
<a name="l00207"></a>00207 va_list ap)
<a name="l00208"></a>00208 __attribute__((format(printf, 2, 0)));
<a name="l00209"></a>00209 <span class="comment"></span>
<a name="l00210"></a>00210 <span class="comment">/** Make sure that the string @a str has at least @a minimum_size bytes of</span>
<a name="l00211"></a>00211 <span class="comment"> * space available in the memory block.</span>
<a name="l00212"></a>00212 <span class="comment"> *</span>
<a name="l00213"></a>00213 <span class="comment"> * (@a minimum_size should include space for the terminating NULL character.)</span>
<a name="l00214"></a>00214 <span class="comment"> */</span>
<a name="l00215"></a>00215 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g647abffad5b778d01557d7fba6551f64" title="Make sure that the string str has at least minimum_size bytes of space available...">svn_stringbuf_ensure</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str,
<a name="l00216"></a>00216 apr_size_t minimum_size);
<a name="l00217"></a>00217 <span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment">/** Set a bytestring @a str to @a value */</span>
<a name="l00219"></a>00219 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g026d3c9d0850c9b3131dcb37400de532" title="Set a bytestring str to value.">svn_stringbuf_set</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str, const <span class="keywordtype">char</span> *value);
<a name="l00220"></a>00220 <span class="comment"></span>
<a name="l00221"></a>00221 <span class="comment">/** Set a bytestring @a str to empty (0 length). */</span>
<a name="l00222"></a>00222 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#gb83a676f045b8661689f04a59e0efce9" title="Set a bytestring str to empty (0 length).">svn_stringbuf_setempty</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str);
<a name="l00223"></a>00223 <span class="comment"></span>
<a name="l00224"></a>00224 <span class="comment">/** Return @c TRUE if a bytestring is empty (has length zero). */</span>
<a name="l00225"></a>00225 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g40f3e623c857983b4b56e603431a00fa" title="Return TRUE if a bytestring is empty (has length zero).">svn_stringbuf_isempty</a>(const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str);
<a name="l00226"></a>00226 <span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">/** Chop @a nbytes bytes off end of @a str, but not more than @a str-&gt;len. */</span>
<a name="l00228"></a>00228 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g49dc0be31e13c8264575723cf4695c68" title="Chop nbytes bytes off end of str, but not more than str-&amp;gt;len.">svn_stringbuf_chop</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str, apr_size_t nbytes);
<a name="l00229"></a>00229 <span class="comment"></span>
<a name="l00230"></a>00230 <span class="comment">/** Fill bytestring @a str with character @a c. */</span>
<a name="l00231"></a>00231 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g4373bb2fae064fb648344f49f24fc96c" title="Fill bytestring str with character c.">svn_stringbuf_fillchar</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c);
<a name="l00232"></a>00232 <span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">/** Append an array of bytes onto @a targetstr.</span>
<a name="l00234"></a>00234 <span class="comment"> *</span>
<a name="l00235"></a>00235 <span class="comment"> * reallocs if necessary. @a targetstr is affected, nothing else is.</span>
<a name="l00236"></a>00236 <span class="comment"> */</span>
<a name="l00237"></a>00237 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g1c60f08eaa9f01d244072291f4cf42d0" title="Append an array of bytes onto targetstr.">svn_stringbuf_appendbytes</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *targetstr,
<a name="l00238"></a>00238 const <span class="keywordtype">char</span> *bytes,
<a name="l00239"></a>00239 apr_size_t count);
<a name="l00240"></a>00240 <span class="comment"></span>
<a name="l00241"></a>00241 <span class="comment">/** Append an @c svn_stringbuf_t onto @a targetstr.</span>
<a name="l00242"></a>00242 <span class="comment"> *</span>
<a name="l00243"></a>00243 <span class="comment"> * reallocs if necessary. @a targetstr is affected, nothing else is.</span>
<a name="l00244"></a>00244 <span class="comment"> */</span>
<a name="l00245"></a>00245 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g670edcdb88bcbfc421f06b58683a5efb" title="Append an svn_stringbuf_t onto targetstr.">svn_stringbuf_appendstr</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *targetstr,
<a name="l00246"></a>00246 const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *appendstr);
<a name="l00247"></a>00247 <span class="comment"></span>
<a name="l00248"></a>00248 <span class="comment">/** Append a C string onto @a targetstr.</span>
<a name="l00249"></a>00249 <span class="comment"> *</span>
<a name="l00250"></a>00250 <span class="comment"> * reallocs if necessary. @a targetstr is affected, nothing else is.</span>
<a name="l00251"></a>00251 <span class="comment"> */</span>
<a name="l00252"></a>00252 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g21e883d584131b35082f23d27fe877ea" title="Append a C string onto targetstr.">svn_stringbuf_appendcstr</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *targetstr,
<a name="l00253"></a>00253 const <span class="keywordtype">char</span> *cstr);
<a name="l00254"></a>00254 <span class="comment"></span>
<a name="l00255"></a>00255 <span class="comment">/** Return a duplicate of @a original_string. */</span>
<a name="l00256"></a>00256 <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *<a class="code" href="group__svn__string__svn__stringbuf__t.html#gd96ee402d1430439779f7e19159ecd78" title="Return a duplicate of original_string.">svn_stringbuf_dup</a>(const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *original_string,
<a name="l00257"></a>00257 apr_pool_t *pool);
<a name="l00258"></a>00258
<a name="l00259"></a>00259 <span class="comment"></span>
<a name="l00260"></a>00260 <span class="comment">/** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */</span>
<a name="l00261"></a>00261 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g58bf192fb1bab3755a3cb9699ab472c4" title="Return TRUE iff str1 and str2 have identical length and data.">svn_stringbuf_compare</a>(const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str1,
<a name="l00262"></a>00262 const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str2);
<a name="l00263"></a>00263 <span class="comment"></span>
<a name="l00264"></a>00264 <span class="comment">/** Return offset of first non-whitespace character in @a str, or return</span>
<a name="l00265"></a>00265 <span class="comment"> * @a str-&gt;len if none.</span>
<a name="l00266"></a>00266 <span class="comment"> */</span>
<a name="l00267"></a>00267 apr_size_t <a class="code" href="group__svn__string__svn__stringbuf__t.html#g4fc22d2b21e2e8d4bcd1d71f3ed662e8" title="Return offset of first non-whitespace character in str, or return str-&amp;gt;len if...">svn_stringbuf_first_non_whitespace</a>(const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str);
<a name="l00268"></a>00268 <span class="comment"></span>
<a name="l00269"></a>00269 <span class="comment">/** Strip whitespace from both sides of @a str (modified in place). */</span>
<a name="l00270"></a>00270 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g6509ce58676a3f404250ea8653034a20" title="Strip whitespace from both sides of str (modified in place).">svn_stringbuf_strip_whitespace</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str);
<a name="l00271"></a>00271 <span class="comment"></span>
<a name="l00272"></a>00272 <span class="comment">/** Return position of last occurrence of @a ch in @a str, or return</span>
<a name="l00273"></a>00273 <span class="comment"> * @a str-&gt;len if no occurrence.</span>
<a name="l00274"></a>00274 <span class="comment"> */</span>
<a name="l00275"></a>00275 apr_size_t <a class="code" href="group__svn__string__svn__stringbuf__t.html#ga277b724082d592ac403a3c14a1f8636" title="Return position of last occurrence of ch in str, or return str-&amp;gt;len if no occurrence...">svn_stringbuf_find_char_backward</a>(const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str,
<a name="l00276"></a>00276 <span class="keywordtype">char</span> ch);
<a name="l00277"></a>00277 <span class="comment"></span>
<a name="l00278"></a>00278 <span class="comment">/** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */</span>
<a name="l00279"></a>00279 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__svn__stringbuf__t.html#g7fd0407b0fd66e903255e2b8ad61a9cc" title="Return TRUE iff str1 and str2 have identical length and data.">svn_string_compare_stringbuf</a>(const <a class="code" href="structsvn__string__t.html" title="A simple counted string.">svn_string_t</a> *str1,
<a name="l00280"></a>00280 const <a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *str2);
<a name="l00281"></a>00281 <span class="comment"></span>
<a name="l00282"></a>00282 <span class="comment">/** @} */</span>
<a name="l00283"></a>00283
<a name="l00284"></a>00284 <span class="comment"></span>
<a name="l00285"></a>00285 <span class="comment">/** C strings.</span>
<a name="l00286"></a>00286 <span class="comment"> *</span>
<a name="l00287"></a>00287 <span class="comment"> * @defgroup svn_string_cstrings c string functions</span>
<a name="l00288"></a>00288 <span class="comment"> * @{</span>
<a name="l00289"></a>00289 <span class="comment"> */</span>
<a name="l00290"></a>00290 <span class="comment"></span>
<a name="l00291"></a>00291 <span class="comment">/** Divide @a input into substrings along @a sep_chars boundaries, return an</span>
<a name="l00292"></a>00292 <span class="comment"> * array of copies of those substrings, allocating both the array and</span>
<a name="l00293"></a>00293 <span class="comment"> * the copies in @a pool.</span>
<a name="l00294"></a>00294 <span class="comment"> *</span>
<a name="l00295"></a>00295 <span class="comment"> * None of the elements added to the array contain any of the</span>
<a name="l00296"></a>00296 <span class="comment"> * characters in @a sep_chars, and none of the new elements are empty</span>
<a name="l00297"></a>00297 <span class="comment"> * (thus, it is possible that the returned array will have length</span>
<a name="l00298"></a>00298 <span class="comment"> * zero).</span>
<a name="l00299"></a>00299 <span class="comment"> *</span>
<a name="l00300"></a>00300 <span class="comment"> * If @a chop_whitespace is TRUE, then remove leading and trailing</span>
<a name="l00301"></a>00301 <span class="comment"> * whitespace from the returned strings.</span>
<a name="l00302"></a>00302 <span class="comment"> */</span>
<a name="l00303"></a>00303 apr_array_header_t *<a class="code" href="group__svn__string__cstrings.html#g1af9bdcdb39027b11107088fd02cad9b" title="Divide input into substrings along sep_chars boundaries, return an array of copies...">svn_cstring_split</a>(const <span class="keywordtype">char</span> *input,
<a name="l00304"></a>00304 const <span class="keywordtype">char</span> *sep_chars,
<a name="l00305"></a>00305 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> chop_whitespace,
<a name="l00306"></a>00306 apr_pool_t *pool);
<a name="l00307"></a>00307 <span class="comment"></span>
<a name="l00308"></a>00308 <span class="comment">/** Like svn_cstring_split(), but append to existing @a array instead of</span>
<a name="l00309"></a>00309 <span class="comment"> * creating a new one. Allocate the copied substrings in @a pool</span>
<a name="l00310"></a>00310 <span class="comment"> * (i.e., caller decides whether or not to pass @a array-&gt;pool as @a pool).</span>
<a name="l00311"></a>00311 <span class="comment"> */</span>
<a name="l00312"></a>00312 <span class="keywordtype">void</span> <a class="code" href="group__svn__string__cstrings.html#gbb4be8497dbc9b869bcabefe93a08f83" title="Like svn_cstring_split(), but append to existing array instead of creating a new...">svn_cstring_split_append</a>(apr_array_header_t *array,
<a name="l00313"></a>00313 const <span class="keywordtype">char</span> *input,
<a name="l00314"></a>00314 const <span class="keywordtype">char</span> *sep_chars,
<a name="l00315"></a>00315 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> chop_whitespace,
<a name="l00316"></a>00316 apr_pool_t *pool);
<a name="l00317"></a>00317
<a name="l00318"></a>00318 <span class="comment"></span>
<a name="l00319"></a>00319 <span class="comment">/** Return @c TRUE iff @a str matches any of the elements of @a list, a list</span>
<a name="l00320"></a>00320 <span class="comment"> * of zero or more glob patterns.</span>
<a name="l00321"></a>00321 <span class="comment"> */</span>
<a name="l00322"></a>00322 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__string__cstrings.html#g550544d34961e2cbd9b50364f1b200fe" title="Return TRUE iff str matches any of the elements of list, a list of zero or more glob...">svn_cstring_match_glob_list</a>(const <span class="keywordtype">char</span> *str,
<a name="l00323"></a>00323 apr_array_header_t *list);
<a name="l00324"></a>00324 <span class="comment"></span>
<a name="l00325"></a>00325 <span class="comment">/**</span>
<a name="l00326"></a>00326 <span class="comment"> * Return the number of line breaks in @a msg, allowing any kind of newline</span>
<a name="l00327"></a>00327 <span class="comment"> * termination (CR, LF, CRLF, or LFCR), even inconsistent.</span>
<a name="l00328"></a>00328 <span class="comment"> *</span>
<a name="l00329"></a>00329 <span class="comment"> * @since New in 1.2.</span>
<a name="l00330"></a>00330 <span class="comment"> */</span>
<a name="l00331"></a>00331 <span class="keywordtype">int</span> <a class="code" href="group__svn__string__cstrings.html#g842ab6a90aecda5498232ad7dc5a3365" title="Return the number of line breaks in msg, allowing any kind of newline termination...">svn_cstring_count_newlines</a>(const <span class="keywordtype">char</span> *msg);
<a name="l00332"></a>00332 <span class="comment"></span>
<a name="l00333"></a>00333 <span class="comment">/**</span>
<a name="l00334"></a>00334 <span class="comment"> * Return a cstring which is the concatenation of @a strings (an array</span>
<a name="l00335"></a>00335 <span class="comment"> * of char *) each followed by @a separator (that is, @a separator</span>
<a name="l00336"></a>00336 <span class="comment"> * will also end the resulting string). Allocate the result in @a pool.</span>
<a name="l00337"></a>00337 <span class="comment"> * If @a strings is empty, then return the empty string.</span>
<a name="l00338"></a>00338 <span class="comment"> *</span>
<a name="l00339"></a>00339 <span class="comment"> * @since New in 1.2.</span>
<a name="l00340"></a>00340 <span class="comment"> */</span>
<a name="l00341"></a>00341 <span class="keywordtype">char</span> *
<a name="l00342"></a>00342 <a class="code" href="group__svn__string__cstrings.html#g76a5c28609bad95cf55ecb816f5831a0" title="Return a cstring which is the concatenation of strings (an array of char *) each...">svn_cstring_join</a>(apr_array_header_t *strings,
<a name="l00343"></a>00343 const <span class="keywordtype">char</span> *separator,
<a name="l00344"></a>00344 apr_pool_t *pool);
<a name="l00345"></a>00345 <span class="comment"></span>
<a name="l00346"></a>00346 <span class="comment">/**</span>
<a name="l00347"></a>00347 <span class="comment"> * Compare two strings @a atr1 and @a atr2, treating case-equivalent</span>
<a name="l00348"></a>00348 <span class="comment"> * unaccented Latin (ASCII subset) letters as equal.</span>
<a name="l00349"></a>00349 <span class="comment"> *</span>
<a name="l00350"></a>00350 <span class="comment"> * @since New in 1.5.</span>
<a name="l00351"></a>00351 <span class="comment"> */</span>
<a name="l00352"></a>00352 <span class="keywordtype">int</span> <a class="code" href="group__svn__string__cstrings.html#g33a5b549150b10cc9dae66e96062f077" title="Compare two strings atr1 and atr2, treating case-equivalent unaccented Latin (ASCII...">svn_cstring_casecmp</a>(const <span class="keywordtype">char</span> *str1, const <span class="keywordtype">char</span> *str2);
<a name="l00353"></a>00353
<a name="l00354"></a>00354 <span class="comment"></span>
<a name="l00355"></a>00355 <span class="comment">/** @} */</span>
<a name="l00356"></a>00356 <span class="comment"></span>
<a name="l00357"></a>00357 <span class="comment">/** @} */</span>
<a name="l00358"></a>00358
<a name="l00359"></a>00359
<a name="l00360"></a>00360 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00361"></a>00361 <span class="preprocessor"></span>}
<a name="l00362"></a>00362 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00363"></a>00363
<a name="l00364"></a>00364 <span class="preprocessor">#endif </span><span class="comment">/* SVN_STRING_H */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 24 16:18:25 2008 for Subversion by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>