| OLD | NEW |
| 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 library protobuf; | 5 library protobuf; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 import 'dart:collection' show ListMixin; | 8 import 'dart:collection' show ListMixin; |
| 9 import 'dart:convert' show JSON, Utf8Codec; | 9 import 'dart:convert' show JSON, Utf8Codec; |
| 10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
| 11 import 'dart:typed_data' show TypedData, Uint8List, ByteData, Endianness; | 11 import 'dart:typed_data' show TypedData, Uint8List, ByteData, Endianness; |
| 12 | 12 |
| 13 import 'package:crypto/crypto.dart' show CryptoUtils; | 13 import 'package:crypto/crypto.dart' show CryptoUtils; |
| 14 import 'package:fixnum/fixnum.dart' show Int64; | 14 import 'package:fixnum/fixnum.dart' show Int64; |
| 15 | 15 |
| 16 part 'src/protobuf/coded_buffer_reader.dart'; | 16 part 'src/protobuf/coded_buffer_reader.dart'; |
| 17 part 'src/protobuf/coded_buffer_writer.dart'; | 17 part 'src/protobuf/coded_buffer_writer.dart'; |
| 18 part 'src/protobuf/builder_info.dart'; | 18 part 'src/protobuf/builder_info.dart'; |
| 19 part 'src/protobuf/event_plugin.dart'; | 19 part 'src/protobuf/event_plugin.dart'; |
| 20 part 'src/protobuf/exceptions.dart'; | 20 part 'src/protobuf/exceptions.dart'; |
| 21 part 'src/protobuf/extension.dart'; | 21 part 'src/protobuf/extension.dart'; |
| 22 part 'src/protobuf/extension_registry.dart'; | 22 part 'src/protobuf/extension_registry.dart'; |
| 23 part 'src/protobuf/field_info.dart'; | 23 part 'src/protobuf/field_info.dart'; |
| 24 part 'src/protobuf/field_type.dart'; |
| 24 part 'src/protobuf/generated_message.dart'; | 25 part 'src/protobuf/generated_message.dart'; |
| 25 part 'src/protobuf/generated_service.dart'; | 26 part 'src/protobuf/generated_service.dart'; |
| 26 part 'src/protobuf/pb_list.dart'; | 27 part 'src/protobuf/pb_list.dart'; |
| 27 part 'src/protobuf/protobuf_enum.dart'; | 28 part 'src/protobuf/protobuf_enum.dart'; |
| 28 part 'src/protobuf/readonly_message.dart'; | 29 part 'src/protobuf/readonly_message.dart'; |
| 29 part 'src/protobuf/rpc_client.dart'; | 30 part 'src/protobuf/rpc_client.dart'; |
| 30 part 'src/protobuf/unknown_field_set.dart'; | 31 part 'src/protobuf/unknown_field_set.dart'; |
| 31 part 'src/protobuf/utils.dart'; | 32 part 'src/protobuf/utils.dart'; |
| 32 part 'src/protobuf/wire_format.dart'; | 33 part 'src/protobuf/wire_format.dart'; |
| 33 | 34 |
| 34 // TODO(sra): Remove this method when clients upgrade to protoc 0.3.5 | 35 // TODO(sra): Remove this method when clients upgrade to protoc 0.3.5 |
| 35 Int64 makeLongInt(int n) => new Int64(n); | 36 Int64 makeLongInt(int n) => new Int64(n); |
| 36 | 37 |
| 37 // TODO(sra): Use Int64.parse() when available - see http://dartbug.com/21915. | 38 // TODO(sra): Use Int64.parse() when available - see http://dartbug.com/21915. |
| 38 Int64 parseLongInt(String text) { | 39 Int64 parseLongInt(String text) { |
| 39 if (text.startsWith('0x')) return Int64.parseHex(text.substring(2)); | 40 if (text.startsWith('0x')) return Int64.parseHex(text.substring(2)); |
| 40 if (text.startsWith('+0x')) return Int64.parseHex(text.substring(3)); | 41 if (text.startsWith('+0x')) return Int64.parseHex(text.substring(3)); |
| 41 if (text.startsWith('-0x')) return -Int64.parseHex(text.substring(3)); | 42 if (text.startsWith('-0x')) return -Int64.parseHex(text.substring(3)); |
| 42 return Int64.parseInt(text); | 43 return Int64.parseInt(text); |
| 43 } | 44 } |
| 44 | 45 |
| 45 const _UTF8 = const Utf8Codec(allowMalformed: true); | 46 const _UTF8 = const Utf8Codec(allowMalformed: true); |
| OLD | NEW |