Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: lib/utf/utf32.dart

Issue 9861011: - Remove type arguments from internal classes and interfaces. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/utf/utf16.dart ('k') | lib/utf/utf8.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Decodes the UTF-32 bytes as an iterable. Thus, the consumer can only convert 6 * Decodes the UTF-32 bytes as an iterable. Thus, the consumer can only convert
7 * as much of the input as needed. Determines the byte order from the BOM, 7 * as much of the input as needed. Determines the byte order from the BOM,
8 * or uses big-endian as a default. This method always strips a leading BOM. 8 * or uses big-endian as a default. This method always strips a leading BOM.
9 * Set the replacementCharacter to null to throw an IllegalArgumentException 9 * Set the replacementCharacter to null to throw an IllegalArgumentException
10 * rather than replace the bad value. 10 * rather than replace the bad value.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 final Function codeunitsProvider; 182 final Function codeunitsProvider;
183 183
184 IterableUtf32Decoder._(Function this.codeunitsProvider); 184 IterableUtf32Decoder._(Function this.codeunitsProvider);
185 185
186 Utf32BytesDecoder iterator() => codeunitsProvider(); 186 Utf32BytesDecoder iterator() => codeunitsProvider();
187 } 187 }
188 188
189 /** 189 /**
190 * Abstrace parent class converts encoded bytes to codepoints. 190 * Abstrace parent class converts encoded bytes to codepoints.
191 */ 191 */
192 class Utf32BytesDecoder implements _ListRangeIterator<int> { 192 class Utf32BytesDecoder implements _ListRangeIterator {
193 final _ListRangeIterator<int> utf32EncodedBytesIterator; 193 final _ListRangeIterator utf32EncodedBytesIterator;
194 final int replacementCodepoint; 194 final int replacementCodepoint;
195 195
196 Utf32BytesDecoder._fromListRangeIterator( 196 Utf32BytesDecoder._fromListRangeIterator(
197 _ListRangeIterator<int> this.utf32EncodedBytesIterator, 197 _ListRangeIterator this.utf32EncodedBytesIterator,
198 int this.replacementCodepoint); 198 int this.replacementCodepoint);
199 199
200 factory Utf32BytesDecoder(List<int> utf32EncodedBytes, [ 200 factory Utf32BytesDecoder(List<int> utf32EncodedBytes, [
201 int offset = 0, int length, 201 int offset = 0, int length,
202 int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) { 202 int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
203 if (length == null) { 203 if (length == null) {
204 length = utf32EncodedBytes.length - offset; 204 length = utf32EncodedBytes.length - offset;
205 } 205 }
206 if (hasUtf32beBom(utf32EncodedBytes, offset, length)) { 206 if (hasUtf32beBom(utf32EncodedBytes, offset, length)) {
207 return new Utf32beBytesDecoder(utf32EncodedBytes, offset + 4, length - 4, 207 return new Utf32beBytesDecoder(utf32EncodedBytes, offset + 4, length - 4,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 value += (utf32EncodedBytesIterator.next() << 24); 309 value += (utf32EncodedBytesIterator.next() << 24);
310 return value; 310 return value;
311 } 311 }
312 } 312 }
313 313
314 bool _validCodepoint(int codepoint) { 314 bool _validCodepoint(int codepoint) {
315 return (codepoint >= 0 && codepoint < UNICODE_UTF16_RESERVED_LO) || 315 return (codepoint >= 0 && codepoint < UNICODE_UTF16_RESERVED_LO) ||
316 (codepoint > UNICODE_UTF16_RESERVED_HI && 316 (codepoint > UNICODE_UTF16_RESERVED_HI &&
317 codepoint < UNICODE_VALID_RANGE_MAX); 317 codepoint < UNICODE_VALID_RANGE_MAX);
318 } 318 }
OLDNEW
« no previous file with comments | « lib/utf/utf16.dart ('k') | lib/utf/utf8.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698