1 stringpool.inl |
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __STRINGPOOL_INL__ |
|
17 #define __STRINGPOOL_INL__ |
|
18 |
|
19 |
|
20 |
|
21 inline RStringTokenBase::RStringTokenBase() |
|
22 : iVal(0) |
|
23 /** Default constructor. */ |
|
24 { |
|
25 } |
|
26 |
|
27 |
|
28 inline RStringTokenBase RStringTokenBase::operator=(RStringBase aVal) |
|
29 /** Assignment operator, which makes a string token from a string. |
|
30 |
|
31 @param aVal The value of the string to copy. |
|
32 @return The string token base. */ |
|
33 { |
|
34 iVal = aVal.iVal; |
|
35 return *this; |
|
36 } |
|
37 |
|
38 |
|
39 inline TBool RStringTokenBase::IsNull() const |
|
40 /** Tests if the string is null or not. |
|
41 |
|
42 @return ETrue if the string is null, otherwise EFalse. */ |
|
43 { |
|
44 return (iVal == 0); |
|
45 } |
|
46 |
|
47 |
|
48 inline TBool RStringToken::operator==(RStringToken aVal) const |
|
49 /** Equality operator. |
|
50 |
|
51 @param aVal The string to compare. |
|
52 @return ETrue if the strings are the same, otherwise EFalse. */ |
|
53 { |
|
54 return iVal == aVal.iVal; |
|
55 } |
|
56 |
|
57 |
|
58 inline TBool RStringToken::operator!=(RStringToken aVal) const |
|
59 /** Inequality operator. |
|
60 |
|
61 @param aVal The string to compare. |
|
62 @return ETrue if the strings are different, else EFalse */ |
|
63 { |
|
64 return iVal != aVal.iVal; |
|
65 } |
|
66 |
|
67 |
|
68 inline RStringToken RStringToken::operator=(RString aVal) |
|
69 /** Assignment operator, which makes a string token from a string. |
|
70 |
|
71 @param aVal The string to copy. |
|
72 @return The string token. */ |
|
73 { |
|
74 iVal = aVal.iVal; |
|
75 return *this; |
|
76 } |
|
77 |
|
78 |
|
79 inline TBool RStringTokenF::operator==(RStringTokenF aVal) const |
|
80 /** Equality operator. |
|
81 |
|
82 @param aVal The string to compare. |
|
83 @return ETrue if the strings are the same, otherwise EFalse. */ |
|
84 { |
|
85 return iVal == aVal.iVal; |
|
86 } |
|
87 |
|
88 |
|
89 inline TBool RStringTokenF::operator!=(RStringTokenF aVal) const |
|
90 /** Inequality operator. |
|
91 |
|
92 @param aVal The string to compare. |
|
93 @return ETrue if any strings are different, else EFalse */ |
|
94 { |
|
95 return iVal != aVal.iVal; |
|
96 } |
|
97 |
|
98 |
|
99 inline RStringTokenF RStringTokenF::operator=(RStringF aVal) |
|
100 /** Assignment operator that makes a string token from a string. |
|
101 |
|
102 @param aVal The string to compare. |
|
103 @return The string token. */ |
|
104 { |
|
105 iVal = aVal.iVal; |
|
106 return *this; |
|
107 } |
|
108 |
|
109 |
|
110 inline RStringBase::RStringBase() |
|
111 : iVal(0) |
|
112 /** Default constructor. */ |
|
113 { |
|
114 } |
|
115 |
|
116 /** Returns a compact string equivalent to the string */ |
|
117 inline RStringBase::operator RStringTokenBase() const |
|
118 { |
|
119 RStringTokenBase s; |
|
120 s.iVal = iVal; |
|
121 return s; |
|
122 } |
|
123 |
|
124 inline RString RString::Copy() |
|
125 /** Copies a string. |
|
126 |
|
127 Both the original and the copy must be separately closed. |
|
128 |
|
129 @return The string to copy. */ |
|
130 { |
|
131 RStringBase::Copy(); |
|
132 return *this; |
|
133 } |
|
134 |
|
135 /** Returns a compact string equivalent to the string (for case-sensitive strings) */ |
|
136 inline RString::operator RStringToken() const |
|
137 { |
|
138 RStringToken s; |
|
139 s.iVal = iVal; |
|
140 return s; |
|
141 } |
|
142 |
|
143 inline RStringF RStringF::Copy() |
|
144 /** Copies a string. |
|
145 |
|
146 Both the original and the copy must be separately closed. |
|
147 |
|
148 @return The string to copy. */ |
|
149 { |
|
150 RStringBase::Copy(); |
|
151 return *this; |
|
152 } |
|
153 |
|
154 |
|
155 inline TBool RStringF::operator==(const RStringF& aVal) const |
|
156 /** Equality operator. |
|
157 |
|
158 @param aVal The string to compare. |
|
159 @return ETrue if the strings are equal, else EFalse */ |
|
160 { |
|
161 __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); |
|
162 return (iVal == aVal.iVal); |
|
163 } |
|
164 |
|
165 |
|
166 inline TBool RStringF::operator!=(const RStringF& aVal) const |
|
167 /** Inequality operator. |
|
168 |
|
169 @param aVal The string to compare. |
|
170 @return ETrue if the strings are not equal, else EFalse */ |
|
171 { |
|
172 __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); |
|
173 return (iVal != aVal.iVal); |
|
174 } |
|
175 |
|
176 |
|
177 inline RStringF::operator RStringTokenF() const |
|
178 { |
|
179 RStringTokenF s; |
|
180 s.iVal = iVal; |
|
181 return s; |
|
182 } |
|
183 |
|
184 |
|
185 inline RStringPool RStringBase::Pool() const |
|
186 /** Gets the string pool. |
|
187 |
|
188 @return The string pool. */ |
|
189 { |
|
190 return iPool; |
|
191 } |
|
192 |
|
193 |
|
194 inline TBool RString::operator==(const RString& aVal) const |
|
195 /** Equality operator. |
|
196 |
|
197 @param aVal The string to compare. |
|
198 @return ETrue if the strings are equal, else EFalse */ |
|
199 { |
|
200 __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); |
|
201 return (iVal == aVal.iVal); |
|
202 } |
|
203 |
|
204 |
|
205 inline TBool RString::operator!=(const RString& aVal) const |
|
206 /** Inequality operator. |
|
207 |
|
208 @param aVal The string to compare. |
|
209 @return ETrue if the strings are not equal, else EFalse */ |
|
210 { |
|
211 __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); |
|
212 return (iVal != aVal.iVal); |
|
213 } |
|
214 |
|
215 inline RStringPool::RStringPool() |
|
216 : iImplementation(0) |
|
217 /** Default constructor. */ |
|
218 { |
|
219 } |
|
220 |
|
221 |
|
222 #endif // __STRINGPOOL_INL__ |