equal
deleted
inserted
replaced
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
26 |
26 |
27 ////////////////////////////////////////////////////////////////////////////////////////////// |
27 ////////////////////////////////////////////////////////////////////////////////////////////// |
28 // Global functions |
28 // Global functions |
29 ////////////////////////////////////////////////////////////////////////////////////////////// |
29 ////////////////////////////////////////////////////////////////////////////////////////////// |
30 |
30 |
31 TChar UTF16ToChar(const TText16* a); |
31 inline TChar UTF16ToChar(const TText16* a); |
32 TBool IsBaseCharacter(TChar); |
32 TBool IsBaseCharacter(TChar); |
33 |
33 |
34 TBool MatchSectionFolded(TUTF32Iterator& aCandidateString, TUTF32Iterator& aSearchTerm); |
34 TBool MatchSectionFolded(TUTF32Iterator& aCandidateString, TUTF32Iterator& aSearchTerm); |
35 |
35 |
36 TBool FindMatchSectionFolded(TUTF32Iterator& aCandidateString, TUTF32Iterator& aSearchTerm); |
36 TBool FindMatchSectionFolded(TUTF32Iterator& aCandidateString, TUTF32Iterator& aSearchTerm); |
65 inline TUTF32Iterator(const TText16* aStart, const TText16* aEnd); |
65 inline TUTF32Iterator(const TText16* aStart, const TText16* aEnd); |
66 inline TUTF32Iterator(const TText16* aStart, const TText16* aEnd, TStartsWithValidCharacter); |
66 inline TUTF32Iterator(const TText16* aStart, const TText16* aEnd, TStartsWithValidCharacter); |
67 |
67 |
68 inline TUTF32Iterator CurrentAsIterator() const; |
68 inline TUTF32Iterator CurrentAsIterator() const; |
69 inline TBool AtEnd() const; |
69 inline TBool AtEnd() const; |
70 void Next(); |
70 inline void Next(); |
71 inline TChar Current() const; |
71 inline TChar Current() const; |
72 TBool LocateFoldedBaseCharacter(TChar aChar); |
72 TBool LocateFoldedBaseCharacter(TChar aChar); |
73 inline const TText16* CurrentPosition() const; |
73 inline const TText16* CurrentPosition() const; |
74 inline TInt Length() const; |
74 inline TInt Length() const; |
75 inline TInt operator[](TInt) const; |
75 inline TInt operator[](TInt) const; |
91 { |
91 { |
92 public: |
92 public: |
93 inline TFoldedDecompIterator(); |
93 inline TFoldedDecompIterator(); |
94 explicit TFoldedDecompIterator(const TUTF32Iterator&); |
94 explicit TFoldedDecompIterator(const TUTF32Iterator&); |
95 inline void Set(const TUTF32Iterator&); |
95 inline void Set(const TUTF32Iterator&); |
96 TBool AtEnd() const; |
96 inline TBool AtEnd() const; |
97 TBool AtEndOrWildcard() const; |
97 TBool AtEndOrWildcard() const; |
98 TBool EnterFoldedSequence(); |
98 TBool EnterFoldedSequence(); |
99 TBool StrictEnterFoldedSequence(); |
99 TBool StrictEnterFoldedSequence(); |
100 inline TBool IsInFoldedSequence() const; |
100 inline TBool IsInFoldedSequence() const; |
101 TBool CurrentIsBaseFoldedFromCombiner() const; |
101 TBool CurrentIsBaseFoldedFromCombiner() const; |
102 TChar Current() const; |
102 inline TChar Current() const; |
103 TBool Match(TChar aCode); |
103 TBool Match(TChar aCode); |
104 TBool Match(TFoldedDecompIterator& aThat); |
104 TBool Match(TFoldedDecompIterator& aThat); |
105 void Next(); |
105 void Next(); |
106 inline TUTF32Iterator BaseIterator() const; |
106 inline TUTF32Iterator BaseIterator() const; |
107 private: |
107 private: |
118 { |
118 { |
119 public: |
119 public: |
120 inline TFoldedSortedDecompIterator(); |
120 inline TFoldedSortedDecompIterator(); |
121 TInt Set(TFoldedDecompIterator &aBase); |
121 TInt Set(TFoldedDecompIterator &aBase); |
122 void Set(); |
122 void Set(); |
123 TBool AtEnd() const; |
123 inline TBool AtEnd() const; |
124 TChar Current() const; |
124 inline TChar Current() const; |
125 void Next(); |
125 void Next(); |
126 |
126 |
127 private: |
127 private: |
128 TFoldedDecompIterator iStart; // Starting code. |
128 TFoldedDecompIterator iStart; // Starting code. |
129 TInt iLength; // Length in decomposed codes. |
129 TInt iLength; // Length in decomposed codes. |
141 */ |
141 */ |
142 class TFoldedCanonicalIterator |
142 class TFoldedCanonicalIterator |
143 { |
143 { |
144 public: |
144 public: |
145 TFoldedCanonicalIterator(const TUTF32Iterator&); |
145 TFoldedCanonicalIterator(const TUTF32Iterator&); |
146 TBool AtEnd() const; |
146 inline TBool AtEnd() const; |
147 TChar Current() const; |
147 inline TChar Current() const; |
148 void Next(const TUnicodeDataSet* aCharDataSet); |
148 void Next(const TUnicodeDataSet* aCharDataSet); |
149 private: |
149 private: |
150 TFoldedDecompIterator iBase; |
150 TFoldedDecompIterator iBase; |
151 TFoldedSortedDecompIterator iSorted; |
151 TFoldedSortedDecompIterator iSorted; |
152 }; |
152 }; |
163 { |
163 { |
164 public: |
164 public: |
165 inline TDecompositionIterator(); |
165 inline TDecompositionIterator(); |
166 void Set(const TUTF32Iterator&); |
166 void Set(const TUTF32Iterator&); |
167 explicit TDecompositionIterator(const TUTF32Iterator&); |
167 explicit TDecompositionIterator(const TUTF32Iterator&); |
168 TBool AtEnd() const; |
168 inline TBool AtEnd() const; |
169 TChar Current() const; |
169 inline TChar Current() const; |
170 void Next(); |
170 void Next(); |
171 const TText16* CurrentPosition() const; |
171 const TText16* CurrentPosition() const; |
172 private: |
172 private: |
173 TUTF32Iterator iBase; |
173 TUTF32Iterator iBase; |
174 TUTF32Iterator iDecomposition; |
174 TUTF32Iterator iDecomposition; |
180 class TCanonicalDecompositionIterator |
180 class TCanonicalDecompositionIterator |
181 { |
181 { |
182 public: |
182 public: |
183 inline TCanonicalDecompositionIterator(); |
183 inline TCanonicalDecompositionIterator(); |
184 void Set(const TUTF32Iterator&); |
184 void Set(const TUTF32Iterator&); |
185 TBool AtEnd() const; |
185 inline TBool AtEnd() const; |
186 TChar Current() const; |
186 inline TChar Current() const; |
187 void Next(); |
187 void Next(); |
188 const TText16* CurrentPositionIfAtCharacter() const; |
188 const TText16* CurrentPositionIfAtCharacter() const; |
189 TBool IsInOpenSequence() const; |
189 TBool IsInOpenSequence() const; |
190 private: |
190 private: |
191 TDecompositionIterator iBase; |
191 TDecompositionIterator iBase; |
211 */ |
211 */ |
212 class TCanonicalDecompositionIteratorCached |
212 class TCanonicalDecompositionIteratorCached |
213 { |
213 { |
214 public: |
214 public: |
215 void Set(const TUTF32Iterator&); |
215 void Set(const TUTF32Iterator&); |
216 TBool AtEnd() const; |
216 inline TBool AtEnd() const; |
217 // Advance aOffset characters. |
217 // Advance aOffset characters. |
218 void Next(TInt aOffset); |
218 void Next(TInt aOffset); |
219 // Get the character at the position of the iterator plus aOffset steps. |
219 // Get the character at the position of the iterator plus aOffset steps. |
220 // Returns FFFF if we are looking too far ahead. |
220 // Returns FFFF if we are looking too far ahead. |
221 TChar Get(TInt aOffset); |
221 TChar Get(TInt aOffset); |