Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 2367

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: iutil/string.h Source File (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>iutil/string.h</h1><a href="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">    Crystal Space String interface</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 1999 by Brandon Ehle (Azverkan)</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00007"></a>00007 <span class="comment">    License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment">    version 2 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment">    Library General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU Library General Public</span>
<a name="l00016"></a>00016 <span class="comment">    License along with this library; if not, write to the Free</span>
<a name="l00017"></a>00017 <span class="comment">    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00018"></a>00018 <span class="comment">*/</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef __CS_IUTIL_STRING_H__</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define __CS_IUTIL_STRING_H__</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="scf__interface_8h.html" title="Crystal Space Shared Class Facility (SCF) - interface creation support.">csutil/scf_interface.h</a>"</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00032"></a><a class="code" href="structiString.html">00032</a> <span class="keyword">struct </span><a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a>
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034   SCF_INTERFACE(<a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>, 2,1,0);
<a name="l00043"></a>00043   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#d345cc8e9e26522768f30b993d55519f" title="Advise the string that it should allocate enough space to hold up to NewSize characters...">SetCapacity</a> (<span class="keywordtype">size_t</span> NewSize) = 0;
<a name="l00045"></a>00045   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#10cc4fecc697efb1271488e3ed3e382f" title="Return the current capacity.">GetCapacity</a> () <span class="keyword">const</span> = 0;
<a name="l00046"></a>00046 
<a name="l00059"></a>00059   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#67c1e58aaacfaec8112b4a1de9a2b9ad" title="Advise the string that it should grow its allocated buffer by approximately this...">SetGrowsBy</a>(<span class="keywordtype">size_t</span>) = 0;
<a name="l00065"></a>00065   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#484d4249e0b4f8a474f81fe4e566e601" title="Return the number of bytes by which the string grows.">GetGrowsBy</a>() <span class="keyword">const</span> = 0;
<a name="l00066"></a>00066 
<a name="l00076"></a>00076   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#d239e95f431b72266848fae23df85a1d" title="Truncate the string.">Truncate</a> (<span class="keywordtype">size_t</span> Len) = 0;
<a name="l00077"></a>00077 
<a name="l00086"></a>00086   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#416840b184caf9c030582d663e793a2b" title="Set string buffer capacity to hold exactly the current content.">ShrinkBestFit</a> () = 0;
<a name="l00087"></a>00087 
<a name="l00093"></a>00093   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#4d59ea18156a41ee338751bbddb93063" title="Clear the string (so that it contains only a null terminator).">Empty</a> () = 0;
<a name="l00094"></a>00094 
<a name="l00101"></a>00101   <a class="code" href="cssysdef_8h.html#69b27a22db26f4a2bb7a26a85d2ab06b" title="A variant of CS_DEPRECATED_METHOD that also emits the message msg on compilers that...">CS_DEPRECATED_METHOD_MSG</a>(<span class="stringliteral">"Use Empty() instead"</span>)
<a name="l00102"></a>00102   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#f69fb824e112c5259027dccbdd880573" title="Clear the string (so that it contains only a null terminator).">Clear</a> () = 0;
<a name="l00103"></a>00103 
<a name="l00105"></a>00105   <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;iString&gt;</a> <a class="code" href="structiString.html#4c43904fce1fe9862b096b00153ba281" title="Get a copy of this string.">Clone</a> () <span class="keyword">const</span> = 0;
<a name="l00106"></a>00106 
<a name="l00112"></a>00112   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="structiString.html#7f60de0d77b660881ffceb9b3a7c080c" title="Get a pointer to the null-terminated character array.">GetData</a> () <span class="keyword">const</span> = 0;
<a name="l00113"></a>00113 
<a name="l00121"></a>00121   <span class="comment">/*CS_DEPRECATED_METHOD*/</span> 
<a name="l00122"></a>00122   <span class="comment">// @@@ GCC and VC always seem to prefer this GetData() and barf "deprecated".</span>
<a name="l00123"></a>00123   <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code" href="structiString.html#7f60de0d77b660881ffceb9b3a7c080c" title="Get a pointer to the null-terminated character array.">GetData</a> () = 0;
<a name="l00124"></a>00124 
<a name="l00130"></a>00130   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#675c584cd36211cc61a721a4aba24e1f" title="Query string length.">Length</a> () <span class="keyword">const</span> = 0;
<a name="l00131"></a>00131 
<a name="l00137"></a>00137   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#8ef2056f7333757c715a741e4eeb39f1" title="Check if string is empty.">IsEmpty</a> () <span class="keyword">const</span> = 0;
<a name="l00138"></a>00138 
<a name="l00140"></a>00140   <span class="keyword">virtual</span> <span class="keywordtype">char</span>&amp; <a class="code" href="structiString.html#d7be85ec8345c6d24672f68fab54da6e" title="Get a modifiable reference to n&amp;#39;th character.">operator [] </a>(<span class="keywordtype">size_t</span> n) = 0;
<a name="l00141"></a>00141 
<a name="l00143"></a>00143   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <a class="code" href="structiString.html#d7be85ec8345c6d24672f68fab54da6e" title="Get a modifiable reference to n&amp;#39;th character.">operator [] </a>(<span class="keywordtype">size_t</span> n) <span class="keyword">const</span> = 0;
<a name="l00144"></a>00144 
<a name="l00151"></a>00151   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#c8e84f39b34c626c2a32450306365f76" title="Set the n&amp;#39;th character.">SetAt</a> (<span class="keywordtype">size_t</span> n, <span class="keywordtype">char</span> iChar) = 0;
<a name="l00152"></a>00152 
<a name="l00154"></a>00154   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <a class="code" href="structiString.html#04ce763f7281b25a72909fbe74c0444f" title="Get the n&amp;#39;th character.">GetAt</a> (<span class="keywordtype">size_t</span> n) <span class="keyword">const</span> = 0;
<a name="l00155"></a>00155 
<a name="l00161"></a>00161   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#5386914283741d53c47be4a151d34722" title="Delete a range of characters from the string.">DeleteAt</a> (<span class="keywordtype">size_t</span> Pos, <span class="keywordtype">size_t</span> Count = 1) = 0;
<a name="l00162"></a>00162 
<a name="l00168"></a>00168   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#b716081108324542a10f3193205baeb3" title="Insert another string into this one.">Insert</a> (<span class="keywordtype">size_t</span> Pos, <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a> <span class="keyword">const</span>* Str) = 0;
<a name="l00169"></a>00169 
<a name="l00177"></a>00177   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#2e48e1cef04cf9219ab1cee17ed1bb2f" title="Overlay another string onto a part of this string.">Overwrite</a> (<span class="keywordtype">size_t</span> Pos, <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a> <span class="keyword">const</span>* Str) = 0;
<a name="l00178"></a>00178 
<a name="l00185"></a>00185   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#e055fa1d0307874e02f3f9c36d11e723" title="Append a null-terminated C-string to this one.">Append</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* Str, <span class="keywordtype">size_t</span> Count = (<span class="keywordtype">size_t</span>)-1) = 0;
<a name="l00186"></a>00186 
<a name="l00193"></a>00193   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#e055fa1d0307874e02f3f9c36d11e723" title="Append a null-terminated C-string to this one.">Append</a> (<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* Str, <span class="keywordtype">size_t</span> Count = (<span class="keywordtype">size_t</span>)-1) = 0;
<a name="l00194"></a>00194 
<a name="l00201"></a>00201   <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;iString&gt;</a> <a class="code" href="structiString.html#661cbed557193f210c5f640136884634" title="Copy and return a portion of this string.">Slice</a> (<span class="keywordtype">size_t</span> start, <span class="keywordtype">size_t</span> len) <span class="keyword">const</span> = 0;
<a name="l00202"></a>00202 
<a name="l00213"></a>00213   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#c6969d095ee0033e6072fd4d4226a2aa" title="Copy a portion of this string.">SubString</a> (<a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* sub, <span class="keywordtype">size_t</span> start, <span class="keywordtype">size_t</span> len) <span class="keyword">const</span> = 0;
<a name="l00214"></a>00214 
<a name="l00221"></a>00221   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#1019101394669173ef37e20439d73acc" title="Find the first occurrence of a character in the string.">FindFirst</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> c, <span class="keywordtype">size_t</span> p = (<span class="keywordtype">size_t</span>)-1) <span class="keyword">const</span> = 0;
<a name="l00222"></a>00222 
<a name="l00230"></a>00230   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#0c494ebc6e74c89ad4bb59821232cb04" title="Find the last occurrence of a character in the string.">FindLast</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> c, <span class="keywordtype">size_t</span> p = (<span class="keywordtype">size_t</span>)-1) <span class="keyword">const</span> = 0;
<a name="l00231"></a>00231   
<a name="l00238"></a>00238   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="structiString.html#3402e6294ec7339f201591fbd9b0260d" title="Find the first occurrence of search in this string starting at pos.">Find</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* search, <span class="keywordtype">size_t</span> pos = 0) <span class="keyword">const</span> = 0;
<a name="l00239"></a>00239 
<a name="l00244"></a>00244   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#b6f7e821c3e12194b60f110b5c8b4038" title="Find all occurrences of search in this string and replace them with replacement.">ReplaceAll</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* search, <span class="keyword">const</span> <span class="keywordtype">char</span>* replacement) = 0;
<a name="l00245"></a>00245 
<a name="l00252"></a>00252   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#22359fa73fe1bb3e07eb747ce56f6869" title="Format this string using sprintf()-style formatting directives.">Format</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* format, ...) <a class="code" href="cssysdef_8h.html#8e48e51430e3babbaf943b676c17ec31">CS_GNUC_PRINTF</a> (2, 3) = 0;
<a name="l00253"></a>00253 
<a name="l00261"></a>00261   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#b6869ad4b59789f5247afb255d4cdcc9" title="Format this string using sprintf() formatting directives in a va_list.">FormatV</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* format, va_list args) = 0;
<a name="l00262"></a>00262 
<a name="l00269"></a>00269   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#46f8bb3eacb44e2c2766dc186f62538e" title="Replace contents of this string with the contents of another.">Replace</a> (<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* str, <span class="keywordtype">size_t</span> count = (<span class="keywordtype">size_t</span>)-1) = 0;
<a name="l00270"></a>00270 
<a name="l00277"></a>00277   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#46f8bb3eacb44e2c2766dc186f62538e" title="Replace contents of this string with the contents of another.">Replace</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* str, <span class="keywordtype">size_t</span> count = (<span class="keywordtype">size_t</span>)-1) = 0;
<a name="l00278"></a>00278 
<a name="l00285"></a>00285   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#083d4efc376c21039df973010f0bd6db" title="Check if another string is equal to this one.">Compare</a> (<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* Str) <span class="keyword">const</span> = 0;
<a name="l00286"></a>00286 
<a name="l00293"></a>00293   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#eb9e3eff117b5cba3db704e6b258f71a" title="Check if another string is equal to this one.">CompareNoCase</a> (<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* Str) <span class="keyword">const</span> = 0;
<a name="l00294"></a>00294 
<a name="l00301"></a>00301   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#1ac32424bcc4b9663c01293b2b5bdc43" title="Check if this string starts with another one.">StartsWith</a> (<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* Str, <span class="keywordtype">bool</span> ignore_case = <span class="keyword">false</span>) <span class="keyword">const</span> = 0;
<a name="l00302"></a>00302 
<a name="l00309"></a>00309   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#1ac32424bcc4b9663c01293b2b5bdc43" title="Check if this string starts with another one.">StartsWith</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* Str, <span class="keywordtype">bool</span> ignore_case = <span class="keyword">false</span>) <span class="keyword">const</span> = 0;
<a name="l00310"></a>00310 
<a name="l00312"></a>00312   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#ca1ce34729c9c5f5f87e5651358d0fb4" title="Append another string to this one.">operator += </a>(<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>&amp; iStr) = 0;
<a name="l00313"></a>00313 
<a name="l00315"></a>00315   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#ca1ce34729c9c5f5f87e5651358d0fb4" title="Append another string to this one.">operator += </a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* iStr) = 0;
<a name="l00316"></a>00316 
<a name="l00318"></a>00318   <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;iString&gt;</a> <a class="code" href="structiString.html#2bd3eac0180b2795bc9e949924934588" title="Concatenate two strings and return a third one.">operator + </a>(<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>&amp; iStr) <span class="keyword">const</span> = 0;
<a name="l00319"></a>00319 
<a name="l00325"></a>00325   <span class="keyword">virtual</span> <a class="code" href="structiString.html#6306686a4a7afab5dc860e5aa339c914" title="Get a pointer to the null-terminated character array.">operator char const* </a>() <span class="keyword">const</span> = 0;
<a name="l00326"></a>00326 
<a name="l00333"></a>00333   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#6e01a318e2f516f3a117466749ae6c1a" title="Check if another string is equal to this one.">operator == </a>(<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>&amp; Str) <span class="keyword">const</span> = 0;
<a name="l00334"></a>00334 
<a name="l00341"></a>00341   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiString.html#5a2022e4ecb51110ae85ad18ad0e78be" title="Check if another string is not equal to this one.">operator != </a>(<span class="keyword">const</span> <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>&amp; Str) <span class="keyword">const</span> = 0;
<a name="l00342"></a>00342 
<a name="l00344"></a>00344   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#80455dc99087c820610b6603dc066851" title="Convert string to lowercase.">Downcase</a>() = 0;
<a name="l00345"></a>00345 
<a name="l00347"></a>00347   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiString.html#b8b46e78ed67e5b4661b70fcff6d1fb2" title="Convert string to uppercase.">Upcase</a>() = 0;
<a name="l00348"></a>00348 };
<a name="l00349"></a>00349 
<a name="l00352"></a>00352 <span class="preprocessor">#endif // __CS_IUTIL_STRING_H__</span>
</pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>