UnitTestImportProtoFile.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. using pb = global::Google.ProtocolBuffers;
  3. using pbc = global::Google.ProtocolBuffers.Collections;
  4. using pbd = global::Google.ProtocolBuffers.Descriptors;
  5. using scg = global::System.Collections.Generic;
  6. using self = global::Google.ProtocolBuffers.TestProtos;
  7. namespace Google.ProtocolBuffers.TestProtos {
  8. public static partial class UnitTestImportProtoFile {
  9. #region Descriptor
  10. public static pbd::FileDescriptor Descriptor {
  11. get { return descriptor; }
  12. }
  13. private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
  14. new byte[] {
  15. 0x0a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
  16. 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
  17. 0x18, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69,
  18. 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x1a, 0x0a, 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
  19. 0x67, 0x65, 0x12, 0x09, 0x0a, 0x01, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x2a, 0x3c, 0x0a, 0x0a, 0x49, 0x6d, 0x70,
  20. 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, 0x4f,
  21. 0x4f, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x08, 0x12,
  22. 0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x41, 0x5a, 0x10, 0x09, 0x42, 0x5a, 0x0a, 0x18, 0x63,
  23. 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x74,
  24. 0x65, 0x73, 0x74, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
  25. 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f,
  26. 0x73, 0xca, 0x3e, 0x17, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72,
  27. 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
  28. }, new pbd::FileDescriptor[] {
  29. });
  30. #endregion
  31. #region Extensions
  32. #endregion
  33. #region Static variables
  34. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor
  35. = Descriptor.MessageTypes[0];
  36. internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable
  37. = new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor,
  38. new string[] { "D", },
  39. typeof (self::ImportMessage),
  40. typeof (self::ImportMessage.Builder));
  41. #endregion
  42. }
  43. #region Enums
  44. public enum ImportEnum {
  45. IMPORT_FOO = 7,
  46. IMPORT_BAR = 8,
  47. IMPORT_BAZ = 9,
  48. }
  49. #endregion
  50. #region Messages
  51. public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> {
  52. private static readonly ImportMessage defaultInstance = new ImportMessage();
  53. public static ImportMessage DefaultInstance {
  54. get { return defaultInstance; }
  55. }
  56. public override ImportMessage DefaultInstanceForType {
  57. get { return defaultInstance; }
  58. }
  59. public static pbd::MessageDescriptor Descriptor {
  60. get { return self::UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; }
  61. }
  62. protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
  63. get { return self::UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; }
  64. }
  65. // optional int32 d = 1;
  66. private bool hasD;
  67. private int d_ = 0;
  68. public bool HasD {
  69. get { return hasD; }
  70. }
  71. public int D {
  72. get { return d_; }
  73. }
  74. public override bool IsInitialized {
  75. get {
  76. return true;
  77. }
  78. }
  79. public override void WriteTo(pb::CodedOutputStream output) {
  80. if (HasD) {
  81. output.WriteInt32(1, D);
  82. }
  83. UnknownFields.WriteTo(output);
  84. }
  85. private int memoizedSerializedSize = -1;
  86. public override int SerializedSize {
  87. get {
  88. int size = memoizedSerializedSize;
  89. if (size != -1) return size;
  90. size = 0;
  91. if (HasD) {
  92. size += pb::CodedOutputStream.ComputeInt32Size(1, D);
  93. }
  94. size += UnknownFields.SerializedSize;
  95. memoizedSerializedSize = size;
  96. return size;
  97. }
  98. }
  99. public static self::ImportMessage ParseFrom(pb::ByteString data) {
  100. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  101. }
  102. public static self::ImportMessage ParseFrom(pb::ByteString data,
  103. pb::ExtensionRegistry extensionRegistry) {
  104. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  105. .BuildParsed();
  106. }
  107. public static self::ImportMessage ParseFrom(byte[] data) {
  108. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  109. }
  110. public static self::ImportMessage ParseFrom(byte[] data,
  111. pb::ExtensionRegistry extensionRegistry) {
  112. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  113. .BuildParsed();
  114. }
  115. public static self::ImportMessage ParseFrom(global::System.IO.Stream input) {
  116. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  117. }
  118. public static self::ImportMessage ParseFrom(
  119. global::System.IO.Stream input,
  120. pb::ExtensionRegistry extensionRegistry) {
  121. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  122. .BuildParsed();
  123. }
  124. public static self::ImportMessage ParseFrom(pb::CodedInputStream input) {
  125. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  126. }
  127. public static self::ImportMessage ParseFrom(pb::CodedInputStream input,
  128. pb::ExtensionRegistry extensionRegistry) {
  129. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  130. .BuildParsed();
  131. }
  132. public static Builder CreateBuilder() { return new Builder(); }
  133. public override IBuilder<self::ImportMessage> CreateBuilderForType() { return new Builder(); }
  134. public static Builder CreateBuilder(self::ImportMessage prototype) {
  135. return (Builder) new Builder().MergeFrom(prototype);
  136. }
  137. public sealed partial class Builder : pb::GeneratedBuilder<self::ImportMessage, Builder> {
  138. // Construct using self::ImportMessage.CreateBuilder()
  139. internal Builder() {}
  140. self::ImportMessage result = new self::ImportMessage();
  141. protected override self::ImportMessage MessageBeingBuilt {
  142. get { return result; }
  143. }
  144. public override IBuilder<self::ImportMessage> Clear() {
  145. result = new self::ImportMessage();
  146. return this;
  147. }
  148. public override IBuilder<self::ImportMessage> Clone() {
  149. return new Builder().MergeFrom(result);
  150. }
  151. public override pbd::MessageDescriptor DescriptorForType {
  152. get { return self::ImportMessage.Descriptor; }
  153. }
  154. public override self::ImportMessage DefaultInstanceForType {
  155. get { return self::ImportMessage.DefaultInstance; }
  156. }
  157. public override self::ImportMessage BuildPartial() {
  158. self::ImportMessage returnMe = result;
  159. result = null;
  160. return returnMe;
  161. }
  162. protected override IBuilder MergeFromImpl(CodedInputStream data, ExtensionRegistry extensionRegistry) {
  163. return MergeFrom(data, extensionRegistry);
  164. }
  165. public override IBuilder MergeFrom(pb::IMessage other) {
  166. if (other is self::ImportMessage) {
  167. return MergeFrom((self::ImportMessage) other);
  168. } else {
  169. base.MergeFrom(other);
  170. return this;
  171. }
  172. }
  173. public override IBuilder<self::ImportMessage> MergeFrom(self::ImportMessage other) {
  174. if (other == self::ImportMessage.DefaultInstance) return this;
  175. if (other.HasD) {
  176. D = other.D;
  177. }
  178. this.MergeUnknownFields(other.UnknownFields);
  179. return this;
  180. }
  181. public override IBuilder<self::ImportMessage> MergeFrom(pb::CodedInputStream input) {
  182. return MergeFrom(input, pb::ExtensionRegistry.Empty);
  183. }
  184. public override IBuilder<self::ImportMessage> MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
  185. pb::UnknownFieldSet.Builder unknownFields =
  186. pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
  187. while (true) {
  188. uint tag = input.ReadTag();
  189. switch (tag) {
  190. case 0:
  191. this.UnknownFields = unknownFields.Build();
  192. return this;
  193. default: {
  194. if (!ParseUnknownField(input, unknownFields,
  195. extensionRegistry, tag)) {
  196. this.UnknownFields = unknownFields.Build();
  197. return this;
  198. }
  199. break;
  200. }
  201. case 8: {
  202. D = input.ReadInt32();
  203. break;
  204. }
  205. }
  206. }
  207. }
  208. // optional int32 d = 1;
  209. public bool HasD {
  210. get { return result.HasD; }
  211. }
  212. public int D {
  213. get { return result.D; }
  214. set { SetD(value); }
  215. }
  216. public Builder SetD(int value) {
  217. result.hasD = true;
  218. result.d_ = value;
  219. return this;
  220. }
  221. public Builder ClearD() {
  222. result.hasD = false;
  223. result.d_ = 0;
  224. return this;
  225. }
  226. }
  227. }
  228. #endregion
  229. #region Services
  230. #endregion
  231. }