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

Unified Diff: client/samples/swarm/Decoder.dart

Issue 9314024: Final CL to kill off client/samples . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/samples/swarm/DataSource.dart ('k') | client/samples/swarm/HelpDialog.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/samples/swarm/Decoder.dart
===================================================================
--- client/samples/swarm/Decoder.dart (revision 3770)
+++ client/samples/swarm/Decoder.dart (working copy)
@@ -1,41 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// TODO(jimhug): Fill out methods, add encoder, move to shared lib.
-class Decoder {
- int index;
- String data;
-
- Decoder(this.data) {
- this.index = 0;
- }
-
- // Reads numbers in variable-length 7-bit encoding. This matches the
- // varint encoding used by protobufs except that it only uses 7
- // bits per byte so it can be efficiently passed as UTF8.
- // For more info, see appengine/encoder.py.
- int readInt() {
- var r = 0;
- for (var i=0; ; i++) {
- var v = data.charCodeAt(index++);
- r |= (v & 0x3F) << (6 * i);
- if ((v & 0x40) == 0) break;
- }
- return r.toInt();
- }
-
- bool readBool() {
- final ch = data[index++];
- assert (ch == 'T' || ch == 'F');
- return ch == 'T';
- }
-
- String readString() {
- int len = readInt();
- String s = data.substring(index, index+len);
- index += len;
- return s;
- }
-}
-
« no previous file with comments | « client/samples/swarm/DataSource.dart ('k') | client/samples/swarm/HelpDialog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698