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

Side by Side Diff: pkg/webdriver/lib/src/base64decoder.dart

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 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 | « pkg/serialization/test/serialization_test.dart ('k') | pkg/webdriver/lib/webdriver.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 webdriver; 5 part of webdriver;
6 6
7 /** 7 /**
8 * A simple base64 decoder class, used to decode web browser screenshots 8 * A simple base64 decoder class, used to decode web browser screenshots
9 * returned by WebDriver. 9 * returned by WebDriver.
10 */ 10 */
11 class Base64Decoder { 11 class Base64Decoder {
12 12
13 static int getVal(String s, pos) { 13 static int getVal(String s, pos) {
14 int code = s.charCodeAt(pos); 14 int code = s.codeUnitAt(pos);
15 if (code >= 65 && code < (65+26)) { // 'A'..'Z' 15 if (code >= 65 && code < (65+26)) { // 'A'..'Z'
16 return code - 65; 16 return code - 65;
17 } else if (code >= 97 && code < (97+26)) { // 'a'..'z' 17 } else if (code >= 97 && code < (97+26)) { // 'a'..'z'
18 return code - 97 + 26; 18 return code - 97 + 26;
19 } else if (code >= 48 && code < (48+10)) { // '0'..'9' 19 } else if (code >= 48 && code < (48+10)) { // '0'..'9'
20 return code - 48 + 52; 20 return code - 48 + 52;
21 } else if (code == 43) { // '+' 21 } else if (code == 43) { // '+'
22 return 62; 22 return 62;
23 } else if (code == 47) { // '/' 23 } else if (code == 47) { // '/'
24 return 63; 24 return 63;
(...skipping 21 matching lines...) Expand all
46 (getVal(s, pos + 2) << 6) | getVal(s, pos+3); 46 (getVal(s, pos + 2) << 6) | getVal(s, pos+3);
47 pos += 4; 47 pos += 4;
48 rtn.add((v >> 16 ) & 0xff); 48 rtn.add((v >> 16 ) & 0xff);
49 rtn.add((v >> 8) & 0xff); 49 rtn.add((v >> 8) & 0xff);
50 rtn.add(v & 0xff); 50 rtn.add(v & 0xff);
51 } 51 }
52 } 52 }
53 return rtn; 53 return rtn;
54 } 54 }
55 } 55 }
OLDNEW
« no previous file with comments | « pkg/serialization/test/serialization_test.dart ('k') | pkg/webdriver/lib/webdriver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698