UnitTestCSharpOptionsProtoFile.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. // Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT!
  2. #pragma warning disable 1591, 0612, 3021
  3. #region Designer generated code
  4. using pb = global::Google.ProtocolBuffers;
  5. using pbc = global::Google.ProtocolBuffers.Collections;
  6. using pbd = global::Google.ProtocolBuffers.Descriptors;
  7. using scg = global::System.Collections.Generic;
  8. namespace Google.ProtocolBuffers.TestProtos {
  9. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  10. public static partial class UnitTestCSharpOptionsProtoFile {
  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. static UnitTestCSharpOptionsProtoFile() {
  25. byte[] descriptorData = global::System.Convert.FromBase64String(
  26. string.Concat(
  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. #region Messages
  53. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  54. public sealed partial class OptionsMessage : pb::GeneratedMessage<OptionsMessage, OptionsMessage.Builder> {
  55. private OptionsMessage() { }
  56. private static readonly OptionsMessage defaultInstance = new OptionsMessage().MakeReadOnly();
  57. private static readonly string[] _optionsMessageFieldNames = new string[] { "customized", "normal", "options_message" };
  58. private static readonly uint[] _optionsMessageFieldTags = new uint[] { 26, 10, 18 };
  59. public static OptionsMessage DefaultInstance {
  60. get { return defaultInstance; }
  61. }
  62. public override OptionsMessage DefaultInstanceForType {
  63. get { return DefaultInstance; }
  64. }
  65. protected override OptionsMessage ThisMessage {
  66. get { return this; }
  67. }
  68. public static pbd::MessageDescriptor Descriptor {
  69. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__Descriptor; }
  70. }
  71. protected override pb::FieldAccess.FieldAccessorTable<OptionsMessage, OptionsMessage.Builder> InternalFieldAccessors {
  72. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; }
  73. }
  74. public const int NormalFieldNumber = 1;
  75. private bool hasNormal;
  76. private string normal_ = "";
  77. public bool HasNormal {
  78. get { return hasNormal; }
  79. }
  80. public string Normal {
  81. get { return normal_; }
  82. }
  83. public const int OptionsMessage_FieldNumber = 2;
  84. private bool hasOptionsMessage_;
  85. private string optionsMessage_ = "";
  86. public bool HasOptionsMessage_ {
  87. get { return hasOptionsMessage_; }
  88. }
  89. public string OptionsMessage_ {
  90. get { return optionsMessage_; }
  91. }
  92. public const int CustomNameFieldNumber = 3;
  93. private bool hasCustomName;
  94. private string customized_ = "";
  95. public bool HasCustomName {
  96. get { return hasCustomName; }
  97. }
  98. public string CustomName {
  99. get { return customized_; }
  100. }
  101. public override bool IsInitialized {
  102. get {
  103. return true;
  104. }
  105. }
  106. public override void WriteTo(pb::ICodedOutputStream output) {
  107. CalcSerializedSize();
  108. string[] field_names = _optionsMessageFieldNames;
  109. if (hasNormal) {
  110. output.WriteString(1, field_names[1], Normal);
  111. }
  112. if (hasOptionsMessage_) {
  113. output.WriteString(2, field_names[2], OptionsMessage_);
  114. }
  115. if (hasCustomName) {
  116. output.WriteString(3, field_names[0], CustomName);
  117. }
  118. UnknownFields.WriteTo(output);
  119. }
  120. private int memoizedSerializedSize = -1;
  121. public override int SerializedSize {
  122. get {
  123. int size = memoizedSerializedSize;
  124. if (size != -1) return size;
  125. return CalcSerializedSize();
  126. }
  127. }
  128. private int CalcSerializedSize() {
  129. int size = memoizedSerializedSize;
  130. if (size != -1) return size;
  131. size = 0;
  132. if (hasNormal) {
  133. size += pb::CodedOutputStream.ComputeStringSize(1, Normal);
  134. }
  135. if (hasOptionsMessage_) {
  136. size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_);
  137. }
  138. if (hasCustomName) {
  139. size += pb::CodedOutputStream.ComputeStringSize(3, CustomName);
  140. }
  141. size += UnknownFields.SerializedSize;
  142. memoizedSerializedSize = size;
  143. return size;
  144. }
  145. public static OptionsMessage ParseFrom(pb::ByteString data) {
  146. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  147. }
  148. public static OptionsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
  149. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
  150. }
  151. public static OptionsMessage ParseFrom(byte[] data) {
  152. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  153. }
  154. public static OptionsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
  155. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
  156. }
  157. public static OptionsMessage ParseFrom(global::System.IO.Stream input) {
  158. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  159. }
  160. public static OptionsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
  161. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
  162. }
  163. public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input) {
  164. return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
  165. }
  166. public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
  167. return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
  168. }
  169. public static OptionsMessage ParseFrom(pb::ICodedInputStream input) {
  170. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  171. }
  172. public static OptionsMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
  173. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
  174. }
  175. private OptionsMessage MakeReadOnly() {
  176. return this;
  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 new Builder(prototype);
  183. }
  184. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  185. public sealed partial class Builder : pb::GeneratedBuilder<OptionsMessage, Builder> {
  186. protected override Builder ThisBuilder {
  187. get { return this; }
  188. }
  189. public Builder() {
  190. result = DefaultInstance;
  191. resultIsReadOnly = true;
  192. }
  193. internal Builder(OptionsMessage cloneFrom) {
  194. result = cloneFrom;
  195. resultIsReadOnly = true;
  196. }
  197. private bool resultIsReadOnly;
  198. private OptionsMessage result;
  199. private OptionsMessage PrepareBuilder() {
  200. if (resultIsReadOnly) {
  201. OptionsMessage original = result;
  202. result = new OptionsMessage();
  203. resultIsReadOnly = false;
  204. MergeFrom(original);
  205. }
  206. return result;
  207. }
  208. public override bool IsInitialized {
  209. get { return result.IsInitialized; }
  210. }
  211. protected override OptionsMessage MessageBeingBuilt {
  212. get { return PrepareBuilder(); }
  213. }
  214. public override Builder Clear() {
  215. result = DefaultInstance;
  216. resultIsReadOnly = true;
  217. return this;
  218. }
  219. public override Builder Clone() {
  220. if (resultIsReadOnly) {
  221. return new Builder(result);
  222. } else {
  223. return new Builder().MergeFrom(result);
  224. }
  225. }
  226. public override pbd::MessageDescriptor DescriptorForType {
  227. get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Descriptor; }
  228. }
  229. public override OptionsMessage DefaultInstanceForType {
  230. get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance; }
  231. }
  232. public override OptionsMessage BuildPartial() {
  233. if (resultIsReadOnly) {
  234. return result;
  235. }
  236. resultIsReadOnly = true;
  237. return result.MakeReadOnly();
  238. }
  239. public override Builder MergeFrom(pb::IMessage other) {
  240. if (other is OptionsMessage) {
  241. return MergeFrom((OptionsMessage) other);
  242. } else {
  243. base.MergeFrom(other);
  244. return this;
  245. }
  246. }
  247. public override Builder MergeFrom(OptionsMessage other) {
  248. if (other == global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance) return this;
  249. PrepareBuilder();
  250. if (other.HasNormal) {
  251. Normal = other.Normal;
  252. }
  253. if (other.HasOptionsMessage_) {
  254. OptionsMessage_ = other.OptionsMessage_;
  255. }
  256. if (other.HasCustomName) {
  257. CustomName = other.CustomName;
  258. }
  259. this.MergeUnknownFields(other.UnknownFields);
  260. return this;
  261. }
  262. public override Builder MergeFrom(pb::ICodedInputStream input) {
  263. return MergeFrom(input, pb::ExtensionRegistry.Empty);
  264. }
  265. public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
  266. PrepareBuilder();
  267. pb::UnknownFieldSet.Builder unknownFields = null;
  268. uint tag;
  269. string field_name;
  270. while (input.ReadTag(out tag, out field_name)) {
  271. if(tag == 0 && field_name != null) {
  272. int field_ordinal = global::System.Array.BinarySearch(_optionsMessageFieldNames, field_name, global::System.StringComparer.Ordinal);
  273. if(field_ordinal >= 0)
  274. tag = _optionsMessageFieldTags[field_ordinal];
  275. else {
  276. if (unknownFields == null) {
  277. unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
  278. }
  279. ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
  280. continue;
  281. }
  282. }
  283. switch (tag) {
  284. case 0: {
  285. throw pb::InvalidProtocolBufferException.InvalidTag();
  286. }
  287. default: {
  288. if (pb::WireFormat.IsEndGroupTag(tag)) {
  289. if (unknownFields != null) {
  290. this.UnknownFields = unknownFields.Build();
  291. }
  292. return this;
  293. }
  294. if (unknownFields == null) {
  295. unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
  296. }
  297. ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
  298. break;
  299. }
  300. case 10: {
  301. result.hasNormal = input.ReadString(ref result.normal_);
  302. break;
  303. }
  304. case 18: {
  305. result.hasOptionsMessage_ = input.ReadString(ref result.optionsMessage_);
  306. break;
  307. }
  308. case 26: {
  309. result.hasCustomName = input.ReadString(ref result.customized_);
  310. break;
  311. }
  312. }
  313. }
  314. if (unknownFields != null) {
  315. this.UnknownFields = unknownFields.Build();
  316. }
  317. return this;
  318. }
  319. public bool HasNormal {
  320. get { return result.hasNormal; }
  321. }
  322. public string Normal {
  323. get { return result.Normal; }
  324. set { SetNormal(value); }
  325. }
  326. public Builder SetNormal(string value) {
  327. pb::ThrowHelper.ThrowIfNull(value, "value");
  328. PrepareBuilder();
  329. result.hasNormal = true;
  330. result.normal_ = value;
  331. return this;
  332. }
  333. public Builder ClearNormal() {
  334. PrepareBuilder();
  335. result.hasNormal = false;
  336. result.normal_ = "";
  337. return this;
  338. }
  339. public bool HasOptionsMessage_ {
  340. get { return result.hasOptionsMessage_; }
  341. }
  342. public string OptionsMessage_ {
  343. get { return result.OptionsMessage_; }
  344. set { SetOptionsMessage_(value); }
  345. }
  346. public Builder SetOptionsMessage_(string value) {
  347. pb::ThrowHelper.ThrowIfNull(value, "value");
  348. PrepareBuilder();
  349. result.hasOptionsMessage_ = true;
  350. result.optionsMessage_ = value;
  351. return this;
  352. }
  353. public Builder ClearOptionsMessage_() {
  354. PrepareBuilder();
  355. result.hasOptionsMessage_ = false;
  356. result.optionsMessage_ = "";
  357. return this;
  358. }
  359. public bool HasCustomName {
  360. get { return result.hasCustomName; }
  361. }
  362. public string CustomName {
  363. get { return result.CustomName; }
  364. set { SetCustomName(value); }
  365. }
  366. public Builder SetCustomName(string value) {
  367. pb::ThrowHelper.ThrowIfNull(value, "value");
  368. PrepareBuilder();
  369. result.hasCustomName = true;
  370. result.customized_ = value;
  371. return this;
  372. }
  373. public Builder ClearCustomName() {
  374. PrepareBuilder();
  375. result.hasCustomName = false;
  376. result.customized_ = "";
  377. return this;
  378. }
  379. }
  380. static OptionsMessage() {
  381. object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.Descriptor, null);
  382. }
  383. }
  384. #endregion
  385. }
  386. #endregion Designer generated code