using System; namespace Google.ProtocolBuffers.Serialization { /// /// Defines control information for the various formatting used with HTTP services /// public struct MessageFormatOptions { /// The mime type for xml content /// Other valid xml mime types include: application/binary, application/x-protobuf public const string ContentTypeProtoBuffer = "application/vnd.google.protobuf"; /// The mime type for xml content /// Other valid xml mime types include: text/xml public const string ContentTypeXml = "application/xml"; /// The mime type for json content /// /// Other valid json mime types include: application/json, application/x-json, /// application/x-javascript, text/javascript, text/x-javascript, text/x-json, text/json /// public const string ContentTypeJson = "application/json"; private string _defaultContentType; private string _xmlReaderRootElementName; private string _xmlWriterRootElementName; private ExtensionRegistry _extensionRegistry; /// /// The default content type to use if the input type is null or empty. If this /// value is not supplied an ArgumentOutOfRangeException exception will be raised. /// public string DefaultContentType { get { return _defaultContentType ?? String.Empty; } set { _defaultContentType = value; } } /// /// The extension registry to use when reading messages /// public ExtensionRegistry ExtensionRegistry { get { return _extensionRegistry ?? ExtensionRegistry.Empty; } set { _extensionRegistry = value; } } /// /// The name of the xml root element when reading messages /// public string XmlReaderRootElementName { get { return _xmlReaderRootElementName ?? XmlFormatReader.DefaultRootElementName; } set { _xmlReaderRootElementName = value; } } /// /// Xml reader options /// public XmlReaderOptions XmlReaderOptions { get; set; } /// /// True to use formatted output including new-lines and default indentation /// public bool FormattedOutput { get; set; } /// /// The name of the xml root element when writing messages /// public string XmlWriterRootElementName { get { return _xmlWriterRootElementName ?? XmlFormatWriter.DefaultRootElementName; } set { _xmlWriterRootElementName = value; } } /// /// Xml writer options /// public XmlWriterOptions XmlWriterOptions { get; set; } } }