#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// http://github.com/jskeet/dotnet-protobufs/
// Original C++/Java/Python code:
// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using Google.ProtocolBuffers.Descriptors;
//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members
#pragma warning disable 3010
namespace Google.ProtocolBuffers
{
///
/// Provides an interface that is used write a message. Most often proto buffers are written
/// in their binary form by creating a instance via the CodedOutputStream.CreateInstance
/// static factory.
///
public interface ICodedOutputStream
{
///
/// Writes any message initialization data needed to the output stream
///
///
/// This is primarily used by text formats and unnecessary for protobuffers' own
/// binary format. The API for MessageStart/End was added for consistent handling
/// of output streams regardless of the actual writer implementation.
///
void WriteMessageStart();
///
/// Writes any message finalization data needed to the output stream
///
///
/// This is primarily used by text formats and unnecessary for protobuffers' own
/// binary format. The API for MessageStart/End was added for consistent handling
/// of output streams regardless of the actual writer implementation.
///
void WriteMessageEnd();
///
/// Indicates that all temporary buffers be written to the final output.
///
void Flush();
///
/// Writes an unknown message as a group
///
[Obsolete]
void WriteUnknownGroup(int fieldNumber, IMessageLite value);
///
/// Writes an unknown field value of bytes
///
void WriteUnknownBytes(int fieldNumber, ByteString value);
///
/// Writes an unknown field of a primitive type
///
[CLSCompliant(false)]
void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);
///
/// Writes an extension as a message-set group
///
void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);
///
/// Writes an unknown extension as a message-set group
///
void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);
///
/// Writes a field value, including tag, to the stream.
///
void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);
///
/// Writes a double field value, including tag, to the stream.
///
void WriteDouble(int fieldNumber, string fieldName, double value);
///
/// Writes a float field value, including tag, to the stream.
///
void WriteFloat(int fieldNumber, string fieldName, float value);
///
/// Writes a uint64 field value, including tag, to the stream.
///
[CLSCompliant(false)]
void WriteUInt64(int fieldNumber, string fieldName, ulong value);
///
/// Writes an int64 field value, including tag, to the stream.
///
void WriteInt64(int fieldNumber, string fieldName, long value);
///
/// Writes an int32 field value, including tag, to the stream.
///
void WriteInt32(int fieldNumber, string fieldName, int value);
///
/// Writes a fixed64 field value, including tag, to the stream.
///
[CLSCompliant(false)]
void WriteFixed64(int fieldNumber, string fieldName, ulong value);
///
/// Writes a fixed32 field value, including tag, to the stream.
///
[CLSCompliant(false)]
void WriteFixed32(int fieldNumber, string fieldName, uint value);
///
/// Writes a bool field value, including tag, to the stream.
///
void WriteBool(int fieldNumber, string fieldName, bool value);
///
/// Writes a string field value, including tag, to the stream.
///
void WriteString(int fieldNumber, string fieldName, string value);
///
/// Writes a group field value, including tag, to the stream.
///
void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);
///
/// Writes a message field value, including tag, to the stream.
///
void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);
///
/// Writes a byte array field value, including tag, to the stream.
///
void WriteBytes(int fieldNumber, string fieldName, ByteString value);
///
/// Writes a UInt32 field value, including tag, to the stream.
///
[CLSCompliant(false)]
void WriteUInt32(int fieldNumber, string fieldName, uint value);
///
/// Writes an enum field value, including tag, to the stream.
///
void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);
///
/// Writes a fixed 32-bit field value, including tag, to the stream.
///
void WriteSFixed32(int fieldNumber, string fieldName, int value);
///
/// Writes a signed fixed 64-bit field value, including tag, to the stream.
///
void WriteSFixed64(int fieldNumber, string fieldName, long value);
///
/// Writes a signed 32-bit field value, including tag, to the stream.
///
void WriteSInt32(int fieldNumber, string fieldName, int value);
///
/// Writes a signed 64-bit field value, including tag, to the stream.
///
void WriteSInt64(int fieldNumber, string fieldName, long value);
///
/// Writes a repeated field value, including tag(s), to the stream.
///
void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated group value, including tag(s), to the stream.
///
void WriteGroupArray(int fieldNumber, string fieldName, IEnumerable list)
where T : IMessageLite;
///
/// Writes a repeated message value, including tag(s), to the stream.
///
void WriteMessageArray(int fieldNumber, string fieldName, IEnumerable list)
where T : IMessageLite;
///
/// Writes a repeated string value, including tag(s), to the stream.
///
void WriteStringArray(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated ByteString value, including tag(s), to the stream.
///
void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated boolean value, including tag(s), to the stream.
///
void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Int32 value, including tag(s), to the stream.
///
void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated SInt32 value, including tag(s), to the stream.
///
void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated UInt32 value, including tag(s), to the stream.
///
void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Fixed32 value, including tag(s), to the stream.
///
void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated SFixed32 value, including tag(s), to the stream.
///
void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Int64 value, including tag(s), to the stream.
///
void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated SInt64 value, including tag(s), to the stream.
///
void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated UInt64 value, including tag(s), to the stream.
///
void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Fixed64 value, including tag(s), to the stream.
///
void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated SFixed64 value, including tag(s), to the stream.
///
void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Double value, including tag(s), to the stream.
///
void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated Float value, including tag(s), to the stream.
///
void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a repeated enumeration value of type T, including tag(s), to the stream.
///
[CLSCompliant(false)]
void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list)
where T : struct, IComparable, IFormattable, IConvertible;
///
/// Writes a packed repeated primitive, including tag and length, to the stream.
///
void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);
///
/// Writes a packed repeated boolean, including tag and length, to the stream.
///
void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Int32, including tag and length, to the stream.
///
void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated SInt32, including tag and length, to the stream.
///
void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated UInt32, including tag and length, to the stream.
///
void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Fixed32, including tag and length, to the stream.
///
void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated SFixed32, including tag and length, to the stream.
///
void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Int64, including tag and length, to the stream.
///
void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated SInt64, including tag and length, to the stream.
///
void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated UInt64, including tag and length, to the stream.
///
void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Fixed64, including tag and length, to the stream.
///
void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated SFixed64, including tag and length, to the stream.
///
void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Double, including tag and length, to the stream.
///
void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated Float, including tag and length, to the stream.
///
void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list);
///
/// Writes a packed repeated enumeration of type T, including tag and length, to the stream.
///
[CLSCompliant(false)]
void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list)
where T : struct, IComparable, IFormattable, IConvertible;
}
}