]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /// Licensed to the Apache Software Foundation (ASF) under one |
2 | /// or more contributor license agreements. See the NOTICE file | |
3 | /// distributed with this work for additional information | |
4 | /// regarding copyright ownership. The ASF licenses this file | |
5 | /// to you under the Apache License, Version 2.0 (the | |
6 | /// "License"); you may not use this file except in compliance | |
7 | /// with the License. You may obtain a copy of the License at | |
8 | /// | |
9 | /// http://www.apache.org/licenses/LICENSE-2.0 | |
10 | /// | |
11 | /// Unless required by applicable law or agreed to in writing, | |
12 | /// software distributed under the License is distributed on an | |
13 | /// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
14 | /// KIND, either express or implied. See the License for the | |
15 | /// specific language governing permissions and limitations | |
16 | /// under the License. | |
17 | ||
18 | part of thrift; | |
19 | ||
20 | abstract class TProtocol { | |
21 | final TTransport transport; | |
22 | ||
23 | TProtocol(this.transport); | |
24 | ||
25 | /// Write | |
26 | void writeMessageBegin(TMessage message); | |
27 | void writeMessageEnd(); | |
28 | ||
29 | void writeStructBegin(TStruct struct); | |
30 | void writeStructEnd(); | |
31 | ||
32 | void writeFieldBegin(TField field); | |
33 | void writeFieldEnd(); | |
34 | void writeFieldStop(); | |
35 | ||
36 | void writeMapBegin(TMap map); | |
37 | void writeMapEnd(); | |
38 | ||
39 | void writeListBegin(TList list); | |
40 | void writeListEnd(); | |
41 | ||
42 | void writeSetBegin(TSet set); | |
43 | void writeSetEnd(); | |
44 | ||
45 | void writeBool(bool b); | |
46 | ||
47 | void writeByte(int b); | |
48 | ||
49 | void writeI16(int i16); | |
50 | ||
51 | void writeI32(int i32); | |
52 | ||
53 | void writeI64(int i64); | |
54 | ||
55 | void writeDouble(double d); | |
56 | ||
57 | void writeString(String str); | |
58 | ||
59 | void writeBinary(Uint8List bytes); | |
60 | ||
61 | /// Read | |
62 | TMessage readMessageBegin(); | |
63 | void readMessageEnd(); | |
64 | ||
65 | TStruct readStructBegin(); | |
66 | void readStructEnd(); | |
67 | ||
68 | TField readFieldBegin(); | |
69 | void readFieldEnd(); | |
70 | ||
71 | TMap readMapBegin(); | |
72 | void readMapEnd(); | |
73 | ||
74 | TList readListBegin(); | |
75 | void readListEnd(); | |
76 | ||
77 | TSet readSetBegin(); | |
78 | void readSetEnd(); | |
79 | ||
80 | bool readBool(); | |
81 | ||
82 | int readByte(); | |
83 | ||
84 | int readI16(); | |
85 | ||
86 | int readI32(); | |
87 | ||
88 | int readI64(); | |
89 | ||
90 | double readDouble(); | |
91 | ||
92 | String readString(); | |
93 | ||
94 | Uint8List readBinary(); | |
95 | } |