aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__str__ptr__len_8h-source.html
blob: 5d13e6bca1e0a346f0dc843afc4c42a99fba9706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!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>oscl_str_ptr_len.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<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>
00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
00003 
00004 <span class="comment">//               O S C L _ S T R _ P T R _ L E N</span>
00005 
00006 <span class="comment">//    This file contains C-based data structure definitions for string</span>
00007 <span class="comment">//    manipulations.</span>
00008 
00009 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
00010 
00022 <span class="preprocessor">#ifndef OSCL_STR_PTR_LEN_H_INCLUDED</span>
00023 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_STR_PTR_LEN_H_INCLUDED</span>
00024 <span class="preprocessor"></span>
00025 <span class="comment">// - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span>
00026 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
00027 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span>
00028 <span class="preprocessor">#endif</span>
00029 <span class="preprocessor"></span>
00030 <span class="preprocessor">#ifndef OSCL_STDSTRING_H_INCLUDED</span>
00031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__stdstring_8h.html">oscl_stdstring.h</a>"</span>
00032 <span class="preprocessor">#endif</span>
00033 <span class="preprocessor"></span>
00034 <span class="comment">//#ifndef OSCL_TYPES_H_INCLUDED</span>
00035 <span class="comment">//#include "oscl_types.h"</span>
00036 <span class="comment">//#endif</span>
00037 
00038 <span class="comment">// - - Definitions - - - - - - - - - - - - - - - - - - - - - - - - - - -</span>
00039 
00040 <span class="comment">// this is the XOR difference between any two ascii letters, 32</span>
<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;
00042 
00044 
<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>
00048 {
00049 <span class="keyword">protected</span>:
<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>;
<a name="l00051"></a><a class="code" href="structStrPtrLen.html#n1">00051</a>     int32 <a class="code" href="structStrPtrLen.html#n1">len</a>;
00052 
<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>
00054 <span class="keyword">    </span>{
00055         <span class="keywordflow">return</span> ((c &gt;= 65 &amp;&amp; c &lt;= 90) || (c &gt;= 97 &amp;&amp; c &lt;= 122));
00056     }
00057 
00058 <span class="keyword">public</span>:
00059 
<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)
00061             : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(newPtr)
00062     {
00063         <a class="code" href="structStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(newPtr);
00064     }
00065 
<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)
00067             : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(newPtr), <a class="code" href="structStrPtrLen.html#n1">len</a>(newLen)
00068     {}
00069 
<a name="l00070"></a><a class="code" href="structStrPtrLen.html#a2">00070</a>     <a class="code" href="structStrPtrLen.html#a2">StrPtrLen</a>()
00071             : <a class="code" href="structStrPtrLen.html#n0">ptr</a>(""), <a class="code" href="structStrPtrLen.html#n1">len</a>(0)
00072     {}
00073 
<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>&amp; rhs)
00075             : <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>)
00076     {}
00077 
<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>
00079 <span class="keyword">    </span>{
00080         <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n0">ptr</a>;
00081     }
00082 
<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>
00084 <span class="keyword">    </span>{
00085         <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n1">len</a>;
00086     }
00087 
<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>
00089 <span class="keyword">    </span>{
00090         <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#n1">len</a>;
00091     }
00092 
<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)
00094     {
00095         <a class="code" href="structStrPtrLen.html#n0">ptr</a> = newPtr;
00096         <a class="code" href="structStrPtrLen.html#n1">len</a> = newLen;
00097     }
00098 
<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>&amp; rhs)<span class="keyword"> const</span>
00100 <span class="keyword">    </span>{
00101         <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>)
00102         {
00103             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00104         }
00105         <span class="comment">// since they are the same length just check for the prefix condition</span>
00106         <span class="keywordflow">return</span> <a class="code" href="structStrPtrLen.html#a9">isCIPrefixOf</a>(rhs);
00107     }
00108 
<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>&amp; rhs)<span class="keyword"> const</span>
00110 <span class="keyword">    </span>{
00111         <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> &gt; rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>)
00112         {
00113             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00114         }
00115 
00116         <span class="keywordflow">for</span> (int32 ii = 0; ii &lt; <a class="code" href="structStrPtrLen.html#n1">len</a>; ++ii)
00117         {
00118             <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])
00119             {
00120                 <span class="keywordflow">if</span> (!<a class="code" href="structStrPtrLen.html#b0">isLetter</a>(<a class="code" href="structStrPtrLen.html#n0">ptr</a>[ii]) ||
00121                         (<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>)))
00122                 {
00123                     <span class="keywordflow">return</span> <span class="keyword">false</span>;
00124                 }
00125             }
00126         }
00127         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00128     }
00129 
<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>&amp; rhs)<span class="keyword"> const</span>
00131 <span class="keyword">    </span>{
00132         <span class="keywordflow">if</span> (<a class="code" href="structStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>)
00133         {
00134             <span class="comment">//return (!(len-rhs.len));</span>
00135             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00136         }
00137 
00138         <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>));
00139     }
00140 
<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>&amp; rhs)<span class="keyword"> const</span>
00142 <span class="keyword">    </span>{
00143         <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);
00144     }
00145 
<a name="l00146"></a><a class="code" href="structStrPtrLen.html#a12">00146</a>     <a class="code" href="structStrPtrLen.html">StrPtrLen</a> &amp;<a class="code" href="structStrPtrLen.html#a12">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>&amp; rhs)
00147     {
00148         this-&gt;<a class="code" href="structStrPtrLen.html#n0">ptr</a> = rhs.<a class="code" href="structStrPtrLen.html#n0">ptr</a>;
00149         this-&gt;<a class="code" href="structStrPtrLen.html#n1">len</a> = rhs.<a class="code" href="structStrPtrLen.html#n1">len</a>;
00150         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00151     }
00152 
<a name="l00153"></a><a class="code" href="structStrPtrLen.html#a13">00153</a>     <a class="code" href="structStrPtrLen.html">StrPtrLen</a> &amp;<a class="code" href="structStrPtrLen.html#a12">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* rhs)
00154     {
00155         this-&gt;<a class="code" href="structStrPtrLen.html#n0">ptr</a> = rhs;
00156         this-&gt;<a class="code" href="structStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(rhs);
00157         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00158     }
00159 
00160 } <a class="code" href="structStrPtrLen.html">StrPtrLen</a>;
00161 
00163 
<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>
00167 {
00168 <span class="keyword">protected</span>:
<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>;
<a name="l00170"></a><a class="code" href="structWStrPtrLen.html#n1">00170</a>     int32 <a class="code" href="structWStrPtrLen.html#n1">len</a>;
00171 
00172 <span class="keyword">public</span>:
00173 
<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)
00175             : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(newPtr)
00176     {
00177         <a class="code" href="structWStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(newPtr);
00178     }
00179 
<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)
00181             : <a class="code" href="structWStrPtrLen.html#n0">ptr</a>(newPtr), <a class="code" href="structWStrPtrLen.html#n1">len</a>(newLen)
00182     {}
00183 
<a name="l00184"></a><a class="code" href="structWStrPtrLen.html#a2">00184</a>     <a class="code" href="structWStrPtrLen.html#a2">WStrPtrLen</a>()
00185             : <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)
00186     {}
00187 
<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>&amp; rhs)
00189             : <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>)
00190     {}
00191 
<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>
00193 <span class="keyword">    </span>{
00194         <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n0">ptr</a>;
00195     }
00196 
<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>
00198 <span class="keyword">    </span>{
00199         <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n1">len</a>;
00200     }
00201 
<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>
00203 <span class="keyword">    </span>{
00204         <span class="keywordflow">return</span> <a class="code" href="structWStrPtrLen.html#n1">len</a>;
00205     }
00206 
<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)
00208     {
00209         <a class="code" href="structWStrPtrLen.html#n0">ptr</a> = newPtr;
00210         <a class="code" href="structWStrPtrLen.html#n1">len</a> = newLen;
00211     }
00212 
<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>&amp; rhs)<span class="keyword"> const</span>
00214 <span class="keyword">    </span>{
00215         <span class="keywordflow">if</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>)
00216         {
00217             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00218         }
00219 
00220         <span class="keywordflow">for</span> (int32 ii = 0; ii &lt; <a class="code" href="structWStrPtrLen.html#n1">len</a>; ++ii)
00221         {
00222             <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>))
00223             {
00224                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00225             }
00226         }
00227 
00228         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00229     }
00230 
<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>&amp; rhs)<span class="keyword"> const</span>
00232 <span class="keyword">    </span>{
00233         <span class="keywordflow">if</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> != rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>)
00234         {
00235             <span class="keywordflow">return</span> (<a class="code" href="structWStrPtrLen.html#n1">len</a> -rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>);
00236         }
00237         <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>));
00238     }
00239 
<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>&amp; rhs)<span class="keyword"> const</span>
00241 <span class="keyword">    </span>{
00242         <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);
00243     }
00244 
<a name="l00245"></a><a class="code" href="structWStrPtrLen.html#a11">00245</a>     <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>&amp; <a class="code" href="structWStrPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>&amp; rhs)
00246     {
00247         this-&gt;<a class="code" href="structWStrPtrLen.html#n0">ptr</a> = rhs.<a class="code" href="structWStrPtrLen.html#n0">ptr</a>;
00248         this-&gt;<a class="code" href="structWStrPtrLen.html#n1">len</a> = rhs.<a class="code" href="structWStrPtrLen.html#n1">len</a>;
00249         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00250     }
00251 
<a name="l00252"></a><a class="code" href="structWStrPtrLen.html#a12">00252</a>     <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>&amp; <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)
00253     {
00254         this-&gt;<a class="code" href="structWStrPtrLen.html#n0">ptr</a> = rhs;
00255         this-&gt;<a class="code" href="structWStrPtrLen.html#n1">len</a> = <a class="code" href="group__osclbase.html#a43">oscl_strlen</a>(rhs);
00256         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00257     }
00258 
00259 } <a class="code" href="structWStrPtrLen.html">WStrPtrLen</a>;
00260 
<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>
00263 {
00264 <span class="keyword">public</span>:
<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>;
00266 
00267 <span class="keyword">protected</span>:
<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>;
00269 
00270 <span class="keyword">public</span>:
00271 
<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)
00273     {
00274         <a class="code" href="structStrPtrLen.html#a7">StrPtrLen::setPtrLen</a>(newPtr, newLen);
00275         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00276     }
00277 
<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>
00279 <span class="keyword">    </span>{
00280         <span class="keywordflow">return</span> <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>;
00281     }
00282 
00283     OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00284 
<a name="l00285"></a><a class="code" href="structStrCSumPtrLen.html#a3">00285</a>     <a class="code" href="structStrCSumPtrLen.html#a3">StrCSumPtrLen</a>()
00286             : <a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>(0)
00287     {}
00288 
<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)
00290             : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(newPtr)
00291     {
00292         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00293     }
00294 
<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)
00296             : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(newPtr, newLen)
00297     {
00298         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00299     }
00300 
<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>&amp; rhs)
00302             : <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>)
00303     {}
00304 
<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> &amp; rhs)
00306             : <a class="code" href="structStrPtrLen.html">StrPtrLen</a>(rhs)
00307     {
00308         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00309     }
00310 
00311 
<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>&amp; rhs)<span class="keyword"> const</span>
00313 <span class="keyword">    </span>{
00314         <span class="keywordflow">if</span> (<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>() != rhs.<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>())
00315         {
00316             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00317         }
00318 
00319         <span class="keywordflow">return</span> static_cast&lt;const StrPtrLen&amp;&gt;(*this).isCIEquivalentTo(
00320                    static_cast&lt;const StrPtrLen&amp;&gt;(rhs));
00321     }
00322 
<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>&amp; rhs)<span class="keyword"> const</span>
00324 <span class="keyword">    </span>{
00325         <span class="keywordflow">if</span> (<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>() != rhs.<a class="code" href="structStrCSumPtrLen.html#a1">getCheckSum</a>())
00326         {
00327             <span class="keywordflow">return</span> <span class="keyword">false</span>;
00328         }
00329 
00330         <span class="keywordflow">return</span> (static_cast&lt;const StrPtrLen&amp;&gt;(*this)
00331                 ==  static_cast&lt;const StrPtrLen&amp;&gt;(rhs));
00332     }
00333 
<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>&amp; rhs)<span class="keyword"> const</span>
00335 <span class="keyword">    </span>{
00336         <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);
00337     }
00338 
<a name="l00339"></a><a class="code" href="structStrCSumPtrLen.html#a11">00339</a>     <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>&amp; <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>&amp; rhs)
00340     {
00341         <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs);
00342         this-&gt;<a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a> = rhs.<a class="code" href="structStrCSumPtrLen.html#n0">checkSum</a>;
00343         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00344     }
00345 
<a name="l00346"></a><a class="code" href="structStrCSumPtrLen.html#a12">00346</a>     <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>&amp; <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <a class="code" href="structStrPtrLen.html">StrPtrLen</a>&amp; rhs)
00347     {
00348         <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs);
00349         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00350         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00351     }
00352 
<a name="l00353"></a><a class="code" href="structStrCSumPtrLen.html#a13">00353</a>     <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>&amp; <a class="code" href="structStrCSumPtrLen.html#a11">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* rhs)
00354     {
00355         <a class="code" href="structStrPtrLen.html#a12">StrPtrLen::operator=</a>(rhs);
00356         <a class="code" href="structStrCSumPtrLen.html#a2">setCheckSum</a>();
00357         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00358     }
00359 
00360 } <a class="code" href="structStrCSumPtrLen.html">StrCSumPtrLen</a>;
00361 
00362 <span class="comment">// Set character code to UNICODE</span>
<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>;
00364 
00365 <span class="preprocessor">#endif // OSCL_STR_PTR_LEN_H_INCLUDED</span>
00366 <span class="preprocessor"></span>
</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>