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