aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/ICodedOutputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/ProtocolBuffers/ICodedOutputStream.cs')
-rw-r--r--csharp/src/ProtocolBuffers/ICodedOutputStream.cs103
1 files changed, 41 insertions, 62 deletions
diff --git a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs
index 77de60ca..e51c10a4 100644
--- a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs
+++ b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs
@@ -36,13 +36,13 @@
using System;
using System.Collections;
-using System.Collections.Generic;
-using Google.ProtocolBuffers.Descriptors;
+using Google.Protobuf.Collections;
+using Google.Protobuf.Descriptors;
//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members
#pragma warning disable 3010
-namespace Google.ProtocolBuffers
+namespace Google.Protobuf
{
/// <summary>
/// Provides an interface that is used write a message. Most often proto buffers are written
@@ -69,32 +69,11 @@ namespace Google.ProtocolBuffers
/// of output streams regardless of the actual writer implementation.
/// </remarks>
void WriteMessageEnd();
+
/// <summary>
/// Indicates that all temporary buffers be written to the final output.
/// </summary>
void Flush();
- /// <summary>
- /// Writes an unknown message as a group
- /// </summary>
- [Obsolete]
- void WriteUnknownGroup(int fieldNumber, IMessageLite value);
- /// <summary>
- /// Writes an unknown field value of bytes
- /// </summary>
- void WriteUnknownBytes(int fieldNumber, ByteString value);
- /// <summary>
- /// Writes an unknown field of a primitive type
- /// </summary>
-
- void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);
- /// <summary>
- /// Writes an extension as a message-set group
- /// </summary>
- void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);
- /// <summary>
- /// Writes an unknown extension as a message-set group
- /// </summary>
- void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);
/// <summary>
/// Writes a field value, including tag, to the stream.
@@ -149,12 +128,12 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Writes a group field value, including tag, to the stream.
/// </summary>
- void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);
+ void WriteGroup(int fieldNumber, string fieldName, IMessage value);
/// <summary>
/// Writes a message field value, including tag, to the stream.
/// </summary>
- void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);
+ void WriteMessage(int fieldNumber, string fieldName, IMessage value);
/// <summary>
/// Writes a byte array field value, including tag, to the stream.
@@ -169,7 +148,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Writes an enum field value, including tag, to the stream.
/// </summary>
- void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);
+ void WriteEnum<T>(int fieldNumber, string fieldName, T value) where T : struct, IComparable, IFormattable;
/// <summary>
/// Writes a fixed 32-bit field value, including tag, to the stream.
@@ -199,94 +178,94 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Writes a repeated group value, including tag(s), to the stream.
/// </summary>
- void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
- where T : IMessageLite;
+ void WriteGroupArray<T>(int fieldNumber, string fieldName, RepeatedField<T> list)
+ where T : IMessage;
/// <summary>
/// Writes a repeated message value, including tag(s), to the stream.
/// </summary>
- void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
- where T : IMessageLite;
+ void WriteMessageArray<T>(int fieldNumber, string fieldName, RepeatedField<T> list)
+ where T : IMessage;
/// <summary>
/// Writes a repeated string value, including tag(s), to the stream.
/// </summary>
- void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list);
+ void WriteStringArray(int fieldNumber, string fieldName, RepeatedField<string> list);
/// <summary>
/// Writes a repeated ByteString value, including tag(s), to the stream.
/// </summary>
- void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list);
+ void WriteBytesArray(int fieldNumber, string fieldName, RepeatedField<ByteString> list);
/// <summary>
/// Writes a repeated boolean value, including tag(s), to the stream.
/// </summary>
- void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list);
+ void WriteBoolArray(int fieldNumber, string fieldName, RepeatedField<bool> list);
/// <summary>
/// Writes a repeated Int32 value, including tag(s), to the stream.
/// </summary>
- void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
+ void WriteInt32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a repeated SInt32 value, including tag(s), to the stream.
/// </summary>
- void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
+ void WriteSInt32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a repeated UInt32 value, including tag(s), to the stream.
/// </summary>
- void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
+ void WriteUInt32Array(int fieldNumber, string fieldName, RepeatedField<uint> list);
/// <summary>
/// Writes a repeated Fixed32 value, including tag(s), to the stream.
/// </summary>
- void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);
+ void WriteFixed32Array(int fieldNumber, string fieldName, RepeatedField<uint> list);
/// <summary>
/// Writes a repeated SFixed32 value, including tag(s), to the stream.
/// </summary>
- void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list);
+ void WriteSFixed32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a repeated Int64 value, including tag(s), to the stream.
/// </summary>
- void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
+ void WriteInt64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a repeated SInt64 value, including tag(s), to the stream.
/// </summary>
- void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
+ void WriteSInt64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a repeated UInt64 value, including tag(s), to the stream.
/// </summary>
- void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
+ void WriteUInt64Array(int fieldNumber, string fieldName, RepeatedField<ulong> list);
/// <summary>
/// Writes a repeated Fixed64 value, including tag(s), to the stream.
/// </summary>
- void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);
+ void WriteFixed64Array(int fieldNumber, string fieldName, RepeatedField<ulong> list);
/// <summary>
/// Writes a repeated SFixed64 value, including tag(s), to the stream.
/// </summary>
- void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list);
+ void WriteSFixed64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a repeated Double value, including tag(s), to the stream.
/// </summary>
- void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list);
+ void WriteDoubleArray(int fieldNumber, string fieldName, RepeatedField<double> list);
/// <summary>
/// Writes a repeated Float value, including tag(s), to the stream.
/// </summary>
- void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list);
+ void WriteFloatArray(int fieldNumber, string fieldName, RepeatedField<float> list);
/// <summary>
/// Writes a repeated enumeration value of type T, including tag(s), to the stream.
/// </summary>
- void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
+ void WriteEnumArray<T>(int fieldNumber, string fieldName, RepeatedField<T> list)
where T : struct, IComparable, IFormattable;
/// <summary>
@@ -297,72 +276,72 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Writes a packed repeated boolean, including tag and length, to the stream.
/// </summary>
- void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list);
+ void WritePackedBoolArray(int fieldNumber, string fieldName, RepeatedField<bool> list);
/// <summary>
/// Writes a packed repeated Int32, including tag and length, to the stream.
/// </summary>
- void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
+ void WritePackedInt32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a packed repeated SInt32, including tag and length, to the stream.
/// </summary>
- void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
+ void WritePackedSInt32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a packed repeated UInt32, including tag and length, to the stream.
/// </summary>
- void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
+ void WritePackedUInt32Array(int fieldNumber, string fieldName, RepeatedField<uint> list);
/// <summary>
/// Writes a packed repeated Fixed32, including tag and length, to the stream.
/// </summary>
- void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);
+ void WritePackedFixed32Array(int fieldNumber, string fieldName, RepeatedField<uint> list);
/// <summary>
/// Writes a packed repeated SFixed32, including tag and length, to the stream.
/// </summary>
- void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);
+ void WritePackedSFixed32Array(int fieldNumber, string fieldName, RepeatedField<int> list);
/// <summary>
/// Writes a packed repeated Int64, including tag and length, to the stream.
/// </summary>
- void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
+ void WritePackedInt64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a packed repeated SInt64, including tag and length, to the stream.
/// </summary>
- void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
+ void WritePackedSInt64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a packed repeated UInt64, including tag and length, to the stream.
/// </summary>
- void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
+ void WritePackedUInt64Array(int fieldNumber, string fieldName, RepeatedField<ulong> list);
/// <summary>
/// Writes a packed repeated Fixed64, including tag and length, to the stream.
/// </summary>
- void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);
+ void WritePackedFixed64Array(int fieldNumber, string fieldName, RepeatedField<ulong> list);
/// <summary>
/// Writes a packed repeated SFixed64, including tag and length, to the stream.
/// </summary>
- void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);
+ void WritePackedSFixed64Array(int fieldNumber, string fieldName, RepeatedField<long> list);
/// <summary>
/// Writes a packed repeated Double, including tag and length, to the stream.
/// </summary>
- void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list);
+ void WritePackedDoubleArray(int fieldNumber, string fieldName, RepeatedField<double> list);
/// <summary>
/// Writes a packed repeated Float, including tag and length, to the stream.
/// </summary>
- void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list);
+ void WritePackedFloatArray(int fieldNumber, string fieldName, RepeatedField<float> list);
/// <summary>
/// Writes a packed repeated enumeration of type T, including tag and length, to the stream.
/// </summary>
- void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
+ void WritePackedEnumArray<T>(int fieldNumber, string fieldName, RepeatedField<T> list)
where T : struct, IComparable, IFormattable;
}
} \ No newline at end of file