Index: lib/protobuf.dart |
diff --git a/lib/protobuf.dart b/lib/protobuf.dart |
index f1e55cd21534cb6604e5d7a8a2d2a4e76460a555..13bddf0c772e5407cc2af7e4df35c1fb95abf27f 100644 |
--- a/lib/protobuf.dart |
+++ b/lib/protobuf.dart |
@@ -26,6 +26,15 @@ part 'src/protobuf/unknown_field_set.dart'; |
part 'src/protobuf/utils.dart'; |
part 'src/protobuf/wire_format.dart'; |
+// TODO(sra): Remove this method when clients upgrade to protoc 0.3.5 |
Siggi Cherem (dart-lang)
2014/12/19 21:53:37
add @deprecated.
Alternatively, you can bump this
sra1
2014/12/19 23:15:54
This CL can land ahead of the protoc one.
I don't
|
Int64 makeLongInt(int n) => new Int64(n); |
+// TODO(http://dartbug.com/21915): Use Int64.parse() when available. |
Siggi Cherem (dart-lang)
2014/12/19 21:53:38
nit: format the todo with your username, as follow
sra1
2014/12/19 23:15:54
Done.
|
+Int64 parseLongInt(String text) { |
+ if (text.startsWith('0x')) return Int64.parseHex(text.substring(2)); |
+ if (text.startsWith('+0x')) return Int64.parseHex(text.substring(3)); |
+ if (text.startsWith('-0x')) return -Int64.parseHex(text.substring(3)); |
+ return Int64.parseInt(text); |
+} |
+ |
const _UTF8 = const Utf8Codec(allowMalformed: true); |