| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library input.transformer.log_file; | 5 library input.transformer.log_file; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/java_engine.dart'; | 9 import 'package:analyzer/src/generated/java_engine.dart'; |
| 10 import 'package:logging/logging.dart'; | 10 import 'package:logging/logging.dart'; |
| 11 | 11 |
| 12 import 'input_converter.dart'; | 12 import 'input_converter.dart'; |
| 13 import 'operation.dart'; | 13 import 'operation.dart'; |
| 14 | 14 |
| 15 const CONNECTED_MSG_FRAGMENT = ' <= {"event":"server.connected"'; | 15 const CONNECTED_MSG_FRAGMENT = ' <= {"event":"server.connected"'; |
| 16 final int NINE = '9'.codeUnitAt(0); | |
| 17 const RECEIVED_FRAGMENT = ' <= {'; | 16 const RECEIVED_FRAGMENT = ' <= {'; |
| 18 const SENT_FRAGMENT = ' => {'; | 17 const SENT_FRAGMENT = ' => {'; |
| 18 final int NINE = '9'.codeUnitAt(0); |
| 19 final int ZERO = '0'.codeUnitAt(0); | 19 final int ZERO = '0'.codeUnitAt(0); |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * [LogFileInputConverter] converts a log file stream | 22 * [LogFileInputConverter] converts a log file stream |
| 23 * into a series of operations to be sent to the analysis server. | 23 * into a series of operations to be sent to the analysis server. |
| 24 */ | 24 */ |
| 25 class LogFileInputConverter extends CommonInputConverter { | 25 class LogFileInputConverter extends CommonInputConverter { |
| 26 LogFileInputConverter(String tmpSrcDirPath, PathMap srcPathMap) | 26 LogFileInputConverter(String tmpSrcDirPath, PathMap srcPathMap) |
| 27 : super(tmpSrcDirPath, srcPathMap); | 27 : super(tmpSrcDirPath, srcPathMap); |
| 28 | 28 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 while (index < line.length) { | 75 while (index < line.length) { |
| 76 int code = line.codeUnitAt(index); | 76 int code = line.codeUnitAt(index); |
| 77 if (code < ZERO || NINE < code) { | 77 if (code < ZERO || NINE < code) { |
| 78 return line.substring(0, index); | 78 return line.substring(0, index); |
| 79 } | 79 } |
| 80 ++index; | 80 ++index; |
| 81 } | 81 } |
| 82 return line; | 82 return line; |
| 83 } | 83 } |
| 84 } | 84 } |
| OLD | NEW |