blob: d197fa55f884a4e00beff970e385a78b5504e304 [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;
csharptestb00ea132011-06-10 01:09:57 -050038using System.Collections.Generic;
csharptestcc8d2aa2011-06-03 12:15:42 -050039using Google.ProtocolBuffers.Descriptors;
40
csharptestffafdaa2011-06-03 12:58:14 -050041//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members
42#pragma warning disable 3010
43
csharptestcc8d2aa2011-06-03 12:15:42 -050044namespace Google.ProtocolBuffers
45{
46 public interface ICodedOutputStream
47 {
csharptestb00ea132011-06-10 01:09:57 -050048 void Flush();
49
50 [Obsolete]
csharptest2b868842011-06-10 14:41:47 -050051 void WriteUnknownGroup(int fieldNumber, IMessageLite value);
52 void WriteUnknownBytes(int fieldNumber, ByteString value);
53 [CLSCompliant(false)]
54 void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);
55
csharptestb00ea132011-06-10 01:09:57 -050056 void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);
57 void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);
58
59 void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);
60
csharptestcc8d2aa2011-06-03 12:15:42 -050061 /// <summary>
62 /// Writes a double field value, including tag, to the stream.
63 /// </summary>
64 void WriteDouble(int fieldNumber, string fieldName, double value);
65
66 /// <summary>
67 /// Writes a float field value, including tag, to the stream.
68 /// </summary>
69 void WriteFloat(int fieldNumber, string fieldName, float value);
70
71 /// <summary>
72 /// Writes a uint64 field value, including tag, to the stream.
73 /// </summary>
74 [CLSCompliant(false)]
75 void WriteUInt64(int fieldNumber, string fieldName, ulong value);
76
77 /// <summary>
78 /// Writes an int64 field value, including tag, to the stream.
79 /// </summary>
80 void WriteInt64(int fieldNumber, string fieldName, long value);
81
82 /// <summary>
83 /// Writes an int32 field value, including tag, to the stream.
84 /// </summary>
85 void WriteInt32(int fieldNumber, string fieldName, int value);
86
87 /// <summary>
88 /// Writes a fixed64 field value, including tag, to the stream.
89 /// </summary>
90 [CLSCompliant(false)]
91 void WriteFixed64(int fieldNumber, string fieldName, ulong value);
92
93 /// <summary>
94 /// Writes a fixed32 field value, including tag, to the stream.
95 /// </summary>
96 [CLSCompliant(false)]
97 void WriteFixed32(int fieldNumber, string fieldName, uint value);
98
99 /// <summary>
100 /// Writes a bool field value, including tag, to the stream.
101 /// </summary>
102 void WriteBool(int fieldNumber, string fieldName, bool value);
103
104 /// <summary>
105 /// Writes a string field value, including tag, to the stream.
106 /// </summary>
107 void WriteString(int fieldNumber, string fieldName, string value);
108
109 /// <summary>
110 /// Writes a group field value, including tag, to the stream.
111 /// </summary>
112 void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);
113
csharptestb00ea132011-06-10 01:09:57 -0500114 /// <summary>
115 /// Writes a message field value, including tag, to the stream.
116 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500117 void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);
csharptestb00ea132011-06-10 01:09:57 -0500118 /// <summary>
119 /// Writes a byte array field value, including tag, to the stream.
120 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500121 void WriteBytes(int fieldNumber, string fieldName, ByteString value);
122
csharptestb00ea132011-06-10 01:09:57 -0500123 /// <summary>
124 /// Writes a UInt32 field value, including tag, to the stream.
125 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500126 [CLSCompliant(false)]
127 void WriteUInt32(int fieldNumber, string fieldName, uint value);
128
csharptestb00ea132011-06-10 01:09:57 -0500129 /// <summary>
130 /// Writes an enum field value, including tag, to the stream.
131 /// </summary>
csharptestced18e12011-06-09 19:47:56 -0500132 void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);
csharptestb00ea132011-06-10 01:09:57 -0500133 /// <summary>
134 /// Writes a fixed 32-bit field value, including tag, to the stream.
135 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500136 void WriteSFixed32(int fieldNumber, string fieldName, int value);
csharptestb00ea132011-06-10 01:09:57 -0500137 /// <summary>
138 /// Writes a signed fixed 64-bit field value, including tag, to the stream.
139 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500140 void WriteSFixed64(int fieldNumber, string fieldName, long value);
csharptestb00ea132011-06-10 01:09:57 -0500141 /// <summary>
142 /// Writes a signed 32-bit field value, including tag, to the stream.
143 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500144 void WriteSInt32(int fieldNumber, string fieldName, int value);
csharptestb00ea132011-06-10 01:09:57 -0500145 /// <summary>
146 /// Writes a signed 64-bit field value, including tag, to the stream.
147 /// </summary>
csharptestcc8d2aa2011-06-03 12:15:42 -0500148 void WriteSInt64(int fieldNumber, string fieldName, long value);
csharptestb00ea132011-06-10 01:09:57 -0500149
csharptestcc8d2aa2011-06-03 12:15:42 -0500150 void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);
csharptestb00ea132011-06-10 01:09:57 -0500151
152 void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
153 where T : IMessageLite;
154
155 void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
156 where T : IMessageLite;
157
158 void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list);
159
160 void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list);
161
162 void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list);
163
164 void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
165
166 void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
167
168 void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
169
170 void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
171
172 void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
173
174 void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
175
176 void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
177
178 void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
179
180 void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
181
182 void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
183
184 void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list);
185
186 void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list);
187
188 [CLSCompliant(false)]
189 void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
190 where T : struct, IComparable, IFormattable, IConvertible;
191
csharptestcc8d2aa2011-06-03 12:15:42 -0500192 void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);
csharptestb00ea132011-06-10 01:09:57 -0500193
194 void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list);
195
196 void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
197
198 void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
199
200 void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
201
202 void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
203
204 void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
205
206 void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
207
208 void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
209
210 void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
211
212 void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
213
214 void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
215
216 void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list);
217
218 void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list);
219
220 [CLSCompliant(false)]
221 void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
222 where T : struct, IComparable, IFormattable, IConvertible;
csharptestcc8d2aa2011-06-03 12:15:42 -0500223 }
224}