<!-- iframe showing the search results (closed by default) -->
<divid="MSearchResultsWindow">
<iframesrc="javascript:void(0)"frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<divclass="header">
<divclass="headertitle">
<divclass="title">charbuf.cpp</div></div>
</div><!--header-->
<divclass="contents">
<ahref="charbuf_8cpp.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> * Copyright (c) 2015-2017 Carsten Sonne Larsen <cs@innolan.dk></span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> * All rights reserved.</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * Redistribution and use in source and binary forms, with or without</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> * modification, are permitted provided that the following conditions</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * are met:</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> * 1. Redistributions of source code must retain the above copyright</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer.</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer in the</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> * documentation and/or other materials provided with the distribution.</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment"> * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span>
<divclass="ttc"id="classCharBuffer_html_a64988275bda43dddb6d2b3b9551cefb0"><divclass="ttname"><ahref="classCharBuffer.html#a64988275bda43dddb6d2b3b9551cefb0">CharBuffer::Is</a></div><divclass="ttdeci">bool Is(const char *string)</div><divclass="ttdoc">Compare content of CharBuffer with string) </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00163">charbuf.cpp:163</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a36d153c126a018c5090374ccb5c37508"><divclass="ttname"><ahref="classCharBuffer.html#a36d153c126a018c5090374ccb5c37508">CharBuffer::CharBuffer</a></div><divclass="ttdeci">CharBuffer(unsigned int size)</div><divclass="ttdoc">Initialize while allocating specified amount of memory. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00049">charbuf.cpp:49</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a0bcdd5708db4b04c887224e83a05086f"><divclass="ttname"><ahref="classCharBuffer.html#a0bcdd5708db4b04c887224e83a05086f">CharBuffer::ClearBuffer</a></div><divclass="ttdeci">void ClearBuffer()</div><divclass="ttdoc">Release memory in buffer. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00065">charbuf.cpp:65</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a4345e9a5114f5c0292e8f242f26e3a7b"><divclass="ttname"><ahref="classCharBuffer.html#a4345e9a5114f5c0292e8f242f26e3a7b">CharBuffer::CharBuffer</a></div><divclass="ttdeci">CharBuffer()</div><divclass="ttdoc">Initialize without allocating memory. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00038">charbuf.cpp:38</a></div></div>
<divclass="ttc"id="strcmp_8c_html_a2a1f39d11cbbaac992d42e67557dac4b"><divclass="ttname"><ahref="strcmp_8c.html#a2a1f39d11cbbaac992d42e67557dac4b">StrIsEqual</a></div><divclass="ttdeci">bool StrIsEqual(const char *s1, const char *s2)</div><divclass="ttdoc">Compare two null terminated strings to each other. </div><divclass="ttdef"><b>Definition:</b><ahref="strcmp_8c_source.html#l00049">strcmp.c:49</a></div></div>
<divclass="ttc"id="alloccpy_8c_html_a5bed05c70cb17e541fee570b5dc32e1a"><divclass="ttname"><ahref="alloccpy_8c.html#a5bed05c70cb17e541fee570b5dc32e1a">AllocAndCopy</a></div><divclass="ttdeci">unsigned int AllocAndCopy(char **destination, const char *source)</div><divclass="ttdoc">Allocate memory and copy a string into the array. </div><divclass="ttdef"><b>Definition:</b><ahref="alloccpy_8c_source.html#l00034">alloccpy.c:34</a></div></div>
<divclass="ttc"id="classCharBuffer_html_ac3265c68505802fbe8b590d5a423b0d0"><divclass="ttname"><ahref="classCharBuffer.html#ac3265c68505802fbe8b590d5a423b0d0">CharBuffer::cursize</a></div><divclass="ttdeci">unsigned int cursize</div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8h_source.html#l00078">charbuf.h:78</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a73c71d361110b37819a1d681a1504b0e"><divclass="ttname"><ahref="classCharBuffer.html#a73c71d361110b37819a1d681a1504b0e">CharBuffer::EnsureGrowth</a></div><divclass="ttdeci">void EnsureGrowth(unsigned int size)</div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00158">charbuf.cpp:158</a></div></div>
<divclass="ttc"id="clib_8h_html_a67ec56eb98b49515d35005a5b3bf9a32"><divclass="ttname"><ahref="clib_8h.html#a67ec56eb98b49515d35005a5b3bf9a32">StrLen</a></div><divclass="ttdeci">int StrLen(const char *string)</div><divclass="ttdoc">Get the length of a null terminated string. </div><divclass="ttdef"><b>Definition:</b><ahref="strlen_8c_source.html#l00031">strlen.c:31</a></div></div>
<divclass="ttc"id="classCharBuffer_html_ac52ed7b91190240eb7db4cf43d1e2abb"><divclass="ttname"><ahref="classCharBuffer.html#ac52ed7b91190240eb7db4cf43d1e2abb">CharBuffer::ClearAndCopy</a></div><divclass="ttdeci">void ClearAndCopy(const char *source)</div><divclass="ttdoc">Release memory, allocate and copy source. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00080">charbuf.cpp:80</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a91ce4f4083b9a29c48f75e2af4071f28"><divclass="ttname"><ahref="classCharBuffer.html#a91ce4f4083b9a29c48f75e2af4071f28">CharBuffer::EnsureSize</a></div><divclass="ttdeci">void EnsureSize(unsigned int blocksize, unsigned int blocks)</div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00139">charbuf.cpp:139</a></div></div>
<divclass="ttc"id="classCharBuffer_html_af0db379281b7f3f8b4746344521999c1"><divclass="ttname"><ahref="classCharBuffer.html#af0db379281b7f3f8b4746344521999c1">CharBuffer::Append</a></div><divclass="ttdeci">void Append(const char c, unsigned int count)</div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00200">charbuf.cpp:200</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a42fcc0397a2d7cb6d412a124de076aff"><divclass="ttname"><ahref="classCharBuffer.html#a42fcc0397a2d7cb6d412a124de076aff">CharBuffer::minimumSize</a></div><divclass="ttdeci">static const unsigned int minimumSize</div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8h_source.html#l00079">charbuf.h:79</a></div></div>
<divclass="ttc"id="classCharBuffer_html"><divclass="ttname"><ahref="classCharBuffer.html">CharBuffer</a></div><divclass="ttdoc">Encapsulate an character array which can be used as a string. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8h_source.html#l00043">charbuf.h:43</a></div></div>
<divclass="ttc"id="classCharBuffer_html_ad1907009b5ad136692b989fa96bf2f7e"><divclass="ttname"><ahref="classCharBuffer.html#ad1907009b5ad136692b989fa96bf2f7e">CharBuffer::EnsureSize</a></div><divclass="ttdeci">void EnsureSize(unsigned int size)</div><divclass="ttdoc">Ensure a memory block of speficied size is allocated. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00112">charbuf.cpp:112</a></div></div>
<divclass="ttc"id="classCharBuffer_html_a8c0927c2c05c954161151045f68581c6"><divclass="ttname"><ahref="classCharBuffer.html#a8c0927c2c05c954161151045f68581c6">CharBuffer::ClearAndAlloc</a></div><divclass="ttdeci">void ClearAndAlloc(unsigned int size)</div><divclass="ttdoc">Release memory and allocate new size. </div><divclass="ttdef"><b>Definition:</b><ahref="charbuf_8cpp_source.html#l00091">charbuf.cpp:91</a></div></div>