1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3<title>oscl_str_ptr_len.h Source File</title> 4<link href="doxygen.css" rel="stylesheet" type="text/css"> 5</head><body> 6<!-- Generated by Doxygen 1.2.18 --> 7<center> 8<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> 9<hr><h1>oscl_str_ptr_len.h</h1><a href="oscl__str__ptr__len_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> 1000002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1100003 1200004 <span class="comment">// O S C L _ S T R _ P T R _ L E N</span> 1300005 1400006 <span class="comment">// This file contains C-based data structure definitions for string</span> 1500007 <span class="comment">// manipulations.</span> 1600008 1700009 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1800010 1900022 <span class="preprocessor">#ifndef OSCL_STR_PTR_LEN_H_INCLUDED</span> 2000023 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_STR_PTR_LEN_H_INCLUDED</span> 2100024 <span class="preprocessor"></span> 2200025 <span class="comment">// - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span> 2300026 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span> 2400027 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span> 2500028 <span class="preprocessor">#endif</span> 2600029 <span class="preprocessor"></span> 2700030 <span class="preprocessor">#ifndef OSCL_STDSTRING_H_INCLUDED</span> 2800031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__stdstring_8h.html">oscl_stdstring.h</a>"</span> 2900032 <span class="preprocessor">#endif</span> 3000033 <span class="preprocessor"></span> 3100034 <span class="comment">//#ifndef OSCL_TYPES_H_INCLUDED</span> 3200035 <span class="comment">//#include "oscl_types.h"</span> 3300036 <span class="comment">//#endif</span> 3400037 3500038 <span class="comment">// - - Definitions - - - - - - - - - - - - - - - - - - - - - - - - - - -</span> 3600039 3700040 <span class="comment">// this is the XOR difference between any two ascii letters, 32</span> 38<a name="l00041"></a><a class="code" href="group__osclutil.html#a4">00041</a> <span class="keyword">const</span> uint8 <a class="code" href="group__osclutil.html#a4">OSCL_ASCII_CASE_MAGIC_BIT</a> = 0x20; 3900042 4000044 41<a name="l00047"></a><a class="code" href="structStrPtrLen.html">00047</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structStrPtrLen.html">StrPtrLen</a> 4200048 { 4300049 <span class="keyword">protected</span>: 44<a name="l00050"></a><a class="code" href="structStrPtrLen.html#n0">00050</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="structStrPtrLen.html#n0">ptr</a>; 45<a name="l00051"></a><a class="code" href="structStrPtrLen.html#n1">00051</a> int32 <a class="code" href="structStrPtrLen.html#n1">len</a>; 4600052 47<a name="l00053"></a><a class="code" href="structStrPtrLen.html#b0">00053</a> <span class="keywordtype">bool</span> <a class="code" href="structStrPtrLen.html#b0">isLetter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> c)<span class="keyword"> const</span> 4800054 <span class="keyword"> </span>{ 4900055 <span class="keywordflow">return</span> ((c >= 65 && c <= 90) || (c >= 97 && c <= 122)); 5000056 } 5100057 5200058 <span class="keyword">public</span>: 5300059 54<a name="l00060"></a><a class="code" href="structStrPtrLen.html#a0">00060</a> <a class="code" href="structStrPtrLen.html#a2">StrPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr) 5500061 : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(newPtr) 5600062 { 5700063 <a class="code" href="structStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(newPtr); 5800064 } 5900065 60<a name="l00066"></a><a class="code" href="structStrPtrLen.html#a1">00066</a> <a class="code" href="structStrPtrLen.html#a2">StrPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr, uint32 newLen) 6100067 : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(newPtr), <a class="code" href="structStrPtrLen.html#n1">len</a>(newLen) 6200068 {} 6300069 64<a name="l00070"></a><a class="code" href="structStrPtrLen.html#a2">00070</a> <a class="code" href="structStrPtrLen.html#a2">StrPtrLen</a>() 6500071 : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(""), <a class="code" href="structStrPtrLen.html#n1">len</a>(0) 6600072 {} 6700073 68<a name="l00074"></a><a class="code" href="structStrPtrLen.html#a3">00074</a> <a class="code" href="structStrPtrLen.html#a2">StrPtrLen</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs) 6900075 : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>), <a class="code" href="structStrPtrLen.html#n1">len</a>(rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>) 7000076 {} 7100077 72<a name="l00078"></a><a class="code" href="structStrPtrLen.html#a4">00078</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="structStrPtrLen.html#a4">c_str</a>()<span class="keyword"> const</span> 7300079 <span class="keyword"> </span>{ 7400080 <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n0">ptr</a>; 7500081 } 7600082 77<a name="l00083"></a><a class="code" href="structStrPtrLen.html#a5">00083</a> int32 <a class="code" href="structStrPtrLen.html#a5">length</a>()<span class="keyword"> const</span> 7800084 <span class="keyword"> </span>{ 7900085 <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n1">len</a>; 8000086 } 8100087 82<a name="l00088"></a><a class="code" href="structStrPtrLen.html#a6">00088</a> int32 <a class="code" href="structStrPtrLen.html#a6">size</a>()<span class="keyword"> const</span> 8300089 <span class="keyword"> </span>{ 8400090 <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n1">len</a>; 8500091 } 8600092 87<a name="l00093"></a><a class="code" href="structStrPtrLen.html#a7">00093</a> <span class="keywordtype">void</span> <a class="code" href="structStrPtrLen.html#a7">setPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr, uint32 newLen) 8800094 { 8900095 <a class="code" href="structStrPtrLen.html#n0">ptr</a> = newPtr; 9000096 <a class="code" href="structStrPtrLen.html#n1">len</a> = newLen; 9100097 } 9200098 93<a name="l00099"></a><a class="code" href="structStrPtrLen.html#a8">00099</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structStrPtrLen.html#a8">isCIEquivalentTo</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs)<span class="keyword"> const</span> 9400100 <span class="keyword"> </span>{ 9500101 <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>) 9600102 { 9700103 <span class="keywordflow">return</span> <span class="keyword">false</span>; 9800104 } 9900105 <span class="comment">// since they are the same length just check for the prefix condition</span> 10000106 <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#a9">isCIPrefixOf</a>(rhs); 10100107 } 10200108 103<a name="l00109"></a><a class="code" href="structStrPtrLen.html#a9">00109</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structStrPtrLen.html#a9">isCIPrefixOf</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs)<span class="keyword"> const</span> 10400110 <span class="keyword"> </span>{ 10500111 <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> > rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>) 10600112 { 10700113 <span class="keywordflow">return</span> <span class="keyword">false</span>; 10800114 } 10900115 11000116 <span class="keywordflow">for</span> (int32 ii = 0; ii < <a class="code" href="structStrPtrLen.html#n1">len</a>; ++ii) 11100117 { 11200118 <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii] != rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii]) 11300119 { 11400120 <span class="keywordflow">if</span> (!<a class="code" href="structStrPtrLen.html#b0">isLetter</a>(<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii]) || 11500121 (<a class="code" href="group__osclutil.html#a4">OSCL_ASCII_CASE_MAGIC_BIT</a> != ((<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii] ^ rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii]) | <a class="code" href="group__osclutil.html#a4">OSCL_ASCII_CASE_MAGIC_BIT</a>))) 11600122 { 11700123 <span class="keywordflow">return</span> <span class="keyword">false</span>; 11800124 } 11900125 } 12000126 } 12100127 <span class="keywordflow">return</span> <span class="keyword">true</span>; 12200128 } 12300129 124<a name="l00130"></a><a class="code" href="structStrPtrLen.html#a10">00130</a> int32 <a class="code" href="structStrPtrLen.html#a10">operator==</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs)<span class="keyword"> const</span> 12500131 <span class="keyword"> </span>{ 12600132 <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>) 12700133 { 12800134 <span class="comment">//return (!(len-rhs.len));</span> 12900135 <span class="keywordflow">return</span> <span class="keyword">false</span>; 13000136 } 13100137 13200138 <span class="keywordflow">return</span>(!<a class="code" href="group__osclbase.html#a49">oscl_strncmp</a>(<a class="code" href="structStrPtrLen.html#n0">ptr</a>, rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>, rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>)); 13300139 } 13400140 135<a name="l00141"></a><a class="code" href="structStrPtrLen.html#a11">00141</a> int32 <a class="code" href="structStrPtrLen.html#a11">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs)<span class="keyword"> const</span> 13600142 <span class="keyword"> </span>{ 13700143 <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs); 13800144 } 13900145 140<a name="l00146"></a><a class="code" href="structStrPtrLen.html#a12">00146</a> <a class="code" href="structStrPtrLen.html">StrPtrLen</a> &<a class="code" href="structStrPtrLen.html#a12">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs) 14100147 { 14200148 this-><a class="code" href="structStrPtrLen.html#n0">ptr</a> = rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>; 14300149 this-><a class="code" href="structStrPtrLen.html#n1">len</a> = rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>; 14400150 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 14500151 } 14600152 147<a name="l00153"></a><a class="code" href="structStrPtrLen.html#a13">00153</a> <a class="code" href="structStrPtrLen.html">StrPtrLen</a> &<a class="code" href="structStrPtrLen.html#a12">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* rhs) 14800154 { 14900155 this-><a class="code" href="structStrPtrLen.html#n0">ptr</a> = rhs; 15000156 this-><a class="code" href="structStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(rhs); 15100157 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 15200158 } 15300159 15400160 } <a class="code" href="structStrPtrLen.html">StrPtrLen</a>; 15500161 15600163 157<a name="l00166"></a><a class="code" href="structWStrPtrLen.html">00166</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structWStrPtrLen.html">WStrPtrLen</a> 15800167 { 15900168 <span class="keyword">protected</span>: 160<a name="l00169"></a><a class="code" href="structWStrPtrLen.html#n0">00169</a> <span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* <a class="code" href="structWStrPtrLen.html#n0">ptr</a>; 161<a name="l00170"></a><a class="code" href="structWStrPtrLen.html#n1">00170</a> int32 <a class="code" href="structWStrPtrLen.html#n1">len</a>; 16200171 16300172 <span class="keyword">public</span>: 16400173 165<a name="l00174"></a><a class="code" href="structWStrPtrLen.html#a0">00174</a> <a class="code" href="structWStrPtrLen.html#a2">WStrPtrLen</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* newPtr) 16600175 : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(newPtr) 16700176 { 16800177 <a class="code" href="structWStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(newPtr); 16900178 } 17000179 171<a name="l00180"></a><a class="code" href="structWStrPtrLen.html#a1">00180</a> <a class="code" href="structWStrPtrLen.html#a2">WStrPtrLen</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* newPtr, uint32 newLen) 17200181 : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(newPtr), <a class="code" href="structWStrPtrLen.html#n1">len</a>(newLen) 17300182 {} 17400183 175<a name="l00184"></a><a class="code" href="structWStrPtrLen.html#a2">00184</a> <a class="code" href="structWStrPtrLen.html#a2">WStrPtrLen</a>() 17600185 : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(<a class="code" href="group__osclbase.html#a81">NULL</a>), <a class="code" href="structWStrPtrLen.html#n1">len</a>(0) 17700186 {} 17800187 179<a name="l00188"></a><a class="code" href="structWStrPtrLen.html#a3">00188</a> <a class="code" href="structWStrPtrLen.html#a2">WStrPtrLen</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& rhs) 18000189 : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(rhs.<a class="code" href="structWStrPtrLen.html#n0">ptr</a>), <a class="code" href="structWStrPtrLen.html#n1">len</a>(rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>) 18100190 {} 18200191 183<a name="l00192"></a><a class="code" href="structWStrPtrLen.html#a4">00192</a> <span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* <a class="code" href="structWStrPtrLen.html#a4">c_str</a>()<span class="keyword"> const</span> 18400193 <span class="keyword"> </span>{ 18500194 <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n0">ptr</a>; 18600195 } 18700196 188<a name="l00197"></a><a class="code" href="structWStrPtrLen.html#a5">00197</a> int32 <a class="code" href="structWStrPtrLen.html#a5">length</a>()<span class="keyword"> const</span> 18900198 <span class="keyword"> </span>{ 19000199 <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n1">len</a>; 19100200 } 19200201 193<a name="l00202"></a><a class="code" href="structWStrPtrLen.html#a6">00202</a> int32 <a class="code" href="structWStrPtrLen.html#a6">size</a>()<span class="keyword"> const</span> 19400203 <span class="keyword"> </span>{ 19500204 <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n1">len</a>; 19600205 } 19700206 198<a name="l00207"></a><a class="code" href="structWStrPtrLen.html#a7">00207</a> <span class="keywordtype">void</span> <a class="code" href="structWStrPtrLen.html#a7">setPtrLen</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* newPtr, uint32 newLen) 19900208 { 20000209 <a class="code" href="structWStrPtrLen.html#n0">ptr</a> = newPtr; 20100210 <a class="code" href="structWStrPtrLen.html#n1">len</a> = newLen; 20200211 } 20300212 204<a name="l00213"></a><a class="code" href="structWStrPtrLen.html#a8">00213</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structWStrPtrLen.html#a8">isCIEquivalentTo</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& rhs)<span class="keyword"> const</span> 20500214 <span class="keyword"> </span>{ 20600215 <span class="keywordflow">if</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>) 20700216 { 20800217 <span class="keywordflow">return</span> <span class="keyword">false</span>; 20900218 } 21000219 21100220 <span class="keywordflow">for</span> (int32 ii = 0; ii < <a class="code" href="structWStrPtrLen.html#n1">len</a>; ++ii) 21200221 { 21300222 <span class="keywordflow">if</span> (<a class="code" href="group__osclutil.html#a4">OSCL_ASCII_CASE_MAGIC_BIT</a> != ((<a class="code" href="structWStrPtrLen.html#n0">ptr</a>[ii] ^ rhs.<a class="code" href="structWStrPtrLen.html#n0">ptr</a>[ii]) | <a class="code" href="group__osclutil.html#a4">OSCL_ASCII_CASE_MAGIC_BIT</a>)) 21400223 { 21500224 <span class="keywordflow">return</span> <span class="keyword">false</span>; 21600225 } 21700226 } 21800227 21900228 <span class="keywordflow">return</span> <span class="keyword">true</span>; 22000229 } 22100230 222<a name="l00231"></a><a class="code" href="structWStrPtrLen.html#a9">00231</a> int32 <a class="code" href="structWStrPtrLen.html#a9">operator==</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& rhs)<span class="keyword"> const</span> 22300232 <span class="keyword"> </span>{ 22400233 <span class="keywordflow">if</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>) 22500234 { 22600235 <span class="keywordflow">return</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> -rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>); 22700236 } 22800237 <span class="keywordflow">return</span>(!<a class="code" href="group__osclbase.html#a49">oscl_strncmp</a>(<a class="code" href="structWStrPtrLen.html#n0">ptr</a>, rhs.<a class="code" href="structWStrPtrLen.html#n0">ptr</a>, rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>)); 22900238 } 23000239 231<a name="l00240"></a><a class="code" href="structWStrPtrLen.html#a10">00240</a> int32 <a class="code" href="structWStrPtrLen.html#a10">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& rhs)<span class="keyword"> const</span> 23200241 <span class="keyword"> </span>{ 23300242 <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs); 23400243 } 23500244 236<a name="l00245"></a><a class="code" href="structWStrPtrLen.html#a11">00245</a> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& <a class="code" href="structWStrPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& rhs) 23700246 { 23800247 this-><a class="code" href="structWStrPtrLen.html#n0">ptr</a> = rhs.<a class="code" href="structWStrPtrLen.html#n0">ptr</a>; 23900248 this-><a class="code" href="structWStrPtrLen.html#n1">len</a> = rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>; 24000249 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 24100250 } 24200251 243<a name="l00252"></a><a class="code" href="structWStrPtrLen.html#a12">00252</a> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>& <a class="code" href="structWStrPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a>* rhs) 24400253 { 24500254 this-><a class="code" href="structWStrPtrLen.html#n0">ptr</a> = rhs; 24600255 this-><a class="code" href="structWStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(rhs); 24700256 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 24800257 } 24900258 25000259 } <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>; 25100260 252<a name="l00262"></a><a class="code" href="structStrCSumPtrLen.html">00262</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a> : <span class="keyword">public</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a> 25300263 { 25400264 <span class="keyword">public</span>: 255<a name="l00265"></a><a class="code" href="structStrCSumPtrLen.html#s0">00265</a> <span class="keyword">typedef</span> int16 <a class="code" href="structStrCSumPtrLen.html#s0">CheckSumType</a>; 25600266 25700267 <span class="keyword">protected</span>: 258<a name="l00268"></a><a class="code" href="structStrCSumPtrLen.html#n0">00268</a> <a class="code" href="structStrCSumPtrLen.html#s0">CheckSumType</a> <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>; 25900269 26000270 <span class="keyword">public</span>: 26100271 262<a name="l00272"></a><a class="code" href="structStrCSumPtrLen.html#a0">00272</a> <span class="keywordtype">void</span> <a class="code" href="structStrCSumPtrLen.html#a0">setPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr, uint32 newLen) 26300273 { 26400274 <a class="code" href="structStrPtrLen.html#a7">StrPtrLen::setPtrLen</a>(newPtr, newLen); 26500275 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 26600276 } 26700277 268<a name="l00278"></a><a class="code" href="structStrCSumPtrLen.html#a1">00278</a> <a class="code" href="structStrCSumPtrLen.html#s0">CheckSumType</a> <a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>()<span class="keyword"> const</span> 26900279 <span class="keyword"> </span>{ 27000280 <span class="keywordflow">return</span> <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>; 27100281 } 27200282 27300283 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 27400284 275<a name="l00285"></a><a class="code" href="structStrCSumPtrLen.html#a3">00285</a> <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>() 27600286 : <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>(0) 27700287 {} 27800288 279<a name="l00289"></a><a class="code" href="structStrCSumPtrLen.html#a4">00289</a> <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr) 28000290 : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(newPtr) 28100291 { 28200292 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 28300293 } 28400294 285<a name="l00295"></a><a class="code" href="structStrCSumPtrLen.html#a5">00295</a> <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* newPtr, uint32 newLen) 28600296 : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(newPtr, newLen) 28700297 { 28800298 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 28900299 } 29000300 291<a name="l00301"></a><a class="code" href="structStrCSumPtrLen.html#a6">00301</a> <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& rhs) 29200302 : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(rhs), <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>(rhs.<a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>) 29300303 {} 29400304 295<a name="l00305"></a><a class="code" href="structStrCSumPtrLen.html#a7">00305</a> <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a> & rhs) 29600306 : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(rhs) 29700307 { 29800308 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 29900309 } 30000310 30100311 302<a name="l00312"></a><a class="code" href="structStrCSumPtrLen.html#a8">00312</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structStrCSumPtrLen.html#a8">isCIEquivalentTo</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& rhs)<span class="keyword"> const</span> 30300313 <span class="keyword"> </span>{ 30400314 <span class="keywordflow">if</span> (<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>() != rhs.<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>()) 30500315 { 30600316 <span class="keywordflow">return</span> <span class="keyword">false</span>; 30700317 } 30800318 30900319 <span class="keywordflow">return</span> static_cast<const StrPtrLen&>(*this).isCIEquivalentTo( 31000320 static_cast<const StrPtrLen&>(rhs)); 31100321 } 31200322 313<a name="l00323"></a><a class="code" href="structStrCSumPtrLen.html#a9">00323</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structStrCSumPtrLen.html#a9">operator==</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& rhs)<span class="keyword"> const</span> 31400324 <span class="keyword"> </span>{ 31500325 <span class="keywordflow">if</span> (<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>() != rhs.<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>()) 31600326 { 31700327 <span class="keywordflow">return</span> <span class="keyword">false</span>; 31800328 } 31900329 32000330 <span class="keywordflow">return</span> (static_cast<const StrPtrLen&>(*this) 32100331 == static_cast<const StrPtrLen&>(rhs)); 32200332 } 32300333 324<a name="l00334"></a><a class="code" href="structStrCSumPtrLen.html#a10">00334</a> <a class="code" href="group__osclbase.html#a24">c_bool</a> <a class="code" href="structStrCSumPtrLen.html#a10">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& rhs)<span class="keyword"> const</span> 32500335 <span class="keyword"> </span>{ 32600336 <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs); 32700337 } 32800338 329<a name="l00339"></a><a class="code" href="structStrCSumPtrLen.html#a11">00339</a> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& rhs) 33000340 { 33100341 <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs); 33200342 this-><a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a> = rhs.<a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>; 33300343 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 33400344 } 33500345 336<a name="l00346"></a><a class="code" href="structStrCSumPtrLen.html#a12">00346</a> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>& rhs) 33700347 { 33800348 <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs); 33900349 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 34000350 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 34100351 } 34200352 343<a name="l00353"></a><a class="code" href="structStrCSumPtrLen.html#a13">00353</a> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>& <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* rhs) 34400354 { 34500355 <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs); 34600356 <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>(); 34700357 <span class="keywordflow">return</span> *<span class="keyword">this</span>; 34800358 } 34900359 35000360 } <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>; 35100361 35200362 <span class="comment">// Set character code to UNICODE</span> 353<a name="l00363"></a><a class="code" href="group__osclutil.html#a8">00363</a> <span class="keyword">typedef</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a> <a class="code" href="structWStrPtrLen.html">OSCL_TStrPtrLen</a>; 35400364 35500365 <span class="preprocessor">#endif // OSCL_STR_PTR_LEN_H_INCLUDED</span> 35600366 <span class="preprocessor"></span> 357</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 358<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 359</small></address> 360</body> 361</html> 362