blob: df8ca107245876e2165d9ba3e5b94b10bb55b587 [file] [log] [blame]
csharptestff628f62011-06-11 12:32:36 -05001#region Copyright notice and license
2
3// Protocol Buffers - Google's data interchange format
4// Copyright 2008 Google Inc. All rights reserved.
5// http://github.com/jskeet/dotnet-protobufs/
6// Original C++/Java/Python code:
7// http://code.google.com/p/protobuf/
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// * Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15// * Redistributions in binary form must reproduce the above
16// copyright notice, this list of conditions and the following disclaimer
17// in the documentation and/or other materials provided with the
18// distribution.
19// * Neither the name of Google Inc. nor the names of its
20// contributors may be used to endorse or promote products derived from
21// this software without specific prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
35#endregion
36
csharptestcc8d2aa2011-06-03 12:15:42 -050037using System;
csharptest74c5e0c2011-07-14 13:06:22 -050038using System.Collections;
csharptestb00ea132011-06-10 01:09:57 -050039using System.Collections.Generic;
csharptestcc8d2aa2011-06-03 12:15:42 -050040using Google.ProtocolBuffers.Descriptors;
41
csharptestffafdaa2011-06-03 12:58:14 -050042//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members
43#pragma warning disable 3010
44
csharptestcc8d2aa2011-06-03 12:15:42 -050045namespace Google.ProtocolBuffers
46{
47 public interface ICodedOutputStream
48 {
csharptestb00ea132011-06-10 01:09:57 -050049 void Flush();
50
51 [Obsolete]
csharptest2b868842011-06-10 14:41:47 -050052 void WriteUnknownGroup(int fieldNumber, IMessageLite value);
csharptest74c5e0c2011-07-14 13:06:22 -050053
csharptest2b868842011-06-10 14:41:47 -050054 void WriteUnknownBytes(int fieldNumber, ByteString value);
csharptest74c5e0c2011-07-14 13:06:22 -050055
csharptest2b868842011-06-10 14:41:47 -050056 [CLSCompliant(false)]
57 void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);
58
csharptestb00ea132011-06-10 01:09:57 -050059 void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);
60 void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);
61
62 void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);
63
csharptestcc8d2aa2011-06-03 12:15:42 -050064 /// <summary>
65 /// Writes a double field value, including tag, to the stream.
66 /// </summary>
67 void WriteDouble(int fieldNumber, string fieldName, double value);
68
69 /// <summary>
70 /// Writes a float field value, including tag, to the stream.
71 /// </summary>
72 void WriteFloat(int fieldNumber, string fieldName, float value);
73
74 /// <summary>
75 /// Writes a uint64 field value, including tag, to the stream.
76 /// </summary>
77 [CLSCompliant(false)]
78 void WriteUInt64(int fieldNumber, string fieldName, ulong value);
79
80 /// <summary>
81 /// Writes an int64 field value, including tag, to the stream.
82 /// </summary>
83 void WriteInt64(int fieldNumber, string fieldName, long value);
84
85 /// <summary>
86 /// Writes an int32 field value, including tag, to the stream.
87 /// </summary>
88 void WriteInt32(int fieldNumber, string fieldName, int value);
89
90 /// <summary>
91 /// Writes a fixed64 field value, including tag, to the stream.
92 /// </summary>
93 [CLSCompliant(false)]
94 void WriteFixed64(int fieldNumber, string fieldName, ulong value);
95
96 /// <summary>
97 /// Writes a fixed32 field value, including tag, to the stream.
98 /// </summary>
99 [CLSCompliant(false)]
100 void WriteFixed32(int fieldNumber, string fieldName, uint value);
101
102 /// <summary>
103 /// Writes a bool field value, including tag, to the stream.
104 /// </summary>
105 void WriteBool(int fieldNumber, string fieldName, bool value);
106
107 /// <summary>
108 /// Writes a string field value, including tag, to the stream.
109 /// </summary>
110 void WriteString(int fieldNumber, string fieldName, string value);
111
112 /// <summary>
113 /// Writes a group field value, including tag, to the stream.
114 /// </summary>
115 void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);
116
csharptestb00ea132011-06-10 01:09:57 -0500117 /// <summary>
118 /// Writes a message field value, including tag, to the stream.
119 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500120 void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);
csharptest74c5e0c2011-07-14 13:06:22 -0500121
csharptestb00ea132011-06-10 01:09:57 -0500122 /// <summary>
123 /// Writes a byte array field value, including tag, to the stream.
124 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500125 void WriteBytes(int fieldNumber, string fieldName, ByteString value);
126
csharptestb00ea132011-06-10 01:09:57 -0500127 /// <summary>
128 /// Writes a UInt32 field value, including tag, to the stream.
129 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500130 [CLSCompliant(false)]
131 void WriteUInt32(int fieldNumber, string fieldName, uint value);
132
csharptestb00ea132011-06-10 01:09:57 -0500133 /// <summary>
134 /// Writes an enum field value, including tag, to the stream.
135 /// </summary>
csharptestced18e12011-06-09 19:47:56 -0500136 void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);
csharptest74c5e0c2011-07-14 13:06:22 -0500137
csharptestb00ea132011-06-10 01:09:57 -0500138 /// <summary>
139 /// Writes a fixed 32-bit field value, including tag, to the stream.
140 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500141 void WriteSFixed32(int fieldNumber, string fieldName, int value);
csharptest74c5e0c2011-07-14 13:06:22 -0500142
csharptestb00ea132011-06-10 01:09:57 -0500143 /// <summary>
144 /// Writes a signed fixed 64-bit field value, including tag, to the stream.
145 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500146 void WriteSFixed64(int fieldNumber, string fieldName, long value);
csharptest74c5e0c2011-07-14 13:06:22 -0500147
csharptestb00ea132011-06-10 01:09:57 -0500148 /// <summary>
149 /// Writes a signed 32-bit field value, including tag, to the stream.
150 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500151 void WriteSInt32(int fieldNumber, string fieldName, int value);
csharptest74c5e0c2011-07-14 13:06:22 -0500152
csharptestb00ea132011-06-10 01:09:57 -0500153 /// <summary>
154 /// Writes a signed 64-bit field value, including tag, to the stream.
155 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500156 void WriteSInt64(int fieldNumber, string fieldName, long value);
csharptestb00ea132011-06-10 01:09:57 -0500157
csharptest74c5e0c2011-07-14 13:06:22 -0500158 void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);
csharptestb00ea132011-06-10 01:09:57 -0500159
160 void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
161 where T : IMessageLite;
csharptest74c5e0c2011-07-14 13:06:22 -0500162
csharptestb00ea132011-06-10 01:09:57 -0500163 void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
164 where T : IMessageLite;
csharptest74c5e0c2011-07-14 13:06:22 -0500165
csharptestb00ea132011-06-10 01:09:57 -0500166 void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500167
csharptestb00ea132011-06-10 01:09:57 -0500168 void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500169
csharptestb00ea132011-06-10 01:09:57 -0500170 void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500171
csharptestb00ea132011-06-10 01:09:57 -0500172 void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500173
csharptestb00ea132011-06-10 01:09:57 -0500174 void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500175
csharptestb00ea132011-06-10 01:09:57 -0500176 void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500177
csharptestb00ea132011-06-10 01:09:57 -0500178 void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500179
csharptestb00ea132011-06-10 01:09:57 -0500180 void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500181
csharptestb00ea132011-06-10 01:09:57 -0500182 void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500183
csharptestb00ea132011-06-10 01:09:57 -0500184 void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500185
csharptestb00ea132011-06-10 01:09:57 -0500186 void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500187
csharptestb00ea132011-06-10 01:09:57 -0500188 void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500189
csharptestb00ea132011-06-10 01:09:57 -0500190 void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
191
192 void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list);
csharptest74c5e0c2011-07-14 13:06:22 -0500193
csharptestb00ea132011-06-10 01:09:57 -0500194 void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list);
195
196 [CLSCompliant(false)]
csharptest74c5e0c2011-07-14 13:06:22 -0500197 void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
csharptestb00ea132011-06-10 01:09:57 -0500198 where T : struct, IComparable, IFormattable, IConvertible;
199
csharptest74c5e0c2011-07-14 13:06:22 -0500200 void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);
201
csharptestb00ea132011-06-10 01:09:57 -0500202 void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list);
203
204 void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
205
206 void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
207
208 void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
209
210 void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
211
212 void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
213
214 void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
215
216 void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
217
218 void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
219
220 void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
221
222 void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
223
224 void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list);
225
226 void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list);
227
228 [CLSCompliant(false)]
229 void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
230 where T : struct, IComparable, IFormattable, IConvertible;
csharptestcc8d2aa2011-06-03 12:15:42 -0500231 }
232}