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_string.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_string.h</h1><a href="oscl__string_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> 10 00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 11 00003 12 00004 <span class="comment">// O S C L_ S T R I N G C L A S S</span> 13 00005 14 00006 <span class="comment">// This file contains a standardized set of string containers that</span> 15 00007 <span class="comment">// can be used in place of character arrays.</span> 16 00008 17 00009 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 18 00010 19 00025 <span class="preprocessor">#ifndef OSCL_STRING_H_INCLUDED</span> 20 00026 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_STRING_H_INCLUDED</span> 21 00027 <span class="preprocessor"></span> 22 00028 23 00029 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span> 24 00030 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span> 25 00031 <span class="preprocessor">#endif</span> 26 00032 <span class="preprocessor"></span> 27 00033 <span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span> 28 00034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span> 29 00035 <span class="preprocessor">#endif</span> 30 00036 <span class="preprocessor"></span> 31 <a name="l00041"></a><a class="code" href="classOSCL__String.html">00041</a> <span class="keyword">class </span><a class="code" href="classOSCL__String.html">OSCL_String</a> : <span class="keyword">public</span> <a class="code" href="classHeapBase.html">HeapBase</a> 32 00042 33 00043 { 34 00044 <span class="keyword">public</span>: 35 <a name="l00045"></a><a class="code" href="classOSCL__String.html#s0">00045</a> <span class="keyword">typedef</span> <span class="keywordtype">char</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>; 36 00046 37 00051 <span class="keyword">virtual</span> uint32 <a class="code" href="classOSCL__String.html#a0">get_size</a>() <span class="keyword">const</span> = 0; 38 00052 39 00058 <span class="keyword">virtual</span> uint32 <a class="code" href="classOSCL__String.html#a1">get_maxsize</a>() <span class="keyword">const</span> = 0; 40 00059 41 00063 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* <a class="code" href="classOSCL__String.html#a2">get_cstr</a>() <span class="keyword">const</span> = 0; 42 00064 43 00068 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a3">is_writable</a>() <span class="keyword">const</span>; 44 00069 45 00074 <span class="keyword">virtual</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* <a class="code" href="classOSCL__String.html#a4">get_str</a>() <span class="keyword">const</span> = 0; 46 00075 47 00078 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html">OSCL_String</a>& <a class="code" href="classOSCL__String.html#a5">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src); 48 00079 49 00083 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html">OSCL_String</a>& <a class="code" href="classOSCL__String.html#a5">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* cstr); 50 00084 51 00089 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html">OSCL_String</a>& <a class="code" href="classOSCL__String.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src); 52 00090 53 00096 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html">OSCL_String</a>& <a class="code" href="classOSCL__String.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* cstr); 54 00097 55 00102 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html">OSCL_String</a>& <a class="code" href="classOSCL__String.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a> c); 56 00103 57 00106 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a10">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 58 00107 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a11">operator!= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 59 00108 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a12">operator< </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 60 00109 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a13">operator<= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 61 00110 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a14">operator> </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 62 00111 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a15">operator>= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) <span class="keyword">const</span>; 63 00112 64 00116 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__String.html#a10">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* cstr) <span class="keyword">const</span>; 65 00117 66 00124 OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html#s0">chartype</a> <a class="code" href="classOSCL__String.html#a17">operator[]</a>(uint32 index) <span class="keyword">const</span>; 67 00125 68 00131 OSCL_IMPORT_REF <span class="keyword">virtual</span> <a class="code" href="classOSCL__String.html#s0">chartype</a> <a class="code" href="classOSCL__String.html#a18">read</a>(uint32 index)<span class="keyword">const</span>; 69 00132 70 00137 OSCL_IMPORT_REF <span class="keyword">virtual</span> int8 <a class="code" href="classOSCL__String.html#a19">hash</a>() <span class="keyword">const</span>; 71 00138 72 00145 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#a20">write</a>(uint32 index,<a class="code" href="classOSCL__String.html#s0">chartype</a> c); 73 00146 74 00156 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#a20">write</a>(uint32 offset, uint32 length, <span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* buf); 75 00157 76 00158 <span class="preprocessor">#ifdef T_ARM</span> 77 00159 <span class="preprocessor"></span><span class="comment">//ADS 1.2 compiler doesn't interpret "protected" correctly for templates.</span> 78 00160 <span class="comment">//so the constructor/destructor need to be public.</span> 79 00161 <span class="keyword">public</span>: 80 00162 <span class="preprocessor">#else</span> 81 00163 <span class="preprocessor"></span> <span class="keyword">protected</span>: 82 00164 <span class="preprocessor">#endif</span> 83 00165 <span class="preprocessor"></span> OSCL_IMPORT_REF <a class="code" href="classOSCL__String.html#b0">OSCL_String</a>(); 84 00166 OSCL_IMPORT_REF <span class="keyword">virtual</span> <a class="code" href="classOSCL__String.html#b1">~OSCL_String</a>(); 85 00167 86 00168 <span class="keyword">protected</span>: 87 00175 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#b2">set_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* cstr) = 0; 88 00176 89 00181 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#b3">append_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html#s0">chartype</a>* cstr) = 0; 90 00182 91 00185 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#b2">set_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) = 0; 92 00186 93 00190 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#b3">append_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__String.html">OSCL_String</a>& src) = 0; 94 00191 95 00195 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__String.html#b6">set_len</a>(uint32 len) = 0; 96 00196 }; 97 00197 98 <a name="l00205"></a><a class="code" href="classOSCL__wString.html">00205</a> <span class="keyword">class </span><a class="code" href="classOSCL__wString.html">OSCL_wString</a> 99 00206 { 100 00207 <span class="keyword">public</span>: 101 <a name="l00208"></a><a class="code" href="classOSCL__wString.html#s0">00208</a> <span class="keyword">typedef</span> <a class="code" href="group__osclbase.html#a32">oscl_wchar</a> <a class="code" href="classOSCL__wString.html#s0">chartype</a>; 102 00209 103 00210 <span class="keyword">virtual</span> uint32 <a class="code" href="classOSCL__wString.html#a0">get_size</a>() <span class="keyword">const</span> = 0; 104 00211 105 00212 <span class="keyword">virtual</span> uint32 <a class="code" href="classOSCL__wString.html#a1">get_maxsize</a>() <span class="keyword">const</span> = 0; 106 00213 107 00214 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* <a class="code" href="classOSCL__wString.html#a2">get_cstr</a>() <span class="keyword">const</span> = 0; 108 00215 109 00216 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a3">is_writable</a>() <span class="keyword">const</span>; 110 00217 111 00218 <span class="keyword">virtual</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* <a class="code" href="classOSCL__wString.html#a4">get_str</a>() <span class="keyword">const</span> = 0; 112 00219 113 00220 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& <a class="code" href="classOSCL__wString.html#a5">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src); 114 00221 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& <a class="code" href="classOSCL__wString.html#a5">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* cstr); 115 00222 116 00223 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& <a class="code" href="classOSCL__wString.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src); 117 00224 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& <a class="code" href="classOSCL__wString.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* cstr); 118 00225 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& <a class="code" href="classOSCL__wString.html#a7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a> c); 119 00226 120 00227 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a10">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 121 00228 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a11">operator!= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 122 00229 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a12">operator< </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 123 00230 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a13">operator<= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 124 00231 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a14">operator> </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 125 00232 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a15">operator>= </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) <span class="keyword">const</span>; 126 00233 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classOSCL__wString.html#a10">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* cstr) <span class="keyword">const</span>; 127 00234 128 00235 OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html#s0">chartype</a> <a class="code" href="classOSCL__wString.html#a17">operator[]</a>(uint32 index) <span class="keyword">const</span>; 129 00236 130 00237 OSCL_IMPORT_REF <span class="keyword">virtual</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a> <a class="code" href="classOSCL__wString.html#a18">read</a>(uint32 index)<span class="keyword">const</span>; 131 00238 132 00239 OSCL_IMPORT_REF <span class="keyword">virtual</span> int8 <a class="code" href="classOSCL__wString.html#a19">hash</a>() <span class="keyword">const</span>; 133 00240 134 00241 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#a20">write</a>(uint32 index,<a class="code" href="classOSCL__wString.html#s0">chartype</a> c); 135 00242 OSCL_IMPORT_REF <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#a20">write</a>(uint32 offset, uint32 length, <span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* buf); 136 00243 137 00244 <span class="preprocessor">#ifdef T_ARM</span> 138 00245 <span class="preprocessor"></span><span class="comment">//ADS 1.2 compiler doesn't interpret "protected" correctly for templates.</span> 139 00246 <span class="comment">//so the constructor/destructor need to be public.</span> 140 00247 <span class="keyword">public</span>: 141 00248 <span class="preprocessor">#else</span> 142 00249 <span class="preprocessor"></span> <span class="keyword">protected</span>: 143 00250 <span class="preprocessor">#endif</span> 144 00251 <span class="preprocessor"></span> OSCL_IMPORT_REF <a class="code" href="classOSCL__wString.html#b0">OSCL_wString</a>(); 145 00252 OSCL_IMPORT_REF <span class="keyword">virtual</span> <a class="code" href="classOSCL__wString.html#b1">~OSCL_wString</a>(); 146 00253 147 00254 <span class="keyword">protected</span>: 148 00255 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#b2">set_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* cstr) = 0; 149 00256 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#b3">append_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html#s0">chartype</a>* cstr) = 0; 150 00257 151 00258 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#b2">set_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) = 0; 152 00259 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#b3">append_rep</a>(<span class="keyword">const</span> <a class="code" href="classOSCL__wString.html">OSCL_wString</a>& src) = 0; 153 00260 154 00261 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOSCL__wString.html#b6">set_len</a>(uint32 len) = 0; 155 00262 }; 156 00263 157 00264 <span class="preprocessor">#endif // OSCL_STRING_H_INCLUDED</span> 158 00265 <span class="preprocessor"></span> 159 </pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 160 <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 161 </small></address> 162 </body> 163 </html> 164