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

Side by Side Diff: lib/protobuf/runtime/WireFormat.dart

Issue 10595002: Protocol Buffer runtime library and 'protoc' plugin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Work around http://code.google.com/p/dart/issues/detail?id=3806 Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/protobuf/runtime/UnknownFieldSet.dart ('k') | lib/protobuf/runtime/mock_io.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class WireFormat {
6
7 static final int TAG_TYPE_BITS = 3;
8 static final int TAG_TYPE_MASK = (1 << TAG_TYPE_BITS) - 1;
9
10 static final int WIRETYPE_VARINT = 0;
11 static final int WIRETYPE_FIXED64 = 1;
12 static final int WIRETYPE_LENGTH_DELIMITED = 2;
13 static final int WIRETYPE_START_GROUP = 3;
14 static final int WIRETYPE_END_GROUP = 4;
15 static final int WIRETYPE_FIXED32 = 5;
16
17 static int getTagFieldNumber(int tag) {
18 return (tag & 0x7fffffff) >> TAG_TYPE_BITS; // >>>
19 }
20
21 static int getTagWireType(final int tag) {
22 return tag & TAG_TYPE_MASK;
23 }
24
25 static int makeTag(int fieldNumber, final int wireType) {
26 return (fieldNumber << TAG_TYPE_BITS) | wireType;
27 }
28 }
OLDNEW
« no previous file with comments | « lib/protobuf/runtime/UnknownFieldSet.dart ('k') | lib/protobuf/runtime/mock_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698