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

Side by Side Diff: sdk/lib/io/mime_multipart_parser.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « sdk/lib/io/io.dart ('k') | sdk/lib/io/path_impl.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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * Parser for MIME multipart types of data as described in RFC 2046 8 * Parser for MIME multipart types of data as described in RFC 2046
9 * section 5.1.1. The data to parse is supplied through the [:update:] 9 * section 5.1.1. The data to parse is supplied through the [:update:]
10 * method. As the data is parsed the following callbacks are called: 10 * method. As the data is parsed the following callbacks are called:
(...skipping 24 matching lines...) Expand all
35 const int _LAST_BOUNDARY_ENDING = 12; 35 const int _LAST_BOUNDARY_ENDING = 12;
36 const int _LAST_BOUNDARY_END = 13; 36 const int _LAST_BOUNDARY_END = 13;
37 const int _DONE = 14; 37 const int _DONE = 14;
38 const int _FAILURE = 15; 38 const int _FAILURE = 15;
39 39
40 // Construct a new MIME multipart parser with the boundary 40 // Construct a new MIME multipart parser with the boundary
41 // [boundary]. The boundary should be as specified in the content 41 // [boundary]. The boundary should be as specified in the content
42 // type parameter, that is without the -- prefix. 42 // type parameter, that is without the -- prefix.
43 _MimeMultipartParser(String boundary) { 43 _MimeMultipartParser(String boundary) {
44 List<int> charCodes = boundary.charCodes; 44 List<int> charCodes = boundary.charCodes;
45 _boundary = new List<int>(4 + charCodes.length); 45 _boundary = new List<int>.fixedLength(4 + charCodes.length);
46 // Set-up the matching boundary preceding it with CRLF and two 46 // Set-up the matching boundary preceding it with CRLF and two
47 // dashes. 47 // dashes.
48 _boundary[0] = _CharCode.CR; 48 _boundary[0] = _CharCode.CR;
49 _boundary[1] = _CharCode.LF; 49 _boundary[1] = _CharCode.LF;
50 _boundary[2] = _CharCode.DASH; 50 _boundary[2] = _CharCode.DASH;
51 _boundary[3] = _CharCode.DASH; 51 _boundary[3] = _CharCode.DASH;
52 _boundary.setRange(4, charCodes.length, charCodes); 52 _boundary.setRange(4, charCodes.length, charCodes);
53 _state = _START; 53 _state = _START;
54 _headerField = new StringBuffer(); 54 _headerField = new StringBuffer();
55 _headerValue = new StringBuffer(); 55 _headerValue = new StringBuffer();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 Function partDataReceived; 324 Function partDataReceived;
325 Function partEnd; 325 Function partEnd;
326 } 326 }
327 327
328 328
329 class MimeParserException implements Exception { 329 class MimeParserException implements Exception {
330 const MimeParserException([String this.message = ""]); 330 const MimeParserException([String this.message = ""]);
331 String toString() => "MimeParserException: $message"; 331 String toString() => "MimeParserException: $message";
332 final String message; 332 final String message;
333 } 333 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io.dart ('k') | sdk/lib/io/path_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698