csharptest | ff628f6 | 2011-06-11 12:32:36 -0500 | [diff] [blame^] | 1 | #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 |
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 37 | using System;
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 38 | using System.Collections.Generic;
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 39 | using Google.ProtocolBuffers.Descriptors;
|
| 40 |
|
csharptest | ffafdaa | 2011-06-03 12:58:14 -0500 | [diff] [blame] | 41 | //Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members
|
| 42 | #pragma warning disable 3010
|
| 43 |
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 44 | namespace Google.ProtocolBuffers
|
| 45 | {
|
| 46 | public interface ICodedOutputStream
|
| 47 | {
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 48 | void Flush();
|
| 49 |
|
| 50 | [Obsolete]
|
csharptest | 2b86884 | 2011-06-10 14:41:47 -0500 | [diff] [blame] | 51 | 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 |
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 56 | 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 |
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 61 | /// <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 |
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 114 | /// <summary>
|
| 115 | /// Writes a message field value, including tag, to the stream.
|
| 116 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 117 | void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 118 | /// <summary>
|
| 119 | /// Writes a byte array field value, including tag, to the stream.
|
| 120 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 121 | void WriteBytes(int fieldNumber, string fieldName, ByteString value);
|
| 122 |
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 123 | /// <summary>
|
| 124 | /// Writes a UInt32 field value, including tag, to the stream.
|
| 125 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 126 | [CLSCompliant(false)]
|
| 127 | void WriteUInt32(int fieldNumber, string fieldName, uint value);
|
| 128 |
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 129 | /// <summary>
|
| 130 | /// Writes an enum field value, including tag, to the stream.
|
| 131 | /// </summary>
|
csharptest | ced18e1 | 2011-06-09 19:47:56 -0500 | [diff] [blame] | 132 | void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 133 | /// <summary>
|
| 134 | /// Writes a fixed 32-bit field value, including tag, to the stream.
|
| 135 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 136 | void WriteSFixed32(int fieldNumber, string fieldName, int value);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 137 | /// <summary>
|
| 138 | /// Writes a signed fixed 64-bit field value, including tag, to the stream.
|
| 139 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 140 | void WriteSFixed64(int fieldNumber, string fieldName, long value);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 141 | /// <summary>
|
| 142 | /// Writes a signed 32-bit field value, including tag, to the stream.
|
| 143 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 144 | void WriteSInt32(int fieldNumber, string fieldName, int value);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 145 | /// <summary>
|
| 146 | /// Writes a signed 64-bit field value, including tag, to the stream.
|
| 147 | /// </summary>
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 148 | void WriteSInt64(int fieldNumber, string fieldName, long value);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 149 |
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 150 | void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 151 |
|
| 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 |
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 192 | void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);
|
csharptest | b00ea13 | 2011-06-10 01:09:57 -0500 | [diff] [blame] | 193 |
|
| 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;
|
csharptest | cc8d2aa | 2011-06-03 12:15:42 -0500 | [diff] [blame] | 223 | }
|
| 224 | } |