csharptest | 980ba8d | 2010-11-07 16:30:39 -0600 | [diff] [blame] | 1 | // Generated by ProtoGen, Version=0.9.0.0, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 2 | |
| 3 | using pb = global::Google.ProtocolBuffers; |
| 4 | using pbc = global::Google.ProtocolBuffers.Collections; |
| 5 | using pbd = global::Google.ProtocolBuffers.Descriptors; |
| 6 | using scg = global::System.Collections.Generic; |
| 7 | namespace Google.ProtocolBuffers.TestProtos { |
| 8 | |
| 9 | public static partial class UnitTestCSharpOptionsProtoFile { |
| 10 | |
| 11 | #region Extension registration |
| 12 | public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
| 13 | } |
| 14 | #endregion |
| 15 | #region Static variables |
| 16 | internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionsMessage__Descriptor; |
| 17 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionsMessage, global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Builder> internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; |
| 18 | #endregion |
| 19 | #region Descriptor |
| 20 | public static pbd::FileDescriptor Descriptor { |
| 21 | get { return descriptor; } |
| 22 | } |
| 23 | private static pbd::FileDescriptor descriptor; |
| 24 | |
| 25 | static UnitTestCSharpOptionsProtoFile() { |
| 26 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 27 | "Ci1nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfY3NoYXJwX29wdGlvbnMucHJv" + |
| 28 | "dG8SEXByb3RvYnVmX3VuaXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJw" + |
| 29 | "X29wdGlvbnMucHJvdG8iXgoOT3B0aW9uc01lc3NhZ2USDgoGbm9ybWFsGAEg" + |
| 30 | "ASgJEhcKD29wdGlvbnNfbWVzc2FnZRgCIAEoCRIjCgpjdXN0b21pemVkGAMg" + |
| 31 | "ASgJQg/CPgwKCkN1c3RvbU5hbWVCRsI+QwohR29vZ2xlLlByb3RvY29sQnVm" + |
| 32 | "ZmVycy5UZXN0UHJvdG9zEh5Vbml0VGVzdENTaGFycE9wdGlvbnNQcm90b0Zp" + |
| 33 | "bGU="); |
| 34 | pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
| 35 | descriptor = root; |
| 36 | internal__static_protobuf_unittest_OptionsMessage__Descriptor = Descriptor.MessageTypes[0]; |
| 37 | internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable = |
| 38 | new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionsMessage, global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Builder>(internal__static_protobuf_unittest_OptionsMessage__Descriptor, |
| 39 | new string[] { "Normal", "OptionsMessage_", "CustomName", }); |
| 40 | pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
| 41 | RegisterAllExtensions(registry); |
| 42 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); |
| 43 | return registry; |
| 44 | }; |
| 45 | pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
| 46 | new pbd::FileDescriptor[] { |
| 47 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, |
| 48 | }, assigner); |
| 49 | } |
| 50 | #endregion |
| 51 | |
| 52 | } |
| 53 | #region Messages |
| 54 | public sealed partial class OptionsMessage : pb::GeneratedMessage<OptionsMessage, OptionsMessage.Builder> { |
| 55 | private static readonly OptionsMessage defaultInstance = new Builder().BuildPartial(); |
| 56 | public static OptionsMessage DefaultInstance { |
| 57 | get { return defaultInstance; } |
| 58 | } |
| 59 | |
| 60 | public override OptionsMessage DefaultInstanceForType { |
| 61 | get { return defaultInstance; } |
| 62 | } |
| 63 | |
| 64 | protected override OptionsMessage ThisMessage { |
| 65 | get { return this; } |
| 66 | } |
| 67 | |
| 68 | public static pbd::MessageDescriptor Descriptor { |
| 69 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__Descriptor; } |
| 70 | } |
| 71 | |
| 72 | protected override pb::FieldAccess.FieldAccessorTable<OptionsMessage, OptionsMessage.Builder> InternalFieldAccessors { |
| 73 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; } |
| 74 | } |
| 75 | |
| 76 | public const int NormalFieldNumber = 1; |
| 77 | private bool hasNormal; |
| 78 | private string normal_ = ""; |
| 79 | public bool HasNormal { |
| 80 | get { return hasNormal; } |
| 81 | } |
| 82 | public string Normal { |
| 83 | get { return normal_; } |
| 84 | } |
| 85 | |
| 86 | public const int OptionsMessage_FieldNumber = 2; |
| 87 | private bool hasOptionsMessage_; |
| 88 | private string optionsMessage_ = ""; |
| 89 | public bool HasOptionsMessage_ { |
| 90 | get { return hasOptionsMessage_; } |
| 91 | } |
| 92 | public string OptionsMessage_ { |
| 93 | get { return optionsMessage_; } |
| 94 | } |
| 95 | |
| 96 | public const int CustomNameFieldNumber = 3; |
| 97 | private bool hasCustomName; |
| 98 | private string customized_ = ""; |
| 99 | public bool HasCustomName { |
| 100 | get { return hasCustomName; } |
| 101 | } |
| 102 | public string CustomName { |
| 103 | get { return customized_; } |
| 104 | } |
| 105 | |
Jon Skeet | 0864d30 | 2009-06-05 20:10:32 +0100 | [diff] [blame] | 106 | public override bool IsInitialized { |
| 107 | get { |
| 108 | return true; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | public override void WriteTo(pb::CodedOutputStream output) { |
Jon Skeet | 17ded82 | 2010-05-19 21:07:58 +0100 | [diff] [blame] | 113 | int size = SerializedSize; |
Jon Skeet | 0864d30 | 2009-06-05 20:10:32 +0100 | [diff] [blame] | 114 | if (HasNormal) { |
| 115 | output.WriteString(1, Normal); |
| 116 | } |
| 117 | if (HasOptionsMessage_) { |
| 118 | output.WriteString(2, OptionsMessage_); |
| 119 | } |
| 120 | if (HasCustomName) { |
| 121 | output.WriteString(3, CustomName); |
| 122 | } |
| 123 | UnknownFields.WriteTo(output); |
| 124 | } |
| 125 | |
| 126 | private int memoizedSerializedSize = -1; |
| 127 | public override int SerializedSize { |
| 128 | get { |
| 129 | int size = memoizedSerializedSize; |
| 130 | if (size != -1) return size; |
| 131 | |
| 132 | size = 0; |
| 133 | if (HasNormal) { |
| 134 | size += pb::CodedOutputStream.ComputeStringSize(1, Normal); |
| 135 | } |
| 136 | if (HasOptionsMessage_) { |
| 137 | size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_); |
| 138 | } |
| 139 | if (HasCustomName) { |
| 140 | size += pb::CodedOutputStream.ComputeStringSize(3, CustomName); |
| 141 | } |
| 142 | size += UnknownFields.SerializedSize; |
| 143 | memoizedSerializedSize = size; |
| 144 | return size; |
| 145 | } |
| 146 | } |
| 147 | |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 148 | public static OptionsMessage ParseFrom(pb::ByteString data) { |
| 149 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 150 | } |
| 151 | public static OptionsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
| 152 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 153 | } |
| 154 | public static OptionsMessage ParseFrom(byte[] data) { |
| 155 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 156 | } |
| 157 | public static OptionsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
| 158 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 159 | } |
| 160 | public static OptionsMessage ParseFrom(global::System.IO.Stream input) { |
| 161 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 162 | } |
| 163 | public static OptionsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| 164 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 165 | } |
| 166 | public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
| 167 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
| 168 | } |
| 169 | public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| 170 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
| 171 | } |
| 172 | public static OptionsMessage ParseFrom(pb::CodedInputStream input) { |
| 173 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 174 | } |
| 175 | public static OptionsMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| 176 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 177 | } |
| 178 | public static Builder CreateBuilder() { return new Builder(); } |
| 179 | public override Builder ToBuilder() { return CreateBuilder(this); } |
| 180 | public override Builder CreateBuilderForType() { return new Builder(); } |
| 181 | public static Builder CreateBuilder(OptionsMessage prototype) { |
| 182 | return (Builder) new Builder().MergeFrom(prototype); |
| 183 | } |
| 184 | |
| 185 | public sealed partial class Builder : pb::GeneratedBuilder<OptionsMessage, Builder> { |
| 186 | protected override Builder ThisBuilder { |
| 187 | get { return this; } |
| 188 | } |
| 189 | public Builder() {} |
| 190 | |
| 191 | OptionsMessage result = new OptionsMessage(); |
| 192 | |
| 193 | protected override OptionsMessage MessageBeingBuilt { |
| 194 | get { return result; } |
| 195 | } |
| 196 | |
| 197 | public override Builder Clear() { |
| 198 | result = new OptionsMessage(); |
| 199 | return this; |
| 200 | } |
| 201 | |
| 202 | public override Builder Clone() { |
| 203 | return new Builder().MergeFrom(result); |
| 204 | } |
| 205 | |
| 206 | public override pbd::MessageDescriptor DescriptorForType { |
Jon Skeet | 5cb5d78 | 2009-06-25 10:51:31 +0100 | [diff] [blame] | 207 | get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Descriptor; } |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | public override OptionsMessage DefaultInstanceForType { |
Jon Skeet | 5cb5d78 | 2009-06-25 10:51:31 +0100 | [diff] [blame] | 211 | get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance; } |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | public override OptionsMessage BuildPartial() { |
| 215 | if (result == null) { |
| 216 | throw new global::System.InvalidOperationException("build() has already been called on this Builder"); |
| 217 | } |
| 218 | OptionsMessage returnMe = result; |
| 219 | result = null; |
| 220 | return returnMe; |
| 221 | } |
| 222 | |
Jon Skeet | 0864d30 | 2009-06-05 20:10:32 +0100 | [diff] [blame] | 223 | public override Builder MergeFrom(pb::IMessage other) { |
| 224 | if (other is OptionsMessage) { |
| 225 | return MergeFrom((OptionsMessage) other); |
| 226 | } else { |
| 227 | base.MergeFrom(other); |
| 228 | return this; |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | public override Builder MergeFrom(OptionsMessage other) { |
Jon Skeet | 5cb5d78 | 2009-06-25 10:51:31 +0100 | [diff] [blame] | 233 | if (other == global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance) return this; |
Jon Skeet | 0864d30 | 2009-06-05 20:10:32 +0100 | [diff] [blame] | 234 | if (other.HasNormal) { |
| 235 | Normal = other.Normal; |
| 236 | } |
| 237 | if (other.HasOptionsMessage_) { |
| 238 | OptionsMessage_ = other.OptionsMessage_; |
| 239 | } |
| 240 | if (other.HasCustomName) { |
| 241 | CustomName = other.CustomName; |
| 242 | } |
| 243 | this.MergeUnknownFields(other.UnknownFields); |
| 244 | return this; |
| 245 | } |
| 246 | |
| 247 | public override Builder MergeFrom(pb::CodedInputStream input) { |
| 248 | return MergeFrom(input, pb::ExtensionRegistry.Empty); |
| 249 | } |
| 250 | |
| 251 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| 252 | pb::UnknownFieldSet.Builder unknownFields = null; |
| 253 | while (true) { |
| 254 | uint tag = input.ReadTag(); |
| 255 | switch (tag) { |
| 256 | case 0: { |
| 257 | if (unknownFields != null) { |
| 258 | this.UnknownFields = unknownFields.Build(); |
| 259 | } |
| 260 | return this; |
| 261 | } |
| 262 | default: { |
| 263 | if (pb::WireFormat.IsEndGroupTag(tag)) { |
| 264 | if (unknownFields != null) { |
| 265 | this.UnknownFields = unknownFields.Build(); |
| 266 | } |
| 267 | return this; |
| 268 | } |
| 269 | if (unknownFields == null) { |
| 270 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| 271 | } |
| 272 | ParseUnknownField(input, unknownFields, extensionRegistry, tag); |
| 273 | break; |
| 274 | } |
| 275 | case 10: { |
| 276 | Normal = input.ReadString(); |
| 277 | break; |
| 278 | } |
| 279 | case 18: { |
| 280 | OptionsMessage_ = input.ReadString(); |
| 281 | break; |
| 282 | } |
| 283 | case 26: { |
| 284 | CustomName = input.ReadString(); |
| 285 | break; |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 291 | |
| 292 | public bool HasNormal { |
| 293 | get { return result.HasNormal; } |
| 294 | } |
| 295 | public string Normal { |
| 296 | get { return result.Normal; } |
| 297 | set { SetNormal(value); } |
| 298 | } |
| 299 | public Builder SetNormal(string value) { |
| 300 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
| 301 | result.hasNormal = true; |
| 302 | result.normal_ = value; |
| 303 | return this; |
| 304 | } |
| 305 | public Builder ClearNormal() { |
| 306 | result.hasNormal = false; |
| 307 | result.normal_ = ""; |
| 308 | return this; |
| 309 | } |
| 310 | |
| 311 | public bool HasOptionsMessage_ { |
| 312 | get { return result.HasOptionsMessage_; } |
| 313 | } |
| 314 | public string OptionsMessage_ { |
| 315 | get { return result.OptionsMessage_; } |
| 316 | set { SetOptionsMessage_(value); } |
| 317 | } |
| 318 | public Builder SetOptionsMessage_(string value) { |
| 319 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
| 320 | result.hasOptionsMessage_ = true; |
| 321 | result.optionsMessage_ = value; |
| 322 | return this; |
| 323 | } |
| 324 | public Builder ClearOptionsMessage_() { |
| 325 | result.hasOptionsMessage_ = false; |
| 326 | result.optionsMessage_ = ""; |
| 327 | return this; |
| 328 | } |
| 329 | |
| 330 | public bool HasCustomName { |
| 331 | get { return result.HasCustomName; } |
| 332 | } |
| 333 | public string CustomName { |
| 334 | get { return result.CustomName; } |
| 335 | set { SetCustomName(value); } |
| 336 | } |
| 337 | public Builder SetCustomName(string value) { |
| 338 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
| 339 | result.hasCustomName = true; |
| 340 | result.customized_ = value; |
| 341 | return this; |
| 342 | } |
| 343 | public Builder ClearCustomName() { |
| 344 | result.hasCustomName = false; |
| 345 | result.customized_ = ""; |
| 346 | return this; |
| 347 | } |
| 348 | } |
| 349 | static OptionsMessage() { |
Jon Skeet | c784be3 | 2009-06-17 15:47:33 +0100 | [diff] [blame] | 350 | object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.Descriptor, null); |
Jon Skeet | df67f14 | 2009-06-05 19:29:36 +0100 | [diff] [blame] | 351 | } |
| 352 | } |
| 353 | |
| 354 | #endregion |
| 355 | |
| 356 | } |